(window["webpackJsonptrueChart"]=window["webpackJsonptrueChart"]||[]).push([[31],{1117:function(e,t,r){"use strict";r.r(t);var St=r(1);var i=r(21);
/*!
 * High Coordination SUCCESS Business Engine v2019.5.1_4
 * http://www.highcoordination.com
 *
 * Copyright 2013-2016, HighCoordination GmbH
 *
 * Date: Fri, 14 Jun 2019 11:59:42 GMT
 */
/*!
 * High Coordination SUCCESS Business Engine v2019.5.1_4
 * http://www.highcoordination.com
 *
 * Copyright 2013-2016, HighCoordination GmbH
 *
 * Date: Fri, 14 Jun 2019 11:59:42 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 n=i.lastIndexOf(e,t);return n!==-1&&n===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 n=arguments[1];var a=0;while(a<i){var r=t[a];if(e.call(n,r,a,t)){return a}a++}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(n,a,r){return this.each(function(){var t=0,i=this;if(HiCo.$.browser.msie){e(this).bind("dblclick",function(e){t=2;a.call(i,e)});e(this).bind("click",function(e){setTimeout(function(){if(t!=2){n.call(i,e)}t=0},r||300)})}else{e(this).bind("click",function(e){t++;if(t==1){setTimeout(function(){if(t==1){n.call(i,e)}else{a.call(i,e)}t=0},r||300)}})}})}}})(i["b"]);var n=r(609);var a=r(606);var Q=r(465);var H=r(305);var it=r(49);var Me=r(2);var k=r(382);var q=r(40);var G=r(73);var V=r(10);var W=r(222);var J=r(186);var C=r(43);var z={updateIdentifiers:function(e){var c=null;loadCTIdsToReplace();e.forEach(function(e){var t=e.getController().getRootModel();var i=St["b"].DataObjects.DocumentDO.getIdentifiersToReplaceById(e.getId());c&&addCTIdsToReplace(i);updateRootModel(t,i);!St["b"].DataObjects.DocumentDO.getConnector().inPlayMode()&&updateCommentReferences(e,i);updateContextCTReferences(e,i)});function updateRootModel(i,e){for(var n in i){if(i.hasOwnProperty(n)){if(typeof i[n]==="object"&&i[n]!==null&&n!=="$scope"){updateRootModel(i[n],e)}else if(typeof i[n]==="string"){applyIdentifiers(e,function(e,t){i[n]=St["b"].Utils.GlobalFunctions.replaceAll(i[n],e,t)})}}}}function updateCommentReferences(i,t){var e=St["b"].DataObjects.DocumentDO.getAllExtensions();if(e.indexOf(i)<0){return}St["b"].DataObjects.CommentRepo.reloadComments(e);i.getAdapter().getExtensionDefinition().comments.forEach(function(e){replaceReferenceIds(e);var t=St["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=St["b"].Utils.GlobalFunctions.replaceAll(i.extension,e,t);i.refId=C["a"].createGuid()});return i})})})})}}function loadCTIdsToReplace(){var e=St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().textProperties.publication;var t=St["b"].DataObjects.DocumentDO.getConnector().isPublished&&St["b"].Utils.GlobalVariables.hasService;var i=e.renameCommonTables&&e.commonTablesSuffix;if(t&&i){var n=e.commonTablesSuffix;var a=St["b"].DataObjects.CommonTableRepo.getCommonTableRepo();c={};for(var r in a){var o=a[r];var l=o.key+n;for(var s in a){var d=a[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 nt=r(194);var B=r(88);var j=r(114);var re=r(47);var X=r(9);var o=r(26);var l=r(617);var s=r(160);var d=r(618);var c=r(1475);var u=r(577);var Ot=r(15);var Y=r(93);var K=r(135);var Z=r(485);var ee=r(57);var te=r(615);var ie=r(407);var Se=r(46);var ne=r(92);var ae=["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 p={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(u){return Me["b"](this,void 0,void 0,function(){var t,i,n,a,r,o,l,s,d,c;return Me["e"](this,function(e){switch(e.label){case 0:t=St["b"].Factories.ModelFactory.getParentContainer(u.extension.getController().getRootModel().firstObjectGrid,u.model)[0];i=t.extendedModel.info;if(t&&t.extendedModel.navigationVariable){if(t.extendedModel.navigationVariable.variable!==""){u.extension.getController().dispatch("updateHiCoNavigation",u)}}if(i.extensions===undefined){return[2]}n=St["b"].DataObjects.DocumentDO.getAllExtensions();a=0;e.label=1;case 1:if(!(a<i.actions.length))return[3,8];for(r=0,o=n;r<o.length;r++){l=o[r];if(l.getAdapter().getServerId().split("\\")[1]===i.extensions[a]){i.extensions[a]=l.getContexts()[0].cid;break}}s=i.extensions[a];d=St["b"].DataObjects.ContextRepo.getExtensionByContextCid(s);if(!d)return[3,6];e.label=2;case 2:e.trys.push([2,4,,5]);return[4,this.triggerAction(i.actions[a],d)];case 3:e.sent();return[3,5];case 4:c=e.sent();if(c instanceof te["a"]){j["a"].warning(Ot["a"].getTranslation(c.TranslationKey),Ot["a"].getTranslation("ACTION_TRIGGER_FAILED"))}q["a"].error("Unhandled error in button action: "+i.actions[a],"Error: "+c.message);return[3,5];case 5:return[3,7];case 6:q["a"].error("Cannot trigger action! Maybe extension '"+i.extensions[a]+"' does not exist anymore.");e.label=7;case 7:a++;return[3,1];case 8:return[2]}})})},checkEDXStatus:function(t,i,n){var a=this;function updatePainting(){console.log("repaint triggered");n.paint()}St["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"){console.log("Task failed");setTimeout(updatePainting,4e3)}else if(e.d.TaskStatus!=="Completed"){a.checkEDXStatusCall(t,i,n)}else{setTimeout(updatePainting,4e3)}}})},checkEDXStatusCall:function(e,t,i){var n=this;var a=function(){n.checkEDXStatus(e,t,i)};setTimeout(a,1e3)},triggerAction:function(U,F){var B=[];for(var e=2;e<arguments.length;e++){B[e-2]=arguments[e]}return Me["b"](this,void 0,Promise,function(){var t,i,n,a,r,o,l,s,d,c,u,p,g,m,h,f,v,b,T,E,x,C,y,M,S,O,L,A,_,I,D,R,N,P,w;return Me["e"](this,function(e){switch(e.label){case 0:if(St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){return[2]}if(~ae.indexOf(U)&&!Se["a"].hasService){throw new te["a"]("ACTION_NEEDS_SERVICE")}t={};i=U;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"SaveObject":return[3,3];case"Save_All":return[3,3];case"Refresh":return[3,4];case"ExportAsPDF":return[3,5];case"Export_As_PDF":return[3,5];case"ExportAsImage":return[3,6];case"Export_As_PNG":return[3,6];case"ExportAsVectorGraphic":return[3,7];case"Export_As_EMF":return[3,7];case"ExportAsExcel":return[3,8];case"Export_As_XLS":return[3,8];case"ReloadComments":return[3,9];case"Reload_Common_Tables":return[3,9];case"SaveCommentsInApp":return[3,10];case"Save_Comments_In_App":return[3,10]}return[3,15];case 1:F.getController().dispatch("updateDocumentMode",{});return[3,16];case 2:n=[];a=F.getController().getRootModel().firstObjectGrid;St["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(a,n,"TableModel");t.extension=F;t.parameters={saveChanged:true};for(r=0,o=n;r<o.length;r++){l=o[r];t.model=l;F.getController().dispatch("updateInputSaveStates",t)}F.getController().dispatch("updateRootModel",t);return[2,F.paint()];case 3:t.extension=F;if(St["b"].DataObjects.RuntimeDO.getUser().IsDesigner){F.getController().dispatch("updateRootModel",t)}else{q["a"].warn("invalid action: 'save object' requires an unpublished app and designer rights.")}return[3,16];case 4:setTimeout(function(){return location.reload()},500);return[3,16];case 5:t.extension=F;F.getController().dispatch("createPDF",t);return[3,16];case 6:t.extension=F;F.getController().dispatch("createPNG",t);return[3,16];case 7:t.extension=F;F.getController().dispatch("createEMF",t);return[3,16];case 8:t.extension=F;F.getController().dispatch("getXLSExporterDialog",t);return[3,16];case 9:t.extension=F;t.parameters={saveChanged:true};St["b"].DataObjects.CommonTableRepo.refreshCommonTables();s=[];St["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(F.getController().getRootModel().firstObjectGrid,s,"TableModel");for(d=0,c=s;d<c.length;d++){u=c[d];t.model=u;p=St["b"].DataObjects.ContextRepo.getContextByCid(t.model.extendedModel.contextId);g=t.model.multiplePath!==undefined?St["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(p.dataModel,t.model.multiplePath,1,true,t.model.isMultipleTotal):St["b"].Models.Actions.DataModelActions.getMultipleDimensions(p.dataModel,1);for(m=0,h=g;m<h.length;m++){f=h[m];v={columns:[]};b=f.ref;T=f.path;E=b.nodes[0].nodes.length;x=-1;while(++x<E){C={commonTable:"",dataId_dims:[],representationType:"",extendedModel:t.model.extendedModel,saveName:"",addKeyVariable:""};y=null;for(M=0,S=t.model.extendedModel.expressions;M<S.length;M++){O=S[M];if(b.nodes[0].nodes[x].key===O.id.split(".").pop()){y=O;break}}if(y!=null&&y.commonTable!=null){C.commonTable=y.commonTable;C.representationType=y.representation;C.addKeyVariable=y.addKeyVariable;if(y.saveName&&y.saveName.toLowerCase()!=="auto"&&y.saveName!==""){C.saveName=y.saveName}else{C.saveName=y.id.split(".").pop().replace("expr","")}for(L=0,A=b.nodes;L<A.length;L++){_=A[L];I=T+(T===""?"":"@")+_.value;C.dataId_dims.push(I)}v.columns.push(C)}}St["b"].DataObjects.InlineCommentRepo.loadCommonComments(v)}}F.paint();return[3,16];case 10:D=B||[];R=Object(V["r"])(D[0])&&D[0].source||Object(V["r"])(D[3])&&D[3][0];N=R==="_self"?St["b"].DataObjects.DocumentDO.getHash():K["a"].createSHA1Hash(R);e.label=11;case 11:e.trys.push([11,13,,14]);return[4,Z["a"].initCopy(St["b"].DataObjects.DocumentDO.getConnector(),N)];case 12:e.sent();j["a"].success(Ot["a"].getTranslation("DOWNLOAD_COMMENTS_SUCCESS"));return[3,14];case 13:P=e.sent();ne["a"].close();if(P instanceof ie["a"]){j["a"].warning(Ot["a"].getTranslation(P.TranslationKey))}else{w=P instanceof Error?P.message:P||Y["e"];q["a"].error(w);j["a"].error(Ot["a"].getTranslation("GENERIC_ERROR_MESSAGE"),Ot["a"].getTranslation("SAVE_COMMENTS_IN_APP"));throw P}return[3,14];case 14:return[3,16];case 15:throw new Error("Invalid button action");case 16:return[2]}})})}};var g=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 n=new Function("$","element","mashUp","contextType","event","clickInfo",e.functionBody);return Promise.resolve(n(St["b"].$,i.element,null,{},i.event,i.clickInfo))},ToggleShowEditMode:function(){return t.run("ToggleShowEditMode")},SaveComments:function(e){return t.run("SaveComments",e)},SaveObject:function(e){return t.run("SaveObject",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 n=t.objectId?this.DocumentDO.getExtension(t.objectId):this.DocumentDO.getAllExtensions()[0];return n?Promise.resolve(p.triggerAction(e,n,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=St["b"].DataObjects.DocumentDO)},enumerable:true,configurable:true});return Actions}();function getBlacklistedActions(){var e=St["b"].DataObjects.DocumentDO.getApi().ConfigManager;var t=[];if(St["b"].Utils.GlobalVariables.hasService){t=t.concat([ee["a"].ExportAsImage,ee["a"].ExportAsExcel,ee["a"].ExportAsPDF,ee["a"].ExportAsVectorGraphic])}switch(e.getConfig().biType){case"sense":case"view":break;default:t=t.concat([ee["a"].Refresh])}return t}St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetMultiActions=p;var m=r(496);var h=r(469);St["b"].DataObjects.DocumentDO=function(e,t,i){var a=this;var p=this,l=e,n=l.getDocumentName(),r=l.getId(),g=t;var m;var s=[];var o=[];var d={};var c=0;var h=false;var f=false;var v={};var b={};var T={};var E={};var x={};var C=[];var y=[];var M=[];var S=[];var O={};var L=false;var A=[];var u={};var _={};var I=i.settings;var D=new k["a"](r,null);var R=null;var N=false;var P=[];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 U=i;if(U!=null){init(U)}function init(e){if(e.settings===null){e.settings=I}if(!St["b"].DataObjects.RuntimeDO.getUser().userSpecific){St["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 n=d[e];if(n===null||n===undefined){return null}delete St["b"].develop.penitentiary[e];delete St["b"].develop.hicoObjects[e];if(t){return delete d[e]}if(n.getAdapter().isSnapshotItem()&&!l.inPlayMode()){St["b"].DataObjects.CommentRepo.updateRefrencesForSnapshot(true);a.removeReferenceReplaceId(e)}n.onDestroy();St["b"].DataObjects.CommentRepo.deleteExtension(e);St["b"].DataObjects.RuntimeDO.clearClipboardState(e);i&&a.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){m=e};this.getName=function(){return n};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 _};this.getBIVariables=function(e){if(e===void 0){e=s}var t=[];for(var i=0,n=e.length;i<n;i++){var a=e[i];!a.internal&&t.push(a)}return t};this.getVariables=function(){return s};this.getCurrentBIVariables=function(){return a.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 n=l.varListReady();var a=A.indexOf(e)!==-1;if(n&&!a&&t!==false&&(!l.isPrinting()||false)){l.isPrinting()&&j["a"].error(s.map(function(e){return e.name}).join(", "),"Current variables",{preventDuplicates:true,timeOut:2e5});St["b"].Factories.DialogFactory.createMissingVariableDialog(e);A.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 _[name];break}}};function requestVariable(e){if(!u[e.name]){u[e.name]=e;if(!e.internal){l.getVariableValue(e.name);l.addToUsedBIVariables(e)}}_[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 n=0,a=s,r=a.length;n<r;n++){if(t[a[n].name]){var o=a[n];u[o.name]=o;i[o.id]=o.name}}l.setDocumentValue("usedBIVariables",i)}}function clearUsedVariablesList(){u={};_={};l.setDocumentValue("usedBIVariables",{})}function paintAllExtensions(){return Me["b"](this,void 0,void 0,function(){var t,i,n,a,r,o,l,s,d,c,u;return Me["e"](this,function(e){switch(e.label){case 0:if(L){z.updateIdentifiers(S);O={}}if(f){t=b,i=T,n=v,a=x,r=E;o=h;h=false;f=false;v={};b={};T={};x={};E={};St["b"].Utils.Update.ContextUpdater.finalUpdate(t,i,n,o,a,r)}else{St["b"].Utils.Update.ContextUpdater.synchronizeKeyColumnsNames()}if(!L)return[3,1];S.forEach(function(e){if(e.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY){saveObject(e);saveInlineComments(e);e.saveExtension();St["b"].DataObjects.RuntimeDO.setRebuildComments(e.getId()+"#"+e.getController().getRootModel().id,true)}});p.saveDocument();p.triggerDelayedRepaint();return[3,3];case 1:g.init();A=[];return[4,paintExtensions(p.getAllExtensions())];case 2:e.sent();if(m===true){D.dispatch("updateScalingGroups",{type:"document"});D.dispatch("updateScalingGroups",{type:"user"});m=false}e.label=3;case 3:l=[];while(y.length){s=p.getExtension(y.pop());R=s;s.getController().dispatch("updateRootModelState",{extension:s});l.push(s.LayoutDefinition.id)}while(C.length){d=C.pop();if(l.indexOf(d)===-1){c=p.getExtensionByLayoutDefinitionId(d);c&&c.getController().dispatch("updateRootModelState",{extension:c})}}while(M.length){u=it["a"].getExtensionByContextCid(M.pop());R=u;u.getController().dispatch("createContextState",{extension:u,saveQVF:true})}S=[];L=false;return[2]}})})}function paintExtensions(n,a){return Me["b"](this,void 0,void 0,function(){var t,t,i,t;return Me["e"](this,function(e){switch(e.label){case 0:if(paintIsNotAllowed(n)||n.length===0){return[2]}q["a"].info("start painting trueChart");HiCoMVCInit.paintingPromise.createNewPromise();nt["a"].clearAllInstances();_={};g.resetState();if(!a){rebuildContexts()}for(t=0;t<n.length;t++){n[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();n.forEach(function(e){return e.updateContent()});rebuildContexts(true);St["b"].DataObjects.CommentRepo.reloadComments(n);for(t=0;t<n.length;t++){n[t].rebuildComments();n[t].updateLayout()}prePaintExtensions(n);if(paintIsNotAllowed(n)){return[2]}i=updateExtensionsLayout(n);if(i){q["a"].info("repainting trueChart");prePaintExtensions(n);i=updateExtensionsLayout(n)}St["b"].DataObjects.RuntimeDO.setPrePaint(false);if(i){q["a"].info("repainting trueChart");prePaintExtensions(n)}else{for(t=0;t<n.length;t++){n[t].finishPainting()}}St["b"].DataObjects.RuntimeDO.setPrePaint(true);HiCoMVCInit.paintingPromise.resolveProm();updateScalingGroups();St["b"].develop.runIntegrationTests();return[2]}})})}function saveObject(e){var t={extension:e,saveLocally:false,dontNotifyText:true};e.getController().dispatch("updateRootModel",t);var i=y.indexOf(e.getId());i>=0&&y.splice(i,1);i=C.indexOf(e.LayoutDefinition.id);i>=0&&C.splice(i,1);i=M.indexOf(e.getId());i>=0&&M.splice(i,1)}function saveInlineComments(i){var e=[];var t=i.getController().getRootModel().firstObjectGrid;St["b"].Models.Actions.ViewModelActions.General.getAllChartsByChartProperty(t,e);var n={extension:i,parameters:{saveChanged:true,saveLocally:false,savedBecauseCopied:true}};e.forEach(function(t){n.model=t;t.charts.forEach(function(e){if(e.model.instanceOf==="TableModel"){t.extendedModel=e.model;i.getController().dispatch("updateInputSaveStates",n)}})})}var F=null,B;this.triggerDelayedRepaint=function(e){if(e===void 0){e=c}window.clearTimeout(B);if(F!==null){F.reject()}F=new G["a"];B=window.setTimeout(function(){Promise.all(Object.keys(d).map(function(e){return d[e].isInitialized()}).concat([l.varValuesReady().promise,l.exprValuesReady().promise])).then(F.resolve,p.triggerDelayedRepaint)},e);return F.promise.then(paintAllExtensions).catch(function(e){return e&&q["a"].error("paintExtensions failed!",e.stack)})};this.clearDelayedRepaint=function(){window.clearTimeout(B)};this.getScalingGroups=function(){var e=St["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(St["b"].DataObjects.RuntimeDO.getUser().userSpecific!==undefined){e=St["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,n=t.DataContext.measures;i<n.length;i++){var a=n[i];e[a.scalingGroup]=true}return e},{});for(var n in e){if(i[n]===undefined&&e[n].auto){delete e[n]}}for(var n in t){if(i[n]===undefined&&t[n].auto){delete t[n]}}};this.getDocSettings=function(e){if(e){return I}if(I.userSpecific.value==="true"&&St["b"].DataObjects.RuntimeDO.getUser().userSpecific){return St["b"].DataObjects.RuntimeDO.getUser().userSpecific}return I};this.getSettings=function(){if(I.userSpecific.value==="true"&&St["b"].DataObjects.RuntimeDO.getUser().userSpecific){return St["b"].DataObjects.RuntimeDO.getUser().userSpecific}return I};this.setDocSettings=function(e){I=e;updateTimeoutSetting()};this.allExtensionsHidden=function(){if(I.showUnlicensed.value==="false"){if(St["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]}f=true};this.addDidToRemoveList=function(e,t){if(b[e]){b[e].indexOf(t)===-1&&b[e].push(t)}else{b[e]=[t]}f=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}]}f=true};this.addDidListToRenameList=function(e,t){if(T[e]){T[e]=T[e].concat(t)}else{T[e]=t}f=true};this.setContextFormulasModifiedFlag=function(){h=true};this.addDimensionToAddList=function(e,t){if(x[e]){x[e].push(t)}else{x[e]=[t]}f=true};this.addDimensionToRemoveList=function(e,t){if(E[e]){E[e].push(t)}else{E[e]=[t]}f=true};function pushLayoutDefinitionUpdate(e){if(C.indexOf(e)===-1){C.push(e)}}this.pushRootModelUpdate=function(e){if(y.indexOf(e)===-1){y.push(e)}};function pushContextModelUpdate(e){if(M.indexOf(e)===-1){M.push(e)}}this.addExtensionToUpdate=function(e){var t=this.getExtension(e);t&&S.push(t)};this.addIdentifierToReplace=function(e,t,i){O[e]=O[e]||{};O[e][t]=i;L=true};this.getIdentifiersToReplaceById=function(e){var t={},i=O[e];for(var n in i){t[n]=i[n]}for(var n in O){var a=O[n];if(n!==e){for(var r in a){t[r]===undefined&&(t[r]=a[r])}}}return t};this.getReferenceReplaceIds=function(){return P};this.addReferenceReplaceId=function(t){var i=false;P.some(function(e){if(e.newId===t.newId){i=true;return true}});if(!i){P.push(t)}};this.removeReferenceReplaceId=function(i){P.some(function(e,t){if(e.newId===i){P.splice(t,1);return true}})};this.clearReferenceReplaceIds=function(){var t=Object.keys(d);P=P.filter(function(e){return t.indexOf(e.newId)!==-1})};this.initViews=function(e){var t={};for(var i=0;i<e.length;i++){var n=e[i];if(!n.isNotVisible()){this.setCurrentPaintingExtension(n);W["a"].buildViews(n)}}if(l.varValuesReady().pending){console.log("cancel painting trueChart");return}var a=new St["b"].Layout.Iterator.Iterator;a.init();a.optimize();for(var i=0;i<e.length;i++){var n=e[i];if(!n.isNotVisible()){var r=n.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 n=e[i];if(!n.isNotVisible()){n.updateGlobalZoom(t)}}for(var i=0;i<e.length;i++){var n=e[i];if(!n.isNotVisible()&&!n.hasError()){if(document.getElementById(n.getId())===null){continue}this.setCurrentPaintingExtension(n);W["a"].drawViews(n)}}};this.setCurrentPaintingExtension=function(e){if(this.getConnector().supportsSnapshots()){var t=e&&e.getAdapter();if(t&&t.isSnapshotItem()){s=t.getVariablesForSnapshot();St["b"].DataObjects.RuntimeDO.useNotationManual(t.getSnapshotData("notationManual"))}else{s=o;St["b"].DataObjects.RuntimeDO.useNotationManual(null)}}R=e};this.getCurrentPaintingExtension=function(){return R&&d[R.getId()]||null};this.setNeedsSnapshotReplace=function(e){N=e};this.freeScalingHelpers=[null,null,null];this.setDocumentValue=function(e,t){l.setDocumentValue(e,t)};this.saveDocument=function(){l.saveDocument()};function getOptionsData(){return Me["b"](this,void 0,void 0,function(){var t,i,n,a;var r=this;return Me["e"](this,function(e){switch(e.label){case 0:return[4,l.getOptionsData()];case 1:t=e.sent()||{};i=this.getApi().GlobalFeatureManager,n=i.Expression,a=i.Mashup;St["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 St["b"].Utils.GlobalVariables.hasService?re["a"].repositoryAsync("getApplicationsForCommentCopy",{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,Me["a"]({},t,{biSystem:this.getApi().ConfigManager.getConfig().biSystem,biExpressionType:n.isEnabled?n.Feature.type:undefined,biFeatures:Me["a"]({},t.biFeatures,{hasMashupSupport:a.isEnabled}),blacklistedActions:(t.blacklistedActions||[]).concat([]),dataContexts:it["a"].getAllContexts().map(function(e){return e.DataContext}),commonTables:Object(V["v"])(H["a"].getCommonTableRepo(),function(e){return{id:e.hash,key:e.key,additionInformation:e.additionInformation,description:e.description}}),scalingGroups:Object.keys(St["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:Me["a"]({},t["callbacks"],{onResetVariableCache:function(){r.clearUsedVariables();r.triggerDelayedRepaint();return HiCoMVCInit.paintingPromise.getPromise()},getVariableList:function(){var t=r.getUsedVariables();var e=Object(V["v"])(t,function(e){return Me["a"]({},e,{used:true})});var i=Object(V["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 St["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(N){p.clearReferenceReplaceIds();St["b"].DataObjects.CommentRepo.updateRefrencesForSnapshot();N=false}buildScalingHelpers(t,i);e.forEach(function(e){return e.rebuildViews()});St["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(!St["b"].DataObjects.DocumentDO.getConnector().varValuesReady().resolved){t=true}else if(e.some(function(e){return e.getMode()===St["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 n=it["a"].getExtensionByContextCid(t[i].cid);if(n){p.setCurrentPaintingExtension(n);if(e){t[i].hasDimensions()&&nt["a"].getInstance(t[i].cid).setupDataTypesByRules();continue}t[i].dataModel=null;St["b"].Models.Actions.ModelActions.ContextModel.buildAllContextDataModel(t[i],n,e)}}}function buildScalingHelpers(e,t){p.freeScalingHelpers=[null,null,null];for(var i=0;i<e.length;i++){var n=e[i];n.charts=St["b"].Factories.ModelFactory.buildScalingHelpers1(n.root,n.charts,t)}for(var i=0;i<e.length;i++){var n=e[i];n.charts=St["b"].Factories.ModelFactory.buildScalingHelpers2(n.root,n.charts,t);delete n.root.maximizedScalingGroups}}function updateScalingGroups(){if(St["b"].DataObjects.RuntimeDO.getUpdateScalingGroups()){var e=p.getDocSettings(true);if(e.userSpecific.value==="true"&&e.userSpecificScaling.value==="true"&&St["b"].DataObjects.RuntimeDO.getUser().userSpecific){D.dispatch("updateScalingGroups",{type:"user"})}else{D.dispatch("updateScalingGroups",{type:"document"})}St["b"].DataObjects.RuntimeDO.setUpdateScalingGroups(false)}}function mapExtension(e){var t=[];for(var i=0,n=p.getAllExtensions();i<n.length;i++){var a=n[i];p.setCurrentPaintingExtension(a);t.push(e(a))}return t}};St["b"].DataObjects.DocumentDO.prototype={getMediaData:function(e,t){var i=this.getConnector();if(t&&(i.isPrinting()||i.inStoryMode()||i.inPlayMode())){var n=this.getExtension(t);if(n){var a=n.getAdapter();if(a.isSnapshotItem()){return Promise.resolve(a.getSnapshotData("media")[e]||null)}}return Promise.resolve(null)}try{return d["a"].Instance.loadData(e)}catch(e){q["a"].warn(e);e.message.indexOf("initialize")!==0&&d["a"].initialize({storage:new c["a"]});return Promise.resolve(null)}},getExtensionByLayoutDefinitionId:function(e){for(var t=0,i=this.getAllExtensions();t<i.length;t++){var n=i[t];if(n.LayoutDefinition.id===e){return n}}return null},setUpExpressionModule:function(){var e=this.getApi().GlobalFeatureManager;X["a"].init({biType:e.Expression.isEnabled?e.Expression.Feature.type:undefined,decode:nt["a"].decodeExpression,encode:nt["a"].encodeExpression,evaluate:nt["a"].evaluateExpression,resolve:nt["a"].resolveExpression,checkResult:nt["a"].checkExpressionResult})},setUpButtonModule:function(){var e=this.getApi().GlobalFeatureManager,t=e.Actions,i=e.Selection,n=e.Storage;var a=Object.keys(g.Instance.execute).concat(Object.keys(t.isEnabled?t.Feature.execute:{}));if(t.isEnabled){var r=t.Feature.unsupported||[];a=a.filter(function(e){return r.indexOf(e)===-1})}Object(B["initializeButton"])({optionProviderOptions:{actions:a,customActionParameters:St["b"].Connector.ConnectorHelper.Settings.customActionParameters,fontFamilies:St["b"].Connector.ConnectorHelper.Settings.additionalFonts},actionManagerOptions:{actions:Me["a"]({},g.Instance.execute,t&&t.isEnabled?t.Feature.execute:{}),customTriggerObject:St["a"],preventActions:t&&t.isEnabled?t.Feature.preventActions.bind(t.Feature):undefined,onSelection:i.isEnabled?i.Feature.onSelection.bind(i.Feature):undefined},expressionProviderOptions:{evaluate:nt["a"].evaluateExpression,resolve:nt["a"].resolveExpression},mediaProviderOptions:n.isEnabled?{getMediaDataByUrl:this.getMediaData.bind(this)}:{}})},setUpComponentsModule:function(){s["a"].initialize({translation:Ot["a"]});var e=this.getApi().GlobalFeatureManager.Storage;var t=e&&e.isEnabled?e.Feature.media:undefined;u["a"].initialize({canUseMediaLibrary:!!t,isUpdatable:!this.getConnector().isPublished,storage:t})},setUpModelModule:function(){var t=this;var i=St["b"].DataObjects.RuntimeDO;var n;o["a"].initialize({initialDataTypes:m["a"],initialParameters:h["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(n||(n=nt["a"].getInstance())).encode(e,t)},decodeFormula:function(e,t){return(n||(n=nt["a"].getInstance())).decode(e,t)},getExtensionIdByContextCid:function(e){return it["a"].getExtensionIdByContextCid(e)},customClickBehavior:Y["d"],createInitialLayout:function(e,t,i){return St["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:St["b"].Utils.Constants.Parameters,createRootContainer:St["b"].Factories.ModelFactory.createRootContainer,createSHA1Hash:function(e){return K["a"].createSHA1Hash(e)},throwError:function(e){return t.getAllExtensions()[0].getCore().EventsManager.throwError(e)},getCommentById:function(e,t){return St["b"].DataObjects.CommentRepo.getCommentById(e,t)},getTranslation:function(e){return Ot["a"].getTranslation(e)},getFullContextTitle:function(e){return St["b"].DataObjects.ContextRepo.getFullContextTitle(e)},getAllContexts:function(){return St["b"].DataObjects.ContextRepo.getAllContexts()},getContextByCidOrThrow:function(e){return St["b"].DataObjects.ContextRepo.getContextByCidOrThrow(e)},getContextByCid:function(e){return St["b"].DataObjects.ContextRepo.getContextByCid(e)},isReadOnly:function(e){return St["b"].DataObjects.ContextRepo.isReadOnly(e)}});l["a"].initialize({ContextRepo:it["a"],onLayoutUpdate:this.pushLayoutDefinitionUpdate,onDataUpdate:this.pushContextModelUpdate})}};var f=r(560);St["b"].DataObjects=St["b"].DataObjects||{};St["b"].DataObjects.InlineCommentRepo=function(){var c={},y=St["b"].DataObjects.RuntimeDO,u=y.getFullUserName(),g=St["b"].DataObjects.CommonTableRepo,M=Ot["a"].getTranslation("ENTER_COMMENT"),S=St["b"].Utils.Format.DateChecker,O=St["b"].Utils.Constants.TypeValues.tableRepresentation,L="rgb(255, 0, 0)",A="rgb(150, 150, 150)",_="rgb(255, 255, 255)",I="rgb(0, 0, 0)",D="choose",R="end",N="DESIGN",n="TableModel",d="InlineModel",p="tc##";var P=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_LIST"),w=Ot["a"].getTranslation("HELP_TABLE_NUMBER_COMMENT"),U=Ot["a"].getTranslation("HELP_TABLE_DATE_COMMENT"),F=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_COMMENT"),B=Ot["a"].getTranslation("HELP_TABLE_MANDATORY_FLAG");this.getInlineCommentRepo=function(){return c};function getInlineRepoAndRepresentation(e,t,i,n){var a={obj:null,repo:c[e]};if(!a.repo){a.repo=c[e]=[]}else{a.obj=getRepresentationFromRepository(a.repo,t,i,n)}return a}function getCommonRepoAndRepresentation(e,t,i,n){var a={obj:null,repo:g.getCommonTable(e).inlineComments};a.obj=getRepresentationFromRepository(a.repo,t,i,n);return a}this.setInlineComment=function(e,t,i){var n=St["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),e.id.split(".")[0]);if(n){var a=n.extendedModel,r=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(a.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,a.input,e.addKeyVariable);c=getCommonRepoAndRepresentation(o,d,l,s)}else{d=generateTcKey(e.dataId_dim,a.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=C["a"].createFormattedDate();c.obj.lastModifiedBy=u;c.obj.value=t}updateRepoAndCommentObj(c.obj,e)}else{c.obj=createRepresentationObject(e,t,a.input);if(o){updateCommonRepresentationObject(c.obj,e,a.input,o);g.deleteEmptyInlineComment(o,c.obj)}else{updateInlineRepresentationObject(c.obj,e,a.input,i)}c.obj.changed=true;c.obj.lastModified=C["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 n=St["b"].Utils.DOM.strip(t.text);if(n===t.placeholderText||n==null||n===""){return}}else if(t.type===O.FLAG){if(t.text===""||t.text==null){return}}var a=t.commonTable;var r=t.type;var o=t.saveName;var l,s;if(a){l=generateTcKey(t.dataId_dim,e.input,t.addKeyVariable);s=getCommonRepoAndRepresentation(a,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(a){updateCommonRepresentationObject(s.obj,t,e.input,a);g.deleteEmptyInlineComment(a,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!=L){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,n,a,r){var o=c[e.getId()];if(o){var l=generateTcKey(t,n.input,r,e.getName());var s=getRepresentationFromRepository(o,l,i,a);if(s){return s}if(!r){var d=getRepresentationFromRepository(o,deprecated_generateTcKey(t,n.input,e),i,a);if(d){d.tcKey=l;return this.getSingleComment(e,t,i,n,a,r)}}}return null};this.setInlineCommentData=function(e,t,i,n){if(e.type!==t.type){e.hide=true;e.listContent=t.listContent;return}var a=St["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 m=typeof t.isDate==="string"?t.isDate==="true":t.isDate;var h=t.maxLength;var f=typeof t.edit==="string"?t.edit==="true":t.edit;var v=t.transport;var b=t.saveName;var T=t.placeholderText;if(!T){T=M}f=f&&a.documentMode.value===N&&n.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY&&!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions();e.color={border:I,background:_,pattern:I};if(e.type===O.LIST){for(var E=0;E<u.length;E++){if(u[E].key===""){break}if(u[E].key===s){s=E;break}}if(s===t.value){s=0}if(u[s].key===D){if(!f){r=true}if(p){e.color.pattern=L;l=P}else{e.color.pattern=A}}}else if(e.type===O.COMMENT){var x=St["b"].Utils.DOM.strip(s);if(s==null||x==null||x=="null"||x===T||x===""){s=T;x=T;e.color.pattern=A}if(g&&x!==T){e.textAnchor=R;var C=x;if(i){C=C.replace(a.negativeStyle.value,"-").split(a.thousandSep.value).join("").replace(a.decimalSep.value,".");if(isNaN(C)){e.color.pattern=L;l=w}else{s=createDisplayValue(C,a);t.value=C}}else{if(isNaN(C)){C=C.replace(a.negativeStyle.value,"-").split(a.thousandSep.value).join("").replace(a.decimalSep.value,".");if(isNaN(C)){e.color.pattern=L;l=w}else{s=createDisplayValue(C,a)}}else{s=createDisplayValue(C,a)}}}else if(m===true&&x!==T){S.setDateFormat(a.dateFormat.value);if(S.checkDate(x)===false){e.color.pattern=L;l=U}}else if(g){e.textAnchor=R}if(p&&x===T){e.color.pattern=L;l=F}if(!f&&(x===null||x===T||l!=null)){r=true}}else if(e.type===O.FLAG){s=typeof s==="string"?s==="true":s;if(p&&s===false&&f){e.color.border=L;l=B}else{e.color.border=A}}if(i){if(e.color.pattern==L){t.invalid=true}else if(t.invalid){delete t.invalid}}e.edit=f;e.isDate=m;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=h;e.listContent=u;e.saveName=b;e.color.background=e.edit?y.getParameter("COLOR_TEXT_BACKGROUND"):_;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 n=i[0];var a=n.substring(0,1)=="-";if(isNaN(n.substring(0,1))){n=n.substring(1,n.length)}var r="";var o=n.length;while(--o>=0){r=n.substring(o,o+1)+r;if((o-n.length)%3==0&&o>0){r=t.thousandSep.value+r}}var l="";if(a){l=t.negativeStyle.value}l+=r;if(i.length>1){l+=t.decimalSep.value+i[1]}return l}this.updateSaveNamesInline=function(e,i,n,a,r,o){var t=c[a.getId()];if(t){var l=St["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);var s=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(l.dataModel,0);var d=[];s.forEach(function(e){var t=St["b"].DataObjects.InlineCommentRepo.getSingleComment(a,e.path,n,r,i,o.addKeyVariable);t&&d.push(t)});updateSaveNames(d,e,i,n)}};this.updateCreatedInlineCommentsListContent=function(e,t,i,n){var a=c[t.getId()];if(a){updateListContent(a,e,i,n)}};this.updateCreateInlineCommentsTransport=function(e,t,i,n){var a=c[t.getId()];if(a){updateTransport(a,e,i,n)}};this.getRepresentationInlineCommentObjects=function(e,t,i){var n=c[e.getId()];var a=[];if(n){var r=n.length;while(r--){var o=n[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);a.push(s);o.changed=false;delete o.build}}}return a};this.getReleaseRepresentations=function(e,t,i){function traverse(e){if(e){if(e.extendedModel&&e.extendedModel.instanceOf===n){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===n){getReleaseRepresentations(e.children[t])}else{traverse(e.children[t])}}}}}function getReleaseRepresentations(e){for(var t=0,i=e.children.length;t<i;t++){var n=e.children[t];if(n.instanceOf!==d){continue}var a={};if(n.saveName===s){var r=generateTcKey(n.dataId_dim,e.extendedModel.input,n.addKeyVariable,l.getName());a={tcKey:r,saveName:n.saveName,type:n.type};o.push(a)}}}var o=[];var l=e;var s=i;traverse(t.rootContainerModel);return o};function resolveVariableId(e){if(e!=null){var t=St["b"].DataObjects.DocumentDO.getVariableById(e);if(t){return t.name}}return e}function createRepresentationObject(e,t,i){var n={};n.loggable=i.loggable;n.keyColumns=i.keyColumns;n.releaseVariable=i.releaseVariable;n.keyVariable=resolveVariableId(i.keyVariable);n.editVariable=i.editVariable;n.showVariable=i.showVariable;n.saveVariable=i.saveVariable;n.type=e.type;n.number=e.number;n.edit=e.edit;n.mandatory=e.mandatory;n.listContent=e.listContent;n.maxLength=e.maxLength;n.saveName=e.saveName;n.value=t;n.release=e.release;n.isDate=e.isDate;n.transport=e.transport;n.addKeyVariable=e.addKeyVariable;n.placeholderText=e.placeholderText;n.lastModifiedBy=e.lastModifiedBy;n.lastModified=e.lastModified;return n}function updateInlineRepresentationObject(e,t,i,n){if(t.tcKey){e.tcKey=t.tcKey}else{e.tcKey=generateTcKey(t.dataId_dim,i,t.addKeyVariable,n.getName())}}function updateCommonRepresentationObject(e,t,i,n){e.commonTable=n;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,n){var a=e.length;while(a--){var r=e[a];if(r.tcKey===t&&r.type===i&&r.saveName===n){return r}}return null}function deprecated_generateTcKey(e,t,i){var n=St["b"].DataObjects.DocumentDO.getVariableById(t.keyVariable);var a=n?i.getName()+n.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",""));a+=r[s]}return a}this.getRepoAndRepresentationByViewModel=function(e){var t=e.getModel(),i=t.commonTable,n=St["b"].DataObjects.DocumentDO.getExtension(e.getController().getRootModel().extensionHash),a=St["b"].Factories.ModelFactory.getModelById(n.getController().getRootModel(),t.id.split(".")[0]),r=a.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,n.getName());return getInlineRepoAndRepresentation(n.getId(),o,t.type,t.saveName)}};function generateTcKey(e,t,i,n){var a=n?n+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",""));a+=r[l]+p}var s=[t.keyVariable,i];for(var d=0;d<s.length;d++){var c=St["b"].DataObjects.DocumentDO.getVariableById(s[d]);if(!c){c=St["b"].DataObjects.DocumentDO.getVariable(s[d])}if(c){a+=c.value+p}}return a.substring(0,a.lastIndexOf(p))}function updateSaveNames(e,t,i,n){var a=e.length;while(a--){if(e[a].type===n&&e[a].saveName===i){e[a].saveName=t}}}function updateListContent(e,t,i,n){var a=e.length;while(a--){if(e[a].saveName===t&&e[a].build===true&&e[a].type===n){e[a].listContent=i}}}function updateTransport(e,t,i,n){var a=e.length;while(a--){if(e[a].saveName===t&&e[a].type===i&&e[a].transport!==n){e[a].transport=n;if(e[a].lastModified){e[a].changed=true}}}}this.loadCommonComments=function(e){var t=[];for(var i=0;i<e.length;i++){var n=e[i];for(var a=0;a<n.length;a++){var r=n[a];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=St["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 n=0;n<e.length;n++){if(e[n].commonTable==t.commonTableHash){i=e[n];break}}if(!i){i={commonTable:t.commonTableHash,comments:[]};e.push(i)}var a=null;for(var n=0;n<i.comments.length;n++){if(i.comments[n].type==t.type&&i.comments[n].saveName==t.saveName){a=i.comments[n];break}}if(!a){a={type:t.type,saveName:t.saveName,tcKeys:[]};i.comments.push(a)}a.tcKeys.push.apply(a.tcKeys,t.tcKeys)}this.getSingleCommonComment=function(e,t,i,n,a,r,o){var l=g.getCommonTable(e);if(undefined===l){return{hide:true}}l=l.inlineComments;var s=generateTcKey(t,n.input,r);var d=getRepresentationFromRepository(l,s,i,a);if(d===null&&o){if(!g.hasEmptyInlineComment(e,{tcKey:s,type:i,saveName:a})){var c=St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getCommonInlineComment",{commonTable:e,tcKey:s,type:i,saveName:a});if(c){g.addInlineComment(e,c);return c}else{g.addEmptyInlineComment(e,{tcKey:s,type:i,saveName:a})}}}return d};this.updateSaveNamesCommon=function(e,i,n,a,r,o){if(g.hasCommonTable(a)){var t=St["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);var l=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(t.dataModel,0);var s=[];l.forEach(function(e){var t=St["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(a,e.path,n,r,i,o.addKeyVariable,false);t&&s.push(t)});updateSaveNames(s,e,i,n)}};this.updateCreatedCommonCommentsListContent=function(e,t,i,n){var a=g.getCommonTable(t);if(undefined!==a){a=a.inlineComments;updateListContent(a,e,i,n)}};this.updateCreateCommonCommentsTransport=function(e,t,i,n){var a=g.getCommonTable(t);if(undefined!==a){a=a.inlineComments;updateTransport(a,e,i,n)}};this.getRepresentationCommonCommentObjects=function(e,t,i){var n=g.getCommonTable(e);if(undefined===n){return[]}var n=n.inlineComments;var a=[];var r=n.length;while(r--){var o=n[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);a.push(s);o.changed=false;delete o.build}}return a}};var x=r(467);var y=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 M=r(507);var oe=r(497);St["b"].DataObjects.RuntimeDO=function(e,t,i,n){var a=this;var r=e.notationManual;var o=r;var l=JSON.stringify(r);var s=e.notationManualLocalVersion?JSON.stringify(e.notationManualLocalVersion):l;var d=null;var c=null;var u=null;var p="";var g={};var m=false;var h=0;var f=null;var v=false;var b=true;var T=null;setUser(t);init();function init(){St["b"].Utils.Constants.ParameterSets=new y;if(i){Se["a"].hasService=false;return}if(T.userSpecific&&T.userSpecific.documentMode){p=T.userSpecific.documentMode.value}if(!Se["a"].hasService&&T.userSpecific&&T.userSpecific.scalingGroups&&T.userSpecific.scalingGroups.value instanceof String){console.error("HICO-40817: Workaround for broken user scaling groups ")}parseScalingGroups();St["b"].Utils.Mobile.onPointerDown(document.body,function(e){var t=e.target;if(t){if(typeof x["a"].isOpen==="function"&&x["a"].isOpen()&&!St["b"].$(t).closest(".tc-contextmenu").length){x["a"].close()}if(t.id!=="HiCoInlineCommentListSelectBox"&&t.parentNode&&t.parentNode.parentNode&&t.parentNode.parentNode.id!=="HiCoInlineCommentListSelectBox"){St["b"].Utils.DOM.enableInlineCommentRows();St["b"].$("#HiCoInlineCommentListSelectBox").remove()}}});document.addEventListener("keydown",function(e){if(e.keyCode===27){if(typeof x["a"].isOpen==="function"&&x["a"].isOpen()){x["a"].close()}St["b"].DataObjects.DocumentDO.getAllExtensions().forEach(function(e){var t=e.getController(),i=t.getRootModel();i.selectedChart="";if(e.getMode()===St["b"].Utils.Enums.EMode.COMPARE||i.isCompareMode){t.dispatch("updateDisableCompareCollecting",{extension:e})}})}});document.documentElement.addEventListener("touchmove",function(e){if(Se["a"].onTouchMove){e.preventDefault()}},{passive:false});window.oncontextmenu=function(e){e.preventDefault();return false}}function parseScalingGroups(){if(T.userSpecific&&T.userSpecific.scalingGroups){var e=T.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(){E("PRESENTATION",[Y["c"].Permissions.Consumer])};this.setDesignMode=function(){var e=a.getOriginalUserPermissions();if(!e){q["a"].error("Invalid user permissions")}E(p||e.indexOf(Y["c"].Permissions.Designer)===-1?"PRESENTATION":"DESIGN",e)};var E=function(e,t){if(!T){return}T.permissions=t||[];var i=St["b"].DataObjects.DocumentDO.getDocSettings&&St["b"].DataObjects.DocumentDO.getDocSettings(true).userSpecific.value;if((!i||i==="true")&&T.userSpecific&&T.userSpecific.documentMode&&T.userSpecific.documentMode.value){T.userSpecific.documentMode.value=e}};this.getUser=function(){return T};this.getFullUserName=function(){return t.fullUsername};this.getOriginalUserPermissions=function(){return T.originalPermissions};this.setSessionKey=function(e){T.sessionKey=e};this.setUserSettings=function(e){T.userSpecific=e};this.setUpdateScalingGroups=function(e){m=e};this.getUpdateScalingGroups=function(){return m};this.getTranslation=function(e){return Ot["a"].getTranslation(e)};this.getTranslationHtml=function(e){return Ot["a"].getTranslationHtml(e)};this.updateRuntime=function(e){if(Se["a"].hasService){var t=T.permissions;setUser(re["a"].repository("getFrontendSession",undefined,{documentHash:St["b"].DataObjects.DocumentDO.getHash()},false));T.originalPermissions=Object(V["g"])(T.permissions);t=t.filter(function(e){return~T.permissions.indexOf(e)});T.permissions=t.length?t:[Y["c"].Permissions.Consumer];parseScalingGroups()}else{T.userSpecific=St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().userSettings}if(!St["b"].DataObjects.DocumentDO.getConnector().isUpdateable()){this.setPresentationMode()}Ot["a"].initTranslations(St["b"].DataObjects.DocumentDO.getSettings().docLanguage.value).then(function(){St["b"].Utils.Constants.ParameterSets=new y;e()})};this.getParameters=function(){return r.parameters};this.getParameter=function(e,t){if(r.parameters===null){return""}if(!r.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&&r.parameters[e+"_DYNAMIC"]==="true"){return Object(M["a"])(r.parameters[e],window.innerWidth)}break;case"FONT_FAMILY":return oe["a"].getValidFontFamily(r.parameters[e])}return r.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(l)};this.getLocalNotationManual=function(){return JSON.parse(s)};this.getNotationManual=function(){return r};this.useNotationManual=function(e){r=e||o};this.setCurrentNotationManual=function(e){r=o=e};this.setNotationManual=function(e,t,i,n){this.setCurrentNotationManual(e);var a=this.getCentralNotationManual(),r=this.notationManualEqualsLocalVersion(),o=Object(V["p"])(e,a,["_UPDATED_AT","_UPDATED_BY"]),l=Object(V["p"])(e,this.getLocalNotationManual(),["_UPDATED_AT","_UPDATED_BY"]);if(n&&o){this.saveNotationManual(e,t,i)}else if(l||!r){e.parameters._UPDATED_AT=o?(new Date).toJSON():a.parameters._UPDATED_AT;e.parameters._UPDATED_BY=o?T.username:a.parameters._UPDATED_BY;St["b"].DataObjects.DocumentDO.setDocumentValue("notationManualLocalVersion",e);St["b"].DataObjects.DocumentDO.saveDocument()}s=JSON.stringify(e)};this.saveNotationManual=function(t,e,i){if(Se["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);l=s=JSON.stringify(r)}saveNotationManualLocally()})}else{saveNotationManualLocally()}function saveNotationManualLocally(){St["b"].DataObjects.DocumentDO.setDocumentValue("notationManual",t);St["b"].DataObjects.DocumentDO.setDocumentValue("notationManualLocalVersion",undefined);St["b"].DataObjects.DocumentDO.saveDocument()}};this.getDataTypes=function(){return r.datatypes};this.getDataType=function(e){if(!r.datatypes[e]){console.warn("The following key isn't defined in datatypes: ",e)}return r.datatypes[e]};this.setClipboardState=function(e,t){this.clearClipboardState(c);d=e==null?null:JSON.stringify(e);c=t;u=e==null?null:St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(e)};this.getClipboardState=function(){return{sourceExtensionId:c,state:JSON.parse(d)}};this.clearClipboardState=function(e){if(c===e){d=null;c=null;St["b"].DataObjects.DocumentDO.removeTemporaryDisabledVariables()}};this.isClipboardEmpty=function(){return d===null};this.setRebuildComments=function(e,t){g[e]=t};this.getRebuildComments=function(e){return g[e]};this.setRebuildCommentsAll=function(e){for(var t in g){g[t]=e}};this.getClipboardTextContent=function(){return u};this.isTextEditable=function(e){var t="DESIGN"===St["b"].DataObjects.DocumentDO.getSettings().documentMode.value;return t&&St["b"].DataObjects.RuntimeDO.evaluateCommentCondition(e)&&!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()};this.getAllowIcon=function(e){if(e=="Yes"){return true}if(e=="No"){return false}var t=St["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=St["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=v;v=e;return t};this.notationManualDiffers=function(){return!this.notationManualEqualsCentralVersion()||!this.notationManualEqualsLocalVersion()};this.notationManualEqualsCentralVersion=function(){return!Se["a"].hasService||JSON.stringify(r)===l};this.notationManualEqualsLocalVersion=function(){return JSON.stringify(r)===s};this.useLocalVersion=function(){this.setCurrentNotationManual(JSON.parse(s))};this.useCentralVersion=function(){this.setCurrentNotationManual(JSON.parse(l))};this.isPrePaint=function(){return b};this.setPrePaint=function(e){b=e};this.isPrinting=function(){return i};this.isNPrinting=function(){return!!n};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}}});T=e}};var at={build:[3,5,6],draw:[10,25],PREINIT:3,INIT:5,AXIS_ZOOM:6,LEGEND:10,DRAW:25,POST_DRAW:26};var rt=r(53);var ot=r(324);var v=St["b"].Utils.Constants={BuildUp:at,Parameters:ot["a"],TypeValues:rt["a"]};var lt=r(171);var le=new function(){var e,u,t,n,a,i,r,E,p,o=false,g=false,x=false;var C=v.TypeValues;this.exportModel=exportModel;this.init=invalidateInit;function exportModel(e,t){try{!o&&init();u=St["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",n=document.getElementById(i);if(n){n.parentNode.removeChild(n)}}}}catch(e){console.error("HiCo",e)}}function init(){var e=St["b"].DataObjects.RuntimeDO;t=e.getParameter("FONT_FAMILY");n=e.getParameter("FONT_STYLE_CHART");a=e.getParameterParsed("FONT_SIZE_CHART");i=lt["a"].pt2pix(a);r={"*":{"font-size":i+"px","font-family":t,position:"static","white-space":"pre-wrap","word-wrap":"break-word"}};g=false;x=false;o=true}function invalidateInit(){o=false;g=false;x=false}function initTableConstants(){var e=St["b"].DataObjects.RuntimeDO,t=lt["a"].mm2pix(a*e.getParameterParsed("MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE"))+"px",i={"*":{"font-style:":n}};E={metaRepresentationTypes:{visual:[C.tableRepresentation.BAR,C.tableRepresentation.LINE,C.tableRepresentation.NEEDLE,C.tableRepresentation.SYMBOL,C.tableRepresentation.SYMBOL_LINE,C.tableRepresentation.WATERFALL],comment:[C.tableRepresentation.COMMENT,C.tableRepresentation.FLAG,C.tableRepresentation.LIST],value:[C.tableRepresentation.VALUE]},aggregatedHeadersPosition:e.getParameter("AGGREGATION_ALIGNMENT"),defaultBorderStyle:{"border-bottom":t+" solid "+e.getParameter("COLOR_BOTTOM_BORDER")},defaultColumnWidth:lt["a"].mm2pix(a*e.getParameterParsed("MMPT_TABLE_COLUMN_WIDTH")),defaultTdStyle:{padding:"0"},css:Object(V["g"])(Me["a"]({},r["*"],i["*"]))};x=true}function initCommentConstants(){var e=St["b"].DataObjects.RuntimeDO,t=e.getParameter("FONT_STYLE_TITLE").split(" "),i=e.getParameter("FONT_STYLE_SUBTITLE").split(" "),n={".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(V["g"])(Me["a"]({},r["*"],n[".title"])),subtitle:Object(V["g"])(Me["a"]({},r["*"],n[".subtitle"])),comment:Object(V["g"])(r["*"])}},refLabelDistance:St["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){!x&&initTableConstants();var r;var p=[],t=document.getElementById(e.extensionHash).parentNode,o=i.extendedModel,n=o.columnDefinitions,l=o.rowAlignment,a={meta:{chart:i.id,data:[],modelName:i.name||St["b"].DataObjects.DocumentDO.getExtension(e.extensionHash).getAdapter().getServerId()+"_"+i.id,extension:e.extensionHash,width:[]},head:[],body:[]};var s=n.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(E.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 m=0,h=u.length;m<h;m++){var f=u[m];f.isDynamicCol&&(f.width+=g);a.meta.width.push(f.width+"px");if(m<h-1){a.meta.width.push(f.columnDefinition.spacing_right+"px")}}var v=[];for(var b=0,h=o.tableCellData.length;b<h;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"),n=void 0,a=void 0,r=void 0;if(l.isAnnotatorRow()){u=p[t];n=t+(u||0)<c.length-1;a=Object(V["g"])(Me["a"]({},E.defaultTdStyle,e.tdStyle));r=JSON.stringify(e.data)}else{applyStyles(i,E.css);if(l.isHeader&&e.element&&e.element.aggregatedHide){u=calculateColSpan(t,c);s.isAnnotatorRow()&&(p[t]=u)}n=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)}a=Object(V["g"])(E.defaultTdStyle);buildUpAlignmentStyle(t,e,a,l.isHeader,u>0&&!s.isAnnotatorRow());buildUpBorderStyle(t,l,s,a);e.additionalStyle["textAlign"]=a["text-align"]||"";e.additionalStyle["verticalAlign"]=a["vertical-align"]||""}applyStyles(i,e.additionalStyle);d.push({value:i,tdStyle:a,tdData:r,colSpan:u?2*u+1:0});n&&d.push({tdStyle:E.defaultTdStyle})}else{u--}});l.isHeader?a.head.push(d):a.body.push(d)});initExportDiv(t,e.extensionHash).appendChild(createTable(a));function buildUpBorderStyle(e,t,i,n){if(i&&!(i.getIsTotalOrSubtotal()||t.getIsTotalOrSubtotal()||t.isHeader||i.isAnnotatorRow())){St["b"].$.extend(n,E.defaultBorderStyle)}else if(i&&!i.isAnnotatorRow()){var a=i?i.getBorder():undefined,r=a[e]["border-top"],o=t.getBorder();n["border-bottom"]=r?r:o[e]["border-bottom"]}}function buildUpAlignmentStyle(e,t,i,n,a){if(n){i["text-align"]=a||!t.element?E.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 C.labelHorizontalAlignment.LEFT:i["text-align"]="left";break;case C.labelHorizontalAlignment.MIDDLE:i["text-align"]="center";break;case C.labelHorizontalAlignment.RIGHT:i["text-align"]="right"}}}}function calculateColSpan(e,t){var i=0,n;while((n=t[i+e+1])&&t[i+e].content===n.content&&n.element.valueRowLabelPosition!==C.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 n=o.expressions[t];if(n.id.split(".")[2]===e){return n.representation}}}function getMetaRepresentationType(e){var t=E.metaRepresentationTypes;for(var i in t){if(t.hasOwnProperty(i)&&t[i].indexOf(e)!==-1){return i}}}function calculateWidthOfVisualColumn(e,t,i){var n=t.columnDefinition.defMinWidth,a=i.scrollingData?i.scrollingData.realWidth:0;var r;if(n===-1){r=e}else{var o=lt["a"].convertToPixel(n,a,t.columnDefinition.defMinWidthType);r=Math.max(o,e)}return r}function ExtendedColDefObject(n){var a=this;this.columnDefinition=n;this.isDynamicCol=false;this.isHidden=false;this.representationType=undefined;this.metaRepresentationType=undefined;this.width=0;init();function init(){var e=n.exprId.indexOf("dim")>-1&&o.dimensionLabelModel.displayType===C.categoryLabel.NONE||n.IsHidden;a.isHidden=e;a.isDynamicCol=!e&&(!n.columnFix||n.defWidthType==="w");var t=getRepresentationTypeFromExprId(n.exprId),i=getMetaRepresentationType(t);i==="visual"?a.width=undefined:a.width=n.width;a.representationType=t;a.metaRepresentationType=i;!r&&i==="value"&&(r=a)}}}function exportCommentModel(e,t){!g&&initCommentConstants();var i=document.getElementById(t.extensionHash).parentNode,o=St["b"].DataObjects.CommentRepo.getCommentById(e.extendedModel.commentId,t.extensionHash),n=o?o.currContent.grid:[];var a={meta:{chart:e.id,modelName:e.name||u.getAdapter().getServerId()+"_"+e.id,extension:t.extensionHash,width:[]},body:[]};var l=[];var s=false;n.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){a.meta.width.push("auto")}a.meta.width.push(null)}n.forEach(function(e){var r=[];e.forEach(function(e,t){if(l[t]){if(e.reference[0]){var i=St["b"].Layout.CommentReference.ReferenceRepresentation.char.create(e.reference[0].id,true);if(i){r.push({value:i})}else{r.push({})}}else{r.push({})}}var n=document.createElement("div");applyStyles(n,p.css.textType[o.textType]);setTextContent(n,getLabelFormatterInstance().parseLabel(e.text));s&&(n.style.paddingTop=p.refLabelDistance+"px");var a={value:n};r.push(a)});a.body.push(r)});initExportDiv(i,t.extensionHash).appendChild(createTable(a))}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 n=document.createElement("table");n.style.borderCollapse="collapse";if(e.head){var a=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)});a.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}}))});a.appendChild(i)});n.appendChild(a)}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)});n.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)});n.appendChild(l)}i.appendChild(n);return i;function createTd(e,t,i){var n=document.createElement(e);t.value!==undefined&&n.appendChild(t.value);applyStyles(n,t.tdStyle);t.tdData&&(n.dataset.exportData=t.tdData);i&&i(n);return n}}function keepDoubleWhiteSpace(e){return Object(V["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 St["b"].Utils.Format.LabelFormatter);return e}function TableRow(u,p,g){var e,t,i,m=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 m};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 n=u[t].elements[0];if(!n){e.push({});continue}var a=n.color.pattern,r=n.color.background,o=n.color.border;if(n.dimension.height===0){e.push({data:{type:"hidden"},tdStyle:{}})}else if(n.dimension.height===1){e.push({data:{type:"line",color1:a},tdStyle:{borderTop:"1px solid "+a}})}else{var l={border:"1px solid "+o},s=n.dimension.height-2+"px";if(r===a||n.otherPattern===C.otherPattern.FILLED||n.otherPattern===C.otherPattern.EMPTY){var d=n.otherPattern===C.otherPattern.EMPTY?"rgb(255, 255, 255)":a;e.push({data:{type:"filled",color1:d},tdStyle:l,additionalStyle:{height:s,backgroundColor:d}})}else{var c="repeating-linear-gradient(-45deg, "+a+" 0px, "+a+" 2px, "+r+" 2px, "+r+" 4px, "+a+" 4px)";e.push({data:{type:"hatched",color1:a,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 n={},a=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"){a=r[l];o=getLabelFormatterInstance().parseLabel(a.text);(a.isSubtotal||a.isTotal)&&(m=true)}else{r[l].color&&r[l].color.pattern&&(n.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=C.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{a=findModelInElementList(r,"LabelModel");if(a){a.dataId_expr&&a.color&&(n.color=a.color);o=getLabelFormatterInstance().parseLabel(a.text);(a.isSubtotal||a.isTotal)&&(m=true)}}e.push({content:o,element:a,additionalStyle:n})}}return e;function findModelInElementList(e,t){for(var i=0,n=e.length;i<n;i++){if(e[i].instanceOf===t){return e[i]}}}}function getBorder(){var n=[];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)}n.push(i)}});return n}}};St["b"].UI=St["b"].UI||{};St["b"].UI.NotationManual=function(e){this.onApply=e;var b=this;var I;var o;var t=St["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 a=18;var R="0";var N="&nbsp;%";var P="&nbsp;mm/10pt";var p="&nbsp;pt";var w=4;var U=1;var F=0;var B=St["b"].DataObjects.RuntimeDO;var E=B.getDataTypes();var x={Actual:{},Budget:{},Forecast:{}};var g="";var m="";var h="";var f=B.getParameters();var r=!St["b"].Connector.ConnectorHelper.Support.LocalNotationManual;var C=E["Actual"].subtypes;var y=E["Budget"].subtypes;var M=E["Forecast"].subtypes;for(var i in C){if(!C.hasOwnProperty(i)){continue}x["Actual"][i]="-"}for(var i in y){if(!y.hasOwnProperty(i)){continue}x["Budget"][i]="-"}for(var i in M){if(!M.hasOwnProperty(i)){continue}x["Forecast"][i]="-"}var T=St["b"].Utils.Constants.ParameterSets.shapeTypeTranslations;var S=St["b"].Utils.Constants.ParameterSets.shapeTypeIds;var O=St["b"].Utils.Constants.ParameterSets.lineTypeTranslations;var L=St["b"].Utils.Constants.ParameterSets.lineTypeIds;var A=St["b"].Utils.Constants.ParameterSets.otherTypeTranslations;var _=St["b"].Utils.Constants.ParameterSets.otherTypeIds;var v=St["b"].Utils.Constants.TypeValues;var H=oe["a"].getFontTypes();var k=[{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 W=[{id:"arrow",translation:Ot["a"].getTranslation("ARROW")},{id:"pin",translation:Ot["a"].getTranslation("PIN")}];var z=[{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 X=[{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 Y=[];var K=[];var Z=[];var n=[{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 ne=[{id:"XXXmultipleBorder",text:Ot["a"].getTranslation("BORDER"),buildUp:createMultipleBorder}];var ae="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(B.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 n=new St["b"].UI.HiCoDialogDefinition(ae,e,i);n.setHeight(s);n.setWidth(l);n.setAutoOpen(false);D=n.getFontSize();I=new St["b"].UI.HiCoDialog(n);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()});St["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 a="#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(a,r);b.setCSS();I.decorateTabs(0,j,null);I.decorateTabs(0,X,null);I.decorateTabs(0,J,null);I.decorateTabs(0,ee,null);I.decorateTabs(0,te,null);I.decorateTabs(0,ie,null);I.decorateTabs(0,ne,null);I.decorateTabs(0,Y,null);I.decorateTabs(0,K,null);I.decorateTabs(0,Z,null);return I};b.openLocalVersion=function(){b.close(true);St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getNotationManual",{parameters:{use:"local",supressDiffDialog:true,repaint:true}})};b.openCentralVersion=function(){b.close(true);St["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 n=e.length;for(var a=0;a<n;a++){var r=e[a];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===""){F++}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 a=0;a<s;a++){l[a].setAttribute("disabled","disabled");l[a].style.opacity=".35";l[a].style.filter="Alpha(Opacity=35)"}}}function textInputKeydown(){if(this.style.borderColor!==""){this.style.borderColor="";F--;if(F===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,n;var a=e.length;for(var r=0;r<a;r++){if(e[r].type==="section"){I.createSection(t,Ot["a"].getTranslation(e[r].name))}else if(e[r].type==="pureInput"){i=B.getParameter(e[r].parameter);n=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,n,{text:i,labelText:"",keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput")}else if(e[r].type===N){i=(B.getParameter(e[r].parameter)*100).toFixed(U);n=Ot["a"].getTranslation(e[r].name);if(e[r].extra==undefined){I.createTableRow(t,"nm_i_"+e[r].parameter,n,{text:i,labelText:N,change:textInputChange,keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput")}else{I.createTableRow(t,"nm_i_"+e[r].parameter,n,{text:i,labelText:N,change:textInputChange,keydown:textInputKeydown,inputStyle:{backgroundColor:"rgb(240, 240, 240)",border:"0px"}},"textInput",e[r].extra)}}else if(e[r].type===P){i=(B.getParameter(e[r].parameter)*10).toFixed(w);n=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,n,{text:i,labelText:P,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=B.getParameter(e[r].parameter);n=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,n,{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=B.getParameter(e[r].parameter);n=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,n,i,"rgbDiv")}else if(e[r].type==="checkBox"){e[r].value=B.getParameter(e[r].parameter);n=Ot["a"].getTranslation(e[r].name);I.createTableRow(t,"nm_i_"+e[r].parameter,n,e[r],"checkBox")}else if(e[r].type==="dynSize"){var o="FACTOR_"+e[r].parameter;var l="MMPT_"+e[r].parameter;var s=(B.getParameter(o)*100).toFixed(U);var d=(B.getParameter(l)*10).toFixed(w);n=Ot["a"].getTranslation(e[r].name);var c=document.createElement("tr");var u=document.createElement("td");var p=St["b"].Utils.DOM.createSpan(u,n,"");p.style.fontSize=D;St["b"].$(u).css("padding","5px 10px 5px 0px");c.appendChild(u);u=document.createElement("td");var g=St["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",N);St["b"].$(g).on("change",textInputChange);St["b"].$(g).on("keydown",textInputKeydown);var m=St["b"].Utils.DOM.createTextInput(u,"nm_i_"+l,d,6,D);m.style.backgroundColor="rgb(240, 240, 240)";m.style.border="0px";m.setAttribute("maxlength","100");m.setAttribute("mmppt",P);St["b"].$(m).on("change",textInputChange);St["b"].$(m).on("keydown",textInputKeydown);c.appendChild(u);var h=document.createElement("select");h.setAttribute("size","1");h.style.fontSize=D;h.setAttribute("id","nm_i_"+e[r].select);St["b"].$(h).attr("class","_lengthUnits");var f=B.getParameter(e[r].select);var v=z.length;for(var b=0;b<v;b++){var T=document.createElement("option");St["b"].$(T).html(z[b].translation);if(z[b].translation===f){T.setAttribute("selected","selected");if(b===0){m.style.display="none"}else{g.style.display="none"}}h.appendChild(T)}var E=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=""}};St["b"].$(h).on("change",{id:e[r].parameter},E);u.appendChild(h);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 x=document.createElement("tr");for(var b=0;b<e[r].colSpan;b++){x.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(x)}else if(e[r].type==="headers"){var c=document.createElement("tr");var C=document.createElement("tr");c.style.whiteSpace="nowrap";for(var b=0;b<e[r].names.length;b++){var u=document.createElement("td");n=e[r].names[b];if(n!==""){n=Ot["a"].getTranslation(n)}St["b"].$(u).html(n);if(e[r].font!=undefined){u.style.fontWeight=e[r].font}var y="0px 0px 1px 0px";if(e[r].padding){y=e[r].padding}St["b"].$(u).css("padding",y);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(n!==""){var M=document.createElement("span");M.style.margin="0px";St["b"].$(M).html('<hr style="margin:0 0 1px 0; color:'+e[r].color+"; background-color:"+e[r].color+'">');u=document.createElement("td");St["b"].$(u).css("height","1px");u.appendChild(M);St["b"].$(u).css("margin","0px");St["b"].$(u).css("padding","1px 8px 3px 0px");u.setAttribute("valign","top")}C.appendChild(u)}t.appendChild(c);t.appendChild(C)}else if(e[r].type==="multi"){var c=document.createElement("tr");var S={textAlign:"left",verticalAlign:"middle",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(c,S);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 L={text:B.getParameter(e[r].parameters[b],true),labelText:e[r].labelText,spin:false,maxLength:e[r].maxLength,fontSize:D,width:e[r].textWidth};if(L.labelText===P){L.text=(B.getParameter(e[r].parameters[b])*10).toFixed(w)}else if(L.labelText===N){L.text=(B.getParameter(e[r].parameters[b])*100).toFixed(U)}I.createItem(u,"nm_i_"+e[r].parameters[b],L,e[r].createType)}else if(e[r].createType==="rgbDiv"){var L=B.getParameter(e[r].parameters[b]);I.createItem(u,"nm_i_"+e[r].parameters[b],L,e[r].createType,null,null,e[r].noMargin)}else if(e[r].createType==="icon"){for(var A=0;A<e[r].icons.length;A++){var L={src:e[r].icons[A],selectedValue:B.getParameter(e[r].parameters[b]),tooltip:Ot["a"].getTranslationHtml(e[r].tooltip[A]),clazz:e[r].clazz[A],mainClazz:e[r].mainClazz,callback:e[r].callback};var _="nm_i_"+e[r].parameters[b];I.createItem(u,_,L,e[r].createType)}}else if(e[r].createType==="dropdown"){var L={clazz:e[r].clazz,valueArray:e[r].valuesArray,selectedValue:B.getParameter(e[r].parameters[b])};var _="nm_i_"+e[r].parameters[b];I.createItem(u,_,L,e[r].createType)}else if(e[r].createType==="checkBox"){var _="nm_i_"+e[r].parameters[b];I.createItem(u,_,B.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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"VALUE"},{type:N,name:"AMOUNT",parameter:"FACTOR_AMOUNT",extra:"70px"},{type:N,name:"QUANTITY",parameter:"FACTOR_QUANTITY",extra:"70px"},{type:N,name:"RELATION",parameter:"FACTOR_RELATION",extra:"70px"},{type:"section",name:"TIME"},{type:N,name:"YEAR",parameter:"FACTOR_YEAR"},{type:N,name:"QUARTER_NAME",parameter:"FACTOR_QUARTER"},{type:N,name:"MONTH",parameter:"FACTOR_MONTH"},{type:N,name:"WEEK_NAME",parameter:"FACTOR_WEEK"},{type:N,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");St["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 n=document.createElement("table");n.setAttribute("cellspacing",R);var a=[{type:"dropdown",name:"FONT_FAMILY",parameter:"FONT_FAMILY",valuesArray:H,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:P,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:P,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:P,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:P,name:"COMMENT_SPACING",parameter:"MMPT_COMMENT_LABEL_DISTANCE",width:55},{type:"headers",names:["","COLOR","INVERTED"],padding:i,color:"#BABABA"}];buildRows(a,n);var r=document.createElement("tr"),o,l=document.createElement("td"),s=St["b"].Utils.DOM.createSpan(l,St["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=B.getParameter("REFERENCE_FONT_COLOR");I.createItem(o,"nm_i_REFERENCE_FONT_COLOR",d,"rgbDiv");r.appendChild(o);o=document.createElement("td");d=B.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);n.appendChild(r);a=[{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:P,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:P,padding:t,padding2:i,groupPosition:1,subString:"WIDTH",textWidth:55,maxLength:6}];buildRows(a,n);e.appendChild(n);return e}function createGeneralHighlightCompare(){var e=document.createElement("div");e.setAttribute("id","HighlightCompare");var t=parseInt(u)+19;St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:t+"px"});var i=document.createElement("table");var n="5px 33px 0px 0px";var a="5px 44px 0px 0px";var r="5px 30px 0px 0px";if(c==="de_DE"){n="5px 22px 0px 0px";a="5px 62px 0px 0px";r="5px 50px 0px 0px"}var o=[{type:"header",name:"HIGHLIGHT",padding:n,rowSpan:4},{type:"section",name:"ELEMENT"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_HIGHLIGHT"},{type:"header",name:"OVERALL",padding:a,rowSpan:7},{type:"section",name:"ELLIPSE"},{type:N,name:"WIDTH",parameter:"FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"},{type:N,name:"HEIGHT",parameter:"FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"},{type:P,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:W,clazz:"_defaultCompareStyle",style:{fontWeight:"bold"}},{type:"line",colSpan:2,color:"#eeeeee"},{type:"section",name:"ARROW"},{type:P,name:"BODY_SIZE",parameter:"MMPT_HIGHLIGHT_ARROW_SIZE"},{type:N,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:P,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:P,name:"CONNECTOR_AREA_SIZE",parameter:"MMPT_CIRCLE_AREA_SIZE"},{type:"rgbDiv",name:"CONNECTOR_COLOR",parameter:"CON_CIRCLE_COLOR"},{type:P,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:P,name:"CONNECTOR_AREA_SIZE",parameter:"MMPT_TRIANGLE_AREA_SIZE"},{type:"rgbDiv",name:"CONNECTOR_COLOR",parameter:"CON_TRIANGLE_COLOR"},{type:P,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:P,name:"IN_CHART",parameter:"MMPT_OFFSET_IN_CHART"},{type:P,name:"LEGEND_END",parameter:"MMPT_OFFSET_LEGEND_END"},{type:P,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;St["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 n=[{type:"header",name:"SCALING_HELPER",padding:i,rowSpan:8},{type:P,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 a=buildRows(n);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=B.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=B.getParameter("COLOR_SCALING_HELPER_"+r+"_AREA");I.createItem(l,"nm_i_COLOR_SCALING_HELPER_"+r+"_AREA",d,"rgbDiv");o.appendChild(l);a.appendChild(o)}n=[{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(n,a);e.appendChild(a);return e}function createGeneralNavigation(){var e=document.createElement("div");e.setAttribute("id","GeneralNavigation");St["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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:P,name:"BAR_HEIGHT",parameter:"MMPT_STRUCTURE_BAR_HEIGHT"},{type:P,name:"SYMBOL_SIZE",parameter:"MMPT_STRUCTURE_SYMBOL_SIZE"},{type:P,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_STRUCTURE_NEEDLE_LINE_SIZE"},{type:P,name:"LINE_SIZE",parameter:"MMPT_STRUCTURE_LINE_SIZE"},{type:P,name:"THIN_LINE_SIZE",parameter:"MMPT_STRUCTURE_THIN_LINE_SIZE"},{type:P,name:"DIMENSION_DISTANCE",parameter:"MMPT_STRUCTURE_CATEGORY_DISTANCE"},{type:P,name:"OUTLIER_DISTANCE",parameter:"MMPT_STRUCTURE_OUTLIER_DISTANCE"},{type:N,name:"DISPLACEMENT",parameter:"FACTOR_STRUCTURE_ELEMENT_DISPLACEMENT"},{type:"section",name:"AXIS"},{type:P,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_STRUCTURE_AXIS_WITHOUT_NOTATION"},{type:P,name:"WITH_AXIS_NOTATION",parameter:"MMPT_STRUCTURE_AXIS_WITH_NOTATION"},{type:"section",name:"HEADER"},{type:P,name:"TEXT_SPACE",parameter:"MMPT_STRUCTURE_HEADER_TEXT_SPACE"},{type:P,name:"BAR_HEIGHT",parameter:"MMPT_STRUCTURE_HEADER_BAR_HEIGHT"},{type:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"LEGEND"},{type:P,name:"ELEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_LEGEND_ELEMENT_DISTANCE"},{type:P,name:"MINIMUM_CONNECTOR_LENGTH",parameter:"MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH"},{type:P,name:"CONNECTOR_WIDTH",parameter:"MMPT_STRUCTURE_LEGEND_CONNECTOR_WIDTH"},{type:P,name:"SYMBOL_WIDTH",parameter:"MMPT_STRUCTURE_LEGEND_SYMBOL_WIDTH"},{type:P,name:"PADDING",parameter:"MMPT_STRUCTURE_LEGEND_PADDING"},{type:"section",name:"VALUE_LABEL"},{type:P,name:"ELEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE"},{type:P,name:"ELEMENT_DISPLACEMENT_DISTANCE",parameter:"MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISPLACEMENT_DISTANCE"},{type:N,name:"BACKGROUND_TRANSPARENCY",parameter:"FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY"},{type:"section",name:"DIMENSION_LABEL"},{type:P,name:"AXIS_DISTANCE",parameter:"MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE"},{type:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SEPARATOR_CHANGE_OF"},{type:P,name:"SIZE",parameter:"MMPT_STRUCTURE_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_CHANGE_OF_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_RIGHT",parameter:"FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_STRUCTURE_SEPARATOR"},{type:"section",name:"HIERARCHY"},{type:P,name:"OFFSET",parameter:"MMPT_STRUCTURE_HIERARCHY_OFFSET"},{type:"section",name:"CELL_PADDING"},{type:P,name:"TOP",parameter:"MMPT_STRUCTURE_CELL_PADDING_TOP"},{type:P,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");St["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:P,name:"SEPARATOR_SIZE",parameter:"MMPT_STRUCTURE_SUBTOTAL_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:N,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:P,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:N,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:N,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:P,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:N,name:"SEPARATOR_LENGTH_LEFT",parameter:"FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:N,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:P,name:"BAR_HEIGHT",parameter:"MMPT_TABLE_ELEMENT_BAR_HEIGHT"},{type:P,name:"SYMBOL_SIZE",parameter:"MMPT_TABLE_ELEMENT_SYMBOL_WIDTH"},{type:P,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_TABLE_NEEDLE_LINE_SIZE"},{type:P,name:"LINE_SIZE",parameter:"MMPT_TABLE_LINE_SIZE"},{type:P,name:"VALUE_LABEL_DISTANCE",parameter:"MMPT_TABLE_ELEMENT_LABEL_AREA_DISTANCE"},{type:P,name:"OUTLIER_DISTANCE",parameter:"MMPT_TABLE_OUTLIER_DISTANCE"},{type:"section",name:"AXIS"},{type:P,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_TABLE_AXIS_WITHOUT_NOTATION"},{type:P,name:"WITH_AXIS_NOTATION",parameter:"MMPT_TABLE_AXIS_WITH_NOTATION"},{type:"section",name:"HEADER"},{type:P,name:"TEXT_SPACE",parameter:"MMPT_TABLE_HEADER_TEXT_SPACE"},{type:P,name:"HEIGHT_WITH_NOTATION",parameter:"MMPT_TABLE_HEADER_WITH_NOTATION"},{type:P,name:"HEIGHT_WITHOUT_NOTATION",parameter:"MMPT_TABLE_HEADER_WITHOUT_NOTATION"},{type:P,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:k,clazz:"_labelAlignment"},{type:"rgbDiv",name:"AGGREGATED_BORDER_COLOR",parameter:"COLOR_AGGREGATION_BORDER"},{type:P,name:"AGGREGATED_BORDER_HEIGHT",parameter:"MMPT_AGGREGATION_BORDER_HEIGHT"},{type:P,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_HEADER_LABEL_DISTANCE_TOP"},{type:P,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");St["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:P,name:"BORDER_SIZE",parameter:"MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE"},{type:P,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_NORMAL"},{type:P,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:P,name:"BORDER_SIZE",parameter:"MMPT_TABLE_SUBTOTAL_BOTTOM_BORDER_SIZE"},{type:P,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_SUBTOTAL"},{type:P,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:P,name:"BORDER_SIZE",parameter:"MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE"},{type:P,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOP_DISTANCE_TOTAL"},{type:P,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:P,name:"BORDER_SIZE",parameter:"MMPT_TABLE_TOTALS_WITHOUT_VALUES_BOTTOM_BORDER_SIZE"},{type:P,name:"DISTANCE_TO_TOP",parameter:"MMPT_TABLE_TOTALS_WITHOUT_VALUES_TOP_DISTANCE_TOTAL"},{type:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"COLUMN"},{type:P,name:"COLUMN_WIDTH",parameter:"MMPT_TABLE_COLUMN_WIDTH"},{type:P,name:"DISTANCE_BETWEEN_COLUMNS",parameter:"MMPT_TABLE_COLUMN_DISTANCE"},{type:P,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:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"ELEMENT"},{type:P,name:"BAR_WIDTH",parameter:"MMPT_TIME_COLUMN_WIDTH"},{type:P,name:"SYMBOL_SIZE",parameter:"MMPT_TIME_SYMBOL_SIZE"},{type:P,name:"NEEDLE_LINE_SIZE",parameter:"MMPT_TIME_NEEDLE_LINE_SIZE"},{type:P,name:"LINE_SIZE",parameter:"MMPT_TIME_LINE_SIZE"},{type:P,name:"THIN_LINE_SIZE",parameter:"MMPT_TIME_THIN_LINE_SIZE"},{type:P,name:"DIMENSION_DISTANCE",parameter:"MMPT_TIME_CATEGORY_DISTANCE"},{type:P,name:"OUTLIER_DISTANCE",parameter:"MMPT_TIME_OUTLIER_DISTANCE"},{type:N,name:"DISPLACEMENT",parameter:"FACTOR_TIME_ELEMENT_DISPLACEMENT"},{type:"section",name:"AXIS"},{type:P,name:"WITHOUT_AXIS_NOTATION",parameter:"MMPT_TIME_AXIS_WITHOUT_NOTATION"},{type:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"LEGEND"},{type:P,name:"ELEMENT_DISTANCE",parameter:"MMPT_TIME_LEGEND_ELEMENT_DISTANCE"},{type:P,name:"MINIMUM_CONNECTOR_LENGTH",parameter:"MMPT_TIME_LEGEND_MIN_CONNECTOR_LENGTH"},{type:P,name:"CONNECTOR_HEIGHT",parameter:"MMPT_TIME_LEGEND_CONNECTOR_HEIGHT"},{type:P,name:"SYMBOL_WIDTH",parameter:"MMPT_TIME_LEGEND_SYMBOL_WIDTH"},{type:P,name:"PADDING",parameter:"MMPT_TIME_LEGEND_PADDING"},{type:"section",name:"VALUE_LABEL"},{type:P,name:"ELEMENT_DISTANCE",parameter:"MMPT_TIME_LABEL_ELEMENT_DISTANCE"},{type:P,name:"ELEMENT_DISPLACEMENT_DISTANCE",parameter:"MMPT_TIME_LABEL_ELEMENT_DISPLACEMENT_DISTANCE"},{type:N,name:"BACKGROUND_TRANSPARENCY",parameter:"FACTOR_TIME_LABEL_BACKGROUND_TRANSPARENCY"},{type:"section",name:"DIMENSION_LABEL"},{type:P,name:"AXIS_DISTANCE",parameter:"MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE"},{type:P,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");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"SEPARATOR_CHANGE_OF"},{type:P,name:"SIZE",parameter:"MMPT_TIME_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_LEFT_AUTO_LENGTH",parameter:"CHECK_TIME_CHANGE_OF_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_TOP",parameter:"FACTOR_TIME_SEPARATOR_DRAWING_AREA"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_TIME_SEPARATOR"},{type:"section",name:"CELL_PADDING"},{type:P,name:"LEFT",parameter:"MMPT_TIME_VALUE_LABEL_PADDING_LEFT"},{type:P,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");St["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:P,name:"SEPARATOR_SIZE",parameter:"MMPT_TIME_SUBTOTAL_SEPARATOR_SIZE"},{type:"checkBox",name:"SEPARATOR_BOTTOM_AUTO_LENGTH",parameter:"CHECK_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:N,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA"},{type:N,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:P,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:N,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:N,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:P,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:N,name:"SEPARATOR_LENGTH_BOTTOM",parameter:"FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA"},{type:N,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",ne)}function createMultipleBorder(){var e=document.createElement("div");e.setAttribute("id","MULTIPLEBorder");St["b"].Utils.DOM.setStyle(e,{overflow:"auto",width:"100%",height:u+"px"});var t=[{type:"section",name:"TOP"},{type:P,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_TOP_BORDER"},{type:"section",name:"RIGHT"},{type:P,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_RIGHT_BORDER"},{type:"section",name:"BOTTOM"},{type:P,name:"SIZE",parameter:"MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"},{type:"rgbDiv",name:"COLOR",parameter:"COLOR_MULTIPLE_CASE_BOTTOM_BORDER"},{type:"section",name:"LEFT"},{type:P,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",X)}function createDatatypeActualTab(){var e=document.createElement("div");e.setAttribute("id","actualTab");var t=b.createDatatypeHeader("actual");e.appendChild(t);var i=b.createDatatypeContent("actual",C);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",y);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",M);e.appendChild(i);return e}b.createDatatypeHeader=function(t){var e=document.createElement("div");St["b"].Utils.DOM.setStyle(e,{height:25+"px",width:"auto",overflow:"hidden"});var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("td");St["b"].Utils.DOM.setStyle(a,{width:30+"px",minWidth:30+"px",whiteSpace:"nowrap"});St["b"].$(a).html(Ot["a"].getTranslationHtml("VERSION")+"&nbsp;&nbsp;");n.appendChild(a);a=document.createElement("td");St["b"].Utils.DOM.setStyle(a,{whiteSpace:"nowrap"});St["b"].$(a).html(Ot["a"].getTranslationHtml("DEFINITION")+"&nbsp;&nbsp;");n.appendChild(a);a=document.createElement("td");var r=St["b"].Utils.DOM.createSpan(a,"&nbsp;+&nbsp;","add_"+t);St["b"].$(r).click(function(){b.addTab(t)});St["b"].$(r).hover(function(){St["b"].$(this).css("text-decoration","underline")},function(){St["b"].$(this).css("text-decoration","none")});n.appendChild(a);a=document.createElement("td");var o=St["b"].Utils.DOM.createSpan(a,"&nbsp;-&nbsp;","remove_"+t);St["b"].$(o).click(function(e){b.removeTab(t,e)});St["b"].$(o).hover(function(){St["b"].$(this).css("text-decoration","underline")},function(){St["b"].$(this).css("text-decoration","none")});n.appendChild(a);i.appendChild(n);e.appendChild(i);var l=document.createElement("span");l.style.margin="0px";St["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 n in t){if(!t.hasOwnProperty(n)){continue}Y.push({id:"ACT"+t[n].version,text:"ACT_"+t[n].version,buildUp:createActualContentDefinition})}Y.sort(function(e,t){return parseInt(e.id.substring(3))>parseInt(t.id.substring(3))});var a=Y}else if(e==="budget"){for(var n in t){if(!t.hasOwnProperty(n)){continue}K.push({id:"BUD"+t[n].version,text:"BUD_"+t[n].version,buildUp:createBudgetContentDefinition})}K.sort(function(e,t){return parseInt(e.id.substring(3))>parseInt(t.id.substring(3))});var a=K}else if(e==="forecast"){for(var n in t){if(!t.hasOwnProperty(n)){continue}Z.push({id:"FC"+t[n].version,text:"FC_"+t[n].version,buildUp:createForecastContentDefinition})}Z.sort(function(e,t){return parseInt(e.id.substring(2))>parseInt(t.id.substring(2))});var a=Z}I.buildTabs(e+"TabVersion",a,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,n,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);St["b"].Utils.DOM.setStyle(t,{overflow:"auto",width:"100%",height:d+"px"});var i=document.createElement("table");i.setAttribute("cellspacing","10");var n=b.createContent(e);var a=document.createElement("tr");var r=document.createElement("td");r.appendChild(n);a.appendChild(r);i.appendChild(a);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 m="5px 5px 0px 0px";var p="12px 0px 0px 0px";var h=b.getDataObjectSettings(g,t);var i=document.createElement("div");var f=document.createElement("table");f.style.borderSpacing="0px 0px";var n=document.createElement("tr");var v=document.createElement("td");St["b"].$(v).html(Ot["a"].getTranslation("COLORS"));St["b"].$(v).css("padding","0px 0px 0px 0px");St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");n.appendChild(v);f.appendChild(n);function buildUnderline(e,t){var i=document.createElement("tr");for(var n=0;n<7;n++){var a=document.createElement("span");a.style.margin="0px";St["b"].$(a).html('<hr style="margin:0 0 1px 0; color:'+e+"; background-color:"+e+'">');v=document.createElement("td");St["b"].$(v).css("height","1px");v.appendChild(a);St["b"].$(v).css("margin","0px");if(t){St["b"].$(v).css("padding","5px 0px 0px 0px")}else{St["b"].$(v).css("padding","0px 0px 0px 0px")}v.setAttribute("valign","top");i.appendChild(v)}f.appendChild(i)}buildUnderline("#000000",false);var a=[{html:"TYPE"},{html:"CONCEPT"},{html:"SUBTYPE"},{img:Se["a"].imgPath+"HiCo_Zeit_Vorvergangenheit.png",alt:"PAST_PAST"},{img:Se["a"].imgPath+"HiCo_Zeit_Vergangenheit.png",alt:"PAST"},{img:Se["a"].imgPath+"HiCo_Zeit_Heute.png",alt:"PRESENT"},{img:Se["a"].imgPath+"HiCo_Zeit_Zukunft.png",alt:"FUTURE"}];var r=document.createElement("tr");var o=a.length;for(var l=0;l<o;l++){v=document.createElement("td");if(a[l].html){St["b"].$(v).html(Ot["a"].getTranslation(a[l].html));St["b"].$(v).css("padding",m)}else if(a[l].img){St["b"].$(v).css("padding","5px 0px 0px 0px");var s=document.createElement("img");s.setAttribute("src",a[l].img);s.setAttribute("alt",Ot["a"].getTranslation(a[l].alt));s.setAttribute("title",Ot["a"].getTranslation(a[l].alt));St["b"].$(v).css("text-align","center");St["b"].$(s).css("text-align","center");v.appendChild(s)}St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v)}f.appendChild(r);function buildColorSection(e){var t=e.length;for(var i=0;i<t;i++){var n=document.createElement("tr");var a=e[i];var r=a.texts.length;for(var o=0;o<r;o++){v=document.createElement("td");var l=a.texts[o]===""?"":Ot["a"].getTranslation(a.texts[o]);I.createLabel(v,l,true);St["b"].$(v).css("padding",u);n.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+"_"+a.idKey,h.settings[c][a.objectKey],"rgbDiv");St["b"].$(v).css("padding",p);St["b"].$(St["b"].$(v).find("div")[0]).css("margin-left","auto");St["b"].$(St["b"].$(v).find("div")[0]).css("margin-right","auto");n.appendChild(v)}f.appendChild(n)}}buildUnderline("#000000",false);var a=[{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(a);buildUnderline("#eeeeee",true);var a=[{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(a);buildUnderline("#eeeeee",true);var a=[{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(a);f.style.borderSpacing="0px 0px";var r=document.createElement("tr");var n=document.createElement("tr");var v=document.createElement("td");St["b"].$(v).html(Ot["a"].getTranslation("SHAPES"));St["b"].$(v).css("padding",m);St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");n.appendChild(v);f.appendChild(n);buildUnderline("#000000",false);v=document.createElement("td");St["b"].$(v).html(Ot["a"].getTranslation("TYPE"));St["b"].$(v).css("padding",m);St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v);v=document.createElement("td");St["b"].$(v).html(Ot["a"].getTranslation("CONCEPT"));St["b"].$(v).css("padding",m);St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");r.appendChild(v);v=document.createElement("td");St["b"].$(v).html("");St["b"].$(v).css("padding",m);St["b"].$(v).css("margin"," 0px");v.setAttribute("valign","bottom");r.appendChild(v);f.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){St["b"].$(c).html('<hr style="margin:0 0 1px 0; color:#000000; background-color:#000000">')}v=document.createElement("td");St["b"].$(v).css("height","1px");v.appendChild(c);St["b"].$(v).css("margin","0px");v.setAttribute("valign","top");d.appendChild(v)}f.appendChild(d);function buildShapeSection(e){var t=e.length;for(var i=0;i<t;i++){var n=document.createElement("tr");var a=e[i];var r=a.texts.length;for(var o=0;o<r;o++){var l=document.createElement("td");var s=a.texts[o]===""?"":Ot["a"].getTranslation(a.texts[o]);I.createLabel(l,s,true);St["b"].$(l).css("padding",m);n.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(h.settings[u][a.objectKey],"shape");if(p===null||p===undefined){p="Square"}I.createItem(l,"input_"+u+"_"+g+"_"+a.idKey,{valueArray:a.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);St["b"].$(St["b"].$(l).find("select")[0]).css("margin-left","0px");St["b"].$(l).css("padding","5px, 0px, 0px, 0x");n.appendChild(l)}f.appendChild(n)}}var a=[{texts:["SYMBOL","SHAPE",""],objectKey:"symbolShape",idKey:"symbolShape",valueArray:T},{texts:["","OTHER",""],objectKey:"symbolOther",idKey:"symbolOther",valueArray:T}];buildShapeSection(a);var n=document.createElement("tr");var v=document.createElement("td");St["b"].$(v).html(Ot["a"].getTranslation("AREAS"));St["b"].$(v).css("padding",m);St["b"].$(v).css("margin","0px");v.setAttribute("valign","bottom");n.appendChild(v);f.appendChild(n);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: '+m+'">'+e+"</td>"});f.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){St["b"].$(c).html('<hr style="margin:0 0 1px 0; color:#000000; background-color:#000000">')}v=document.createElement("td");St["b"].$(v).css("height","1px");v.appendChild(c);St["b"].$(v).css("margin","0px");v.setAttribute("valign","top");d.appendChild(v)}f.appendChild(d);function buildForecastPatternSection(e){var t=e.length;for(var i=0;i<t;i++){var n=document.createElement("tr");var a=e[i];var r=a.texts.length;for(var o=0;o<r;o++){var l=document.createElement("td");var s=a.texts[o]===""?"":Ot["a"].getTranslation(a.texts[o]);I.createLabel(l,s,true);St["b"].$(l).css("padding",m);n.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(a.idKey==="otherArea"||a.idKey==="otherOther"){var p=getValueText(h.settings[u][a.objectKey],"other");if(p===null||p===undefined){p="Diagonal"}I.createItem(l,"input_"+u+"_"+g+"_"+a.idKey,{valueArray:a.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);St["b"].$(St["b"].$(l).find("select")[0]).css("margin-left","0px");St["b"].$(l).css("padding","5px, 0px, 0px, 0x");n.appendChild(l)}else{var p=getValueText(h.settings[u][a.objectKey],"line");if(p===null||p===undefined){p="Solid"}I.createItem(l,"input_"+u+"_"+g+"_"+a.idKey,{valueArray:a.valueArray,selectedValue:p,clazz:"_shapeType"},"dropdown",false,true);St["b"].$(St["b"].$(l).find("select")[0]).css("margin-left","0px");St["b"].$(l).css("padding","5px, 0px, 0px, 0x");n.appendChild(l)}}f.appendChild(n)}}var a=[{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:A},{texts:["","OTHER",""],objectKey:"otherOther",idKey:"otherOther",valueArray:A}];buildForecastPatternSection(a);i.appendChild(f);return i};b.getDataObjectSettings=function(e,t){var i=null;if(t===null||t===undefined||t===""){if(e.substring(0,3)==="ACT"){i=C[e]}else if(e.substring(0,3)==="BUD"){i=y[e]}else if(e.substring(0,2)==="FC"){i=M[e]}}else if(t==="PPY"){if(e.substring(0,3)==="ACT"){i=C[e].settings.ppy}else if(e.substring(0,3)==="BUD"){i=y[e].settings.ppy}else if(e.substring(0,2)==="FC"){i=M[e].settings.ppy}}else if(t==="PY"){if(e.substring(0,3)==="ACT"){i=C[e].settings.py}else if(e.substring(0,3)==="BUD"){i=y[e].settings.py}else if(e.substring(0,2)==="FC"){i=M[e].settings.py}}else if(t==="Present"){if(e.substring(0,3)==="ACT"){i=C[e].settings.p}else if(e.substring(0,3)==="BUD"){i=y[e].settings.p}else if(e.substring(0,2)==="FC"){i=M[e].settings.p}}else if(t==="Future"){if(e.substring(0,3)==="ACT"){i=C[e].settings.f}else if(e.substring(0,3)==="BUD"){i=y[e].settings.f}else if(e.substring(0,2)==="FC"){i=M[e].settings.f}}return i};b.addTab=function(e){var t=b.getNextId(e);var i=t.id;var n=t.text;b.addNewObject(e,t.version);if(e==="actual"){Y.push({id:i,text:n,buildUp:createActualContentDefinition});I.buildSingleTab("actualTabVersion",i,n,createActualContentDefinition,"auto",{top:"0px",left:"50px"});x["Actual"][i]="-"}else if(e==="budget"){K.push({id:i,text:n,buildUp:createBudgetContentDefinition});I.buildSingleTab("budgetTabVersion",i,n,createBudgetContentDefinition,"auto",{top:"0px",left:"50px"});x["Budget"][i]="-"}else if(e==="forecast"){Z.push({id:i,text:n,buildUp:createForecastContentDefinition});I.buildSingleTab("forecastTabVersion",i,n,createForecastContentDefinition,"auto",{top:"0px",left:"50px"});x["Forecast"][i]="-"}b.setCSS()};b.getNextId=function(e){var t="";var i=-1;if(e==="actual"){t="ACT";for(var n in C){if(C.hasOwnProperty(n)&&parseInt(C[n].version)>i){i=parseInt(C[n].version)}}}else if(e==="budget"){t="BUD";for(var n in y){if(y.hasOwnProperty(n)&&y[n].version>i){i=parseInt(y[n].version)}}}else if(e==="forecast"){t="FC";for(var n in M){if(M.hasOwnProperty(n)&&parseInt(M[n].version)>i){i=parseInt(M[n].version)}}}i++;return{id:t+i,version:i,text:t+"_"+i}};b.addNewObject=function(e,t){if(e==="actual"){C["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"){y["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"){M["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=St["b"].$("#actualTabVersion");var i=St["b"].$(t[0].childNodes[0]).find("a");var n=i.length;for(r=0;r<n;r++){var a=St["b"].$(i[r]);if(a&&a.css("text-decoration").indexOf("underline")!==-1){g=St["b"].$(i[r]).attr("href").replace("#","");if(g==="ACT0"){return}St["b"].$(i[r]).remove();r=i.length}}for(var r=0;r<Y.length;r++){if(Y[r].id===g){Y.splice(r,1)}}delete C[g];St["b"].$("#XXX-TAB-"+g).remove();St["b"].$("#"+g).remove();x["Actual"][g]="delete";St["b"].$(t).tabs("select",0)}else if(e==="budget"){t=document.getElementById("budgetTabVersion");var i=St["b"].$(t.childNodes[0]).find("a");var n=i.length;for(r=0;r<n;r++){var a=St["b"].$(i[r]);if(a&&a.css("text-decoration").indexOf("underline")!==-1){m=St["b"].$(i[r]).attr("href").replace("#","");if(m==="BUD0"){return}St["b"].$(i[r]).remove();r=i.length}}var o=K.length;for(var r=0;r<o;r++){if(K[r].id===m){K.splice(r,1)}}delete y[m];St["b"].$("#XXX-TAB-"+m).remove();St["b"].$("#"+m).remove();x["Budget"][m]="delete";St["b"].$(t).tabs("select",0)}else if(e==="forecast"){t=document.getElementById("forecastTabVersion");var i=St["b"].$(t.childNodes[0]).find("a");var n=i.length;for(r=0;r<n;r++){var a=St["b"].$(i[r]);if(a&&a.css("text-decoration").indexOf("underline")!==-1){h=St["b"].$(i[r]).attr("href").replace("#","");if(h==="FC0"){return}St["b"].$(i[r]).remove();r=i.length}}for(var r=0;r<Z.length;r++){if(Z[r].id===h){Z.splice(r,1)}}delete M[h];St["b"].$("#XXX-TAB-"+h).remove();St["b"].$("#"+h).remove();x["Forecast"][h]="delete";St["b"].$(t).tabs("select",0)}};b.updateDivHeight=function(){var e=St["b"].$(o).dialog("option","height");o.style.height=e-70+"px";var t=122;var i=e-t;St["b"].$("#generalTab").css("height",i);St["b"].$("#structureTab").css("height",i);St["b"].$("#tableTab").css("height",i);St["b"].$("#timeTab").css("height",i);St["b"].$("#multipleTab").css("height",i);St["b"].$("#datatypeTab").css("height",i);i=e-t-81;for(var n in C){St["b"].$("#DefinitionTab_actual-_"+n).css("height",i)}for(var n in y){St["b"].$("#DefinitionTab_budget-_"+n).css("height",i)}for(var n in M){St["b"].$("#DefinitionTab_forecast-_"+n).css("height",i)}i=e-t-44;St["b"].$("#GENERALValueTypes").css("height",i);St["b"].$("#GENERALFontTypes").css("height",i);St["b"].$("#HighlightCompare").css("height",i);St["b"].$("#GeneralNavigation").css("height",i);St["b"].$("#GeneralOther").css("height",i);St["b"].$("#STRUCTUREPresentation").css("height",i);St["b"].$("#STRUCTUREAxisAndLabel").css("height",i);St["b"].$("#STRUCTUREOTHER").css("height",i);St["b"].$("#STRUCTUREValues").css("height",i);St["b"].$("#TABLEPresentation").css("height",i);St["b"].$("#TABLEStructure").css("height",i);St["b"].$("#TABLEAxis").css("height",i);St["b"].$("#TABLEColumnNotation").css("height",i);St["b"].$("#TABLEOther").css("height",i);St["b"].$("#TABLESubtotals").css("height",i);St["b"].$("#TABLETotals").css("height",i);St["b"].$("#TABLEAxisAndColumn").css("height",i);St["b"].$("#TIMEPresentation").css("height",i);St["b"].$("#TIMEFactor").css("height",i);St["b"].$("#TIMEAxis").css("height",i);St["b"].$("#TIMEAxisAndLabel").css("height",i);St["b"].$("#TIMEAxisSeparator").css("height",i);St["b"].$("#TIMECategoryLabel").css("height",i);St["b"].$("#TIMEValueLabel").css("height",i);St["b"].$("#TIMEValueRowLabel").css("height",i);St["b"].$("#TIMEOverallSeparator").css("height",i);St["b"].$("#TIMEValues").css("height",i);St["b"].$("#MULTIPLEBorder").css("height",i)};b.updateHeight=function(){var e=St["b"].$(o).parent().height()-70;o.style.height=e+"px";var t=50;var i=e-t;St["b"].$(".ui-tabs-panel",St["b"].$(o).parent()).height(i-St["b"].$("#tabDiv > .ui-tabs-nav").height()-a);St["b"].Utils.DOM.setStyle(document.getElementById("tabs-general"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tabs-structure"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tabs-table"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tabs-time"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tabs-datatypes"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tabs-multiple"),{height:i+"px"});i=e-t-81;St["b"].Utils.DOM.setStyle(document.getElementById("generalTab"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("structureTab"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("tableTab"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("timeTab"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("multipleTab"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("datatypeTab"),{height:i+"px"});i=e-t-42;St["b"].Utils.DOM.setStyle(document.getElementById("XXXgeneralFont"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXgeneralValue"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXhighlightcompare"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXnavigation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXother"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXstructurePresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureAxisAndLabel"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureOther"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXstructureValues"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtablePresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtableStructure"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtableTitle"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtimePresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeAxisAndLabel"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeAxisSeparator"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXtimeValues"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("XXXmultipleBorder"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-actual"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-budget"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("datatypeTabs-forecast"),{height:i+"px"});i=e-t-40;St["b"].Utils.DOM.setStyle(document.getElementById("GENERALValueTypes"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("GENERALFontTypes"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("HighlightCompare"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("GeneralNavigation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("GeneralOther"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREPresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREAxisAndLabel"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREOTHER"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("STRUCTUREValues"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TABLEPresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TABLEStructure"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TABLEOther"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TIMEPresentation"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TIMEValues"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TIMEAxisSeparator"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("TIMEAxisAndLabel"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("MULTIPLEBorder"),{height:i+"px"});i=e-t-81;for(var n in C){if(!C.hasOwnProperty(n)){continue}St["b"].Utils.DOM.setStyle(document.getElementById(n),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_actual-_"+n),{height:i+"px"})}for(var n in y){if(!y.hasOwnProperty(n)){continue}St["b"].Utils.DOM.setStyle(document.getElementById(n),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_budget-_"+n),{height:i+"px"})}for(var n in M){if(!M.hasOwnProperty(n)){continue}St["b"].Utils.DOM.setStyle(document.getElementById(n),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("DefinitionTab_forecast-_"+n),{height:i+"px"})}};b.changeSelection=function(e,t){var i=[C,y,M];var n=["ppy","py","p","f"];var a=["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<n.length;d++){var c=n[d];var u=a[d];var p=s.settings[c];var g=null;p.colorBorder=St["b"].$("#input_"+u+"_"+l+"_colorBorder").css("background-color");p.colorFill1=St["b"].$("#input_"+u+"_"+l+"_ColorFill1").css("background-color");p.colorFill2=St["b"].$("#input_"+u+"_"+l+"_ColorFill2").css("background-color");p.otherBorder=St["b"].$("#input_"+u+"_"+l+"_otherBorder").css("background-color");p.otherFill1=St["b"].$("#input_"+u+"_"+l+"_OtherFill1").css("background-color");p.otherFill2=St["b"].$("#input_"+u+"_"+l+"_OtherFill2").css("background-color");p.positiveColorBorder=St["b"].$("#input_"+u+"_"+l+"_positiveColorBorder").css("background-color");p.positiveColorFill1=St["b"].$("#input_"+u+"_"+l+"_positiveColorFill1").css("background-color");p.positiveColorFill2=St["b"].$("#input_"+u+"_"+l+"_positiveColorFill2").css("background-color");p.positiveOtherBorder=St["b"].$("#input_"+u+"_"+l+"_positiveOtherBorder").css("background-color");p.positiveOtherFill1=St["b"].$("#input_"+u+"_"+l+"_positiveOtherFill1").css("background-color");p.positiveOtherFill2=St["b"].$("#input_"+u+"_"+l+"_positiveOtherFill2").css("background-color");p.negativeColorBorder=St["b"].$("#input_"+u+"_"+l+"_negativeColorBorder").css("background-color");p.negativeColorFill1=St["b"].$("#input_"+u+"_"+l+"_negativeColorFill1").css("background-color");p.negativeColorFill2=St["b"].$("#input_"+u+"_"+l+"_negativeColorFill2").css("background-color");p.negativeOtherBorder=St["b"].$("#input_"+u+"_"+l+"_negativeOtherBorder").css("background-color");p.negativeOtherFill1=St["b"].$("#input_"+u+"_"+l+"_negativeOtherFill1").css("background-color");p.negativeOtherFill2=St["b"].$("#input_"+u+"_"+l+"_negativeOtherFill2").css("background-color");g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_symbolShape");p.symbolShape=S[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_symbolOther");p.symbolOther=S[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_lineShape");p.lineShape=L[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_lineOther");p.lineOther=L[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_otherArea");p.otherArea=_[g.selectedIndex];g=document.getElementById("input_"+u.toLowerCase()+"_"+l+"_otherOther");p.otherOther=_[g.selectedIndex]}}}var m=B.getParameters();for(var o in m){if(!m.hasOwnProperty(o)){continue}var h=document.getElementById("nm_i_"+o);if(!h){if(o.indexOf("_")!==0){console.warn("element "+o+" not found")}continue}var f=h.tagName.toLowerCase();if(f==="input"){var v=h.type.toLowerCase();if(v==="text"){var b=h.value;b=b.replace(/,/g,".");if(h.getAttribute("mmppt")===P){b=(parseFloat(b)/10).toString()}else if(h.getAttribute("mmppt")===N){b=(parseFloat(b)/100).toString()}m[o]=b}else if(v==="checkbox"){m[o]=h.checked.toString()}else if(v==="image"){m[o]=checkImage(h)}}else if(f==="select"){var T=h.getAttribute("class");if(T==="_fontTypes"){m[o]=H[h.selectedIndex].translation}else if(T==="_labelAlignment"){m[o]=k[h.selectedIndex].id}else if(T==="_lengthUnits"){m[o]=z[h.selectedIndex].translation}else if(T==="_outlierStyle"){m[o]=V[h.selectedIndex].id}else if(T==="_pinStyle"){m[o]=$[h.selectedIndex].id}else if(T==="_tableLabelAlignment"){m[o]=G[h.selectedIndex].id}else if(T==="_defaultCompareStyle"){m[o]=W[h.selectedIndex].id}}else if(f==="div"){m[o]=h.style.backgroundColor}}B.setNotationManual({parameters:m,datatypes:E},e,x,t)};function escapeBeforeHandler(){return true}function escapeAfterHandler(){}b.save=function(){b.changeSelection(false,true);I.close();repaintAllExtensions()};b.apply=function(){b.changeSelection(false,r);f=B.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 f){var n=document.getElementById("nm_i_"+i);if(!f.hasOwnProperty(i)||!n){if(i.indexOf("_")!==0){console.warn("element "+i+" not found")}continue}var a=n.tagName.toLowerCase();if(a==="input"){var r=n.type.toLowerCase();if(r==="text"){var o=n.value;o=o.replace(/,/g,".");if(n.getAttribute("mmppt")===P){o=(parseFloat(o)/10).toString()}else if(n.getAttribute("mmppt")===N){o=(parseFloat(o)/100).toString()}if(o!==f[i]){t=true;break}}else if(r==="checkbox"){if(n.checked.toString()!==f[i].toString()){t=true;break}}}else if(a==="select"){var l=n.getAttribute("class");if(l==="_fontTypes"){if(H[n.selectedIndex].translation.toLowerCase()!==f[i].toLowerCase()){t=true;break}}else if(l==="_labelAlignment"){if(k[n.selectedIndex].id!==f[i]){t=true;break}}else if(l==="_lengthUnits"){if(z[n.selectedIndex].translation.toLowerCase()!==f[i].toLowerCase()){t=true;break}}else if(l==="_outlierStyle"){if(V[n.selectedIndex].id!==f[i]){t=true;break}}else if(l==="_pinStyle"){if($[n.selectedIndex].id!==f[i]){t=true;break}}else if(l==="_tableLabelAlignment"){if(G[n.selectedIndex].id!==f[i]){t=true;break}}else if(l==="_defaultCompareStyle"){if(W[n.selectedIndex].id!==f[i]){t=true;break}}}else if(a==="div"){if(n.style.backgroundColor!==f[i]){t=true;break}}}if(t===false){I.close();repaintAllExtensions();b.onApplyChanges(true)}else{St["b"].Factories.DialogFactory.createConfirmationDialog(St["b"].Utils.Translations.getTranslation("CONFIRM_CLOSE"),St["b"].Utils.Translations.getTranslation("CONFIRM_LOSING_UNSAVED_CHANGES"),function(e){St["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=B.getParameters();f=St["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 n=i.tagName.toLowerCase();if(n==="input"){var a=i.type.toLowerCase();if(a==="text"){var r=i.value;r=r.replace(/,/g,".");if(i.getAttribute("mmppt")===P){r=(parseFloat(r)/10).toString()}else if(i.getAttribute("mmppt")===N){r=(parseFloat(r)/100).toString()}e[t]=r}else if(a==="checkbox"){e[t]=i.checked.toString()}}else if(n==="select"){var o=i.getAttribute("class");if(o==="_fontTypes"){e[t]=H[i.selectedIndex].translation}else if(o==="_labelAlignment"){e[t]=k[i.selectedIndex].id}else if(o==="_lengthUnits"){e[t]=z[i.selectedIndex].translation}else if(o==="_outlierStyle"){e[t]=V[i.selectedIndex].id}}else if(n==="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 n=document.getElementById("nm_i_"+e);if(n===null){continue}if(n.type==="text"){var a=t[i];a=a.replace(/,/g,".");switch(n.getAttribute("mmppt")){case P:a=a*10;a=a.toFixed(4);break;case N:a=a*100;a=a.toFixed(1);break}if(c==="de_DE"){a=a.replace(/\./g,",")}n.value=a}else if(n.tagName==="DIV"){n.style.backgroundColor=t[i]}else if(n.type==="checkbox"){if(t[i]==="true"||t[i]===true){St["b"].$(n).attr("checked",true)}else{St["b"].$(n).attr("checked",false)}}else if(n.type==="select-one"&&(n.className==="_fontTypes"||n.className==="_labelAlignment"||n.className==="_lengthUnits"||n.className==="_outlierStyle")){St["b"].$(n).children().each(function(e){if(St["b"].$(this).html().toLowerCase()===t[i].toLowerCase()){St["b"].$(n).val(e);St["b"].$(this).attr("selected","selected")}else{St["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 C){if(!C.hasOwnProperty(t)){continue}e=document.getElementById("actualDivACT"+C[t].version);I.manipulateCssResetTabs(e)}for(var t in y){if(!y.hasOwnProperty(t)){continue}e=document.getElementById("budgetDivBUD"+y[t].version);I.manipulateCssResetTabs(e)}for(var t in M){if(!M.hasOwnProperty(t)){continue}e=document.getElementById("forecastDivFC"+M[t].version);I.manipulateCssResetTabs(e)}};function buildButtonBar(){var e=St["b"].Utils.Translations.getTranslation,t=[],i=r?e("HELP_NM_SAVE_AND_CLOSE"):e("HELP_NM_SAVE_CENTRAL_AND_CLOSE"),n=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:n,click:b.apply});t.push({text:e("RESET"),id:"resetButton",title:e("HELP_NM_RESET"),click:b.setDefaultValues});if(St["b"].Utils.GlobalVariables.hasService){t.push({text:e("SET_AS_DEFAULT"),id:"defaultButton",title:e("HELP_NM_SET_AS_DEFAULT"),click:b.changeDefaultValues})}if(!B.notationManualEqualsLocalVersion()&&B.notationManualDiffers()){t.push({text:e("LOAD_LOCAL"),id:"loadLocalButton",title:e("HELP_NM_LOAD_LOCAL"),click:b.openLocalVersion})}else if(!B.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 n;if(t==="shape"){n=v.shape}else if(t==="other"){n=v.otherPattern}else if(t==="line"){n=v.line}for(var a in n){if(n.hasOwnProperty(a)&&n[a]===e){i=Ot["a"].getTranslation(a);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(a in n){if(n.hasOwnProperty(a)&&n[a]===e){i=Ot["a"].getTranslation(a);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=St["b"].$(e.parentNode).find("._fontWeightTypes");for(var n=0;n<i.length;n++){var a=i[n];if(St["b"].$(a).hasClass("active")){var r=a.getAttribute("subType");t=t===""?r:t+" "+r}}if(t===""){t="normal"}else if(t==="italic"){t="normal "+t}return t}function changeIcon(e){St["b"].$(e.target).toggleClass("active opClass")}function repaintAllExtensions(){St["b"].Utils.Calculator.IFrameCalculation.cleanCache();St["b"].Layout.CommentReference.ReferenceRepresentation.init();le.init();St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Button=St["b"].Layout.Button||{};St["b"].Layout.Button.ButtonPlusLayout=function(){var E={width:0,height:0};var x,C,y,M;var S,O,L,A;this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){return a}E={width:0,height:0};var r=e[0].getController().getRootModel();var o=n.getModel();if(r.buildUp===St["b"].Utils.Constants.BuildUp.DRAW){x=o.border.left.width+o.padding.left;C=o.border.right.width+o.padding.right;y=o.border.top.width+o.padding.top;M=o.border.bottom.width+o.padding.bottom;S=0;L=i.width-S-x-C;O=0;A=i.height-O-y-M;var l=L,s=A;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,m=p.height;E=c.getPreferredSize();if(E.width){l=E.width}else if(g&&g.indexOf("%")!==-1){l=Math.round(parseFloat(g)*L)/100}if(E.height){s=E.height}else if(m&&m.indexOf("%")!==-1){s=Math.round(parseFloat(m)*A)/100}c.setDimension({width:l,height:s});c.scrollingInfo={horizontal:l>L,vertical:s>A}}else{c.setDimension({width:Math.max(l,L),height:Math.max(s,A)})}c.setPosition({x:0,y:0});a[c.getId()]=c}var h=s,f=l,v=s>A,b=l>L;if(x+C+y+M>0||v||b){var T=St["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:h,realWidth:f,height:A,width:L,scrollingVer:!o.disableScrolling&&v,scrollingHor:!o.disableScrolling&&b,x:x,y:y,id:T};for(var d=0;d<e.length;d++){e[d].getModel().nestedContainerId=T}}else{o.scrollingData={realHeight:h,realWidth:f,width:i.width,height:i.height,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,id:o.id}}}return a};this.getPreferredLayoutSize=function(e,t,i){if(e.length){return e[0].getPreferredSize()}return E}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Comment=St["b"].Layout.Comment||{};St["b"].Layout.Comment.CommentGridLayout=function(e,t,i,n){var a="grid";var S=null;var r=typeof e==="number"?e:1;var o=typeof t==="number"?t:1;var y={width:0,height:0};var l=St["b"].Utils.Calculator.Converter;var s=St["b"].DataObjects.RuntimeDO;var d=s.getParameterParsed("FONT_SIZE_CHART");var Y=St["b"].Utils.Calculator.Converter.pt2pix(d);var O,L,A,_;var I,D,R,N;var K;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){S=e};this.getType=function(){return a};this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){n.getModel().scrollingData={};return a}var r=e[0].getController().getRootModel();var o=n.getModel();var l=o.extendedModel;if(l.gridColumns.length>i.width){return a}if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){var s=getAdditionalHeight(l);O=o.border.left.width+o.padding.left;L=o.border.right.width+o.padding.right;A=o.border.top.width+(o.padding.top||s.top);_=o.border.bottom.width+(o.padding.bottom||s.bottom);I=0;R=i.width-I-O-L;D=0;N=i.height-D-A-_;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]!==N){recalculateCellSizes(l.gridRows,l.gridRowsFixed,N)}K=l.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT?mm2pix("MMPT_COMMENT_LABEL_DISTANCE"):0;calculateCommentTextHeights(e,l,N,o);var u=I;var p=D;var g=S.gridColumns.length;var m=1;var h=1;for(var f=0;f<e.length;f++){var v=e[f];delete v.getModel().nestedContainerId;if(f>=d){break}var b=S.gridColumns[h-1]-(h===1?0:S.gridColumns[h-2]);var T=S.gridRows[m-1]-(m===1?0:S.gridRows[m-2]);v.setPosition({x:u-I,y:p-D});v.setDimension({width:b,height:T});if(h<g){h++;u+=b}else{h=1;m++;u=I;p+=T}}var E=Math.max(N,l.gridRows[l.gridRows.length-1]);var x=Math.max(R,l.gridColumns[l.gridColumns.length-1]);var C=1;if(O+L+A+_>0){var y=St["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[y]={realHeight:E,realWidth:x,height:N,width:R,scrollingVer:!o.disableScrolling&&E-N>C,scrollingHor:!o.disableScrolling&&x-R>C,x:O,y:A,id:y};for(var f=0;f<e.length;f++){if(f>=d){break}e[f].getModel().nestedContainerId=y}}else{o.scrollingData={realHeight:E,realWidth:x,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&E-i.height>C,scrollingHor:!o.disableScrolling&&x-i.width>C,x:t.x,y:t.y,id:o.id};if(e.length>0){var M=e[e.length-1].getModel();o.scrollingData.scrollingVer&&(M.dimension.height=E);o.scrollingData.scrollingHor&&(M.dimension.width=x)}}}for(var f=0;f<e.length;f++){a[e[f].getId()]=e[f]}return a};this.getPreferredLayoutSize=function(e,t,i){var n=i.getController().getRootModel();if(n.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT&&!St["b"].DataObjects.RuntimeDO.isPrePaint()||St["b"].DataObjects.RuntimeDO.isPrePaint()&&n.buildUp===St["b"].Utils.Constants.BuildUp.POST_DRAW){var a=i.getModel(),r=a.extendedModel;if(r.textType===St["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}}}y={width:0,height:o}}else if(r.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||r.textType===St["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=a.border,m=a.padding,h=s.border,f=s.padding,v=g.left.width+g.right.width+m.left+m.right+h.left.width+h.right.width+f.left+f.right,b=getAdditionalHeight(r),T=p.text===""?"|":p.text,E=e[0].getPainter(),x=E.getMeasuredTextDiv(t.width-v,T,p.fontSize,p.font,p.fontWeight);y.height=x+(m.top?0:b.top)+(m.bottom?0:b.bottom);var C=g.bottom.width;y.height+=C&&C!==b.bottomBorder?0:b.bottomBorder;break}}}}}return y};this.getCommentSize=function(e){var t=e.getModel(),i=t.extendedModel.gridRows.length*t.extendedModel.gridColumns.length;var n=0;for(var a=0;a<t.children.length;a++){if(a<i&&t.children[a].column===0){n+=t.children[a].dimension.height}}return n};function getAdditionalHeight(e){var t=0,i=0,n=0;if(e.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE){t=mm2pix("MMPT_TITLE_TOP_DISTANCE");i=mm2pix("MMPT_TITLE_BOTTOM_DISTANCE");n=mm2pix("MMPT_TITLE_BOTTOM_BORDER_SIZE")}else if(e.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){t=mm2pix("MMPT_SUBTITLE_TOP_DISTANCE");i=mm2pix("MMPT_SUBTITLE_BOTTOM_DISTANCE");n=mm2pix("MMPT_SUBTITLE_BOTTOM_BORDER_SIZE")}return{top:t,bottom:i,bottomBorder:n}}function recalculateCellSizes(e,t,i){var n=0;var a=0;if(!t[0]){n=e[0]}else{i-=e[0]}for(var r=1;r<e.length;r++){if(!t[r]){n+=e[r]-e[r-1];a++}else{i-=e[r]-e[r-1]}}if(a===0&&t[0]){return}var o=e[0];var l;var s=Math.max(i,0);if(!t[0]){if(a===0){e[0]=s}else{e[0]=n>0?e[0]/n*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(a===1){e[r]=s+e[r-1]}else{e[r]=n>0?(e[r]-o)/n*i:0;s-=e[r];e[r]+=e[r-1];a--}o=l}}function calculateCommentTextHeights(e,t,i,n){var a=[];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 m=0;m<g.children.length;m++){var h=g.children[m];if(h.instanceOf==="LabelModel"&&h.id.indexOf("commentText")!==-1){if(r[l]===undefined){r[l]={}}r[l].model=h;r[l].row=g.row;r[l].column=g.column;o[l]=p.getChildPanels()[m];l++}else if(h.instanceOf==="LabelModel"&&h.id.indexOf("commentReference")!==-1){if(a[s]===undefined){a[s]={}}a[s].model=h;a[s].row=g.row;a[s].column=g.column;s++}}}}for(var u=0;u<a.length;u++){d[a[u].column]={width:0}}for(var u=0;u<a.length;u++){var f=a[u].model;if(f.isCommentReference){var v=St["b"].Layout.CommentReference.ReferenceRepresentation.svg.getReferenceSize(f.text);f.radius=v.radius;d[a[u].column].width=v.dimension+K*2}}t.maxReferenceWidthPerCol=[];var b=[];for(var T in d){b[T]=d[T].width}t.maxReferenceWidthPerCol=b;handleCommentAutoSize(r,o,a,t,i,n)}function handleCommentAutoSize(e,t,i,n,a,r){var o=St["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 m=c.column;var h=m===0?n.gridColumns[m]:n.gridColumns[m]-n.gridColumns[m-1];var f=n.maxReferenceWidthPerCol[m];h-=f+K*2;d=o.getMeasuredTextDiv("50","|",p.fontSize,p.font,p.fontWeight);var v=o.getMeasuredTextDiv(h,u.getText(),p.fontSize,p.font,p.fontWeight);var b=parseInt(v/u.getModel().fontSize);var T=K*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 E=St["b"].Layout.CommentReference.ReferenceRepresentation.svg.getReferenceSize(i[s].model.text).refLabelDistance;T+=E+1}if(l[g].distance<T){l[g].distance=T}var x=r.children[s],C=x.border,y=x.padding,M=C.top.width+C.bottom.width+y.top+y.bottom;l[g].borderPadding=Math.max(l[g].borderPadding,M)}}var S=[];var O=0;var L=undefined;var A=0;var _=0;var I=0;var D=0;var R=[];for(var N in l){var P=l[N];R[N]=P;if(P.numOfLines>0){_+=P.height+P.borderPadding;I++}else{D+=P.borderPadding}if(!isNaN(P.height)){A+=P.height+P.borderPadding}}var w=0;if(A<=a){for(var U=0;U<R.length;U++){if(R[U].numOfLines>0&&_>0){_+=R[U].distance}if(R[U].numOfLines===0){w+=d+R[U].distance+l[U].borderPadding;if(L===undefined){L=U}else{O++}S[U]=R[U]}}var F=a-_-D;if(F<w){for(var U=0;U<R.length;U++){if(R[U].numOfLines===0){R[U].height=d}}}else{var B=n.gridRows.length-I;var H=Math.round(F/B);for(var U=0;U<S.length;U++){if(S[U]){R[U].height=H-R[U].distance}}var k=F;if(L!==undefined){var G=R[L].height+R[L].distance-l[L].borderPadding;var V=G/F;R[L].height=Math.round(V*F)-R[L].distance;k-=R[L].height+R[L].distance+l[L].borderPadding;for(var U=0;U<S.length;U++){if(S[U]){if(R[U].numOfLines===0){if(L!==U){if(O===1){R[U].height=k-R[U].distance}else if(O>1){R[U].height=Math.round(V*F)-R[U].distance;k-=R[U].height+R[U].distance+l[U].borderPadding;O--}}}}}}}}else{for(var U=0;U<R.length;U++){if(R[U].numOfLines===0){R[U].height=d}}}var $=n.gridColumns.length;for(var U=0;U<R.length;U++){if(R[U].height>=Y){n.gridRows[U]=0;for(var W=0;W<n.gridColumns.length;W++){var z=U*$+W,j=r.children[z],C=j.border,y=j.padding,v=R[U].height+R[U].distance+C.top.width+y.top+C.bottom.width+y.bottom;if(U===0){n.gridRows[U]=Math.max(n.gridRows[U],v)}else{n.gridRows[U]=Math.max(n.gridRows[U],n.gridRows[U-1]+v)}}}}for(var U=0;U<R.length;U++){for(var s=0;s<e.length;s++){var c=e[s];if(c){var g=c.row;var X=c.model;if(U===g){if(R[U].height>=Y){X.dimension.height=R[U].height}}}}}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Comment=St["b"].Layout.Comment||{};St["b"].Layout.Comment.CommentLayout=function(){var e=St["b"].DataObjects.RuntimeDO;var t=St["b"].Utils.Calculator.Converter;var H=t.mm2pix(e.getParameterParsed("FONT_SIZE_CHART")*e.getParameterParsed("MMPT_COMMENT_LABEL_DISTANCE"));var s=3;var k,G,V,$;var W=St["b"].Layout.CommentReference.ReferenceRepresentation.svg;this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){return a}var r=e[0].getController().getRootModel();var o=St["b"].DataObjects.DocumentDO.getExtension(r.extensionHash);var l=n.getModel();var s=l.extendedModel;var d=null;if(s.instanceOf==="CommentModel"){var c=St["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===St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||d.extendedModel.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){H=0}var g=St["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 a}if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){var m=l.border,h=l.padding;G=t;k=i;$={x:0,y:0};V={width:k.width-m.left.width-m.right.width-h.left-h.right,height:k.height-m.top.width-m.bottom.width-h.top-h.bottom};var f={x:$.x+m.left.width+h.left,y:$.y+m.top.width+h.top};var v=bundeldViews(e);v.bundeldViews=resortViews(v);v.bundeldViews=removeHideLabels(v);var b=f.x;var T=f.y;var E=1;var x=d.extendedModel.maxReferenceWidthPerCol[l.column];var C=T+H;for(var y=0;y<v.bundeldViews.length;y++){var M=v.bundeldViews[y];for(var S=0;S<M.length;S++){var O=M[S],L=O.getModel();if(O.getId().indexOf("commentReference")!==-1){var A=W.getReferenceSize(L.text).refLabelDistance,_=L.fontWeight+" "+L.fontSize+"px"+(L.font!==""?" '"+L.font+"'":""),I=O.getPainter().measureTextDim(L.text,_),D=Math.max(I.width,I.height);C+=A+1;O.setPosition({x:b+H,y:C});O.setDimension({width:D,height:D})}else{O.setPosition({x:b+H+x,y:C});L.dimension.width=Math.max(0,V.width-x-H*2)}}if(E<d.extendedModel.gridColumns.length){E++;b+=V.width}else{E=1;b=f.x;T+=V.height}}if(o.getMode()!==St["b"].Utils.Enums.EMode.EDIT_COMMENT){for(var u=0;u<v.bundeldViews.length;u++){var M=v.bundeldViews[u];setDataForScrolling(M,l)}}}else if(r.buildUp===St["b"].Utils.Constants.BuildUp.DRAW){var R={};var N={};var P=d.extendedModel;var w=P.gridRows.length*P.gridColumns.length;for(var u=0;u<d.children.length;u++){if(P&&u>=w){break}var U=d.children[u];for(var p=0;p<U.children.length;p++){R[U.row]={isRef:false,position:null};N[U.column]={isRef:false,positionX:null,positionY:null,width:null}}}for(var u=0;u<d.children.length;u++){if(P&&u>=w){break}var U=d.children[u];for(var p=0;p<U.children.length;p++){var F=U.children[p];if(F.id.indexOf("commentReference")!==-1){if(R[U.row].isRef===false&&F.isCommentReference){R[U.row].isRef=F.isCommentReference;var B=St["b"].Factories.ModelFactory.getModelById(r,F.id.replace("Reference","Text"));R[U.row].positionY=B.position.y}if(N[U.column].isRef===false&&F.isCommentReference){N[U.column].isRef=F.isCommentReference;var B=St["b"].Factories.ModelFactory.getModelById(r,F.id.replace("Reference","Text"));N[U.column].positionX=B.position.x;N[U.column].width=B.dimension.width}}}}for(var u=0;u<d.children.length;u++){if(P&&u>=w){break}var U=d.children[u];for(var p=0;p<U.children.length;p++){var F=U.children[p];if(F.id.indexOf("commentText")!==-1){if(N[U.column].isRef===true){F.position.x=N[U.column].positionX;F.dimension.width=N[U.column].width}if(R[U.row].isRef===true){F.position.y=R[U.row].positionY}}}}}for(var u=0;u<e.length;u++){a[e[u].getId()]=e[u]}return a};this.getPreferredLayoutSize=function(e,t,i){return{height:t.height,width:t.width}};this.setDraggable=function(s,d){var n=null,c=s.getController(),u=c.getRootModel(),p=undefined,g=null,m=null;St["b"].$(d).draggable({disabled:true,containment:"parent",scroll:false,cancel:".ckeditor",revert:function(){if(!(g.extendedModel.isDragging&&p)){return true}},drag:function(i,e){St["b"].Utils.GlobalVariables.isDragDiv=true;St["b"].$(d).appendTo(this.parentNode);this.style.border="1px solid lightGray";this.style.cursor="pointer";n=this;m===null&&(m=St["b"].Factories.ModelFactory.getModelById(u,n.id.split("_")[0]));g===null&&(g=St["b"].Factories.ModelFactory.getParentContainer(u.firstObjectGrid,m)[0]);function helper(e){var t=document.elementFromPoint(i.clientX,i.clientY);if(!t){return}if(n!==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){St["b"].UI.HiCoConfirm(St["b"].DataObjects.RuntimeDO.getTranslation("ALERT_SAVE_COMMENT_ON_EDIT"),function(e){if(e===true){var t=St["b"].Factories.ModelFactory.getModelById(u,p.id.split("_")[0]);var i=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(g,d.id.split("_")[0]);var n=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(g,t.id.split("_")[0]);St["b"].Factories.ViewFactory.getViewById(c.getRootPanel(),g.id).flipChildren(i,n);if(u.id!==null){var a=St["b"].DataObjects.CommentRepo.getCommentById(g.extendedModel.commentId,s.getId());var r=a.currContent.grid[m.row][m.column];var o=a.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()})}St["b"].Utils.GlobalVariables.isDragDiv=false;d.style.border=null;d.style.cursor=""}})};function bundeldViews(e){var t=0,i=[],n="",a=-1;for(var r=0;r<e.length;r++){var o=e[r],l=o.getId().split(".")[3];if(t===0){a++;n=l;i[a]=[]}t++;if(n===l){i[a].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 n=e.bundeldViews[i];for(var a=n.length-1;a>=0;a--){if(n[a].getModel().hideLabel===true){t.push(n[a].getModel().id)}}}for(var i=0;i<e.bundeldViews.length;i++){var n=e.bundeldViews[i];for(var r=0;r<=t.length;r++){for(var a=n.length-1;a>=0;a--){if(n[a].getId().indexOf(t[r])!==-1){n.splice(a,1)}}}}return e.bundeldViews}function resortViews(e){for(var t=0;t<e.bundeldViews.length;t++){var i=e.bundeldViews[t],n=[];for(var a=0;a<i.length;a++){var r=i[a];if(r.getId().indexOf("commentReference")!==-1){n[0]=r}else if(r.getId().indexOf("commentText")!==-1){n[1]=r}}e.bundeldViews[t]=n}return e.bundeldViews}function setDataForScrolling(e,t){var i=e[e.length-1].getModel();var n=i.position.y+i.dimension.height+H+t.border.bottom.width+t.padding.bottom-$.y;t.scrollingData={width:k.width,height:k.height,realWidth:k.width,realHeight:n,scrollingHor:false,scrollingVer:!t.disableScrolling&&n>k.height,x:G.x,y:G.y}}};var S=r(603);St["b"].Layout=St["b"].Layout||{};St["b"].Layout.CommentReference={setDraggable:function(c,u,i){var p=St["b"].DataObjects.CommentRepo;var g=null;var s=null;var m=null;var h=null;var f=null;var v=null;var b=null;var e=c.id.split("_");var T=e[1];var E=e[3];var x=parseInt(e[4]);var C=i.reference[x];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=St["b"].Utils.Constants.ParameterSets.timeLegendTypeIds;var i=e.id.split(".")[0];for(var n=1;n<t.length;n++){if(i.indexOf(t[n])!==-1){i=i.replace(t[n],"");break}}return i}}else if(e.id.indexOf("dimensionchart")!==-1){return e.id.split(".")[0].replace("dimension","")}else{return e.id.split(".")[0]}}St["b"].$(c).draggable({distance:St["b"].Utils.Mobile.isTouchDevice?St["b"].Utils.Mobile.touchMoveDistance:1,drag:function(o){var l=null;C=i.reference[x];function helper(e){var t=document.elementFromPoint(o.clientX,o.clientY);if(t){var i=t.id,n,a=Object(V["m"])(t,["commentReference_","commentReference."],5);if(t.tagName==="svg"&&i.indexOf("_svg")!==-1&&!a){g=i.split("_")[1];s=St["b"].DataObjects.DocumentDO.getExtension(g)}if(!a){if(t.nodeName==="rect"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){n=i.replace("_bg","").replace("_fill","");l=St["b"].$(t.parentNode).find('rect[id="'+n+'"]')[0];f=l.id.split(".")[1]+"#rect"}else if(i.indexOf("compare")!==-1&&i.indexOf("pinCompare")===-1){l=t;f=l.id.split(".")[1]+"#text#"+l.id.split(".")[2]}else if(i.indexOf("pinCompare")!==-1){l=t;f=l.id.split(".")[2]+"#rect"}}else if(t.nodeName==="text"){var r=St["b"].$(t.parentNode).find('rect[id^="'+i+'"]')[0];l=r?r:t;if(i.indexOf("valueRowLabelModel")!==-1){f="valueRowLabelModel#text"}else if(i.indexOf("compare")!==-1){f=l.id.split(".")[1]+"#text#"+l.id.split(".")[2]}else if(i.indexOf("dimensionchart")!==-1){f=l.id.split(".")[0]+"#text"}else if(i.indexOf("representationLabel")!==-1){f=l.id.split(".")[1]+"#text";if(i.indexOf("stack_sum")!==-1){f+="#stack_sum";if(l.id.indexOf(".pos")!==-1){f+="#pos"}else if(l.id.indexOf(".neg")!==-1){f+="#neg"}}}else if(i.indexOf("merkmalsLabel")!==-1){f="merkmalsLabel#text"}else if(i.indexOf("annotationLabel")!==-1){f="annotationLabel#text"}}else if(t.nodeName==="polygon"){if(i.indexOf("compare")!==-1){l=t;f=l.id.split(".")[1]+"#polygon"}}else if(t.nodeName==="line"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){n=i.replace("_line","");l=St["b"].$(t.parentNode).find('[id="'+n+'"]')[0];f=l.id.split(".")[1]+"#line"}}else if(t.nodeName==="polyline"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;f=l.id.split(".")[1]+"#polyline"}}else if(t.nodeName==="path"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;f=l.id.split(".")[1]+"#path"}}else if(t.nodeName==="circle"){if(i.indexOf("representation")!==-1&&i.indexOf("representationLabel")===-1){l=t;f=l.id.split(".")[1]+"#circle"}}}if(e>10||l&&s){if(l===null){h=null}return}t.style.visibility="hidden";helper(e+1);t.style.visibility=""}}helper(0);if(v!==null&&l!==v){St["b"].Layout.CommentReference.removeHighlighting(v);v=null}if(l&&s){m=s.getController();var e=getModelId(l);b=getChartId(l);if(e){h=St["b"].Factories.ModelFactory.getModelById(m.getRootModel(),e);if(h){var t={extension:s,model:h,element:l};m.dispatch("updateHighlightCommentReferenceElement",t);v=l}}}},stop:function(){if(h){if(f.indexOf("valueRowLabelModel")!==-1){C.elementPath="#"+h.dataId_expr}else if(f.indexOf("compare")!==-1){C.elementPath=h.to.split("#")[0]+"#"+h.to.split("#")[1]+";"+h.from.split("#")[0]+"#"+h.from.split("#")[1]+";"}else if(f.indexOf("merkmalsLabel")!==-1){var e=St["b"].Factories.ModelFactory.getParentContainer(m.getRootModel().firstObjectGrid,h)[0];if(e){var t=h.id.split(".").pop();if(t&&e.extendedModel){var i=e.extendedModel.columnDefinitions[t];if(i){C.elementPath=h.dataId_dim+"#"+i.exprId}}}}else if(f.indexOf("dimension")===0){C.elementPath=h.dataId_dim+"#"+h.id.split(".").pop()}else{C.elementPath=h.dataId_dim+"#"+h.dataId_expr}C.elementType=f;C.chartId=b;C.extension=g}if(C.elementPath!==null){var n=St["b"].Layout.CommentReference.getReferencedModels(C);if(n){var a=parseInt(c.style.height),r=void 0;if(h){r=St["b"].Layout.CommentReference.getBindReferencePosition(n,C);St["b"].Layout.CommentReference.setReferenceOffsets(n,C,a,r.align)}else if(n.extension&&n.chartModel){var o=this.getBoundingClientRect(),l=St["b"].Utils.DOM.getPositionOnExtension(n.extension,{clientX:o.left+o.width/2,clientY:o.top+o.height/2}),s=n.extension.getController().getRootModel(),d=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(n.chartModel,s);r=St["b"].Layout.CommentReference.getBindReferencePosition(n,C);C.position.x=l.x-d.x-r.x;C.position.y=l.y-d.y-r.y;St["b"].Layout.CommentReference.convertCurrPositionToStructurePositivePosition(n,C,r.align)}}if(v!==null){St["b"].Layout.CommentReference.removeHighlighting(v);v=null}}else{p.convertToRelativeReferencePosition(C,{x:parseFloat(c.style.left),y:parseFloat(c.style.top)});b=null}St["b"].DataObjects.CommentRepo.removeCommentReferenceDiv(E,x,T,u);C.freshCreate=true;St["b"].DataObjects.CommentRepo.redrawLinkedReferences()}})},redrawReference:function(e,t,i,n,a){var r=St["b"].DataObjects.DocumentDO.getPainter();var o=e.getController().getRootModel();var l=t;var s=a.created_in_chart+".commentReference."+e.getId();var d=St["b"].Factories.ModelFactory.getModelById(o,s);if(!d){return}var c=a.reference[n];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 m=St["b"].Layout.CommentReference.getReferencedModels(c);if(m){if(!m.referencedToModel||m.referencedToModel.hideLabel||m.extension.isHidden()||m.extension.getAdapter().isHidden()){return}}else if(c.elementPath){return}var h=St["b"].DataObjects.RuntimeDO.getParameter("FONT_FAMILY");var f=St["b"].DataObjects.RuntimeDO.getParameter("FONT_STYLE_CHART");var v=lt["a"].pt2pix(St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART"));var b=new S["a"](h,f,v);b.id=d.id.replace("chart","object");b.font=d.font;b.fontSize=d.fontSize;b.text=c.id.toString();var T=St["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(m&&m.referencedToModel){l=St["b"].Layout.CommentReference.getBindReferencePosition(m,c)}d.isCommentReference=b.isCommentReference=true;var E=d.movedReferenceCounter;St["b"].DataObjects.CommentRepo.setMovedReferenceCounter(d,++E);var x=St["b"].Layout.CommentReference.getDivPosition(c);r.paintMoveableCommentReferences(b,x,i,n,m?m.referencedToModel:null,d,l,a);if(c.freshCreate){delete c.freshCreate;if(o.id!==null){e.getController().dispatch("updateRootModelState",{extension:e,commentId:i.id,currCommentCell:a,dontConfirmText:true,updateCommentLastModified:true})}}},getReferencedModels:function(e){var t=St["b"].DataObjects.DocumentDO.getExtension(e.extension);if(t){var i=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),e.chartId);if(i&&i.extendedModel){var n=i.extendedModel.contextId;if(n){var a=St["b"].DataObjects.ContextRepo.getContextByCid(n);if(!a){return}var r=t.getController().getRootModel();var o=St["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 m=i.children[g];if(i.extendedModel.instanceOf==="TableModel"){if(m.id.indexOf(p)!==-1&&m.id.indexOf("merkmalsLabel")!==-1){for(var h=0;h<i.extendedModel.columnDefinitions.length;h++){if(i.extendedModel.columnDefinitions[h].exprId===u){return{referencedToModel:m,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}else if(m.id.indexOf(p)!==-1&&m.id.indexOf("annotationLabel")!==-1){if(m.dataId_expr===u){return{referencedToModel:m,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}else if(m.id.indexOf(p)!==-1&&m.id.indexOf("dimensionchart")!==-1){if(m.dataId_dim===c&&(u==="null"||m.id.split(".").pop()===u)){return{referencedToModel:m,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}else if(i.extendedModel.instanceOf==="ChartModel"||i.extendedModel.instanceOf==="TimeChartModel"){if(m.instanceOf==="ContainerModel"){for(var h=0;h<m.children.length;h++){if(m.children[h].id.indexOf(p)!==-1&&m.children[h].dataId_dim===c){if(i.extendedModel.dimensionLabelModel.displayType!=="categoryLabelType.0"){return{referencedToModel:m.children[h],chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}else{return null}}}}}var f=[];if(p==="representation"||p==="representationLabel"){f.push("representation");f.push("representationLabel")}else{if(e.elementType){f.push(p)}}for(var v=0;v<f.length;v++){var b,T;if(f[v].indexOf("valueRowLabel")!==-1){if(m.id.indexOf(f[v])!==-1){var E=m.dataId_expr;if(E===u){T=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),m.id.replace("representation","representationLabel"));if(f[v].indexOf("valueRowLabel")!==-1){b=T.hideLabel}if(T&&b===false){return{referencedToModel:T,chartModel:i,extension:t,parentContainer:l,grandParentContainer:s}}}}}else if(f[v].indexOf("compare")!==-1){if(m.id.indexOf(f[v])!==-1){var x=m.from.split("#")[1];var C=m.from.split("#")[0];var y=m.to.split("#")[1];var M=m.to.split("#")[0];var S=e.elementPath.split(";");if(S.length===1){e.elementPath=m.to.split("#")[0]+"#"+m.to.split("#")[1]+";"+m.from.split("#")[0]+"#"+m.from.split("#")[1]+";"}var O=e.elementPath.split(";")[0];var L=e.elementPath.split(";")[1];if(M===O.split("#")[0]&&y===O.split("#")[1]&&C===L.split("#")[0]&&x===L.split("#")[1]){T=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),m.id.replace("representation","representationLabel"));if(!m.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(m.id.indexOf(f[v])!==-1&&m.dataId_dim===c&&m.dataId_expr===u){if(e.elementType.indexOf("stack_sum")!==-1){if(m.stackModel===undefined){return null}var A=e.elementType.split("#");var _;if(A[3]==="pos"||A[3]==="neg"){if(m.stackModel.startOn+m.value<0){_=m.id.split(".")[0]+".representationLabel.stack_sum."+m.id.split(".")[2]+".neg"}else{_=m.id.split(".")[0]+".representationLabel.stack_sum."+m.id.split(".")[2]+".pos"}}else{_=m.id.replace("representation","representationLabel.stack_sum")}T=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),_)}else{var I;if(m.id.indexOf("representationLabel")!==-1){I=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),m.id.replace("representationLabel","representation"));T=m}else{I=m;T=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),m.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(m.instanceOf!=="ValueModel"&&m.valueType!=="FACTOR_NONE"&&!m.isNaN){var D=m.dimension.width>=1?m.dimension.width-1:0;var R=m.dimension.height>=1?m.dimension.height-1:0;if(m.instanceOf==="TimeColumnModel"&&(Math.abs(m.dimension.height)<.5||R===0)||m.instanceOf==="TimeWaterfallModel"&&(D<=.5&&D>=-.5||R===0)||(m.instanceOf==="BarModel"||m.instanceOf==="StructureWaterfallModel")&&(Math.abs(m.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=St["b"].DataObjects.DocumentDO.getExtension(e.extension);var i=t.getAdapter().getContainerElementCoordinates();return{x:i.x,y:i.y}}}},removeHighlighting:function(){St["b"].$(document.getElementById("HiCoHighlightedElementBorder")).remove()},getBindReferencePosition:function(e,t){if(t){var i=t.extension;if(i){var n=St["b"].DataObjects.DocumentDO.getExtension(i);if(n&&e.chartModel&&e.chartModel.extendedModel){if(e.chartModel.extendedModel.instanceOf==="TimeChartModel"){return this.getTimePositions(e,n,t)}else{return this.getStructureAndTablePositions(e,n,t)}}}}},setReferenceOffsets:function(e,t,i,n){var a=St["b"].Utils.Constants.TypeValues;if(e.chartModel){var r=e.chartModel.extendedModel;if(r){var o=St["b"].Utils.Constants.Parameters.distanceBetweenRefCircleAndModel;var l=e.referencedToModel.instanceOf==="CompareModel"&&(e.referencedToModel.absolute.legend!==a.indicator.NONE||e.referencedToModel.percent.legend!==a.indicator.NONE||e.referencedToModel.text.legend!==a.indicator.NONE)&&(t.elementType.split("#")[1]&&t.elementType.split("#")[1]==="text");if(r.instanceOf==="TimeChartModel"){if(n.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(n.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(n.y==="top"){t.position.x=0;t.position.y=i/2+o}if(n.y==="bottom"){t.position.x=0;t.position.y=i/2+o}}else{if(n.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(n.x==="left"){t.position.y=0;t.position.x=i/2+o}if(n.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(n.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 n=e.chartModel.extendedModel,a=t.position.x,r=t.position.y;if(e.referencedToModel.instanceOf!=="CompareModel"){if(n.instanceOf==="TimeChartModel"){var o=t.position.x;a=t.position.y;r=o;if(i.x==="right"){r*=-1}if(i.y==="top"){a*=-1}}else{if(i.x==="left"){a*=-1}if(i.y==="bottom"){r*=-1}}}t.position.y=r;t.position.x=a},getMaxLineChartPosition:function(e,t){var i=e.getModel();if(i){var n;if(i.instanceOf==="TimeLineModel"){n=St["b"].DataObjects.DocumentDO.getPainter().getLineChartCords(e,t)}else{n=St["b"].DataObjects.DocumentDO.getPainter().getLineChartCordsTable(e)}if(n.length>0){var a=Math.min(n[0].x,n[1].x);var r=Math.min(n[0].y,n[1].y);var o=Math.max(n[0].x,n[1].x);var l=Math.max(n[0].y,n[1].y);if(n[2]){a=Math.min(a,n[2].x);r=Math.min(r,n[2].y);o=Math.max(o,n[2].x);l=Math.max(l,n[2].y)}if(i.instanceOf==="TimeLineModel"){if(t!=="timeRepresentationType.4"){a=Math.min(a,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){a=Math.min(a,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{a=Math.min(a,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-a;var d=l-r;return{position:{x:a,y:r},dimension:{width:s,height:d}}}}return null},getStructureAndTablePositions:function(e,t,i){var n=e.referencedToModel;var a=e.chartModel;var r,o;var l=null;if(n.instanceOf==="LabelModel"&&n.id.indexOf("representationLabel")!==-1){l=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),n.id.replace("Label",""))}var s;if(n.isStackSum){s=St["b"].Factories.ModelFactory.getStackSum(n,a)}else{s=l?l.value:n.value}var d={x:null,y:null};var c=null;var u=St["b"].Utils.Constants.TypeValues;var p=null;var g=t.getCanvasDO().getDOMElement();if(n.instanceOf==="BarModel"){p=St["b"].$(g).find('text[id^="'+n.id.replace(".representation.",".representationLabel.")+'$0"]')[0]}else if(n.instanceOf==="LabelModel"){var m=St["b"].$(g).find('text[id^="'+n.id+'"]');for(var h in m){if(m[h]&&m[h].id){if(m[h].id.split("$")[0]===n.id){p=m[h]}}}}else if(n.instanceOf==="CompareModel"&&i.elementType.split("#")[1]==="text"){p=St["b"].$(g).find('text[id^="'+n.id+'"]');for(var f=0;f<p.length;f++){if(p[f].id.indexOf(i.elementType.split("#")[2])!==-1){p=p[f];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:n.dimension.width;var E=b?b.height:n.dimension.height;var x=b?Math.max(b.x,0):null;var C=b?Math.max(b.y,0):null;v&&(C+=4);if(C!==null&&a.extendedModel.instanceOf==="TableModel"&&n.nestedContainerId&&n.nestedContainerId.indexOf(St["b"].Utils.Constants.Parameters.idTableContent)>=0){C+=a.scrollingData.headerHeight}var y=u.structureRepresentation;var M=null;if(n.instanceOf==="StructureLineModel"){var S=St["b"].DataObjects.ContextRepo.getContextByCid(n.contextId);if(S){var O=St["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(S);for(var f=0;f<O.length;f++){if(O[f].id.split(".").pop()===n.dataId_expr){M=O[f].representation}}if(M===y.LINE||M===y.SYMBOL_LINE){var L=St["b"].Factories.ViewFactory.getViewById(t.getController().getRootPanel(),n.view);if(L){c=St["b"].Layout.CommentReference.getMaxLineChartPosition(L,M)}}}}if(n.instanceOf==="LabelModel"){if(n.id.indexOf("dimensionchart")!==-1){d={x:"left",y:"center"};if(x){r=x}else{r=n.position.x;if(n.textAnchor==="middle"){r-=T/2}else if(n.textAnchor==="end"){r-=T}}o=C?C:n.position.y;o+=E/2}else if(n.id.indexOf("structureLegendType")!==-1){var A=u.structureLegend;if(x){r=x+T/2}else{r=n.position.x;if(n.textAnchor==="start"){r+=T/2}else if(n.textAnchor==="end"){r-=T/2}}var _=getStructureLegends(n.valueRowLabelPosition);if(_===A.TOP_VALUE||_===A.TOP_MIDDLE||_===A.TOP_AXIS){o=C?C:n.position.y;d={x:"center",y:"top"}}else{o=C?C:n.position.y;o+=E;d={x:"center",y:"bottom"}}}else{o=C?C:n.position.y;o+=E/2;if(s<0){d={x:"left",y:"center"};if(x){r=x}else{if(n.textAnchor==="middle"){r=n.position.x-T/2}else if(n.textAnchor==="end"){r=n.position.x-T}else{r=n.position.x}}}else{d={x:"right",y:"center"};if(x){r=x+T}else{if(n.textAnchor==="middle"){r=n.position.x+T/2}else if(n.textAnchor==="end"){r=n.position.x}else{r=n.position.x+T}}}}}else if(n.id.indexOf("compare")!==-1){var I=St["b"].DataObjects.DocumentDO.getPainter();if(i.elementType.split("#")[1]!=="text"){d={x:"center",y:"top"};var D=St["b"].Layout.Common.getMaxPosition(n);T=D.dimension.width;E=D.dimension.height;r=I.cordCorrectionSVG(D.position.x+1+T/2);o=I.cordCorrectionSVG(D.position.y);if(n.compareLegend==="end"||n.compareLegend==="from"||n.compareLegend==="to"){o+=E;d={x:"center",y:"bottom"}}}else{d={x:"right",y:"center"};var R={x:null,y:null};if(x){R.x=x}if(C){R.y=C}r=x||I.cordCorrectionSVG(R.x);r+=T;o=C||I.cordCorrectionSVG(R.y);o+=E/2}}else{if(s<0){d={x:"left",y:"center"};if(n.instanceOf==="StructureLineModel"){if(c){T=c.dimension.width;E=c.dimension.height;r=c.position.x+c.dimension.width;o=c.position.y+c.dimension.height/2}else{r=n.needlepos.x;o=n.needlepos.y+n.needledim.height/2;T=n.needledim.width;E=n.needledim.height}}else if(n.instanceOf==="NeedleModel"){r=n.needlepos.x;o=n.needlepos.y+n.needledim.height/2;T=n.dimension.width+n.needleSize/2;E=n.dimension.width+n.needleSize/2}else{r=x?x:n.position.x;o=C?C:n.position.y;o+=E/2}}else{d={x:"right",y:"center"};if(n.instanceOf==="StructureLineModel"){if(c){r=c.position.x+c.dimension.width;o=c.position.y+c.dimension.height/2;T=c.dimension.width;E=c.dimension.height}else{T=n.needledim.width;E=n.needledim.height;r=n.needlepos.x+n.needledim.width;o=n.needlepos.y+Math.round(n.needledim.height/2)}}else if(n.instanceOf==="NeedleModel"){r=n.needlepos.x+n.needledim.width;o=n.needlepos.y+Math.round(n.needledim.height/2);T=n.dimension.width+n.needleSize/2;E=n.dimension.width+n.needleSize/2}else{r=x?x:n.position.x;r+=T;o=C?C:n.position.y;o+=E/2}}}return{x:r,y:o,align:d,width:T,height:E};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 n=e.referencedToModel;var a=St["b"].Utils.Constants.TypeValues;var r={x:null,y:null};var o,l;var s=null;if(n.instanceOf==="LabelModel"&&n.id.indexOf("representationLabel")!==-1){s=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),n.id.replace("Label",""))}var d;if(n.isStackSum){d=St["b"].Factories.ModelFactory.getStackSum(n,e.chartModel)}else{d=s?s.value:n.value}var c=null;var u=null;var p=t.getCanvasDO().getDOMElement();if(n.instanceOf==="TimeColumnModel"){u=St["b"].$(p).find('text[id^="'+n.id.replace(".representation.",".representationLabel.")+'$0"]')[0]}else if(n.instanceOf==="LabelModel"){var g=St["b"].$(p).find('text[id^="'+n.id+'"]');for(var m in g){if(g[m]&&g[m].id){if(g[m].id.split("$")[0]===n.id){u=g[m]}}}}else if(n.instanceOf==="CompareModel"&&i.elementType.split("#")[1]==="text"){u=St["b"].$(p).find('text[id^="'+n.id+'"]');for(var h=0;h<u.length;h++){if(u[h].id.indexOf(i.elementType.split("#")[2])!==-1){u=u[h];break}}}var f=u&&u.textContent==="";f&&(u.innerHTML="&nbsp;");var v=u&&u.getBBox?u.getBBox():null;f&&(u.textContent="");var b=v?v.width:n.dimension.width;var T=v?v.height:n.dimension.height;var E=v?Math.max(v.x,0):null;var x=v?Math.max(v.y,0):null;var C=a.timeRepresentation;var y=null;if(n.instanceOf==="TimeLineModel"){var M=St["b"].DataObjects.ContextRepo.getContextByCid(n.contextId);var S=St["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(M);for(var h=0;h<S.length;h++){if(S[h].id.split(".").pop()===n.dataId_expr){y=S[h].representation}}if(y===C.LINE||y===C.SYMBOL_LINE){var O=St["b"].Factories.ViewFactory.getViewById(t.getController().getRootPanel(),n.view);c=St["b"].Layout.CommentReference.getMaxLineChartPosition(O,y)}}if(n.instanceOf==="LabelModel"){if(n.id.indexOf("dimensionchart")!==-1){r={x:"center",y:"bottom"};l=x?x:n.position.y;l+=T;if(E){o=E+b/2}else{if(n.textAnchor==="middle"){o=n.position.x}else if(n.textAnchor==="end"){o=n.position.x-b/2}else{o=n.position.x+b/2}}}else if(n.id.indexOf("valueRowLabel")!==-1){var L=n.valueRowLabelPosition.split(".")[0];if(L==="LeftValue"||L==="LeftAxis"||L==="LeftMiddle"){r={x:"left",y:"center"};if(E){o=E}else{o=n.position.x}l=x?x:n.position.y;l+=T/2}else{r={x:"right",y:"center"};if(E){o=E}else{o=n.position.x}o+=b;l=x?x:n.position.y;l+=T/2}}else{if(E){o=E+b/2}else{if(n.textAnchor==="middle"){o=n.position.x}else if(n.textAnchor==="end"){o=n.position.x-b/2}else{o=n.position.x+b/2}}if(d<0){r={x:"center",y:"bottom"};l=x?x:n.position.y;l+=T}else{l=x?x:n.position.y;r={x:"center",y:"top"}}}}else if(n.id.indexOf("compare")!==-1){var A={x:null,y:null};if(n.absolute.legend===a.indicator.NONE&&n.percent.legend===a.indicator.NONE&&n.text.legend===a.indicator.NONE||i.elementType.split("#")[1]!=="text"){var _=St["b"].Layout.Common.getMaxPosition(n);A=_.position;b=_.dimension.width;T=_.dimension.height}else{if(E){A.x=E}if(x){A.y=x}}r={x:"left",y:"center"};o=A.x;l=A.y+T/2;if(n.compareLegend==="end"||(n.compareLegend==="from"||n.compareLegend==="to")){r={x:"right",y:"center"};o+=b}}else{if(d<0){r={x:"center",y:"bottom"};if(n.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=E?E:n.position.x;o+=b/2;l=x?x:n.position.y;l+=T}}else if(n.instanceOf==="RodModel"){o=n.linePos.x;l=n.linePos.y+n.lineDim.height+(n.needleSize?n.needleSize/2:n.dimension.height/2);b=n.dimension.width+n.needleSize/2;T=n.dimension.height+n.needleSize/2}else{o=E?E:n.position.x;o+=b/2;l=x?x:n.position.y;l+=T}}else{r={x:"center",y:"top"};if(n.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=E?E:n.position.x;o+=b/2;l=x?x:n.position.y}}else if(n.instanceOf==="RodModel"){o=n.linePos.x;l=n.linePos.y-(n.needleSize?n.needleSize/2:n.dimension.height/2);b=n.dimension.width+n.needleSize/2;T=n.dimension.height+n.needleSize/2}else{o=E?E:n.position.x;o+=b/2;l=x?x:n.position.y}}}return{x:o,y:l,align:r,width:b,height:T}},getReferenceCollisionOffset:function(e,t,i,n){var a=St["b"].DataObjects.CommentRepo.getLoadedCommentsByReferencedExtension(e.getId());var r=0;for(var o=0;o<a.length;o++){var l=a[o];var s=St["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 m=p.reference[g];var h=false;if(n.id.indexOf("representationLabel")!==-1&&m.elementType&&t.elementType&&(m.elementType.split("#")[0]==="representation"&&m.elementType.split("#")[1]==="rect")||t.elementType.split("#")[0]==="representation"&&t.elementType.split("#")[1]==="rect"){h=true}if(m.extension===t.extension&&m.chartId===t.chartId&&m.elementPath===t.elementPath&&(!h&&m.elementType===t.elementType||h)&&m.position.x===t.position.x&&m.position.y===t.position.y){var f=document.getElementById("DIV_"+p.created_in_chart.replace("chart","object")+"_commentReference_"+s.getId()+"_"+g);if(f){r++}}}}}}St["b"].DataObjects.CommentRepo.setMoveablePosCounter(r);var v=St["b"].Utils.Constants.Parameters.distanceBetweenRefCircleAndModel;return r*(i+v)},getMoveableCommentReferencePosition:function(e,t){var i=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(e,t.getController().getRootModel());return{x:i.x+2*St["b"].DataObjects.RuntimeDO.getParameterParsed("FONT_SIZE_CHART"),y:i.y}},ReferenceRepresentation:new function(){var p=false,i,g,t,m,h,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;"],f=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=St["b"].DataObjects.RuntimeDO;i=e.getParameter("REFERENCE_FONT_COLOR");g=e.getParameter("FONT_FAMILY");t=e.getParameterParsed("FONT_SIZE_CHART");m=St["b"].Utils.Calculator.Converter.pt2pix(t);h=e.getParameter("FONT_STYLE_CHART");r=h+" "+m+"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 n=document.createElement("div"),a=document.createElement("div");a.style.fontFamily=g;a.style.fontSize=Math.round(m*f)+"px";a.style.fontWeight=h;n.style.width=n.style.height=a.style.lineHeight=Math.round(m*v)+"px";n.style.overflow="hidden";n.style.display="flex";n.style.justifyContent="center";n.style.alignItems="center";n.style.flexDirection="row";n.style.flexWrap="wrap";a.innerHTML=i;n.appendChild(a);activateCharReference(n,t);return n}}function createSVGReference(e,t){!p&&init();var i=getReferenceSize(e),n=i.radius,a=i.dimension.toString(),r=i.refLabelDistance,o=i.refText,l=(n+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=a+"px";c.setAttribute("cx",l);c.setAttribute("cy",l);c.setAttribute("r",n.toString());u.setAttribute("y",(n+o.height/2-r).toString());u.setAttribute("x",(n-o.width/2+r).toString());u.appendChild(document.createTextNode(e.toString()));u.style.fontFamily=g;u.style.fontSize=m;u.style.fontWeight=h;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=St["b"].DataObjects.DocumentDO.getPainter().measureTextDim(e,r),i=t.height>=m?Math.round((t.height-m*.8)/2):0,n=Math.max(t.height,t.width)/2+i,a=(n+i)*2;o.refSize[e]={radius:n,dimension:a,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],n=e.getElementsByTagName("text")[0],a=t?c:b.red,r=t?u:b.red,o=d?r:b.white,l=d?r:a,s=d?b.white:a;i.setAttribute("fill",o);i.setAttribute("stroke",l);n.setAttribute("fill",s)}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["b"].Layout.Grid.AxisGridLayout=function(e,t){var i="AxisGrid";var w=null;var U=e!=null?e:1;var n=t!=null?t:1;var p=St["b"].Utils.Calculator.Converter;var g=St["b"].DataObjects.RuntimeDO;var m=null;var F=null;var h=null;var f=null;var B=null;var H={};var v=St["b"].Utils.Constants.TypeValues;var b;var T,k;var E=null;var c;var u;this.getRows=function(){return U};this.setRows=function(e){U=e};this.getColumns=function(){return n};this.setColumns=function(e){n=e};this.setGridData=function(e){w=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,n){var a={};B=n.getModel();if(e.length===0||B.extendedModel.displayType===v.categoryLabel.NONE){return{}}m=e[0].getController().getRootModel();if(m.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){E=St["b"].DataObjects.ContextRepo.getContextByCid(e[0].getModel().contextId);var r=St["b"].Factories.ModelFactory.getParentContainer(m.firstObjectGrid,n.getModel());F=r[0];h=r[1];var o=r[2];if(o&&o.extendedModel&&o.extendedModel.instanceOf==="MultipleContainerModel"){f=o;b=f.extendedModel.fontSize}else{b=g.getParameterParsed("FONT_SIZE_CHART")}T=getNMParameter("MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE");k=getNMParameter("MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE")}switch(m.buildUp){case St["b"].Utils.Constants.BuildUp.PREINIT:B.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 H){c+=H[u]}B.dimension.height=c;break;case St["b"].Utils.Constants.BuildUp.INIT:break;case St["b"].Utils.Constants.BuildUp.LEGEND:setPanelPositions(e,a);break;case St["b"].Utils.Constants.BuildUp.DRAW:for(var l=0;l<e.length;l++){e[l].getModel().position.x+=B.position.x;e[l].getModel().position.y+=B.position.y;a[e[l].getId()]=e[l]}break}return a;function getNMParameter(e){return p.mm2pix(b*parseFloat(g.getParameter(e)))}};function setDimensionLabelText(e,t){var i=B.extendedModel.calculatedDimTextLength;var n=e.id.split(".").pop();var a=e.dataId_dim+"@"+n;var r=i[a];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 n=e;var a=0;var r;var o=e.length;var l=Math.floor((o-a)/2);while(l>=1){r=a+l;n=e.substring(0,r);n=n+"...";var s=calculateTextWidth(n,i);if(s>t){o=r;l=Math.floor((o-a)/2)}else{a=r;l=Math.floor((o-a)/2)}}var d=e.substring(0,a);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 n=g.getParameter("CHECK_TIME_TOTAL_WITHOUT_VALUES_FONT_BOLD")==="true"?"bold":"normal";var a=e.dataId_dim;var r=St["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(E.dataModel,a);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=n}}}function setPanelPositions(M,S){var e=B.position.x;var O=B.position.y;var L=e;var A=O;var t=St["b"].Layout.Common.getLinkGroups(m,F.id,"Time");var i=t.legend?t.legend.categoryWidth:h.categoryWidth;var _=i.categorySize+2*i.categoryDistance;var I=F.extendedModel.dimensionLabelModel.calculatedEmptySpaces;var D=1;var R=1;var N=U;if(w!==null){N=w.gridRows.length}var P=0;St["b"].$.each(M,function(e,t){var i=t.getModel();var n=i.dataId_dim;var a=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[n];if(s!==undefined&&l==s.positionCnt){if(s.position==="start"){L+=s.space_px}}}P=e%U===0?H[o]-k:P+=H[o];if(w===null){a=_}else{a=w.gridColumns[R-1]-(R===1?0:w.gridColumns[R-2])}if(i.instanceOf!=="LabelModel"){a=Math.round(a)}A=O+B.dimension.height-P;L=Number(L);A=Number(A);if(i.position.x==0&&i.position.y==0){if(i.instanceOf==="LabelModel"&&F.extendedModel&&F.extendedModel.instanceOf==="TimeChartModel"){var d=t.getPainter().measureTextDim(i.text).width;var c=0;if(i.hideLabel===false){if(B.extendedModel.leftSpace>=parseInt(L+a/2-d/2)){B.extendedModel.leftSpace=parseInt(L+a/2-d/2)}i.textAnchor="middle";t.setPosition({x:L+a/2,y:A});c=L+a/2+i.dimension.width/2}else{c=L+a;t.setPosition({x:t.getPosition().x,y:A})}var u=L+a;var p=e+N;for(var g=p;g<=M.length;g+=N){if(g<M.length){var m=M[g].getDimension().width;if(m<a&&m>0){u+=a/2-M[g].getDimension().width/2}else{u+=a}var h=0;var f=M[g-N].getModel();if(f!==undefined){var v=I[f.dataId_dim];var b=f.id.split(".")[1].replace("label","")*1+1;if(v!==undefined&&b==v.positionCnt){if(v.position==="end"){h=v.space_px}}}var T=0;var E=M[g].getModel();if(E!==undefined){var x=I[E.dataId_dim];var C=E.id.split(".")[1].replace("label","")*1+1;if(x!==undefined){if(x.position==="start"&&C==x.positionCnt){T=x.space_px}}}u+=h;u+=T;if(u<c){M[g].getModel().hideLabel=true;var y=St["b"].Layout.Common.getHighlight(F.extendedModel,M[g].getModel(),St["b"].Utils.Constants.TypeValues.highlightType.CATEGORY_LABEL,true);if(y&&y.highlight){y.highlight.active=false}if(m<a){u+=m/2}else{u+=m}}else{break}}}}else{t.setPosition({x:L,y:A})}}S[t.getId()]=t;if(D<N){D++}else{if(D===N){L+=_}D=1;R++;var s=I[n];if(s!==undefined&&l==s.positionCnt){if(s.position==="end"){L+=s.space_px}}}})}function calcDimensionHeightPerLevel(e,t,i){var n=t[0].getPainter();var a=i%U;if(e.instanceOf==="LabelModel"){var r=t[i].getModel().id.split(".");var o=r[r.length-2]+"."+r[r.length-1];var l=H[o];if(e.hideLabel){window.isNaN(l)&&(H[o]=0);return}if(l===undefined){H[o]=0;l=0}var s=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";e.dimension=n.measureTextDim(e.text,s);var d=a==0?k:T;if(e.dimension.height>l){H[o]=e.dimension.height+d}}}this.getPreferredLayoutSize=function(e,t){return{height:0,width:0}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["b"].Layout.Grid.EmptyLayout=function(e,t){var i="grid";var m=e!=null?e:1;var h=t!=null?t:1;var f,v,b,T;var E,x,C,y;this.getRows=function(){return m};this.setRows=function(e){m=e};this.getColumns=function(){return h};this.setColumns=function(e){h=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){return a}var r=e[0].getController().getRootModel();var o=n.getModel();if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){f=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;E=0;C=i.width-E-f-v;x=0;y=i.height-x-b-T;var l=e[0];delete l.getModel().nestedContainerId;var s=C/h,d=y/m;l.setPosition({x:0,y:0});l.setDimension({width:s,height:d});var c=y,u=C;if(f+v+b+T>0){var p=St["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:y,width:C,scrollingVer:false,scrollingHor:false,x:f,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++){a[e[g].getId()]=e[g]}return a};this.getPreferredLayoutSize=function(e,t,i){return{height:-1,width:-1}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["b"].Layout.Grid.GridLayout=function(e,t){var i="grid";var H=null;var k=e!=null?e:1;var G=t!=null?t:1;var S=null;var V=St["b"].Utils.Calculator.Converter;var $=St["b"].DataObjects.RuntimeDO;var W,z,j,X;var Y,K,Z,Q;this.getRows=function(){return k};this.setRows=function(e){k=e};this.getColumns=function(){return G};this.setColumns=function(e){G=e};this.setGridData=function(e){H=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){n.getModel().scrollingData={};return a}var r=e[0].getController().getRootModel();var o=n.getModel();var l=o.extendedModel;if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){W=o.border.left.width+o.padding.left;z=o.border.right.width+o.padding.right;j=o.border.top.width+o.padding.top;X=o.border.bottom.width+o.padding.bottom;Y=0;Z=i.width-Y-W-z;K=0;var s=0,d=0;var c,u,p=0;if(l&&l.multipleMode){var g=St["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,o)[0].extendedModel;c=e[e.length-2];u=e[e.length-1];var m=c.getModel();var h=Z;var f=g.dimensions[g.dimensions.length-1];if(f.categorySize!==null){h=Math.min(h,V.mm2pix(g.fontSize*f.categorySize))}m.dimension=rearrangeMultipleTitleText(m,h,f.categoryTextBreak,c.getPainter());s=m.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=Y+W;if(f.categoryAlignment==="Mid"){b+=Math.floor(Z/2);m.textAnchor="middle";m.horizontalAlign=St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.MIDDLE}else if(f.categoryAlignment==="Right"){b+=Z-v;m.textAnchor="end";m.horizontalAlign=St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.RIGHT}else{b+=v}c.setPosition({x:b,y:K+d+j});u.setPosition({x:0,y:0});p=l.gridRows.length*l.gridColumns.length}K+=s+d;Q=i.height-K-j-X;var T=Y;var E=K;var x=T;var C=E;var y=H?H.gridRows.length:k;var M=H?H.gridColumns.length:G;var S=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 L=0;L<e.length;L++){var A=e[L];delete A.getModel().nestedContainerId;if(l&&l.multipleMode&&L>=p){break}var _=0,I=0;if(H===null){_=Z/M;I=Q/y}else{_=H.gridColumns[O-1]-(O===1?0:H.gridColumns[O-2]);I=H.gridRows[S-1]-(S===1?0:H.gridRows[S-2])}A.setPosition({x:x,y:C});A.setDimension({width:_,height:I});if(O<M){O++;x+=_}else{O=1;S++;x=T;C+=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 N=i.height-j-X,P=.5,w=!o.disableScrolling&&D-N>P,U=!o.disableScrolling&&R-Z>P;if(W+z+j+X>0){var F=St["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[F]={realHeight:D,realWidth:R,height:N,width:Z,scrollingVer:w,scrollingHor:U,x:W,y:j,id:F};for(var L=0;L<e.length;L++){if(l&&l.multipleMode&&L>=p){break}e[L].getModel().nestedContainerId=F}}else{o.scrollingData={realHeight:D,realWidth:R,width:i.width,height:i.height,scrollingVer:!o.disableScrolling&&D-i.height>P,scrollingHor:!o.disableScrolling&&R-i.width>P,x:t.x,y:t.y,id:o.id};if(l&&l.multipleMode&&e.length>0){var B=e[e.length-1].getModel();o.scrollingData.scrollingVer&&(B.dimension.height=D);o.scrollingData.scrollingHor&&(B.dimension.width=R)}}}for(var L=0;L<e.length;L++){a[e[L].getId()]=e[L]}return a};this.getPreferredLayoutSize=function(e,t,i){var n=i.getController().getRootModel(),a=St["b"].Utils.Constants.BuildUp,r=St["b"].DataObjects.RuntimeDO.isPrePaint(),o=r&&n.buildUp===a.POST_DRAW;S={height:0,width:0};if(n.buildUp===a.PREINIT&&!r||o){var l=i.getModel();var s=l.extendedModel;if(l.id===St["b"].Factories.ModelFactory.idCollection.rootContainer){var d=e[0];S=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 m=g*u,h=s.rowWrappable[g],f=s.rowDynamic[g];for(var v=0;v<u;v++){var b=s.colDynamic[v],T=b||f||h,d=e[m+v],E=d.getModel();if(E.extendedModel&&E.extendedModel.instanceOf!=="ContainerGridModel"&&!T){delete E.prefSize;continue}var x=d.getPreferredSize(),C={width:x.width||0,height:x.height||0},y=E.prefSize||{width:0,height:0},M=y.width!==C.width||y.height!==C.height;if(M&&d.getId().indexOf("chart-")===-1){if(y.width!==C.width&&(h||b)){p=false}else if(y.height!==C.height&&f){p=false}E.prefSize=C}}}if(!p){i.getController().getExtension().setValid("layout",p)}}}return S};function rearrangeMultipleTitleText(e,o,t,l){var s=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";var i=/\n|<br>|<br \/>|<br\/>/;var n=e.text.split(i);var d=0;function findBreakPoint(e,t){var i=Math.round(e.length*o/t);var n=e.substring(0,i);var a=l.measureTextDim(n,s);if(a.width>0&&a.width>o){do{n=e.substring(0,--i);a=l.measureTextDim(n,s)}while(a.width>o);d=Math.max(d,a.width)}else if(a.width>0&&a.width<o){var r=a.width;while(true){n=e.substring(0,++i);a=l.measureTextDim(n,s);if(a.width===o){r=a.width;break}else if(a.width>o){i--;break}r=a.width}d=Math.max(d,r)}else{d=Math.max(d,a.width)}return i}for(var a=0;a<n.length;a++){var r=n[a];var c=l.measureTextDim(r,s);if(c.width>o){var u=findBreakPoint(r,c.width);n[a]=r.substring(0,u);if(t){n.splice(a+1,0,r.substring(u))}}else{d=Math.max(d,c.width)}}e.text=n.join("\n");return{height:(e.fontSize+e.lineSpacing)*n.length-e.lineSpacing,width:d}}function recalculateCellSizes(e,t,i){var n=0;var a=0;if(!t[0]){n=e[0]}else{i-=e[0]}for(var r=1;r<e.length;r++){if(!t[r]){n+=e[r]-e[r-1];a++}else{i-=e[r]-e[r-1]}}if(a===0&&t[0]){return}var o=e[0];var l;var s=Math.max(i,0);if(!t[0]){if(a===0){e[0]=s}else{e[0]=n>0?Math.round(e[0]/n*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(a===1){e[r]=s+e[r-1]}else{e[r]=n>0?Math.round((e[r]-o)/n*i):0;s-=e[r];e[r]+=e[r-1];a--}o=l}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["b"].Layout.Grid.PlaceHolderLayout=function(e,t){var i="grid";var p=e!=null?e:1;var g=t!=null?t:1;var m,h,f,v;var b,T,E,x;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,n){var a={};if(e.length===0){return a}var r=e[0].getController().getRootModel();var o=n.getModel();if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){m=o.border.left.width+o.padding.left;h=o.border.right.width+o.padding.right;f=o.border.top.width+o.padding.top;v=o.border.bottom.width+o.padding.bottom;b=0;E=i.width-b-m-h;T=0;x=i.height-T-f-v;var l=e[0];delete l.getModel().nestedContainerId;var s=E/g,d=x/p;l.setPosition({x:b,y:T});l.setDimension({width:s,height:d});l.getModel().color="rgb(244,244,244)";if(m+h+f+v>0){var c=St["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:x,width:E,scrollingVer:false,scrollingHor:false,x:m,y:f,id:c};for(var u=0;u<e.length;u++){e[u].getModel().nestedContainerId=c}}else{o.scrollingData={realHeight:x,realWidth:E,width:i.width,height:i.height,scrollingVer:false,scrollingHor:false,x:t.x,y:t.y,id:o.id}}}else if(r.buildUp===St["b"].Utils.Constants.BuildUp.DRAW){St["b"].Layout.Common.layoutClickBackground(e[0].getModel(),n.getPainter())}for(var u=0;u<e.length;u++){a[e[u].getId()]=e[u]}return a};this.getPreferredLayoutSize=function(e,t,i){var n=40;return{height:t.height>n?0:n,width:t.width>n?0:n}}};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["b"].Layout.Grid.StructureDimensionGridLayout=function(e,t){var i="StructureDimensionGrid";var a=null;var n=e!=null?e:1;var C=t!=null?t:1;var y={};var r=0;var g=new Array;var m=null;var M=null;var S=null;var h=null;var f=null;var O=null;var L=null;var A=St["b"].Utils.Constants.TypeValues;var v=St["b"].DataObjects.RuntimeDO;var b=St["b"].Utils.Calculator.Converter;var T;var _,I,D;var E=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 n};this.setRows=function(e){n=e};this.getColumns=function(){return C};this.setColumns=function(e){C=e};this.setGridData=function(e){a=e};this.setCurrColumn=function(e){r=e};this.getColIndex=function(){return r};this.getType=function(){return i};this.layoutPanels=function(e,t,i,n){var a={};L=n.getModel();if(e.length===0||L.extendedModel.displayType===A.categoryLabel.NONE){return a}O=e[0].getController().getRootModel();if(O.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){m=St["b"].Factories.ModelFactory.getParentContainer(O.firstObjectGrid,L);S=m[1];M=m[0];f=M.extendedModel;E=St["b"].DataObjects.ContextRepo.getContextByCid(e[0].getModel().contextId);var r=m[2];if(r&&r.extendedModel&&r.extendedModel.instanceOf==="MultipleContainerModel"){h=r;T=h.extendedModel.fontSize}else{T=v.getParameter("FONT_SIZE_CHART")}_=getNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE");I=getNMParameter("MMPT_STRUCTURE_HIERARCHY_OFFSET");D=getNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE")}if(!f||!f.instanceOf||f.instanceOf!=="ChartModel"){return{}}switch(O.buildUp){case St["b"].Utils.Constants.BuildUp.PREINIT:var o=St["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(L.extendedModel.displayType===A.categoryLabel.FREE_AXIS_POS){for(var d=0;d<M.children.length;d++){var c=M.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 y){u+=y[p]}L.dimension.width=u;break;case St["b"].Utils.Constants.BuildUp.INIT:break;case St["b"].Utils.Constants.BuildUp.LEGEND:setPanelPositions(e,n,a);break;case St["b"].Utils.Constants.BuildUp.DRAW:for(var l=0;l<e.length;l++){e[l].getPosition().x+=L.position.x;e[l].getPosition().y+=L.position.y;a[e[l].getId()]=e[l]}break}return a;function getNMParameter(e){return b.mm2pix(T*parseFloat(v.getParameter(e)))}};function setDimensionLabelText(e,t){var i=L.extendedModel.calculatedDimTextLength;var n=e.id.split(".").pop();var a=e.dataId_dim+"@"+n;var r=i[a];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 n=e;var a=0;var r;var o=n.length;var l=Math.floor((o-a)/2);while(l>=1){r=a+l;n=e.substring(0,r);n=n+"...";if(calculateTextWidth(n,i)>t){o=r;l=Math.floor((o-a)/2)}else{a=r;l=Math.floor((o-a)/2)}}var s=e.substring(0,a);s!==""&&(s=s+"...");if(d!==null&&d!==undefined){d=null;c=null}return s}function setPanelPositions(e,t,h){var f=t.getModel();var v=0;var b=1;var i=St["b"].Layout.Common.getLinkGroups(O,M.id,"Structure");var n=i.legend?i.legend.categoryHeight:S.categoryHeight[M.row];var T=n.categorySize+2*n.categoryDistance;var E=M.extendedModel.dimensionLabelModel.calculatedEmptySpaces;var x=C;if(a!==null){x=a.gridColumns.length}St["b"].$.each(e,function(e,t){var i=t.getModel().dataId_dim;var n=parseInt(t.getModel().id.split(".")[1].replace("label",""))+1;if(e%C===0){var a=E[i];if(a!==undefined&&n==a.positionCnt){if(a.position==="start"){v+=a.space_px}}}var r=v+f.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=A.labelHorizontalAlignment;var u=L.extendedModel.alignment;var p=0;for(var g in y){if(p<e%C){l+=y[g]}if(p==e%C){s=y[g]}if(p>e%C){d+=y[g]}p++}var m;if(L.extendedModel.displayType===A.categoryLabel.FREE_AXIS_POS){m=L.dimension.width-d;m-=b==C?_:D;t.getModel().textAnchor="end"}else{if(u!==c.LEFT){if(b==C){s-=_}else{s-=D}}m=l+o;if(t.getModel().hierarchyLvl===undefined){switch(u){case c.LEFT:t.getModel().textAnchor="start";break;case c.MIDDLE:m+=s/2;t.getModel().textAnchor="middle";break;case c.RIGHT:m+=s;t.getModel().textAnchor="end";break}}}t.setPosition({x:m,y:r});h[t.getId()]=t;if(b<x){b++}else{b=1}if(e%C===C-1){v+=T;var a=E[i];var n=parseInt(t.getModel().id.split(".")[1].replace("label",""))+1;if(a!==undefined&&n==a.positionCnt){if(a.position==="end"){v+=a.space_px}}}})}function setTotalFontWeight(e){var t=e.dataId_dim;var i=St["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(E.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 n=t[0].getPainter();var a=i%C;var r=e.id.split(".");var o=r[r.length-2]+"."+r[r.length-1];if(y[o]===undefined){y[o]=0}if(e.instanceOf==="LabelModel"&&!e.hideLabel){var l=e.fontWeight+" "+e.fontSize+"px '"+e.font+"'";e.dimension=n.measureTextDim(e.text,l);if(e.dimension.width!==0&&e.hierarchyLvl!=undefined){e.dimension.width+=e.hierarchyLvl*I}var s=a===C-1?_:D;y[o]=Math.max(y[o],e.dimension.width+s)}}function hideFreeAxisDimensionLabels(){for(var e=0;e<L.children.length;e++){var t=L.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 n=St["b"].Layout.Common.getHighlight(f,t,St["b"].Utils.Constants.TypeValues.highlightType.CATEGORY_LABEL,true);if(n&&n.highlight){n.highlight.active=false}t.dimension.width=0}}}}this.getPreferredLayoutSize=function(e,t){return{height:0,width:0}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Grid=St["b"].Layout.Grid||{};St["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,n){var a={};if(e.length===0){return a}var r=e[0].getController().getRootModel();var o=n.getModel();var l=o.extendedModel;if(r.buildUp===St["b"].Utils.Constants.BuildUp.PREINIT){var s=St["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 m=i.height-u-p;var h=s?0:Math.min(16,i.height);var f=l.dimension.height;var v=f===null||f<m?m:f;var b=l.dimension.width;var T=b===null||b<g?g:b;var E=16;var x=e[0];var C=x.getModel();delete C.nestedContainerId;x.setPosition({x:0,y:0});x.setDimension({height:h,width:T});if(s||g<E||m<E){delete C.image1;delete C.image2}else if(g<32){C.image1=Se["a"].imgPath+"mouse_left_click_small.png";C.image1Dim={height:E,width:E};C.image1Pos={x:Math.min(10,g-E),y:0};delete C.image2}else{C.image1=Se["a"].imgPath+"mouse_left_click_small.png";C.image2=Se["a"].imgPath+"mouse_right_click_small.png";C.image1Dim={height:E,width:E};C.image2Dim={height:E,width:E};var y=g-32;var M=Math.min(10,Math.floor(y/2));C.image1Pos={x:M,y:0};C.image2Pos={x:M+E+M,y:0}}C.dynamicOpacity=true;x=e[1];C=x.getModel();delete C.nestedContainerId;x.setPosition({x:0,y:0});x.setDimension({height:v,width:T});if(d+c+u+p>0){var S=St["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[S]={realHeight:v,realWidth:T,height:m,width:g,scrollingVer:!o.disableScrolling&&v>m,scrollingHor:!o.disableScrolling&&T>g,x:d,y:u,id:S,svgContainerHeight:h};e[0].getModel().nestedContainerId=S;e[1].getModel().nestedContainerId=S}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:h}}}for(var O=0;O<e.length;O++){a[e[O].getId()]=e[O]}return a};this.getPreferredLayoutSize=function(e,t,i){var n=i.getModel();var a=n.extendedModel;r.height=a.dimension.height?a.dimension.height:0;r.width=a.dimension.width?a.dimension.width:0;return r}};var Oe=r(480);St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Multiple=St["b"].Layout.Multiple||{};St["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 n=1;var a=t-e.columns;var r=e.cells[a];while(a>=0&&r.state!==2){n++;a-=e.columns;r=e.cells[a]}if(a>=0){r.span=n+1;i.state=1;i.ownerIndex=a;for(var o=1;o<n;o++){var l=e.cells[t-o*e.columns];l.state=1;l.ownerIndex=a}}}}},disperseFreeCellsForStructure:function(e){for(var t=e.cells.length-1;t>=0;t--){var i=e.cells[t];if(i.state===0){var n=Math.floor(t/e.columns)*e.columns;var a=1;var r=t-1;var o=e.cells[r];while(r>=n&&o.state!==2){a++;o=e.cells[--r]}if(r>=n){o.span=a+1;i.state=1;i.ownerIndex=r;for(var l=1;l<a;l++){var s=e.cells[t-l];s.state=1;s.ownerIndex=r}}}}},createTemporaryChartContainer:function(e,t,i,n){var a,r;if(e.instanceOf==="ChartModel"){a="structure";r=St["b"].Factories.ModelFactory.rebuildChart}else if(e.instanceOf==="TimeChartModel"){a="time";r=St["b"].Factories.ModelFactory.rebuildTimeChart}else if(e.instanceOf==="TableModel"){a="table";r=St["b"].Factories.ModelFactory.rebuildTable}var o=new Oe["a"];o.extendedModel=JSON.parse(JSON.stringify(e));o.layoutType=a;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,n,a){var r=e[e.activeElementType+"DataStorage"];if(r!==undefined&&r[t]){var o=r[t].chartCompares.nodes;if(o&&o[i]&&o[i][n]){return o[i][n].slice(0)}}return[]},getStructureCompareHeights:function(e,t){var i=St["b"].Utils.Calculator.Converter.pt2pix(t);var n=St["b"].Utils.Constants.Parameters.textLineSpacing;var a=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+n)*r.start:0;var l=r.mid?(i+n)*r.mid-n:0;var s=r.end?(i+n)*r.end:0;if(r.auto&&(o||!s)){o+=(i+n)*r.auto}else{s+=(i+n)*r.auto}var d=o&&s?o+Math.max(l,a)+s:o+l+s;return{start:o,mid:l,end:s,cmpDim:a,textSize:d,ellipseTextSize:d}},getTimeCompareWidths:function(e,t){var i=St["b"].DataObjects.DocumentDO.getPainter();var n=St["b"].Utils.Calculator.Converter.pt2pix(t);var a=e.font.fWeight+" "+n+"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,a).width}if(e.percent.legend!=="none"){o[e.percent.legend]=Math.max(o[e.percent.legend],i.measureTextDim(e.percent.text,a).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,a).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,n,a,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<a.children.length;p+=r,u++){if(a.children[p].dataId_dim===c.dataId_dim){break}}}else{}var g="mid";if(o){var m={0:"startStart",1:"midStart",2:"start",3:"mid",4:"end",5:"midEnd",6:"endEnd"};g=m[c.labelPosition.substr(17)]}else if(l){var m={0:"startStart",1:"midStart",2:"start",3:"mid",4:"end",5:"midEnd",6:"endEnd"};g=m[c.positioning.substr(22)]}s.type="rep";s.categoryNumber=u;s.position=g}return s},getCompareAreas:function(e,t,i,n,a,r,o,l,s,d){var c=St["b"].DataObjects.RuntimeDO;var u,p;var g=e.ellipse?Math.round((t.ellipseTextSize*o-t.ellipseTextSize)/2)+l:0;var m=Math.max(t.textSize+g,t.cmpDim);var h=t.start+Math.round(Math.max(t.mid,t.cmpDim)/2);var f=t.end||t.mid?Math.round(Math.max(t.mid,t.cmpDim)/2)+t.end+g:0;var v=Math.max(f,Math.round(t.cmpDim/2));var m=h+v;if(n.type==="start"){u=m-r;p=m+r-i}else if(n.type==="end"){u=-r-i;p=m+r}else{var b=a.categorySize+a.categoryDistance+a.categoryDistance;var T=n.categoryNumber*b+a.categoryDistance+d[n.categoryNumber]+r;switch(n.position){case"start":T+=a.startOffset;break;case"mid":T+=a.midOffset;break;case"end":T+=a.endOffset;break;case"startStart":T+=a.startOffset-St["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"midStart":T+=a.midOffset-St["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"midEnd":T+=a.midOffset+St["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break;case"endEnd":T+=a.endOffset+St["b"].Utils.Calculator.Converter.mm2pix(c.getParameterParsed(s)*.8);break}u=h-T;p=v+T-i}return{start:u,end:p}},getComparesAreas:function(e,t,i,n,a,r,o,l,s){var d=St["b"].DataObjects.RuntimeDO;var c=St["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 m=0;m<t.children.length;m++){if(t.children[m].instanceOf==="ContainerModel"){g=t.children[1];break}}var h=0,f=0;var v,b,T,E;var x;var C;if(l){x=g.layoutData[0];C=g.children.length/g.layoutData[0];v="x";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH")*2;E=St["b"].Layout.Multiple.MultipleHelperCommon.getTimeCompareWidths;T="MMPT_TIME_COLUMN_WIDTH"}else if(s){x=g.layoutData[1];C=g.children.length/g.layoutData[1];v="y";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");E=St["b"].Layout.Multiple.MultipleHelperCommon.getStructureCompareHeights;T="MMPT_STRUCTURE_BAR_HEIGHT"}else{v="y";b=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");E=St["b"].Layout.Multiple.MultipleHelperCommon.getStructureCompareHeights;T="MMPT_TABLE_ELEMENT_BAR_HEIGHT"}var y=C*(a.categorySize+a.categoryDistance+a.categoryDistance);var M=convertNMParameter("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");for(var m=0;m<n.length;m++){var S=n[m];if(S.compareFromCat==="axis"&&S.compareToCat==="axis"){continue}var O=St["b"].Layout.Common.getCompareToAndFrom(S,t,o,undefined);S.compareFrom=O.compareFrom;S.compareTo=O.compareTo;if(S.compareFrom===null||S.compareTo===null){S.compareFrom=null;S.compareTo=null;continue}St["b"].Models.Actions.ViewModelActions.CompareModel.setText(S,r,t);if(!o.setupCompareFormulas(S,i,t.isMultipleTotal)){S.compareFrom=null;S.compareTo=null;continue}St["b"].Layout.Common.setCompareBasicMetaInformation(S,!l,u,convertNMParameter,mm2pix);var L=E(S,e.fontSize);var A=St["b"].Layout.Multiple.MultipleHelperCommon.getCompareStartPosition(S,r,i,t,g,x,l,s);var _=St["b"].Layout.Multiple.MultipleHelperCommon.getCompareAreas(S,L,y,A,a,S.offset[v],b,M,T,p.dimensionLabelModel.emptyBefore);h=Math.max(h,_.start);f=Math.max(f,_.end);S.compareFrom=null;S.compareTo=null}return{start:h,end:f}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Multiple=St["b"].Layout.Multiple||{};St["b"].Layout.Multiple.MultipleHelperFixed={calculateFixedStructure:function(e,t,i){},calculateStructure:function(e,t,i,n,a){}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Multiple=St["b"].Layout.Multiple||{};St["b"].Layout.Multiple.MultipleHelperFlexible={createInitialCellsData:function(e,t,i,n){var a={};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=St["b"].Models.Actions.ExtendedModelActions.MultipleContainerModel.getActiveCase(e,l.path,l.ref.isSum);if(g!==null){var m=r[g].nodes;c=new Array(m.length);u=new Array(m.length);p=new Array(m.length);for(var h=0;h<m.length;h++){var f=m[h].nodes;var v=St["b"].Models.Actions.ViewModelActions.ContainerModel.getActiveChartIndex({charts:f});u[h]=v;var b=null,T=null;if(v!==-1){b=St["b"].Layout.Multiple.MultipleHelperCommon.createTemporaryChartContainer(f[v].model,l.path,l.ref.isSum);T=St["b"].DataObjects.ContextRepo.getContextByCid(b.extendedModel.contextId)}c[h]=b;var E=T?parseFloat(St["b"].DataObjects.RuntimeDO.getParameter(St["b"].Models.Actions.ModelActions.ContextModel.getTimeFactor(T))):Number.NaN;p[h]=isNaN(E)?1:E}d=St["b"].Layout.Multiple.MultipleHelperFlexible.getGridValueSize(e,c,u,l.path,l.ref.isSum,i,n)}a[l.path]={caseIdx:g,grid:c,gridData:u,valueSize:d,categorySize:s,timeFactors:p,isTotal:l.ref.isSum}}return a},getGridValueSize:function(e,t,i,n,a,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 m=c(u,g);var h=St["b"].Layout.Multiple.MultipleHelperFlexible.getChartMinMaxValues(t[m],n,a);p=Math.max(p,h.max-h.min);i[m]={maxValue:h.max,maxLabel:h.maxLabel,minValue:h.min,minLabel:h.minLabel,maxValValue:h.maxVal,maxValLabel:h.maxValLabel,minValValue:h.minVal,minValLabel:h.minValLabel,hasPositive:h.hasPositive,hasNegative:h.hasNegative,chartIdx:i[m]}}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 n=0,a=0;var r="",o="";var l=0,s=0;var d="",c="";var u=false,p=false;function updateValues(e,t,i){if(n<e){n=e;r=i.hideLabel?"":i.text;u=true}else if(a>e){a=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 m=e.children[g];if(m.isNaN!==false||m.valueType==undefined||m.valueType==="FACTOR_NONE"){continue}var h=e.children[g+1];if(m.instanceOf==="BarModel"||m.instanceOf==="TimeColumnModel"||m.instanceOf==="NeedleModel"||m.instanceOf==="RodModel"||m.instanceOf==="StructureLineModel"||m.instanceOf==="TimeLineModel"){updateValues(m.value+m.referencePointerSum,m.value,h)}else if(m.instanceOf==="StructureWaterfallModel"||m.instanceOf==="TimeWaterfallModel"){updateValues(m.relativeValue+m.referencePointerSum,m.value,h)}else if(m.instanceOf==="ValueModel"){if(l<m.value){l=m.value;d=h.hideLabel?"":h.text;u=true}else if(s>m.value){s=m.value;c=h.hideLabel?"":h.text;p=true}}}u=u||!u&&!p;return{max:n,min:a,maxLabel:r,minLabel:o,hasPositive:u,hasNegative:p,maxVal:l,maxValLabel:d,minVal:s,minValLabel:c}},getAdditionalValueSize:function(e,f,v,t){var i=0;var n=St["b"].Utils.Calculator.Converter;var a=St["b"].DataObjects.RuntimeDO;var b=St["b"].DataObjects.DocumentDO.getPainter();var g=n.pt2pix(e.fontSize);var T="normal "+g+"px '"+a.getParameter("FONT_FAMILY")+"'";var m,h,E,x;var C,y,M,S;if(t){m=n.mm2pix(e.fontSize*a.getParameter("MMPT_TIME_LABEL_ELEMENT_DISTANCE"));h=n.mm2pix(e.fontSize*a.getParameter("MMPT_TIME_CATEGORY_LABEL_AXIS_DISTANCE"));E=n.mm2pix(e.fontSize*a.getParameter("MMPT_TIME_CATEGORY_LABEL_SIGN_DISTANCE"));x=n.mm2pix(e.fontSize*a.getParameter("MMPT_TIME_VALUE_LABEL_PADDING_TOP"))}else{C=n.mm2pix(e.fontSize*a.getParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE"));y=n.mm2pix(e.fontSize*a.getParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE"));M=n.mm2pix(e.fontSize*a.getParameter("MMPT_STRUCTURE_CATEGORY_LABEL_SIGN_DISTANCE"));S=n.mm2pix(e.fontSize*a.getParameter("MMPT_STRUCTURE_HIERARCHY_OFFSET"));x=n.mm2pix(e.fontSize*a.getParameter("MMPT_STRUCTURE_CELL_PADDING_SIDE"))}function getAdditionalSizeStructure(e,t,i,n,a){var r=e.extendedModel;var o={size:0,categoryLabels:0,valueLabelsNeg:0,valueLabelsPos:0};var l=St["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);if(l===null){return o}if(r.dimensionLabelModel.displayType===St["b"].Utils.Constants.TypeValues.categoryLabel.AXIS||t===0&&r.dimensionLabelModel.displayType===St["b"].Utils.Constants.TypeValues.categoryLabel.FREE_AXIS_POS){var s=St["b"].Models.Actions.DataModelActions.getDimensionTreeByPath(l.dataModel,v,f.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 m=0;for(var g=0;g<p.length;g++){if(p[g].hier){var h=p[g].width;o.categoryLabels=Math.max(o.categoryLabels,m+h);m+=S}else{var h=p[g].width+M;o.categoryLabels=Math.max(o.categoryLabels,m+h);m+=h}}o.categoryLabels+=y-M}}for(var g=0;g<r.expressions.length;g++){if(r.expressions[g].valueLabelOpt[0]!=="-"){if(t<0){o.valueLabelsNeg+=C+b.measureTextDim(n,T).width}if(i>=0&&a!==""){o.valueLabelsPos+=C+b.measureTextDim(a,T).width}break}}o.size=o.categoryLabels+o.valueLabelsNeg+o.valueLabelsPos+x+x;return o;function processNodes(e,t){for(var i=0;i<e.length;i++){var n=e[i];var a=n.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,a);if(t<u-1){processNodes(n.nodes,t+1)}}}}function getAdditionalSizeTime(e,t,i){var n=e.extendedModel;var a={size:0,categoryLabels:0,valueLabelsNeg:0,valueLabelsPos:0};var r=St["b"].DataObjects.ContextRepo.getContextByCid(n.contextId);if(r===null){return a}if(n.dimensionLabelModel.displayType===St["b"].Utils.Constants.TypeValues.categoryLabel.AXIS||!t&&n.dimensionLabelModel.displayType===St["b"].Utils.Constants.TypeValues.categoryLabel.FREE_AXIS_POS){var o=St["b"].Models.Actions.DataModelActions.getDimensionTreeByPath(r.dataModel,v,f.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);a.categoryLabels=h+(c.length-1)*E;for(var u=0;u<d;u++){a.categoryLabels+=c[u]*g+(c[u]-1)*St["b"].Utils.Constants.Parameters.textLineSpacing}}}for(var u=0;u<n.expressions.length;u++){var p=n.expressions[u];if(p.valueLabelOpt[0]!=="-"){a.valueLabelsNeg=t?g+m:0;a.valueLabelsPos=i?g+m:0;break}}a.size=a.categoryLabels+a.valueLabelsNeg+a.valueLabelsPos+x+x;return a;function processNodes(e,t){for(var i=0;i<e.length;i++){var n=e[i];var a=n.value.split("\n").length;c[t]=Math.max(c[t],a);if(t<d-1){processNodes(n.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=f.grid[s];if(d===null){continue}var c=f.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=f.grid[s];if(d===null){continue}var c=f.gridData[s];var u=getAdditionalSizeTime(d,c.hasNegative,c.hasPositive);p=Math.max(p,u.size);copyToGridData(c,u)}i+=p}}i+=f.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=f.grid[s];if(d===null){continue}var c=f.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=f.grid[s];if(d===null){continue}var c=f.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 n=0;n<e.cells.length;n++){var a=e.cells[n];if(a.path!==null){var r=t[a.path];a.grid=r.grid;a.gridData=r.gridData;a.valueSize=r.valueSize;a.fixedValueSize=St["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(e,r,a.path,i);a.state=2;a.caseIdx=r.caseIdx;a.titleDim=r.titleDim;a.isTotal=r.isTotal}else{a.state=0}a.span=1}},adjustMultipleCellsForTime:function(s,e){var d;var t=s.cells,i=s.cells;var n=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 n=s.cells[i];var a=n.valueSize/(n.span*r-n.fixedValueSize);a=isNaN(a)?n.valueSize:a;if(n.span<s.rows&&n.valueSize!==0&&(e===null||a>t)){e=i;t=a}}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 n=null;for(var a=t;a<e.length;a++){if(Math.floor(a/s.columns)+i.span>s.rows){break}var r=e[a]===undefined&&d>=i.span-1;if(r){for(var o=1;o<i.span;o++){if(e[a+o*s.columns]!==undefined){r=false;break}}}if(r){e[a]=i;for(var o=1;o<i.span;o++){var l=s.cells[getNextFreeCell()];l.state=1;e[a+o*s.columns]=l;d--}n=a;break}}return n}do{n=true;d=getFreeCount();if(d===0){break}var a=getHighestPriorityCellIdx();if(a===null){i=t;break}else{a=s.cells[a]}a.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){n=false;break}else{o++}}}if(n){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{a.span--}}while(n);s.cells=i;for(c=0;c<s.cells.length;c++){var u=s.cells[c];u.state=u.state===2?2:0}St["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 n=r.cells[i];var a=n.valueSize/(n.span*o-n.fixedValueSize);a=isNaN(a)?n.valueSize:a;if(n.span<r.columns&&n.valueSize!==0&&(e===null||a>t)){e=i;t=a}}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 n=true;do{n=true;var a=getFreeCount();if(a===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 m=0;m<g;m++){if(a>0){t[s]=r.cells[getNextFreeCell()];t[s].state=1;s++;a--}else{n=false;break}}}t[s++]=u;for(var m=1;m<u.span;m++){if(a>0){t[s]=r.cells[getNextFreeCell()];t[s].state=1;s++;a--}else{n=false;break}}}if(!n){break}}if(n){for(var c=0;c<d.length;c++){if(d[c].state===0){t[s++]=d[c]}}i=t}else{l.span--}}while(n);r.cells=i;for(c=0;c<r.cells.length;c++){var u=r.cells[c];u.state=u.state===2?2:0}St["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForStructure(r)},createMultipleCellsList:function(e,t,i){var n=[];for(var a=0;a<e.cells.length;a++){var r=e.cells[a];if(r.path!==null){var o=t[r.path];var l=St["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(e,o,r.path,i);n.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 n},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 n=s[i];var a=n.valueSize/(n.span*o-n.fixedValueSize);a=isNaN(a)?n.valueSize:a;if(n.span<r&&n.valueSize!==0&&(e===null||a>t)){e=i;t=a}}return e}function checkLayout(){var e=s.slice(0);e.sort(function(e,t){return t.span-e.span});var n=new Array(l.cells.length);var a=d?l.rows:l.columns;function getNextPos(e){for(var t=0;t<n.length;t++){var i=n[t];if(i===undefined&&t%a+e<=a){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++){n[r+o]=1}}}return true}for(var n=0;n<l.cells.length;n++){if(l.cells[n].path===null){var a=getHighestPriorityCell();if(a===null){break}s[a].span++;if(!checkLayout()){s[a].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 n=null;var a=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(a){return a}var d=getColumnWidths();if(n===null||n>d[d.length-1]){n=d[d.length-1]}var u=getMoveIndicies(d);var p=u.moveUps;var g=u.moveDowns;for(var m=0;m<p.length;m++){var h=p[m];var f=l[h];l[h]=l[h-1];l[h-1]=f}for(var m=0;m<g.length;m++){var v=g[m];if(v!==l.length-1){var f=l[v];l[v]=l[v+1];l[v+1]=f}}}var b=new Array(o);for(var s=0;s<o;s++){b[s]=new Array(r)}for(var m=0;m<c[0].length;m++){var T=[];for(var s=0;s<c.length;s++){if(c[s][m]){T.push(c[s][m])}}T.sort(function(e,t){return e.categorySize-t.categorySize});var E=0;for(var s=0;s<T.length;s++){while(b[E][m]!==undefined){E++}b[E][m]=T[s];for(var x=1;x<T[s].span;x++){b[E][m+x]=0}}}if(i){var C=0;for(var m=0;m<b[0].length;m++){for(var s=0;s<b.length;s++){var y=b[s][m];if(y){e.cells[C++]=y}else{var M=m-1;var S=b[s][M];for(;M>=0&&!S;M--,S=b[s][M]){}var O=M*b.length+s;e.cells[C++]={state:1,path:null,ownerIndex:O}}}}}else{var C=0;var O=0;for(var s=0;s<b.length;s++){var L=b[s];for(var m=0;m<L.length;m++){var y=L[m];if(y){O=C;e.cells[C++]=y}else{e.cells[C++]={state:1,path:null,ownerIndex:O}}}}}return a;function buildGrid(){var e=tryBuildGrid();var t=100;while(e!==null){if(t<=0){a=true;return}if(e===0){var i=l[0];l[0]=l[1];l[1]=i}else{var n=e-1;if(l[e].span>1){while(n>0&&l[n].span>=l[e].span){n--}}var i=l[e];l[e]=l[n];l[n]=i}e=tryBuildGrid();t--}}function tryBuildGrid(){var e=null;for(var t=0;t<c.length;t++){var i=c[t];for(var n=0;n<i.length;n++){i[n]=undefined}}for(var t=0;t<l.length;t++){var a=l[t];var r=getNextPositionForLength(a.span);if(r===null){e=t}else{a.sourceIndex=t;c[r.row][r.col]=a;for(var o=1;o<a.span;o++){c[r.row][r.col+o]=0}}}return e}function getNextPositionForLength(e){var t=null;var i=c[0].length;for(var n=0;n<i;n++){for(var a=0;a<c.length;a++){var r=true;for(var o=0;o<e;o++){if(n+o>=i||c[a][n+o]!==undefined){r=false;break}}if(r){t={row:a,col:n};break}}if(t!==null){break}}return t}function getColumnWidths(){var e=0;var t=c[0].length;var i=St["b"].Utils.GlobalFunctions.createArray(t,0);for(var n=0;n<t;n++){for(var a=0;a<c.length;a++){var r=c[a][n];if(r&&r.span===1){i[n]=Math.max(i[n],r.valueSize+e)}else if(r===0&&(n+1>=t||c[a][n+1])){var o=n-1;var l=c[a][o];for(;o>=0&&!l;o--,l=c[a][o]){}i[n]=Math.max(i[n],l.valueSize+(o===0?0:i[o-1]))}}e=i[n]}return i}function getMoveIndicies(e){var t=[],i=[];var n=c[0].length;for(var a=0;a<n;a++){for(var r=0;r<c.length;r++){var o=c[r][a];if(o===0&&(a+1>=n||c[r][a+1])){var l=a-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[a]-d){t.push(s.sourceIndex)}else if(s.valueSize<e[a]-d){i.push(s.sourceIndex)}}}}return{moveUps:t,moveDowns:i}}},getStructureGridCategorySize:function(e,t,i,n,a,r){var o=St["b"].DataObjects.RuntimeDO;var l=St["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=St["b"].Utils.Constants.TypeValues.structurePosition;var m={};m[g.TOP_TOP]="startStart";m[g.TOP]="start";m[g.MID_TOP]="midStart";m[g.MID]="mid";m[g.MID_BOTTOM]="midEnd";m[g.BOTTOM]="end";m[g.BOTTOM_BOTTOM]="endEnd";var h=parseFloat(o.getParameter("MMPT_STRUCTURE_BAR_HEIGHT"));var f=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 E=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_HEADER_TEXT_SPACE")));var x=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_LEGEND_ELEMENT_DISTANCE")))+l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH")));var C=l.mm2pix(r*parseFloat(o.getParameter("MMPT_STRUCTURE_CELL_PADDING_TOP")));for(var y=0;y<n;y++){var M=[],S=[];var O=0,L=0;var A=false;var _=false,I=false;var D=0,R=0;var N=0;for(var P=0;P<i;P++){var w=y*i+P;var U=d[w];if(!U){continue}M.push(U);S.push(u[w])}var F=St["b"].Layout.CategorySizeCalculator.getCategorySizes(M,m,r,h,f,v,b,"structure",a,t.isTotal,S);for(var P=0;P<i;P++){var w=y*i+P;var B=d[w];if(!B){continue}var H=B.extendedModel.contextId;var k=St["b"].DataObjects.ContextRepo.getContextByCid(H);var G=new St["b"].Utils.Calculator(k);G.setupEmptySpaces(B,e.fontSize,a,t.isTotal);var V=B.extendedModel.dimensionLabelModel;N=Math.max(N,St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(V));for(var $=0;$<U.extendedModel.expressions.length;$++){var W=U.extendedModel.expressions[$];var z=W.name.split("\n").length;var j=W.valueRowLabelPosition.split(".")[1];if(j==="1"||j==="2"||j==="3"){O=Math.max(O,z*p+(z-1)*St["b"].Utils.Constants.Parameters.textLineSpacing);_=_||W.connector==="Always"}else if(j==="4"||j==="5"||j==="6"){L=Math.max(L,z*p+(z-1)*St["b"].Utils.Constants.Parameters.textLineSpacing);I=I||W.connector==="Always"}A=A||W.notation===St["b"].Utils.Constants.TypeValues.notation.HEADER||W.notation===St["b"].Utils.Constants.TypeValues.notation.ELEMENT_HEADER}var X=St["b"].Layout.Multiple.MultipleHelperCommon.getComparesOfChart(e,a,w,c[w].chartIdx,H);if(X.length>0){var Y=St["b"].Layout.Multiple.MultipleHelperCommon.getComparesAreas(e,B,a,X,F,k,G,false,true);D=Math.max(D,Y.start);R=Math.max(R,Y.end)}}L+=I&&L>0?x:0;if(O>0){O+=Math.max(A?T+E:0,_?x:0)}else{O+=A?T:0}O=Math.max(O,D);L=Math.max(L,R);s+=C+O+F.totalLength+N+L}return s},getTimeGridCategorySize:function(e,t,i,n,a,r){var o=St["b"].DataObjects.RuntimeDO;var l=St["b"].Utils.Calculator.Converter;var s=St["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 m="normal "+g+"px '"+o.getParameter("FONT_FAMILY")+"'";var h=St["b"].Utils.Constants.TypeValues.timePosition;var f={};f[h.LEFT_LEFT]="startStart";f[h.LEFT]="start";f[h.MID_LEFT]="midStart";f[h.MID]="mid";f[h.MID_RIGHT]="midEnd";f[h.RIGHT]="end";f[h.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 E=parseFloat(o.getParameter("MMPT_TIME_CATEGORY_DISTANCE"));var x=l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_LEGEND_ELEMENT_DISTANCE")))+l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_LEGEND_MIN_CONNECTOR_LENGTH")));var C=l.mm2pix(r*parseFloat(o.getParameter("MMPT_TIME_VALUE_LABEL_PADDING_LEFT")));for(var y=0;y<i;y++){var M=[],S=[];var O=false,L=false;var A=0,_=0,I=0,D=0,R=0,N=0;var P=0;for(var w=0;w<n;w++){var U=w*i+y;var F=c[U];if(!F){continue}M.push(F);S.push(p[U])}var B=St["b"].Layout.CategorySizeCalculator.getCategorySizes(M,f,r,v,b,T,E,"time",a,t.isTotal,S);for(var w=0;w<n;w++){var U=w*i+y;var H=c[U];if(!H){continue}var k=H.extendedModel.contextId;var G=St["b"].DataObjects.ContextRepo.getContextByCid(k);var V=new St["b"].Utils.Calculator(G);var $=H.extendedModel.expressions;V.setupEmptySpaces(H,e.fontSize,a,t.isTotal);var W=H.extendedModel.dimensionLabelModel;P=Math.max(P,St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(W));for(var z=0;z<$.length;z++){var j=$[z];if(j.valueRowLabelPosition.indexOf("Left")!==-1){A=j.name.split("\n").reduce(function(e,t){return Math.max(e,s.measureTextDim(t,m).width)},A);O=O||j.connector==="Always"}else if(j.valueRowLabelPosition.indexOf("Right")!==-1){_=j.name.split("\n").reduce(function(e,t){return Math.max(e,s.measureTextDim(t,m).width)},_);L=L||j.connector==="Always"}}for(var z=0,X=$.length;z<H.children.length&&X>0;z++){var Y=H.children[z];if(Y.dataId_dim!=null&&Y.dataId_expr!=null&&Y.instanceOf==="LabelModel"&&Y.id.indexOf("representation")>=0){I=Math.max(I,s.measureTextDim(Y.text,m).width);X--}}for(var z=H.children.length-1,X=$.length;z>=0&&X>0;z--){var Y=H.children[z];if(Y.dataId_dim!=null&&Y.dataId_expr!=null&&Y.instanceOf==="LabelModel"&&Y.id.indexOf("representation")>=0){D=Math.max(D,s.measureTextDim(Y.text,m).width);X--}}var K=St["b"].Layout.Multiple.MultipleHelperCommon.getComparesOfChart(e,a,U,u[U].chartIdx,k);if(K.length>0){var Z=St["b"].Layout.Multiple.MultipleHelperCommon.getComparesAreas(e,H,a,K,B,G,V,true,false);R=Math.max(R,Z.start);N=Math.max(N,Z.end)}}A+=O?x:0;_+=L?x:0;var Q=Math.round(I/2-B.categoryDistance-B.categorySize/2);var q=Math.round(D/2-B.categoryDistance-B.categorySize/2);var J=Math.max(A,Q,R);var ee=Math.max(_,q,N);d+=C+J+B.totalLength+P+ee+1}return d},updateCategoryCellSizes:function(e,t,i,n,a,r,o){var l=St["b"].Utils.Calculator.Converter;var s=0,d=0;var c=e.dimensions[0].categoryTextBreak;if(e.dimensions[0].categorySize!==null){a=Math.min(a,l.mm2pix(e.fontSize*e.dimensions[0].categorySize))}var u,p,g,m,h;var f=0,v=0,b="top",T="bottom",E="category";var x=St["b"].DataObjects.RuntimeDO.getParameterParsed("FONT_SIZE_CHART");if(o){u=St["b"].Layout.Multiple.MultipleHelperFlexible.getStructureGridCategorySize;p=e.structureCellValueCount;g=e.structureCellCategoryCount;m=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));h=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"));f=l.mm2pix(e.fontSize*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_STRUCTURE_CELL_PADDING_TOP"));v=f}else if(r){u=St["b"].Layout.Multiple.MultipleHelperFlexible.getTimeGridCategorySize;p=e.timeCellCategoryCount;g=e.timeCellValueCount;m=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_LEFT_BORDER_SIZE"));h=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"));b="left";T="right";E="value";f=l.mm2pix(e.fontSize*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_TOP"));v=l.mm2pix(e.fontSize*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_TIME_VALUE_LABEL_PADDING_LEFT"))}else{u=function(){return 100};p=e.tableCellValueCount;g=e.tableCellCategoryCount;m=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));h=l.mm2pix(x*St["b"].DataObjects.RuntimeDO.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"))}for(var C=0;C<t.length;C++){var y=t[C];var M=i[y.path];if(M.caseIdx!==null){var S=e.cases[M.caseIdx].borders[b].width;var O=e.cases[M.caseIdx].borders[T].width;var L=e.cases[M.caseIdx].titleBold;var A=St["b"].Layout.Multiple.MultipleHelperFlexible.getTitleHeight(e.titleFontSize,L,y.path,a,c);M.titleDim={height:A+f,category:0,value:0};M.titleDim[E]=M.titleDim.height;M.categorySize=u(e,M,p,g,y.path,e.fontSize)+(S===null?m:l.mm2pix(x*S))+(O===null?h:l.mm2pix(x*O))+M.titleDim.category+v;s=Math.max(s,M.categorySize);if(r&&d<M.titleDim.height){d=M.titleDim.height}}}return{maxCategorySize:s,maxTitleValueSize:d}},getMultipleCategorySizeSum:function(e,t,i){var n=0;if(i){for(var a=0;a<e.columns;a++){var r=0;for(var o=0;o<e.rows;o++){var l=e.cells[o*e.columns+a];if(l.path!==null){r=Math.max(r,t[l.path].categorySize)}}n+=r}}else{for(var o=0;o<e.rows;o++){var s=0;for(var a=0;a<e.columns;a++){var l=e.cells[o*e.columns+a];if(l.path!==null){s=Math.max(s,t[l.path].categorySize)}}n+=s}}return n},getMinMaxFontSizes:function(e){var t,i;if(e.fontSizeType==="Fix"){i=t=e.inputFontSize===null?parseInt(St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART")):e.inputFontSize}else{var n=parseInt(St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART"));var a=e.inputFontSize===null?n:e.inputFontSize;t=Math.min(a,n);i=Math.max(a,n)}return{maxFontSize:i,minFontSize:t}},getTotalsSettings:function(e,t,i){var n=t.length;var a=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){n--;l=true;break}}if(l){if(o.totalsPosition==="None"){}else{r=1}}}return{cellCount:n,valueCount:a,categoryCount:r}},getTitleHeight:function(e,t,i,n,a){var r=-St["b"].Utils.Constants.Parameters.textLineSpacing;var o=St["b"].Utils.Calculator.Converter.pt2pix(e);var l=(t?"bold ":"normal ")+o+"px '"+St["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(a){var p=St["b"].DataObjects.DocumentDO.getPainter().measureTextDim(d[c],l).width;u=Math.ceil(p/n)}r+=(o+St["b"].Utils.Constants.Parameters.textLineSpacing)*u}return r},getBiggestTitleHeight:function(e,t,i,n){var a=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=St["b"].Layout.Multiple.MultipleHelperFlexible.getTitleHeight(e.titleFontSize,s,l,n,r);a=Math.max(a,d)}}return a},calculateStructure:function(e,t,i){var n={"0000":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase01,"0010":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase02,"0001":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase03,"0011":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase04,"0100":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,1e3:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,1100:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase05,"0110":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,1010:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,1110:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase06,"0101":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,1001:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,1101:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase07,"0111":St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08,1011:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08,1111:St["b"].Layout.Multiple.MultipleHelperFlexible.calculateFlexibleStructureCase08};var a=e.activeElementType;var r=a==="time";var o=!r&&a==="structure";var l="";l+=e[a+"MultipleCategoryCount"]===null?"0":"1";l+=e[a+"MultipleValueCount"]===null?"0":"1";l+=e[a+"CellCategorySize"]===null?"0":"1";l+=e[a+"CellValueSize"]===null?"0":"1";var s=St["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=St["b"].Utils.Calculator.Converter;var p=St["b"].Layout.Multiple.MultipleHelperFlexible.getMinMaxFontSizes(e);var g=St["b"].Layout.Multiple.MultipleHelperFlexible.getTotalsSettings(e,s,r);var m=St["b"].Layout.Multiple.MultipleHelperFlexible.createInitialCellsData(e,s,r,o);n[l](e,s,m,g,d,c,u,p,r,o)},calculateFlexibleStructureCase01:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=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*St["b"].Utils.Constants.Parameters.minimalChartSize),r);var f;if(s){var v=r/(p*h);var b=Math.ceil(n.cellCount/v);f=Math.floor(a/b)}else{f=p*h}var T=St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,f,s,d);var E=T.maxCategorySize;var x=T.maxTitleValueSize;var C=Math.max(1,Math.min(n.cellCount,Math.floor(a/E)-n.categoryCount));do{var y=Math.ceil(n.cellCount/C);c=Math.floor(r/y);u=(c-x)/h;St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,y,C);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,C,y,r,n,s);g=St["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);m=u>=p;if(m&&g<=a){return}C++;m=m||y<=1}while(!m&&g<a||!m&&e.fontSize===l.minFontSize)}while(e.fontSize>l.minFontSize)},calculateFlexibleStructureCase02:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m,h,f=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)}h=Math.min(o.mm2pix(e.fontSize*St["b"].Utils.Constants.Parameters.minimalChartSize),r);p=o.mm2pix(e.fontSize*T);c=Math.max(1,Math.min(n.cellCount,Math.floor(a/p)-n.categoryCount));u=Math.ceil(n.cellCount/c);if(s){f=St["b"].Layout.Multiple.MultipleHelperFlexible.getBiggestTitleHeight(e,t,i,p)}g=r/u;m=(g-f)/b;v=m>=h;console.log(e.fontSize,c,u,e.cells,g,h,a);if(v){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!v);while(m<h&&u>1){c++;u=Math.ceil(n.cellCount/c);if(s){f=St["b"].Layout.Multiple.MultipleHelperFlexible.getBiggestTitleHeight(e,t,i,p)}g=Math.floor(r/u);m=(g-f)/b;console.warn("case02: chartValueSize too small... readjusting counts",g)}var E=s?p:g;St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,E,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s)},calculateFlexibleStructureCase03:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=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*h);u=Math.max(1,Math.min(n.cellCount,Math.floor(r/p)));c=Math.ceil(n.cellCount/u);var f=p;if(s){f=Math.floor(a/c)}St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,f,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s);m=St["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);g=m<=a&&p<=r;if(g){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!g)},calculateFlexibleStructureCase04:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=e[e.activeElementType+"CellValueSize"];var f=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*f);g=o.mm2pix(e.fontSize*h);u=Math.max(1,Math.min(n.cellCount,Math.floor(r/g)));c=Math.ceil(n.cellCount/u);m=p*c<=a&&g<=r;console.log(e.fontSize,c,u,e.cells,g,r,p,a);if(m){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!m);var v=s?p:g;St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,v,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s)},calculateFlexibleStructureCase05:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=e[e.activeElementType+"MultipleValueCount"];var f=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(h===null){c=Math.max(1,f-n.categoryCount);u=Math.ceil(n.cellCount/c)}else if(f===null){u=Math.max(1,h);c=Math.ceil(n.cellCount/u)}else{c=Math.max(1,f-n.categoryCount);u=Math.max(1,h);if(c*u<n.cellCount){St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=Math.floor(r/u);var v=p;if(s){v=Math.floor(a/c)}St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,v,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s);g=St["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);m=g<=a;if(m){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!m)},calculateFlexibleStructureCase06:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=e[e.activeElementType+"MultipleValueCount"];var f=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(h===null){c=Math.max(1,f-n.categoryCount);u=Math.ceil(n.cellCount/c)}else if(f===null){u=Math.max(1,h);c=Math.ceil(n.cellCount/u)}else{c=Math.max(1,f-n.categoryCount);u=Math.max(1,h);if(c*u<n.cellCount){St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*v);g=Math.floor(r/u);m=p*c<=a;console.log(e.fontSize,c,u,e.cells,g,p,a);if(m){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!m);var b=s?p:g;St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,b,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s)},calculateFlexibleStructureCase07:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=e[e.activeElementType+"MultipleValueCount"];var f=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(h===null){c=Math.max(1,f-n.categoryCount);u=Math.ceil(n.cellCount/c)}else if(f===null){u=Math.max(1,h);c=Math.ceil(n.cellCount/u)}else{c=Math.max(1,f-n.categoryCount);u=Math.max(1,h);if(c*u<n.cellCount){St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*v);var b=p;if(s){b=Math.floor(a/c)}St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,b,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s);g=St["b"].Layout.Multiple.MultipleHelperFlexible.getMultipleCategorySizeSum(e,i,s);m=g<=a&&p*u<=r;if(m){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!m)},calculateFlexibleStructureCase08:function(e,t,i,n,a,r,o,l,s,d){var c,u,p,g,m;var h=e[e.activeElementType+"MultipleCategoryCount"];var f=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(f===null){c=Math.max(1,h-n.categoryCount);u=Math.ceil(n.cellCount/c)}else if(h===null){u=Math.max(1,f);c=Math.ceil(n.cellCount/u)}else{c=Math.max(1,h-n.categoryCount);u=Math.max(1,f);if(c*u<n.cellCount){St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,0,0);return}}p=o.mm2pix(e.fontSize*b);g=o.mm2pix(e.fontSize*v);m=p*c<=a&&g*u<=r;console.log(e.fontSize,c,u,e.cells,g,r,p,a);if(m){console.info("optimal state reached")}}while(e.fontSize>l.minFontSize&&!m);var T=s?p:g;St["b"].Layout.Multiple.MultipleHelperFlexible.updateMultipleRowsColumns(e,s,u,c);St["b"].Layout.Multiple.MultipleHelperFlexible.updateCategoryCellSizes(e,t,i,n,T,s,d);St["b"].Layout.Multiple.MultipleHelperFlexible.layoutMultipleCells(e,t,i,c,u,r,n,s)},layoutMultipleCells:function(e,t,i,n,a,r,o,l){var s=o.cellCount===t.length;e.cells=new Array(n*a);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=St["b"].Layout.Multiple.MultipleHelperFlexible.createMultipleCellsList(e,i,l);var p=e.cells.length;var g;var m=Date.now();do{p--;p=St["b"].Layout.Multiple.MultipleHelperFlexible.assignFreeMultipleCells(e,u,p,r,l);g=St["b"].Layout.Multiple.MultipleHelperFlexible.optimizeMultipleCellsOrder(e,u,l);var h=Date.now();if(g&&h-m>=2e3){console.warn("multipleHelperFlexible.layoutMultipleCells: endless loop while distributing free cells and trying to layout the result");p=St["b"].Layout.Multiple.MultipleHelperFlexible.assignFreeMultipleCells(e,u,1,r,l);g=St["b"].Layout.Multiple.MultipleHelperFlexible.optimizeMultipleCellsOrder(e,u,l)}}while(p>=0&&g);if(l){St["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForTime(e)}else{St["b"].Layout.Multiple.MultipleHelperCommon.disperseFreeCellsForStructure(e)}}else{St["b"].Layout.Multiple.MultipleHelperFlexible.fillMultipleStructure(e,i,l);if(l){St["b"].Layout.Multiple.MultipleHelperFlexible.adjustMultipleCellsForTime(e,r)}else{St["b"].Layout.Multiple.MultipleHelperFlexible.adjustMultipleCellsForStructure(e,r)}}St["b"].Layout.Multiple.MultipleHelperFlexible.addTotalsToLayout(e,t,i,o,l)},addTotalsToLayout:function(a,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 n=St["b"].Layout.Multiple.MultipleHelperFlexible.getAdditionalValueSize(a,i,t.path,o);return{path:t.path,grid:i.grid,gridData:i.gridData,state:2,span:e,valueSize:i.valueSize,fixedValueSize:n,categorySize:i.categorySize,caseIdx:i.caseIdx,titleDim:i.titleDim,isTotal:true}}}if(!o&&e.categoryCount>0){var i=createTotalCell(a.columns);if(a.dimensions[0].totalsPosition==="CategoryStart"){for(var n=0;n<a.cells.length;n++){if(a.cells[n].state===1&&a.cells[n].ownerIndex!=undefined){a.cells[n].ownerIndex+=a.columns}}for(var n=1;n<a.columns;n++){a.cells.unshift({path:null,state:1,span:1,ownerIndex:0})}a.cells.unshift(i)}else{var l=a.cells.length;a.cells.push(i);for(var n=1;n<a.columns;n++){a.cells.push({path:null,state:1,span:1,ownerIndex:l})}}a.rows++}else if(o&&e.categoryCount>0){var i=createTotalCell(a.rows);var s;if(a.dimensions[0].totalsPosition==="CategoryStart"){s=0}else{s=a.columns}for(var n=a.rows-1;n>=1;n--){a.cells.splice(n*a.columns+s,0,{path:null,state:1,span:1,ownerIndex:s})}a.cells.splice(s,0,i);a.columns++;for(var d=0;d<a.cells.length;d++){var i=a.cells[d];if(i.state===2){for(var c=1;c<i.span;c++){a.cells[d+c*a.columns].ownerIndex=d}}}}},updateMultipleRowsColumns:function(e,t,i,n){if(t){e.rows=i;e.columns=n}else{e.columns=i;e.rows=n}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Multiple=St["b"].Layout.Multiple||{};St["b"].Layout.Multiple.MultipleHelperSemiFixed={calculateSemiFixedStructure:function(e,t,i){},getTotalsSettings:function(r,e,t){var o=0;var l=r.dimensions.length;var s=St["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 n=e[i];if(n.isSum){var a=r.dimensions[t-1];if(n.lvl===t){if(a.totalsPosition==="None"){}else if(a.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){}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Multiple=St["b"].Layout.Multiple||{};St["b"].Layout.Multiple.MultipleLayout=function(e){var P=St["b"].Utils.Calculator.Converter;var t=St["b"].DataObjects.RuntimeDO;var ne=true;var o=t.getParameterParsed("FONT_SIZE_CHART");var l=P.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_TOP_BORDER_SIZE"));var s=P.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_RIGHT_BORDER_SIZE"));var d=P.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_BOTTOM_BORDER_SIZE"));var c=P.mm2pix(o*t.getParameterParsed("MMPT_MULTIPLE_CASE_LEFT_BORDER_SIZE"));var ae=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 n={width:0,height:0};this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){return a}var r=e[0].getController().getRootModel();var o=n.getModel();var l=o.extendedModel;var s=l.activeElementType==="time";var d=!s&&l.activeElementType==="structure";if(ne){ne=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 St["b"].Utils.Constants.BuildUp.PREINIT:{var p=0;var g=0;var m=e[e.length-1];m.setDimension({height:i.height,width:i.width});m.setPosition({x:0,y:0});if(e.length===1){}else{var h=o.layoutData[1];var f=o.layoutData[0];var v=collectBorders(l);var b=collectRowColumnData(l,se,v);var T=b.rowsData;var E=b.colsData;var x=b.rowsBorderOverlapArea;var C=b.colsBorderOverlapArea;var y=0;var M=0,S=0;for(var O=0;O<l.cells.length;O++){var L=l.cells[O];var A=v[O];var _=O%h;var I=Math.floor(O/h);var D=T[I];var R=E[_];if(_===0){M=0}if(L.path!==null&&L.caseIdx!==null){var N=R.size;var P=D.size;if(d){var w=1;while(_+w<h&&O+w<l.cells.length&&L.span>w){N+=E[_+w].size-C[_+w-1];w++}}else if(s){var w=1;while(I+w<f&&O+w*h<l.cells.length&&L.span>w){P+=T[I+w].size-x[I+w-1];w++}}else{}var U=v[O-h],F=v[O+1],B=v[O+h],H=v[O-1],k=I===0||U.caseIdx>L.caseIdx?A.top:Math.max(0,A.top-U.bottom),G=_===h-1||F.caseIdx>=L.caseIdx?A.right:Math.max(0,A.right-F.left),V=I===f-1||B.caseIdx>=L.caseIdx?A.bottom:Math.max(0,A.bottom-B.top),$=_===0||H.caseIdx>L.caseIdx?A.left:Math.max(0,A.left-H.right);var W=k<A.top&&I>0?x[I-1]:0;var z=$<A.left&&_>0?C[_-1]:0;var j=N-z;var X=P-W;var Y=M+z;var K=S+W;var Z=e[y++];Z.setDimension({height:X,width:j});Z.setPosition({x:Y,y:K});var Q=l.cases[A.caseIdx].borders;var q=Z.getModel().border;q.top.width=k;q.left.width=$;q.bottom.width=V;q.right.width=G;q.top.color=Q.top.notationColor?ae: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}M+=R.size-C[_];if(_===h-1){S+=D.size-x[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=St["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];a[ie.getId()]=ie}return a};function collectBorders(e){var t=new Array(e.cells.length);for(var i=0;i<e.cells.length;i++){var n=e.cells[i];var a={top:0,right:0,bottom:0,left:0,caseIdx:n.caseIdx};if(n.path!==null&&n.caseIdx!==null){var r=e.cases[n.caseIdx].borders;a.top=r.top.width===null?l:P.mm2pix(o*r.top.width);a.right=r.right.width===null?s:P.mm2pix(o*r.right.width);a.bottom=r.bottom.width===null?d:P.mm2pix(o*r.bottom.width);a.left=r.left.width===null?c:P.mm2pix(o*r.left.width)}t[i]=a}return t}function collectRowColumnData(l,e,t){var i=l.columns;var n=l.rows;var a=l.activeElementType==="time";var r=-1,o=-1;var s=new Array(n);var d=new Array(i);var c=combineBorders(l,t,a);var u=c.rowBorders;var p=c.colBorders;var g;var m=false,h=false;var f=u[0].topMax+u[0].botMax;var v=p[0].leftMax+p[0].rightMax;var b=St["b"].Utils.GlobalFunctions.createArray(n-1,999);var T=St["b"].Utils.GlobalFunctions.createArray(i-1,999);for(var E=1;E<n;E++){b[E-1]=Math.min(b[E-1],u[E-1].botMin,u[E].topMin);f+=u[E].topMax+u[E].botMax-b[E-1]}for(var E=1;E<i;E++){T[E-1]=Math.min(T[E-1],p[E-1].rightMin,p[E].leftMin);v+=p[E].leftMax+p[E].rightMax-T[E-1]}if(l[l.activeElementType+"CellCategorySize"]!==null){if(a){r=Math.floor(P.mm2pix(l.fontSize*l.timeCellCategorySize))}else{o=Math.floor(P.mm2pix(l.fontSize*l[l.activeElementType+"CellCategorySize"]))}}else if(l.expandCategories){h=a;m=!a}if(l[l.activeElementType+"CellValueSize"]!==null){if(a){o=Math.floor(P.mm2pix(l.fontSize*l.timeCellValueSize))}else{r=Math.floor(P.mm2pix(l.fontSize*l[l.activeElementType+"CellValueSize"]))}}else{if(l.optimizeCellStructureSize){g=collectValueSizes(l,a,e.height-f,e.width-v)}else{var x,C;if(a){x=n;C=Math.floor((e.height-f)/n)}else{x=i;C=Math.floor((e.width-v)/i)}g=new Array(x);for(var E=0;E<x;E++){g[E]=(E+1)*C}}}for(var E=0;E<l.cells.length;E++){var y=l.cells[E];if(y.path===null){continue}var M=E%i;var S=Math.floor(E/i);var O=u[S];var L=p[M];if(s[S]===undefined){s[S]={size:0,borderTopMax:O.topMax,borderTopMin:O.topMin,borderBotMax:O.botMax,borderBotMin:O.botMin}}var A=s[S];if(o===-1){if(a){var _=g[S]-(S===0?0:g[S-1]);A.size=_+O.topMax+O.botMax}else{A.size=Math.max(A.size,y.categorySize)}}else{A.size=o}if(d[M]===undefined){d[M]={size:0,borderLeftMax:L.leftMax,borderLeftMin:L.leftMin,borderRightMax:L.rightMax,borderRightMin:L.rightMin}}var I=d[M];if(r===-1){if(a){I.size=Math.max(I.size,y.categorySize)}else{var _=g[M]-(M===0?0:g[M-1]);I.size=_+L.leftMax+L.rightMax}}else{I.size=r}}var D=0,R=0;for(var E=0;E<n;E++){if(s[E]===undefined){var O=u[E];s[E]={size:0,borderTopMax:O.topMax,borderTopMin:O.topMin,borderBotMax:O.botMax,borderBotMin:O.botMin}}D+=s[E].size-(E===0?0:b[E-1])}for(var E=0;E<i;E++){if(d[E]===undefined){var L=p[E];d[E]={size:0,borderLeftMax:L.leftMax,borderLeftMin:L.leftMin,borderRightMax:L.rightMax,borderRightMin:L.rightMin}}R+=d[E].size-(E===0?0:T[E-1])}function getCountForExpand(e,t,i){var n=e;for(var a=0;a<e;a++){var r=true;for(var o=0;o<t;o++){if(l.cells[i(a,o)].path!==null){r=false;break}}if(r){n--}}return n}function expandSizes(e,t,i,n){var a=t-i;if(a<=0){return}var r=n-1;var o=Math.floor(a/n);for(var l=0;l<r;l++){e[l].size+=o}e[r].size+=a-o*r}if(m){var N=getCountForExpand(n,i,function(e,t){return e*i+t});expandSizes(s,e.height,D,N)}if(h){var N=getCountForExpand(i,n,function(e,t){return t*i+e});expandSizes(d,e.width,R,N)}return{rowsData:s,colsData:d,rowsBorderOverlapArea:b,colsBorderOverlapArea:T}}function combineBorders(e,t,i){var n=e.columns;var a=e.rows;var r=new Array(a);var o=new Array(n);for(var l=0;l<e.cells.length;l++){var s=l%n;var d=Math.floor(l/n);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 m=d+c.span-1;if(r[m]===undefined){r[m]={topMax:0,topMin:999,botMax:0,botMin:999}}p=r[m]}else{var h=s+c.span-1;if(o[h]===undefined){o[h]={leftMax:0,leftMin:999,rightMax:0,rightMin:999}}g=o[h]}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<a;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<n;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,n){var a=e.rows;var r=e.columns;var o,l,s;if(t){o=a;l=r;s=i}else{o=r;l=a;s=n}var d=St["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 m=0;var h=0;for(var f=0;f<o;f++){var v=e.cells[p(g,f,r)];if(v.path!==null){m+=v.fixedValueSize;h+=v.valueSize}}c=Math.max(c,h);var b=h===0?0:(s-m)/h;if(u===null||b<u){u=b}}for(var T=0;T<5;T++){var E=tryLayoutCells(e,d,s,u,r,o,l,p);if(E<=0){break}var x=u*c;u=c===0?0:(x-E/2)/c}var C=[];for(var f=0;f<o;f++){for(var g=0;g<l;g++){var y=p(g,f,r);var v=e.cells[y];if(v.path!==null&&v.span!==1){C.push({idx:y,catLine:g,line:f,span:v.span})}}}C.sort(function(e,t){return t.span-e.span});for(var T=0;T<C.length;T++){var M=C[T];var S=getLinesToOptimize(e,M.idx,M.line,M.catLine,a,r,p,t,u);var O=0,L=0;for(var A=0;A<S.length;A++){var _=S[A];var I=d[_.end]-(_.start===0?0:d[_.start-1]);O+=I-_.value;L+=_.end-_.start+1}var D=O/L;for(var A=0;A<S.length;A++){var _=S[A];var R=_.end-_.start+1;var N=_.start===0?0:d[_.start-1];var P=A===S.length-1?O:Math.round(D*R);O-=P;P+=_.value;var w=d[_.end];d[_.end]=N+P;for(var U=_.end-1;U>=_.start;U--){if(d[U]===w){w=d[U];d[U]=d[U+1]}}}}return d}function tryLayoutCells(e,t,i,n,a,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,a)];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 m=l(p,c,a);var g=e.cells[m];if(g.path===null||g.grid[0]===null){continue}var h=g.grid[0].extendedModel.axisLinking?u:g.fixedValueSize;var f=h+2+Math.round(g.valueSize*n);var v=c+g.span-1;s=Math.min(s,t[v]-f)}if(c>0){t[c-1]=s}d=s}return Math.max(0,-s)}function getLinesToOptimize(e,t,i,n,a,r,o,l,s){var d=e.cells[t];var c=i+d.span-1;var u=[];var p=a,g=1;if(l){p=r;g=r}for(var m=i;m<=c;m++){var h=false;var f=m,v=m;var b=[];for(var T=0;T<p;T++){if(T===n){continue}var E=o(T,m,r);var x=e.cells[E];if(x.state===0){continue}var C=x,y=m;if(C.state===1){C=e.cells[x.ownerIndex];y-=(E-x.ownerIndex)/g}var M=y+C.span-1;if(y<=i&&M>=c){continue}else if(y<i&&M<c){h=true;m=M;break}else if(y>i&&M>c){h=true;m=c;break}else if(y<f){h=true;m=M;break}v=Math.max(v,M);b.push(T)}if(!h&&b.length>0){u.push({start:f,end:v,catLines:b});m=v}}if(u.length<2){u=[]}for(var S=0;S<u.length;S++){var O=u[S];var L=0;for(var A=0;A<O.catLines.length;A++){var T=O.catLines[A];var _=0;for(var m=O.start;m<=O.end;m++){var x=e.cells[o(T,m,r)];if(x.path!==null){_+=x.fixedValueSize+Math.round(x.valueSize*s);m+=x.span-1}}L=Math.max(L,_)}O.value=L}return u}function createValueLinking(e,t,i,n,a){var r=e[e.activeElementType+"CellValueCount"];if(!e.valueLinking||r<2||!n&&!a){return}var o=i.linkGroupsMultiple;var l=e[e.activeElementType+"CellCategoryCount"];var s=n?"Time":"Structure";var d=n?l:r;var c=n?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 m={type:"value",linkedType:s,linkedCharts:[]};for(var h=0;h<r;h++){var f=p.children[c(h,g)];m.linkedCharts.push(i.extensionHash+"."+f.id)}o.push(m)}}}function createLegendLinking(e,t,i,n,a){if(!n&&!a){return}var r=i.linkGroupsMultiple;var o=e[e.activeElementType+"CellValueCount"];var l=e[e.activeElementType+"CellCategoryCount"];var s,d,c,u,p,g,m,h;var f=0,v;if(n){s="Time";d="Left";c=l;u=function(e,t){return e*c+t};p=e.columns;g="column";h={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";h={Start:"Top",Mid:"Mid",End:"Bottom"}}var m=new Array(l*p);var b=new Array(l*p);for(var T=0;T<t.length;T++){var E=t[T];if(E.instanceOf==="BackGroundModel"){continue}var x=E[g];do{v=e.cells[f++]}while(v.path===null);for(var C=0;C<l;C++){var y=x*l+C;if(m[y]===undefined){m[y]={type:"legend",linkedType:s,legendOrientation:d,linkedCharts:[]};b[y]={caseIdx:9999,gridIdx:9999,chartIdx:9999}}for(var M=0;M<o;M++){var S=u(M,C);var O=E.children[S];m[y].linkedCharts.push(i.extensionHash+"."+O.id);var L=b[y];if(v.caseIdx<L.caseIdx||v.caseIdx===L.caseIdx&&S<L.gridIdx||v.caseIdx===L.caseIdx&&S===L.gridIdx&&v.gridData[S].chartIdx<L.chartIdx){m[y].legendOrientation=h[O.extendedModel.axisAlignmentCategory];L.caseIdx=v.caseIdx;L.gridIdx=S;L.chartIdx=v.gridData[S].chartIdx}}}}for(var T=0;T<m.length;T++){if(m[T]!==undefined){r.push(m[T])}}}var B=.35;function createAxisLinking(e,t,i,n){if(!i&&!n){return}var a=e.extendedModel;var r=e.children;var o,l,s;if(i){o="Time";l=se.height;s=Math.round(B*se.height/a.rows)}else{o="Structure";l=se.width;s=Math.round(B*se.width/a.columns)}var d=initAxesClusters(a,r,i);for(var c=0;c<d.length;c++){var u=d[c].group;var p=d[c].clusters;var g=[];var m=20;while(m>0&&doClustersDiffer(p,g)){g=p;p=clusterizeAxesAnew(u,p,l,s);d[c].clusters=p;m--}for(var h=0;h<p.length;h++){var f=p[h];if(f.chartIds.length>=2){var v=new Array(f.chartIds.length);for(var b=0;b<f.chartIds.length;b++){v[b]=t.extensionHash+"."+f.chartIds[b]}t.linkGroupsMultiple.push({type:"axis",linkedType:o,axisOrientation:d[c].alignment,linkedCharts:v})}}}}function setAxesPositions(e,t,i,n){var a=t.children;var r=i.gridData;var o,l,s,d,c;if(n){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 m=0;m<s;m++){var h=c(m,u);var f=r[h];if(f&&a[h].extendedModel){var v=Math.round((f.maxValue-f.minValue)/i.valueSize*p);if(a[h].extendedModel.axisLinking){if(n){var b=Math.round(f.maxValue/(f.maxValue-f.minValue)*v);f.axisPos=g+f.valueLabelsPosSize+b}else{var b=Math.round(-f.minValue/(f.maxValue-f.minValue)*v);f.axisPos=g+f.categoryLabelsSize+f.valueLabelsNegSize+b}}g+=v+f.categoryLabelsSize+f.valueLabelsPosSize+f.valueLabelsNegSize}}}}else{var g=t.position[l]+i.titleDim.value;var T=t.dimension[o]-i.titleDim.value;var E=e[e.activeElementType+"CellGridSizes"][n?"rows":"columns"];for(var m=0;m<s;m++){var x=Math.round(E[m]*T);for(var u=0;u<d;u++){var h=c(m,u);var f=r[h];if(f&&a[h].extendedModel&&a[h].extendedModel.axisLinking){var v=x-(f.categoryLabelsSize+f.valueLabelsPosSize+f.valueLabelsNegSize);if(n){var C=f.maxValue/(f.maxValue-f.minValue);f.axisPos=g+f.valueLabelsPosSize+Math.round(C*v)}else{var C=-f.minValue/(f.maxValue-f.minValue);f.axisPos=g+f.categoryLabelsSize+f.valueLabelsNegSize+Math.round(C*v)}}}g+=x}}}function initAxesClusters(i,e,t){var n,a,r,o,l,s,d,c;if(t){n=i.timeCellValueCount;a=i.timeCellCategoryCount;r=function(e,t){return e*a+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{n=i.structureCellValueCount;a=i.structureCellCategoryCount;r=function(e,t){return t*n+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<n;p++){var g=[];var m,h=9999,f=9999;for(var v=0;v<o;v++){for(var b=0;b<l;b++){var T=s(v,b);var E=i.cells[T];if(E.path===null){continue}var x=e[E.childIndex];var C=d(x,E);setAxesPositions(i,x,E,t);for(var y=0;y<a;y++){var M=r(p,y);var S=x.children[M];if(S.extendedModel&&S.extendedModel.axisLinking){var O=e[E.childIndex][c];g.push({axisPos:E.gridData[M].axisPos,cellIdx:T,chartIdx:M,chartId:S.id,cellValueSize:C,rowCol1:O,rowCol2:O+E.span-1});if(E.caseIdx<h||E.caseIdx===h&&E.gridData[M].chartIdx<f){m=S.extendedModel.axisAlignmentElement}}}}}g.sort(function(e,t){return e.axisPos-t.axisPos});var L=[];for(var y=0;y<g.length;y++){var A=g[y];var _=A.axisPos,I=A.axisPos,D=[A.chartId];var R=Math.round(B*A.cellValueSize);var N=_+R;var P=A.rowCol1;var w=A.rowCol2;var U=y+1,F=g[U];while(U<g.length&&F.axisPos<=N&&areClustersAligned(P,w,F.rowCol1,F.rowCol2)){I=F.axisPos;D.push(F.chartId);P=Math.max(P,F.rowCol1);w=Math.min(w,F.rowCol2);y++;F=g[++U]}_=Math.round((_+I)/2);L.push({position:_,chartIds:D,rowColStart:P,rowColEnd:w})}u.push({group:g,clusters:L,alignment:m})}return u}function areClustersAligned(e,t,i,n){return e<=i&&t>=i||e>=i&&e<=n}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,n){var a=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(B*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(a[r]===undefined){a[r]={position:0,posCount:0,minPos:l.axisPos,maxPos:l.axisPos,chartIds:[],rowColStart:l.rowCol1,rowColEnd:l.rowCol2}}var u=a[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<a.length;c++){if(a[c]){a[c].position=Math.round((a[c].minPos+a[c].maxPos)/2)}}for(var o=0;o<a.length;o++){if(a[o]===undefined){a.splice(o,1);o--;continue}var u=a[o];for(var c=o+1;c<a.length;c++){if(areClustersMergeable(u,a[c],n)){var g=a[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);a.splice(c,1);c--}}}return a}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 n}};St["b"].Layout.Iterator=St["b"].Layout.Iterator||{};St["b"].Layout.Iterator.Iterator=function(){var _=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(){_=St["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=St["b"].DataObjects.DocumentDO.getScalingGroups();for(var t in e){if(!e[t].auto){var i=St["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 n=0;n<r.length;n++){var a=r[n];if(i[a]!==undefined){D.push(e);break}}}function buildAllCharts(){function buildAllChartsRecursive(e,t){var i=e.getChildPanels();if(i!==undefined){for(var n=0;n<i.length;n++){var a=i[n];var r=a.getModel();if(r.extendedModel!==undefined&&r.extendedModel!==null&&(r.extendedModel.instanceOf==="TimeChartModel"||r.extendedModel.instanceOf==="ChartModel"||r.extendedModel.instanceOf==="TableModel")){var o=new St["b"].Layout.Iterator.OptimizeChartNode;var l=t.split(".")[0];o.id=l+"."+a.getId();o.path=t+"."+a.getId();o.chart=r;o.panel=a;o.parent=e.getModel();J[l+"."+a.getId()]=o;I[l+"."+a.getId()]=r;checkManualFactors(l+"."+a.getId(),o)}if(r.instanceOf==="ContainerModel"&&(!r.extendedModel||r.extendedModel.instanceOf==="ContainerGridModel"||r.extendedModel.instanceOf==="MultipleContainerModel")){buildAllChartsRecursive(a,t+"."+a.getId())}}}}J={};I={};var e=_.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t].getController().getRootPanel();var n=e[t].getId()+"."+i.getModel().id;buildAllChartsRecursive(i,n)}}function buildDependencies(e){function doChartsIntersect(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}var t=_.getAllExtensions();for(var i=0;i<t.length;i++){var n=t[i].getController().getRootModel();var a=e?n.linkGroupsMultiple:n.linkGroups;if(!a){continue}var r=new N(a);var o=null;while(o=r.next()){var l=o.linkedCharts;var s=[];var d=null;var c,u,p;var g,m,h;var f=false;var v=[];for(var b=0;b<l.length;b++){var T=J[l[b]];if(!T||!T.chart.extendedModel){continue}var E=St["b"].DataObjects.ContextRepo.getContextByCid(T.chart.extendedModel.contextId);if(D.indexOf(l[b])===-1&&E!==null&&E.dataModel&&E.dataModel.baseNode.nodes.length&&(o.linkedType==="Structure"&&T.chart.extendedModel.instanceOf==="ChartModel"||o.linkedType==="Time"&&T.chart.extendedModel.instanceOf==="TimeChartModel")){var x=[T.id];var C=calculateContainerPosByPath(T.path);if(o.linkedType==="Time"){c=C.y;u=c+T.chart.dimension.height;p=C.x}else{c=C.x;u=c+T.chart.dimension.width;p=C.y}for(var y=0;y<l.length;y++){var M=J[l[y]];if(M){if(d===null){d=M.parent.id}if(M.id===T.id){continue}var S=St["b"].DataObjects.ContextRepo.getContextByCid(M.chart.extendedModel.contextId);if(M&&M.chart.extendedModel&&D.indexOf(l[y])===-1&&S!==null&&S.dataModel&&S.dataModel.baseNode.nodes.length&&(o.linkedType==="Structure"&&M.chart.extendedModel.instanceOf==="ChartModel"||o.linkedType==="Time"&&M.chart.extendedModel.instanceOf==="TimeChartModel")){var O=calculateContainerPosByPath(M.path);if(o.linkedType==="Time"){g=O.y;m=g+M.chart.dimension.height;h=O.x}else{g=O.x;m=g+M.chart.dimension.width;h=O.y}if(o.type!=="axis"&&d===M.parent.id&&p===h){f=true}else if(o.type==="axis"&&doChartsIntersect(c,u,g,m)){f=true}}if(f&&s.indexOf(l[y])===-1){x.push(M.id);c=Math.max(c,g);u=Math.min(u,m);s.push(l[y]);f=false}}}v.push(x)}}var L=1;for(var b=0;b<v.length;b++){if(L<v[b].length){L=v[b].length;s=v[b]}}if(s.length>1){for(var b=0;b<s.length;b++){var T=s[b];var A=s.slice(0);A.splice(b,1);if(q[T]===undefined){q[T]=new St["b"].Layout.Iterator.OptimizeDependency;q[T].chart=T}if(o.type==="axis"){q[T].axisDep=A}else if(o.type==="value"){q[T].valueDep=A}delete I[T]}}}}}function createVirtualGridCells(){for(var e in q){var t=J[e];var i=t.parent;var n=i.extendedModel;if(n.virtualGridCells==null){n.virtualGridCells=new Array(i.children.length);for(var a=0;a<i.children.length;a++){n.virtualGridCells[a]={x:i.children[a].position.x,y:i.children[a].position.y,width:i.children[a].dimension.width,height:i.children[a].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 n=i.axisDep;var a=i.axisDep.length>0;if(a){a=optimizeAxes(e)}if(a===false&&p>0){for(var r=0;r<n.length;r++){u.push(n[r])}}if(a){var o=q[e].axisPosition;var l=n.slice(0);l.push(e);o+=optimizeAxesGlobal(l,undefined);for(var r=0;r<n.length;r++){q[n[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 n=true;var a=q[e].axisDep;var r=a.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,m=0;for(var h=0;h<r.length;h++){var f=J[r[h]];o[h]=f.chart;l[h]=f.panel.getLayout();s[h]=calculateContainerPosByPath(f.path);d[h]=l[h].calcChartSpace(o[h]);var v=(t?s[h].y:s[h].x)+l[h].getAxisZeroPosition();c[h]=v+Math.round(d[h]*o[h].extendedModel.axisFactor);u[h]=v+Math.round(d[h]*l[h].limitAxisFactor(0,f.chart));p[h]=v+Math.round(d[h]*l[h].limitAxisFactor(1,f.chart));g+=c[h]}g=Math.round(g/o.length);var b=false,T=false;for(var h=0;h<u.length;h++){if(g<=u[h]){g=u[h];T=true}if(g>=p[h]){g=p[h];b=true}}if(b&&T){return false}for(var h=0;h<o.length;h++){var E=o[h];var x=c[h]-g;if(x===0){m+=c[h];continue}n=false;var C=l[h].calcFreeSpace(E);if(t){C=x>0?C.pos:C.neg}else{C=x>0?C.neg:C.pos}var y;if(C===0){y=.1}else if(C>=Math.abs(x)){y=1}else{y=C/Math.abs(x)}var M=y*x;var S=R;var O=Math.abs(M*S);var L=Math.round(.33*d[h]);if(O<1){S=1/Math.abs(M)}else if(O>L){S=L/Math.abs(M)}E.extendedModel.axisFactor-=Math.round(M*S)/d[h];E.extendedModel.axisFactor=l[h].limitAxisFactor(E.extendedModel.axisFactor,E);var v=(t?s[h].y:s[h].x)+l[h].getAxisZeroPosition();var A=v+Math.round(d[h]*E.extendedModel.axisFactor);m+=A;var _=g-A;if(_>1||_<-1){i=false}}m=Math.round(m/o.length);for(var h=0;h<r.length;h++){q[r[h]].axisPosition=m}if(!n){var I=[];for(var h=0;h<o.length;h++){for(var D in o[h].extendedModel.zoom){if(I.indexOf(D)===-1){I.push(D)}}}for(var h=0;h<I.length;h++){recalcGlobalZoomByScalingGroup(I[h])}}return i}function optimizeAxesGlobal(e,t){var i=2147483647;var n=2147483647;var a=[];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);n=Math.min(n,d.neg)}var c=Math.round((i-n)/2);if(t==="Start"){c=-n}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 m=Math.round(p*l.extendedModel.axisFactor)+g;var h=m+c;l.extendedModel.axisFactor=(h-g)/p;for(var f in l.extendedModel.zoom){if(a.indexOf(f)===-1){a.push(f)}}}for(var o=0;o<a.length;o++){recalcGlobalZoomByScalingGroup(a[o])}return c}function optimizeValue(e,t){var i=false;var n=J[e].chart;var a=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=n.extendedModel.instanceOf==="TimeChartModel";var u=c?s.y:s.x;var p=c?d.y:d.x;var g=r.calcChartSpace(n);var m=o.calcChartSpace(a);var h=u<p;var f=axisPositionsOptimized(e,2);var v=axisPositionsOptimized(t,2);var b=u+r.getAxisZeroPosition()+Math.round(n.extendedModel.axisFactor*g);var T=p+o.getAxisZeroPosition()+Math.round(a.extendedModel.axisFactor*m);var E=b-q[e].axisPosition;var x=T-q[t].axisPosition;var C=o.calcFreeSpace(a);var y=r.calcFreeSpace(n);var M=f?calcLeastFreeSpaceForAxisDependency(e):{pos:0,neg:0};var S=v?calcLeastFreeSpaceForAxisDependency(t):{pos:0,neg:0};var O,L;if(c){if(h){O=calculateAvailableSpaceTop(f,y,E,M.pos,q[e].axisDep.length===0);L=calculateAvailableSpaceBottom(v,C,x,S.neg,q[t].axisDep.length===0)}else{O=calculateAvailableSpaceBottom(f,y,E,M.neg,q[e].axisDep.length===0);L=calculateAvailableSpaceTop(v,C,x,S.pos,q[t].axisDep.length===0)}}else{if(h){O=calculateAvailableSpaceBottom(f,y,E,M.neg,q[e].axisDep.length===0);L=calculateAvailableSpaceTop(v,C,x,S.pos,q[t].axisDep.length===0)}else{O=calculateAvailableSpaceTop(f,y,E,M.pos,q[e].axisDep.length===0);L=calculateAvailableSpaceBottom(v,C,x,S.neg,q[t].axisDep.length===0)}}var A=J[e].parent;var _=c?A.extendedModel.gridRows.length:A.extendedModel.gridColumns.length;var I=c?A.dimension.height:A.dimension.width;var D=1/_;if(I!==0){D=(c?n.dimension.height:n.dimension.width)/I}var R=J[t].parent;var N=c?R.extendedModel.gridRows.length:R.extendedModel.gridColumns.length;var P=c?R.dimension.height:R.dimension.width;var w=1/N;if(P!==0){w=(c?a.dimension.height:a.dimension.width)/P}var U=O+L;var F=D/(D+w);var B=Math.round(F*U);var H=B-O;if(H<0&&Math.abs(H)>O){H=-O}else if(H>0&&H>L){H=L}if(Math.abs(H)<=1){i=true}else{var k=Math.round(ee*H);var G=J[e].parent;var V=G.extendedModel;var $=collectInBetweenCells(G,c,n,a);var W=$.cells;for(var z=0;z<W.length;z++){var j=W[z].cell;var X=axisPositionsOptimized(l+"."+j.id,2);if(X){k=0;break}}if(k===0){return i}if(c){resizeContainersTime(e,t,V,k,$)}else{resizeContainersStructure(e,t,V,k,$)}var Y=[];for(var K in n.extendedModel.zoom){Y.push(K)}for(var K in a.extendedModel.zoom){if(Y.indexOf(K)===-1){Y.push(K)}}for(var z=0;z<Y.length;z++){recalcGlobalZoomByScalingGroup(Y[z])}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,n,a){var r=J[e].chart;var o=J[t].chart;var l=J[e].panel.getLayout();var s=J[t].panel.getLayout();var d=a.cells;var c=a.iterateIndex;var u=a.referenceIndex;var p=calculateContainerPosByPath(J[e].path).y;var g=calculateContainerPosByPath(J[t].path).y;var m=l.calcChartSpace(r);var h=s.calcChartSpace(o);var f=p+l.getAxisZeroPosition()+Math.round(r.extendedModel.axisFactor*m);var v=g+s.getAxisZeroPosition()+Math.round(o.extendedModel.axisFactor*h);if(p<g){i.virtualGridCells[u].y+=n;o.position.y+=n;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].y+=n;d[b].cell.position.y+=n}}else{i.virtualGridCells[c].y-=n;r.position.y-=n;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].y-=n;d[b].cell.position.y-=n}}i.virtualGridCells[c].height+=n;i.virtualGridCells[u].height-=n;r.dimension.height+=n;o.dimension.height-=n;if(n>=0){resizeContainers(e,t,f,v)}else{resizeContainers(t,e,v,f)}}function resizeContainersStructure(e,t,i,n,a){var r=J[e].chart;var o=J[t].chart;var l=J[e].panel.getLayout();var s=J[t].panel.getLayout();var d=a.cells;var c=a.iterateIndex;var u=a.referenceIndex;var p=calculateContainerPosByPath(J[e].path).x;var g=calculateContainerPosByPath(J[t].path).x;var m=l.calcChartSpace(r);var h=s.calcChartSpace(o);var f=p+l.getAxisZeroPosition()+Math.round(r.extendedModel.axisFactor*m);var v=g+s.getAxisZeroPosition()+Math.round(o.extendedModel.axisFactor*h);if(p<g){i.virtualGridCells[u].x+=n;o.position.x+=n;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].x+=n;d[b].cell.position.x+=n}}else{i.virtualGridCells[c].x-=n;r.position.x-=n;for(var b=0;b<d.length;b++){i.virtualGridCells[d[b].index].x-=n;d[b].cell.position.x-=n}}i.virtualGridCells[c].width+=n;i.virtualGridCells[u].width-=n;r.dimension.width+=n;o.dimension.width-=n;if(n>=0){resizeContainers(e,t,f,v)}else{resizeContainers(t,e,v,f)}}function resizeContainers(e,t,i,n){var a=J[e].chart;var r=J[t].chart;var o=J[e].panel.getLayout();var l=J[t].panel.getLayout();var s=o.calcChartSpace(a);var d=l.calcChartSpace(r);var c=calculateContainerPosByPath(J[e].path);var u=calculateContainerPosByPath(J[t].path);var p=a.extendedModel.instanceOf==="TimeChartModel";if(q[t].axisDep.length>0){if(p){r.extendedModel.axisFactor=(n-(u.y+l.getAxisZeroPosition()))/d}else{r.extendedModel.axisFactor=(n-(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){a.extendedModel.axisFactor=(i-(c.y+o.getAxisZeroPosition()))/s}else{a.extendedModel.axisFactor=(i-(c.x+o.getAxisZeroPosition()))/s}}else{o.recalcLocalAxisFactor(a)}a.extendedModel.axisFactor=o.limitAxisFactor(a.extendedModel.axisFactor,a)}function calculateAvailableSpaceTop(e,t,i,n,a){var r;if(e){r=t.neg+n}else{if(i>10||a){r=t.pos+t.neg}else if(i<0){r=t.neg}else{r=t.neg}}return r}function calculateAvailableSpaceBottom(e,t,i,n,a){var r;if(e){r=t.pos+n}else{if(i<-10||a){r=t.pos+t.neg}else if(i>0){r=t.pos}else{r=t.pos}}return r}function collectInBetweenCells(e,t,i,n){var a,r;var o=[];if(t){var l=Math.min(i.row,n.row);var s=Math.max(i.row,n.row)}else{var l=Math.min(i.column,n.column);var s=Math.max(i.column,n.column)}for(var d=0;d<e.children.length;d++){var c=e.children[d];if(c.id===i.id){a=d}else if(c.id===n.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:a,referenceIndex:r}}function calcLeastFreeSpaceForAxisDependency(e){var t=J[e].chart;var i=J[e].panel;var n=i.getLayout();var a=n.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);a.neg=Math.min(a.neg,d.neg);a.pos=Math.min(a.pos,d.pos)}return a}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 n=[];var a=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(a){var g=u+s.getAxisZeroPosition()+Math.round(p*o.extendedModel.axisFactor);n.push(g)}else{var g=c+s.getAxisZeroPosition()+Math.round(p*o.extendedModel.axisFactor);n.push(g)}}var m=n[0];for(var r=1;r<n.length;r++){if(Math.abs(n[r]-m)>t){return false}}return true}function globalZoomToChart(){var e=_.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t];var n=i.getMode();if(n!==St["b"].Utils.Enums.EMode.NOPAINT){i.updateGlobalZoom(o)}}}function recalcGlobalZoomByScalingGroup(e){var t=null;for(var i in J){var n=J[i].chart;var a=J[i].panel.getLayout();var r;if(I[i]){r=I[i].extendedModel.zoom[e]}else{r=a.recalcLocalZoom(n,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=_.getAllExtensions();var i=e.split(".");var n=i[0];i.splice(0,1);for(var a=0;a<t.length;a++){var r=t[a];if(r.getId()===n){calculateContainerPosByPathRecursive([r.getController().getRootPanel()],i)}}function calculateContainerPosByPathRecursive(e,t){if(t.length===0){return}var i=t[0];t.splice(0,1);for(var n=0;n<e.length;n++){var a=e[n];if(a.getId()===i){var r=a.getPosition();o.x+=r.x;o.y+=r.y;calculateContainerPosByPathRecursive(a.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 n=q[i].axisDep;for(var a=0;a<n.length;a++){e.push(n[a])}}}for(var a=0;a<t.length;a++){orientateSingleAxisLink(t[a])}}function getOrientation(e,i,n){var a=null;function processLG(e){if(e.type==="axis"&&(e.linkedType==="Time"&&n.extendedModel&&n.extendedModel.instanceOf==="TimeChartModel"||e.linkedType==="Structure"&&n.extendedModel&&n.extendedModel.instanceOf==="ChartModel")){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===i){a=e.axisOrientation;break}}}}for(var t in e.linkGroups){processLG(e.linkGroups[t]);if(a!==null){break}}for(var r=0;a===null&&r<e.linkGroupsMultiple.length;r++){processLG(e.linkGroupsMultiple[r])}return a}function orientateSingleAxisLink(e){var t=[e];var i=q[e].axisDep;for(var n=0;n<i.length;n++){t.push(i[n])}var a=J[e].chart;var r=e.split(".")[0];var o=St["b"].DataObjects.DocumentDO.getExtension(r);var l=o.getController().getRootModel();var s=getOrientation(l,e,a);var d=true;var c=null;for(var n=0;n<t.length;n++){var u=J[t[n]];var p=u.panel.getLayout();var g=calculateContainerPosByPath(u.path);var m=p.calcChartSpace(u.chart);var h=Math.round(u.chart.extendedModel.axisFactor*m)+(a.extendedModel.instanceOf==="TimeChartModel"?g.y:g.x)+p.getAxisZeroPosition();if(c!==null&&c!==h){d=false;break}c=h}if(d){optimizeAxesGlobal(t,s)}}};var N=function(){function Iterator(t){var e=this;var i,n;var a=function(){i=0;if(t.constructor===Array){e.next=function(){return t[i++]||false}}else if(t.constructor===Object){n=Object.getOwnPropertyNames(t);e.next=function(){var e=n[i++];return e&&t[e]||false}}else{throw new Error("obj is neither an object nor an array")}};a();this.reset=function(){a()}}return Iterator}();St["b"].Layout.Iterator.OptimizeDependency=function(){this.valueDep=[];this.axisDep=[];this.axisPosition=0};St["b"].Layout.Iterator.OptimizeChartNode=function(){this.id="";this.chart=null;this.panel=null;this.path="";this.parent=null};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Overlay=St["b"].Layout.Overlay||{};St["b"].Layout.Overlay.OverlayLayout=function(e){var t="overlay";var g=e;this.getType=function(){return t};this.layoutPanels=function(e,t,i,n){var l={};var s=i.width;var d=i.height;var c=t.x;var u=t.y;n.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 n=u+t.y;var a=t.width;var r=t.height;var o=e.getPreferredSize();if(a===0){a=o.width;if(a===0){a=s-t.x}}if(r===0){r=o.height;if(r===0){r=d-t.x}}if(a===-1){a=s-t.x}if(r===-1){r=d-t.y}e.setDimension({width:a,height:r});e.setPosition({x:i,y:n})}l[e.getId()]=e;if(e.getId().indexOf("commentReference")===-1){p++}});var a=e[0];if(e.length===1&&a.getModel().instanceOf==="BackGroundModel"&&a.getController().getRootModel().buildUp===St["b"].Utils.Constants.BuildUp.DRAW){St["b"].Layout.Common.layoutClickBackground(a.getModel(),a.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 n=e.getDimension().width;var a=e.getDimension().height}else{var r=g[u];var t=r.x;var i=r.y;var n=r.width;var a=r.height}if(t>d){d=t}if(i>c){c=i}if(n>0){if(t+n>d){d=t+n}}if(a>0){if(i+a>c){c=i+a}}var o=e.getPreferredSize();if(n===0||a===0){if(n===0){var l=o.width;if(t+l>d){d=t+l}}if(a===0){var s=o.height;if(i+l>c){c=i+s}}}if(e.getId().indexOf("commentReference")===-1){u++}});return{width:d,height:c}}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Structure=St["b"].Layout.Structure||{};St["b"].Layout.Structure.CompareLayoutHelpers={layoutCompares:function(e,t,i,L,n,a){var A=St["b"].DataObjects.RuntimeDO;var r=St["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 _=St["b"].Utils.Constants.TypeValues.indicator;var d=L.getPosition().x;var I=L.getPosition().y;for(var c=0;c<e.length;c++){var u=e[c];var D=u.getModel();if(D.active===false){continue}var f=D.font;var p=D.compareFrom;var g=D.compareTo;if(p&&g){if(D.offset.y==-1){D.offset.y=0}var m=calculateCompareLayout(p,g,D.offset.y,d);D.fromPosition=m.fromPosition;D.toPosition=m.toPosition;u.setPosition(m.position);u.setDimension(m.dimension);D.preferredDimension=m.dimension;D.preferredPosition=m.position;var h=calculateCompareTextLayout(m);D.percent.position=h.percentPos;D.absolute.position=h.absolutePos;D.text.position=h.textPos;D.ellipseArray=h.ellipse;D.ellipseStrokeWidth=o;D.arrowType=m.arrowType;var v=D.compareStyle;if(v===_.NOTATION){v=A.getParameter("COMPARE_DEFAULT_TYPE")}if(v==="arrow"){D.headBaseSize=l;D.headWidth=A.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=A.getParameterParsed(e);return a&&e!==0?Math.max(1,r.mm2pix(n*e)):r.mm2pix(n*e)}function revertLegend(){if(D.absolute.originalLegend&&D.absolute.originalLegend===_.AUTO){D.absolute.legend=D.absolute.originalLegend;delete D.absolute.originalLegend}if(D.percent.originalLegend&&D.percent.originalLegend===_.AUTO){D.percent.legend=D.percent.originalLegend;delete D.percent.originalLegend}if(D.text.originalLegend&&D.text.originalLegend===_.AUTO){D.text.legend=D.text.originalLegend;delete D.text.originalLegend}}function calculateCompareLayout(e,t,i,n){var a=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(n)}else if(e.value>=0){if(D.compareFromStart==="end"){d=Math.round(e.position.x+e.dimension.width-a)}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(n)}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 m=true;i=i+u.y-p.y}else{var m=false;i=i+p.y-u.y}var h=c-d;var f;var v=D.font.fSize;var b=0;if(D.ellipse){var T=A.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");b=Math.round(D.maxWidth*T*2)}if(D.ellipse){if(h>b+2*v+1){f=0}else if(h>v){f=1}else{f=2}}else{var E=D.compareStyle;if(E===_.NOTATION){E=A.getParameter("COMPARE_DEFAULT_TYPE")}if(E===_.ARROW){if(h>D.maxWidth){f=0}else if(h>v){f=1}else{f=2}}else{if(h>D.maxWidth){f=0}else{f=1}}}if(l<s){l=s}if(D.compareLegend===_.START){var x=D.midMaxHeight;var C=D.topMaxHeight;var y=D.bottomMaxHeight;var M=x-l;if(M<0){M=0}var S=y+M/2;var O=I-l-S+D.offset.y;o={x:d,y:Math.round(O)}}else if(D.compareLegend===_.END){var x=D.midMaxHeight;var C=D.topMaxHeight;var y=D.bottomMaxHeight;var M=x-l;if(M<0){M=0}var S=C+M/2;var O=I+L.getDimension().height+S+D.offset.y;o={x:d,y:Math.round(O)}}else if(D.compareLegend===_.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===_.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(m){o={x:d,y:p.y+i}}else{o={x:d,y:Math.round(u.y+i)}}}return{dimension:{width:h,height:l},position:o,fromPosition:u,toPosition:p,arrowType:f}}function calculateCompareTextLayout(e){var t={x:0,y:0};var i={x:0,y:0};var n={x:0,y:0};var a;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!==_.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!==_.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!==_.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(A.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"))}if(D.percent.legend!==_.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!==_.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!==_.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!==_.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!==_.NONE&&D.text.text!==""){n.x=Math.round(r-D.text.dimension.width/2);if(e.dimension.width<D.text.dimension.width&&d+c+u===1&&D.text.legend!==_.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){n.x=e.position.x+e.dimension.width+g}else{n.x=e.position.x-g-D.text.dimension.width}}n.y=setTextPosition(o,l,d,c,u)}if(D.ellipse){a=setEllipse(d,c,u,l,r,o,i,n,t)}return{absolutePos:t,percentPos:i,textPos:n,ellipse:a}}function setEllipse(e,t,i,n,a,r,o,l,s){r=r+n/2;var d=a;var c={x:0,y:0,width:0,height:0};var u=D.topMaxHeight;var p=D.bottomMaxHeight;var g=0,m=0,h=0;if(n<D.midMaxHeight){g=(D.midMaxHeight-n)/2}if(e===3){m=u/2+n/2+2}else if(e===2){if(t===1){m=g+f.fSize/2+n/2}else{if(i===1){m=n/2;h=n}else{m=u/2+n/2}}}else if(e===1){if(t===1){if(i!==1){m=g+n/2}}else if(t===2){m=f.fSize/2}else if(t===0){if(i===1){h=n}else if(i===2){m=n/2*-1;h=n}else if(i===0){m=n/2+u/2}}}else if(t===2){if(i===1){m=n/2*-1}}else if(t===1){if(i===1){m=n/2*-1}else if(i===2){m=-n/2+f.fSize/2*-1}}else if(i===3){m=-n/2+p/2*-1}else if(i===2){m=-n/2+p/2*-1}else if(i===1){m=-n/2+p/2*-1}if(D.text.moved&&D.text.legend!==_.NONE&&D.text.text!==""){d=l.x+D.text.dimension.width/2}else if(D.percent.moved&&D.percent.legend!==_.NONE){d=o.x+D.percent.dimension.width/2}else if(D.absolute.moved&&D.absolute.legend!==_.NONE){d=s.x+D.absolute.dimension.width/2}c.x=Math.round(d);c.y=Math.round(r-m);c.width=Math.round(D.maxWidth);c.height=Math.round(D.topMaxHeight+D.midMaxHeight+D.bottomMaxHeight+h);return c}function setAbsolutePosition(e,t,i,n,a){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(n===3){d=e-r.height/2+1}else if(n===2){if(D.text.legend==="mid"&&D.text.text!==""){d=e+1}else{d=e-l/2+1}}else if(n===1){d=e-l/2+1}}else{if(a===3){d=e+2+t/2+s}else if(a===2||a===1){d=e+2+t/2+s}}return Math.round(d)}function setPercentPosition(e,t,i,n,a){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(n===3){c=e+l/2-r.height+1}else if(n===2){c=e+l/2-r.height+1}else if(n===1){c=e-l/2+1}}else{if(a===3){c=e+2+t/2+s/2-r.height/2}else if(a===2||a===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,n,a){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,n,a,r,o,l){var f=St["b"].DataObjects.RuntimeDO;var v=St["b"].DataObjects.DocumentDO.getPainter();var s=new St["b"].Utils.Calculator(i);s.setCondenseRoot(i.dataModel.baseNode);if(i.dataModel.dimSize===1){s.setCondenseLevel(1)}else{s.setCondenseLevel(0)}var b=St["b"].Utils.Constants.TypeValues.indicator;for(var d=0;d<t.length;d++){var c=t[d];var T=c.getModel();var E=T.font;T.type="structure";var u=St["b"].Layout.Common.getCompareToAndFrom(T,l,s,n);T.compareFrom=u.compareFrom;T.compareTo=u.compareTo;if(T.compareFrom===b.AXIS&&T.compareTo===b.AXIS){T.active=false;T.hide=true;continue}St["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 m=0;var h=E.fWeight+" "+E.fSize+"px "+E.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 n=parseFloat(f.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));u=Math.round(u*n*2)}}return{absDim:e,percDim:t,textDim:i,topMaxHeight:p,midMaxHeight:m,bottomMaxHeight:g,maxWidth:u};function calcDimensionAndMaxHeights(e,t,i){if(i&&t.text===""){return}if(t.legend===b.NONE){return}t.moved=false;var n=v.measureTextDim(t.text,h);e.width=n.width;e.height=n.height;if(i&&e.height===0){e.height=E.fSize}u=Math.max(e.width,u);if(t.legend===b.AUTO){var a=T.compareFrom.position.x;var r=T.compareTo.position.x;var o=T.compareFromCat!==b.AXIS?a: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(f.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){m+=e.height}else{g+=e.height}}}}},displaceCompares:function(e,t){var i=St["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var n=e.slice(0);n=n.sort(sortAsc);for(var a=0;a<n.length;a++){var r=n[a].getModel();if(!r.active){continue}var o=St["b"].Layout.Common.getMaxPosition(r,true,t);var l=o.position;var s=o.dimension;for(var d=a+1;d<n.length;d++){var c=n[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=St["b"].Layout.Common.getMaxPosition(c,true,t);var p=u.position;var g=u.dimension;var m=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var h=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(m&&h){var f=l.y+s.height-p.y;c.displacement=f;c.displaced=true;c.position.y+=f;if(c.absolute.legend!==i.NONE){c.absolute.position.y+=f}if(c.percent.legend!==i.NONE){c.percent.position.y+=f}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.y+=f}if(c.ellipse){c.ellipseArray.y+=f}}}}}};var Tt=r(33);St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Structure=St["b"].Layout.Structure||{};St["b"].Layout.Structure.StructureChartLayout=function(){var w=St["b"].DataObjects.RuntimeDO;var n=St["b"].Utils.Calculator.Converter;var S=St["b"].Utils.Constants.Parameters;var e=St["b"].Utils.Constants.TypeValues;var m=e.structureRepresentation;var U=e.notation;var F=e.concept;var a=e.indicator;var R=e.structurePosition;var I=e.categoryLabel;var b=St["b"].DataObjects.DocumentDO.getScalingGroups();var t=w.getParameter("FONT_FAMILY");var i=w.getParameter("FONT_STYLE_CHART");var x,O;var p;var B={width:0,height:0};var C=false;function mm2pix(e){return n.mm2pix(x*e)}function convertNMParameter(e){return mm2pix(w.getParameterParsed(e))}function convertNMParameterForMultiple(e){var t=w.getParameterParsed(e),i=n.mm2pix(x*t);return C&&t!==0?Math.max(1,i):i}var H=["structureLegendType.1","structureLegendType.2","structureLegendType.3"];var k=["structureLegendType.4","structureLegendType.5","structureLegendType.6"];var r,o={};var y,N,l,d;var g={},h={};var L,G,A,V=0,$=0;var f,P,c,M;var _,D;var v,T,E;var W;var z;var j=w.getParameterParsed("FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY");var X,Y,K;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,ne=null;var ae,re;var oe;var le,se,de=null;var ce,ue;var pe,ge,me,he;var fe;var ve=0;var be,Te;var Ee,xe,Ce;var ye=null;var Me;var Se=false,Oe=false;var Le=false;var Ae=false,_e=false,Ie=false;var De=true;var Re;var Ne;var Pe,we=[];var Ue=[],Fe=[];var Be={};var He={};var ke={};var Ge={};var Ve=null,$e=null,We=null,ze=null;var je=[],Xe=[],Ye=[],Ke=[],Ze=[],Qe=[];var qe=[],Je=[];var et=[];var tt={},it={};var nt=[],at=[],rt=[],ot=[];var lt=[],st=[],dt=[],ct=[];var ut=[];var pt=[],gt=[],mt=[],ht=[];var ft=[],vt=[],bt=[];this.getType=function(){return"structurechart"};this.recalcLocalAxisFactor=function(){fe=getAvailableSpace();calculateInitialAxisAndZoomFactors(false)};this.recalcLocalZoom=function(e,t){fe=getAvailableSpace();var i=getPosNegAreas();if(e===undefined&&t===undefined){var n={};for(var a in He){var r=He[a];n[a]=r.manualScaling?b[r.originalScalingGroup].manualFactor:recalculateSingleZoomFactor(r,i.pos,i.neg)}for(var o in ke){ne.zoom[o]=n[o]===undefined?n[ke[o]]:n[o]}}else if(ke[t]!==undefined){var l=ke[t];var r=He[l];var s=r.manualScaling?b[r.originalScalingGroup].manualFactor:recalculateSingleZoomFactor(r,i.pos,i.neg);for(var d in ke){if(ke[d]===l){ne.zoom[d]=s}}return s}else{return null}};this.calcFreeSpace=function(){fe=getAvailableSpace();var r=getPosNegAreas();var i=r.pos,n=r.neg;function updateFreeSpaces(e,t){if(t){i=e>=r.pos?0:Math.min(i,r.pos-e)}else{n=e>=r.neg?0:Math.min(n,r.neg-e)}}function updateFreeSpacesWithLegends(e,t){for(var i=0;i<e.scalingData.legendValues.length;i++){var n=e.scalingData.legendLabelWidths[i];if(r.pos+r.neg>=2*n){var a=Math.round(t*e.scalingData.legendValues[i]);if(Math.abs(a)>=n){updateFreeSpaces(Math.abs(a)+n,a>=0)}else{updateFreeSpaces(n+a,true);updateFreeSpaces(n-a-Te,false)}}}}for(var e in He){var t=He[e];var a=ae.globalZoom[e];if(ne.stackType==="%"&&t.stackRepresentations.length>0){if(Ae){updateFreeSpaces(t.scalingData.maxPosTotalLabel+a,true)}if(_e){updateFreeSpaces(t.scalingData.maxNegTotalLabel+a,false)}updateFreeSpacesWithLegends(t,a)}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(a*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(a*Math.abs(t.scalingData.invertedValues[o]));updateFreeSpaces(c,t.scalingData.invertedValues[o]<0)}updateFreeSpacesWithLegends(t,a)}}if(Te!==be){updateFreeSpaces(be,false)}return{pos:i,neg:n}};this.calcChartSpace=function(){fe=getAvailableSpace();return fe};this.limitAxisFactor=function(e){var t=1;var i=be!==Te?be/fe:0;for(var n in He){var a=He[n];t=Math.min(t,1-a.scalingData.maxLabelWidthPos/fe);i=Math.max(i,a.scalingData.maxLabelWidthNeg/fe);if(a.stackRepresentations.length>0&&Ie){t=Math.min(t,1-a.scalingData.maxPosTotalLabel/fe);i=Math.max(i,a.scalingData.maxNegTotalLabel/fe)}for(var r=0;r<a.scalingData.invertedLabelWidths.length;r++){var o=a.scalingData.invertedLabelWidths[r];var l=a.scalingData.invertedValues[r];if(l>=0){i=Math.max(i,(o-Math.round(l*ae.globalZoom[n]))/fe)}else{t=Math.min(t,1-(o+l*ae.globalZoom[n])/fe)}}for(var r=0;r<a.scalingData.legendValues.length;r++){if(a.scalingData.legendValues[r]===0){var s=a.scalingData.legendLabelWidths[r]/fe;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,n){var a={};if(e.length===0){return a}ie=n.getModel();ne=ie.extendedModel;re=St["b"].DataObjects.ContextRepo.getContextByCid(ne.contextId);var r=ie.border,o=ie.padding;ce=i;ue=t;pe=0;ge=0;me={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};he=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(a);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 a}if(te){collectData(e)}switch(ae.buildUp){case St["b"].Utils.Constants.BuildUp.PREINIT:{Ne=St["b"].Layout.Common.getLinkGroups(ae,ie.id,"Structure");getCategoryHeight();setRepresentationsHeights();Re+=2*P;a[We.getId()]=We}break;case St["b"].Utils.Constants.BuildUp.INIT:{ne.zoom={};Ee=St["b"].Layout.Common.getAxisNotation(ne.expressions);xe=Ee?_:D;Ce=Math.floor(xe/2);ye=getHeaderNotationRepresentationIndex();St["b"].Layout.Common.hideMinMaxLabels(je,Ye,ne);if(ne.stackShowLabel.split(".")[0]==="MinMax"){St["b"].Layout.Common.hideMinMaxTotals(je,nt.concat(rt),ne)}else if(ne.stackShowLabel.split(".")[0]==="-"){var s=nt.concat(rt);for(var l=0;l<s.length;l++){s[l].hideLabel=true;var d=St["b"].Layout.Common.getHighlight(ne,s[l],St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(d&&d.highlight){d.highlight.active=false}}}if(ne.stackShowLabel.split(".")[0]==="Function"){St["b"].Layout.Common.hideStackedValueLabels(ne,re,nt.concat(rt))}prepare();setRepresentationPositioningOffsets();be=We.getDimension().width;Te=We.getModel().extendedModel.displayType===I.FREE_AXIS_POS?0:be;fe=getAvailableSpace();calculateInitialAxisAndZoomFactors.call(this,true)}break;case St["b"].Utils.Constants.BuildUp.AXIS_ZOOM:{adjustAxisFactorToGlobalZoom.call(this)}break;case St["b"].Utils.Constants.BuildUp.LEGEND:{var c=this.calcFreeSpace();if(!Ne.axis){alignAxisHorizontally(c)}var u=ie.row;var p=getLegendAreas();var g=p.top;if(ut.length>0){St["b"].Layout.Common.setCompareMetaInformation(ut,true,O,convertNMParameterForMultiple,ie.extendedModel,mm2pix);St["b"].Layout.Structure.CompareLayoutHelpers.setTextAndDimensions(ae,ut,re,Xe,Ge,Ie,getPercentStackTotalValues(),ie);var m=getCompareAreas();g[2]=Math.max(g[2],m.top);p.bottom=Math.max(p.bottom,m.bottom)}if(se.extendedModel.maxValueRowLabelStructure[u]===undefined){se.extendedModel.maxValueRowLabelStructure[u]=g}else{var h=se.extendedModel.maxValueRowLabelStructure[u];h[0]=Math.max(h[0],g[0]);h[1]=Math.max(h[1],g[1]);h[2]=Math.max(h[2],g[2])}if(se.extendedModel.maxValueRowLabelStructureBottom[u]===undefined||se.extendedModel.maxValueRowLabelStructureBottom[u]<p.bottom){se.extendedModel.maxValueRowLabelStructureBottom[u]=p.bottom}a[We.getId()]=We}break;case St["b"].Utils.Constants.BuildUp.DRAW:{var h=se.extendedModel.maxValueRowLabelStructure[ie.row];Me=ge+Q+Math.max(h[0]+h[1],h[2]);adjustTopOffsetToLinkingAndAlignment(Ne.legend);var f=getAxisPosition();layoutBackground(a);layoutAxis(f,a);var v=We.getModel();v.position.y=Me;if(Te!==be){v.position.x=pe+Ve.getPosition().x-be}else if(Ne.axis){if(v.extendedModel.alignment===St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.LEFT){v.position.x=pe+q}else if(v.extendedModel.alignment===St["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}a[We.getId()]=We;var b=getInitialMinMaxLabelXPos(f);var T=layoutRepresentations(f,b,a);layoutValuesRepresentationLabel(f,a);layoutTotals(b,a);layoutOutliers(T,f,b,a);hideOverlappingLabels();var E=getLegendOffsets();E.side=0;layoutLegend(f,E,a);layoutAnnotator(f,a);layoutScalingHelpers(f,E,a);layoutStackLines(f,E,a);if(ut.length>0){St["b"].Layout.Structure.CompareLayoutHelpers.layoutCompares(ut,Xe,a,Ve,x,C);St["b"].Layout.Structure.CompareLayoutHelpers.displaceCompares(ut,convertNMParameterForMultiple)}setDataForScrolling(e);defineAxisSeparators(Math.round(Ve.getModel().position.x+Ve.getModel().dimension.width/2))}break}return a};function calculateInitialAxisAndZoomFactors(e){var t={};var i={};for(var n in He){i[n]=calculateSingleAxisAndZoom(He[n])}var a=false,r=false;for(var o=0;o<ne.expressions.length;o++){var l=ne.expressions[o];var s=Ge[l.id];if(i[s]===undefined){i[s]=i[ke[s]]}t[s]=i[s].scalingFactor;if(i[s].maxPositive!==0&&i[s].maxPositive===Math.abs(i[s].maxNegative)){a=true;r=true}else if(i[s].maxPositive>Math.abs(i[s].maxNegative)){a=true}else if(i[s].maxPositive<Math.abs(i[s].maxNegative)){r=true}}if(a&&r){ne.axisFactor=.5}else if(a){ne.axisFactor=0;for(var n in i){if(i[n].maxPositive!==0&&i[n].axisFactor>ne.axisFactor){ne.axisFactor=i[n].axisFactor}}}else if(r){ne.axisFactor=1;for(var n in i){if(i[n].maxNegative!==0&&i[n].axisFactor<ne.axisFactor){ne.axisFactor=i[n].axisFactor}}}else{ne.axisFactor=.5}if(be!==Te){if(ne.axisFactor*fe<be+Ce){ne.axisFactor=(be+Ce)/fe}}if(ne.axisFactor!==0&&ne.axisFactor!==1){var d=Ce/fe;ne.axisFactor=Math.max(ne.axisFactor,d);ne.axisFactor=Math.min(ne.axisFactor,1-d)}if(e){ne.zoom=t;this.recalcLocalZoom();for(var n in t){if(ae.globalZoom[n]==undefined||ae.globalZoom[n]>t[n]){ae.globalZoom[n]=t[n]}}}}function calculateSingleAxisAndZoom(e){var t=11;var i=3;if(Ie&&e.stackRepresentations.length>0){return calculatePercentStackAxisAndZoom(e)}var n=e.scalingData.values;var a=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 m=e.scalingData.legendValues;var h=e.scalingData.legendLabelWidths;if(c===s&&s===0){return{axisFactor:.5,scalingFactor:St["b"].Utils.Constants.Parameters.defaultZoomFactor,maxPositive:s,maxNegative:c}}if(p+g>fe-i){var f=g/(p+g);return{axisFactor:f,scalingFactor:0,maxPositive:s,maxNegative:c}}var v=(fe-u-d)/(s-c);var f;if(s===0&&d===0){f=1}else if(c===0&&u===0){f=0}else{f=(-c*v+u)/fe}var b,T;var E,x;for(var C=0;C<t;C++){E=p;x=g;b=Math.round(fe*f);T=fe-b;for(var y=0;y<n.length;y++){var M=n[y];var S=Math.round(Math.abs(M)*v);var O=S+a[y];if(M>0||!De&&0===M){E=Math.max(E,O);x=Math.max(x,r[y]-S)}else{x=Math.max(x,O);E=Math.max(E,r[y]-S)}}for(var y=0;y<o.length;y++){var O=l[y]-Math.round(Math.abs(o[y])*v);if(o[y]<0){E=Math.max(E,O)}else{x=Math.max(x,O)}}var L=E-T;var A=x-b;var _=Math.round((A-L)/2);var I=L+A;var D=v-I/fe*v;b+=Te;var R=0,N=0;for(var P=0;P<m.length;P++){if(fe+Te<h[P]*2){continue}if(m[P]===0){if(b<h[P]){var O=h[P]-b;N=Math.max(N,O)}else if(T<h[P]){var O=h[P]-T;R=Math.max(R,O)}}else{var w=Math.round(m[P]*v);var U=b+w;var F=T-w;if(U<h[P]){var O=h[P]-U;N=Math.max(N,O);if(m[P]<0){D=Math.min(D,(w+O)/m[P])}}else if(F<h[P]){var O=h[P]-F;R=Math.max(R,O);if(m[P]>0){D=Math.min(D,(w-O)/m[P])}}}}var B=N-R;_=B===0?_:B;f+=_/fe;f=Math.min(Math.max(f,0),1);v-=v-D}return{axisFactor:f,scalingFactor:v,maxPositive:s,maxNegative:c}}function calculatePercentStackAxisAndZoom(e){var t=11;var i=3;var n=Ae?2147483647:0;var a=_e?-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>fe-i){var d=o/(r+o);return{axisFactor:d,scalingFactor:0,maxPositive:2147483647,maxNegative:-2147483647}}var c=fe-r-o;var d;if(Ae&&_e){c=Math.floor(c/2);d=.5}else if(Ae){d=0}else if(_e){d=1}else{c=2147483647;d=.5}var u,p;for(var g=0;g<t;g++){u=Math.round(fe*d);p=fe-u;if(Ae&&_e){c=Math.min(p-r,u-o)}else if(Ae){c=p-r}else if(_e){c=u-o}else{c=2147483647}u+=Te;var m=0,h=0;for(var f=0;f<l.length;f++){if(fe+Te<s[f]*2){continue}if(l[f]===0){if(u<s[f]){var v=s[f]-u;h=Math.max(h,v)}else if(p<s[f]){var v=s[f]-p;m=Math.max(m,v)}}else{var b=Math.round(l[f]*c);var T=u+b;var E=p-b;if(T<s[f]){var v=s[f]-T;h=Math.max(h,v)}else if(E<s[f]){var v=s[f]-E;m=Math.max(m,v)}}}var x;if(m===0&&h===0){u=fe-p;if(Ae&&_e){x=Math.floor((p-r-(u-o))/2)}else{x=0}}else if(m>0&&h>0){x=Math.floor((h-m)/2)}else if(m>0){x=-Math.floor(m/2)}else{x=Math.floor(h/2)}d+=x/fe;d=Math.min(Math.max(d,0),1)}return{axisFactor:d,scalingFactor:c,maxPositive:n,maxNegative:a}}function recalculateSingleZoomFactor(e,a,r){if(e.stackRepresentations.length>0&&ne.stackType==="%"){return recalculatePercenStackZoomFactor(e,a,r)}var o=null;function calcFactorNormal(e,t){var i=(e>0||!De&&0===e?a:r)-t+.49;var n=i/Math.abs(e);if(o===null||n<o){o=n}}var t=e.scalingData.values;var i=e.scalingData.labelWidths;for(var n=0;n<t.length;n++){if(t[n]!==0){calcFactorNormal(t[n],i[n])}}if(o===null){o=St["b"].Utils.Constants.Parameters.defaultZoomFactor}var l=e.scalingData.legendValues;var s=e.scalingData.legendLabelWidths;for(var n=0;n<l.length;n++){if(l[n]===0){}else if(a+r<2*s[n]){}else{var d=Math.round(o*l[n]);var c;if(l[n]>0){c=a-d;if(c<s[n]){var u=s[n]-c;o=(d-u)/l[n]}}else if(l[n]<0){c=r+d+Te;if(c<s[n]){var u=s[n]-c;o=(d+u)/l[n]}}o=Math.max(0,o)}}return o<0||!isFinite(o)?0:o}function adjustAxisFactorToGlobalZoom(){var e=0;var t=0;var i=Math.round(fe*ne.axisFactor);var n=fe-i;for(var a in He){var r=ae.globalZoom[a];for(var o in ke){if(ke[o]===a){r=Math.min(r,ae.globalZoom[o])}}if(ne.zoom[a]<=r*.9){continue}var l=He[a];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 m=0;m<s.length;m++){var h=s[m];var f=Math.round(Math.abs(h)*r);if(h>0||!De&&0===h){t=Math.max(t,d[m]-f)}else{e=Math.max(e,d[m]-f)}}for(var m=0;m<c.length;m++){var v=u[m]-Math.round(Math.abs(c[m])*r);if(c[m]<0){e=Math.max(e,v)}else{t=Math.max(t,v)}}for(var b=0;b<p.length;b++){if(fe+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 E=false;if(e>n&&t>i){}else if(e>n){ne.axisFactor-=(e-n)/fe;E=true}else if(t>i){ne.axisFactor+=(t-i)/fe;E=true}if(E){this.recalcLocalZoom();for(var a in ne.zoom){if(ae.globalZoom[a]==undefined||ae.globalZoom[a]>ne.zoom[a]){ae.globalZoom[a]=ne.zoom[a]}}}}function recalculatePercenStackZoomFactor(e,t,i){var n=Math.min(t-e.scalingData.maxPosTotalLabel,i-e.scalingData.maxNegTotalLabel);if(Ae&&_e){n=Math.min(t-e.scalingData.maxPosTotalLabel,i-e.scalingData.maxNegTotalLabel)}else if(Ae){n=t-e.scalingData.maxPosTotalLabel}else if(_e){n=i-e.scalingData.maxNegTotalLabel}else{n=2147483647}var a=e.scalingData.legendValues;var r=e.scalingData.legendLabelWidths;for(var o=0;o<a.length;o++){if(a[o]===0){}else if(t+i<2*r[o]){}else{var l=Math.round(n*a[o]);var s;if(a[o]>0){s=t-l;if(s<r[o]){n=Math.floor((t-r[o])/a[o])}}else if(a[o]<0){s=i+l+Te;if(s<r[o]){n=Math.floor((i+Te-r[o])/a[o])}}n=Math.max(0,n)}}return n<0||!isFinite(n)?0:n}function getHeaderNotationRepresentationIndex(){for(var e=0;e<ne.expressions.length;e++){var t=ne.expressions[e];if(t.notation===U.HEADER){var i=t.id.split(".").pop();for(var n=0;n<je.length;n++){var a=je[n];if(a.dataId_expr===i&&a.valueType!=="FACTOR_NONE"&&!a.isNaN){return n}}}else if(t.notation===U.ELEMENT_HEADER){var i=t.id.split(".").pop();for(var n=0;n<Fe.length;n++){var r=Fe[n];var o=r.usedRuledEntry;if(o.referenceUsed&&!isNaN(r.value)&&r.key===i&&o.valueType!=="FACTOR_NONE"){return n}}}}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(Ye.concat(lt,nt,rt,mt,vt));for(var i in He){prepareScalingDataForScalingBlock(He[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 n=e.stackRepresentations;var a=[],r=[],o=[];var l=[],s=[];var d=0,c=0;var u=0,p=0;var g=0,m=0;var h=0,f=0;var v=0,b=0;for(var T=0;T<t.length;T++){var E=t[T];var x=i[T];if(E.isOutlier&&x&&E.valueType!=="FACTOR_NONE"){if(E.value>0||!De&&0===E.value){h=Math.max(h,x.hideLabel?y+M:x.dimension.width+z)}else{f=Math.max(f,x.hideLabel?y+M:x.dimension.width+z)}}}m=h;g=f;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 n=t&&!t.hideLabel?t.dimension.width+z:0;s.push(n);return}}else if(e.instanceOf==="ValueModel"){i=e.value*1e-100;if(!Le){var n=t&&!t.hideLabel?Math.round(t.dimension.width/2):0;if(a[0]===undefined){d=-1e-127;c=1e-127;a[0]=c;a[1]=d;o[0]=0;o[1]=0;r[0]=n;r[1]=n;p=n;u=n}else if(r[0]<n){r[0]=n;r[1]=n;p=n;u=n}return}}else{i=e.referencePointerSum!==undefined?e.referencePointerSum+e.value:e.value}a.push(i);o.push(e.needleSize===undefined?0:Math.floor(e.needleSize/2));var n=t&&!t.hideLabel?t.dimension.width+z:0;if(e.instanceOf==="StructureLineModel"){n+=Math.ceil(Math.max(e.needleSize,e.lineWidth)/2)}else{n+=e.needleSize?Math.ceil(e.needleSize/2):0}if(i>0||!De&&0===i){n=Math.max(n,h);m=Math.max(m,n)}else{n=Math.max(n,f);g=Math.max(g,n)}r.push(n);if(i<d){d=i;u=n}else if(i>c){c=i;p=n}}for(var T=0;T<t.length;T++){var E=t[T];if(E.valueType!=="FACTOR_NONE"&&!E.isNaN){if(!E.isOutlier){collectDataFromSingleValue(E,i[T])}}}if(Ie){for(var T=0;T<n.length;T++){var E=n[T];if(!E.label.hideLabel){if(E.value>0||!De&&0===E.value){v=Math.max(v,E.label.dimension.width)}else{b=Math.max(b,E.label.dimension.width)}}}}else{for(var T=0;T<n.length;T++){var E=n[T];collectDataFromSingleValue(E,E.label)}}p=p===0?h:p;u=u===0?f:u;ve=Math.max(u+p,ve);var C=collectLegendDataForScaling(e.exprs);e.scalingData={values:a,labelWidths:r,symbolSizes:o,invertedValues:l,invertedLabelWidths:s,maxPosVal:c,maxPosLabel:p,maxNegVal:d,maxNegLabel:u,maxLabelWidthPos:m,maxLabelWidthNeg:g,maxPosTotalLabel:v>0?v+z:0,maxNegTotalLabel:b>0?b+z:0,legendValues:C.values,legendLabelWidths:C.labelWidths}}function collectLegendDataForScaling(e){var a=[],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 n=e[i];if(n.legendInGrid){var o=n.id.split(".").pop();var l=n.valueRowLabelPosition.split(".")[1];if(l!=="0"){var s;switch(l){case"2":case"5":s=0;break;case"1":var d=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,true);s=getValue(d,1);break;case"3":var d=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,true);s=getValue(d,2);break;case"4":var d=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,false);s=getValue(d,1);break;case"6":var d=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(tt[o],o,false);s=getValue(d,2);break}a.push(s);var c=getLabel(n.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(ye!==null){var d=je[ye];var n=Be[d.dataId_expr];if(n.legendInGrid){var l=n.valueRowLabelPosition.split(".")[1];var c=getLabel(d.dataId_expr);if(c===null||l!=="2"&&l!=="3"){a.push(0);var u=c===null?oe.measureTextDim(n.name,p).width:c.dimension.width;r.push(Math.round(u/2)+Z)}}}if(ne.stackMode&&Ie&&e[0].isStack&&t&&ne.stackLine!=="-"){if(Ae){addStackPercentLabel("pos",1)}if(_e){addStackPercentLabel("neg",-1)}}return{values:a,labelWidths:r};function addStackPercentLabel(e,t){var i;for(var n=0;n<vt.length;n++){i=vt[n];if(i.id.substr(-3)===e){break}}a.push(t);r.push(Math.round(i.dimension.width/2))}}function getCategoryHeight(){var e=ie.row,t;if(Ne.legend&&Ne.legend.categoryHeight==undefined||!Ne.legend&&se.categoryHeight[e]===undefined){var i=[];if(Ne.legend){i=St["b"].Layout.Common.getLinkedContainers(Ne.legend,ae,ie)}else{var n=e*se.extendedModel.gridColumns.length;for(var a=0;a<se.extendedModel.gridColumns.length;a++){var r=se.children[a+n];var o=St["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=St["b"].Layout.CategorySizeCalculator.getCategorySizes(i,l,x,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);Ne.legend?Ne.legend.categoryHeight=t:se.categoryHeight[e]=t}else{t=Ne.legend?Ne.legend.categoryHeight:se.categoryHeight[e]}Re=t.categorySize;f=t.categoryDistance;P=f}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 n=je[e];if(o[n.valueType]===undefined){o[n.valueType]=w.getValueTypeFactor(n.valueType);g[n.valueType]=getBarHeight(o[n.valueType]);h[n.valueType]=getNeedleSize(o[n.valueType])}if(n.instanceOf==="BarModel"||n.instanceOf==="StructureWaterfallModel"||n.instanceOf==="ValueModel"){n.dimension.height=g[n.valueType]}else{var a=Be[n.dataId_expr].representation;if(a===m.LINE){n.needleSize=0;n.dimension.height=n.lineWidth=l}else if(a===m.SYMBOL_LINE){n.needleSize=h[n.valueType];n.lineWidth=l;n.dimension.height=Math.max(n.needleSize,l)}else{n.dimension.height=n.needleSize=h[n.valueType]}}}}function setRepresentationPositioningOffsets(){var e=[];var t=Ne.legend?Ne.legend.categoryHeight:se.categoryHeight[ie.row];var i=t.positionCount===1;for(var n in Be){var a=tt[n];for(var r=0;r<a.length;r++){if(e[r]==undefined){e[r]=[]}e[r].push(a[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 n=null;for(var a=0;a<t.length;a++){if(e.valueType===t[a].valueType){n=t[a];break}else if(n===null||t[a].valueType===i){n=t[a]}}return g[n===null?e.valueType:n.valueType]}for(var r=0;r<e.length;r++){var o=e[r];var a={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?a.top:a.topTop).push(s);break;case R.MID_TOP:(i?a.mid:a.midTop).push(s);break;case R.TOP:a.top.push(s);break;case R.MID:a.mid.push(s);break;case R.BOTTOM:a.bot.push(s);break;case R.MID_BOTTOM:(i?a.mid:a.midBot).push(s);break;case R.BOTTOM_BOTTOM:(i?a.bot:a.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<a.topTop.length;l++){var s=a.topTop[l];var p=getMasterHeight(s,a.top);s.position.y=d-Math.round(p/2)-s.dimension.height+Math.round(s.dimension.height/2)}for(var l=0;l<a.top.length;l++){a.top[l].position.y=d-Math.round(a.top[l].dimension.height/2)}for(var l=0;l<a.midTop.length;l++){var s=a.midTop[l];var p=getMasterHeight(s,a.mid);s.position.y=c-Math.round(p/2)-s.dimension.height+Math.round(s.dimension.height/2)}for(var l=0;l<a.mid.length;l++){a.mid[l].position.y=c-Math.round(a.mid[l].dimension.height/2)}for(var l=0;l<a.midBot.length;l++){var s=a.midBot[l];var p=getMasterHeight(s,a.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<a.bot.length;l++){a.bot[l].position.y=u-Math.round(a.bot[l].dimension.height/2)}for(var l=0;l<a.botBot.length;l++){var s=a.botBot[l];var p=getMasterHeight(s,a.bot);s.position.y=u-Math.round(p/2)+p-s.dimension.height+Math.round(s.dimension.height/2)-1}}}function getPosNegAreas(){var e=ne.axisFactor;var t=Math.round(fe*e);var i=fe-t;if(e===0){i-=Ce}else if(e===1){t-=Ce}return{pos:i,neg:t}}function getAxisPosition(){var e=Math.round(fe*ne.axisFactor)+Te+q;if(ne.axisFactor===0){e+=Ce}else if(ne.axisFactor===1){e-=Ce}return e}function getLegendAreas(){var e=0,t=0;var i=preLayoutLegendLabels();for(var n=0;n<i.top.length;n++){var a=i.top[n];var r=-a.position.y+V/2;e=Math.max(e,r);Se=Se||a.showConnector}var o=i.top.length>0?K:0;o+=Se?X:0;if(ye!==null){o=Math.max(o,v+T+E)}var l=null;for(var n=0;n<je.length&&je[0].dataId_dim===je[n].dataId_dim;n++){var s=je[n];var d=s.position.y+Math.round((s.dimension.height-Ze[n].dimension.height)/2);l=l===null||l>d?d:l}var c=We.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 n=0;n<i.bottom.length;n++){var a=i.bottom[n];var r=a.position.y+a.dimension.height+$/2;t=Math.max(t,r);Oe=Oe||a.showConnector}var u=t===0?0:K+t+(Oe?X:0);return{top:[o,e,l],bottom:u}}function getCompareAreas(){var e=0,t=0;var a=We.getModel().extendedModel;var i=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(a);var n=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 n=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(a,i);return{categoryIndex:t,emptysSum:n}}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-n))}else if(o.compareLegend==="end"){var s=o.topMaxHeight+Math.max(l,o.midMaxHeight)+o.bottomMaxHeight;e=Math.max(e,-o.offset.y-n);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+f+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 m=p+o.bottomMaxHeight;e=Math.max(e,Math.round(g-u-o.offset.y));t=Math.max(t,Math.round(m+u+o.offset.y-n))}}return{top:e,bottom:t}}function preLayoutLegendLabels(){if(mt.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 n=Ge[Be[t.dataId_expr].id];var a;if(t.isStack){if(Ie){a=getPercentStackValue(t,i?1:2)}else{a=t.stackModel.startOn+(t.referencePointerSum||0)+(i?t.value:t.value/2)}}else if(t.relativeValue!=undefined){a=(t.referencePointerSum||0)+t.relativeValue-(i?0:t.value/2)}else{a=(t.referencePointerSum||0)+(i?t.value:t.value/2)}return g+Math.round(ae.globalZoom[n]*a)}}function allocate(e,t,i,n,a){if(i==="Always"){(t?r:s).push(e)}else if(i==="Horizontal"){if(t){o.push(e);u.push(a<n?[a,n]:[n,a])}else{d.push(e);p.push(a<n?[a,n]:[n,a])}}else if(i==="Vertical"){(t?l:c).push(e)}}if(Ie){var t=getPercentStackZoomFactor();for(var i=0;i<vt.length;i++){var n=vt[i];if(Ae&&n.id.substr(-3)==="pos"){n.position.x=getPercentStackEndPosition(g,t,true);var a=ne.stackLine==="Start";n.position.y=a?-n.dimension.height-O-S.textLineSpacing:O+S.textLineSpacing;n.textAnchor="middle";allocate(n,a,"Always",g,n.position.x);var m={instanceOf:"LabelModel",position:{x:n.position.x,y:a?-O:0},dimension:{height:O,width:Math.round(O/2)},textAnchor:"middle"};allocate(m,a,"Always",g,m.position.x)}else if(_e&&n.id.substr(-3)==="neg"){n.position.x=getPercentStackEndPosition(g,t,false);var a=ne.stackLine==="Start";n.position.y=a?-n.dimension.height-O-S.textLineSpacing:O+S.textLineSpacing;n.textAnchor="middle";allocate(n,a,"Always",g,n.position.x);var m={instanceOf:"LabelModel",position:{x:n.position.x,y:a?-O:0},dimension:{height:O,width:Math.round(O/2)},textAnchor:"middle"};allocate(m,a,"Always",g,m.position.x)}}}for(var i=0;i<mt.length;i++){var n=mt[i];var h=n.id.split(".");var f,v=h[0]+"."+h[1].replace("scalingHelperLabel","scalingHelper");for(var b=0;b<pt.length;b++){if(pt[b].id===v){f=pt[b];break}}var T=Math.round(f.value*ae.globalZoom[Ge[f.expressionId]]);if(!isFinite(T)){T=0}var E=n.valueRowLabelPosition.split(".");var a=E[0]==="Start";n.position={x:g+T,y:a?-n.dimension.height:0};n.textAnchor="middle";allocate(n,a,E[1],g,n.position.x)}for(var i=0;i<e.length;i++){var n=e[i];var x=n.valueRowLabelPosition.split(".");var C;var a;switch(x[1]){case"1":a=true;var y=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,n.dataId_expr,true);C=getPosX(n.dataId_expr,y,true);break;case"2":a=true;C=g;break;case"3":a=true;var y=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,n.dataId_expr,true);C=getPosX(n.dataId_expr,y,false);break;case"4":a=false;var y=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,n.dataId_expr,false);C=getPosX(n.dataId_expr,y,true);break;case"5":a=false;C=g;break;case"6":a=false;var y=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,n.dataId_expr,false);C=getPosX(n.dataId_expr,y,false);break}allocate(n,a,x[2],g,C);var M=n.dimension.height;if(n.isHighlighted&&Be[n.dataId_expr].legendInGrid){if(a){V=Math.max(V,M*L+2*A-M)}else{$=Math.max($,M*L+2*A-M)}}n.position={x:C,y:a?-M:0};n.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 He){if(He[t].stackRepresentations.length>0){e=ae.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 n=0;n<ne.expressions.length;n++){var a=ne.expressions[n];if(a.currPosition===e[i]){var r=a.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,n,a){if(t.length===0&&i.length===0){return}var r=[];var o=[[pe,pe+me.width+1e3]];for(var l=0;l<e.length;l++){var s=e[l];var d=St["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=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(s);var c=findBestPosition(o,me.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>n[l][1]||s.position.x<n[l][0])){s.showConnector=false}if(s.dataId_expr===null||Be[s.dataId_expr].legendInGrid){if(a){if(s.isHighlighted&&s.position.y<=d.y){V=Math.max(V,s.dimension.height*L+2*A-s.dimension.height)}}else{if(s.isHighlighted&&s.position.y>=d.y){$=Math.max($,s.dimension.height*L+2*A-s.dimension.height)}}}}for(var l=0;l<i.length;l++){var s=i[l];var d=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(s);var u=0;while(u<r.length){if(St["b"].Layout.Common.boxesOverlap(d,r[u],J,ee)){if(a){d.y=r[u].y-d.height-S.textLineSpacing}else{d.y=r[u].y+r[u].height+S.textLineSpacing}s.position.y=d.y;if(s.dataId_expr===null||Be[s.dataId_expr].legendInGrid){if(a){if(s.position.y<=r[u].y&&s.isHighlighted){V=Math.max(V,s.dimension.height*L+2*A-s.dimension.height)}else{V=0}}else{if(s.position.y>=r[u].y&&s.isHighlighted){$=Math.max($,s.dimension.height*L+2*A-s.dimension.height)}else{$=0}}}u=0}else{u++}}r.push(d)}function allocateLabel(e,t){var i=10;for(var n=0;n<e.length;n++){if(e[n][0]>t[1]||e[n][1]<t[0]){}else if(e[n][0]<=t[0]&&e[n][1]>=t[1]){var a=e[n][1];e[n][1]=t[0];if(a-t[1]>=i){e.splice(n+1,0,[t[1],a])}if(e[n][1]-e[n][0]<i){e.splice(n,1)}return}else if(e[n][0]<=t[1]&&e[n][0]>=t[0]){e[n][0]=t[1];if(e[n][1]-e[n][0]<i){e.splice(n,1)}return}else if(e[n][1]<=t[1]&&e[n][1]>=t[0]){e[n][1]=t[0];if(e[n][1]-e[n][0]<i){e.splice(n,1)}return}else{console.warn("structure.allocateLabel: impossible path")}}}function findBestPosition(e,t,i){var n=(i[0]+i[1])/2;var a=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(n-e[s][0]),Math.abs(n-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<a){a=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(n-e[c][0])<Math.abs(n-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&&(ne.axisAlignmentElement==="Start"||ne.axisAlignmentElement==="Auto")){ne.axisFactor-=(e.neg-.49)/fe;t=-e.neg}else if(e.pos>0&&ne.axisAlignmentElement==="End"){ne.axisFactor+=(e.pos-.49)/fe;t=e.pos;We.getModel().position.x+=e.pos+e.neg}else if(Math.abs(e.pos-e.neg)>=2&&ne.axisAlignmentElement==="Mid"){t=Math.floor((e.pos-e.neg)/2);ne.axisFactor+=t/fe;We.getModel().position.x+=e.neg+t}else if(ne.expressions.length===0&&ne.axisAlignmentElement==="Mid"){var i=e.pos+e.neg+convertNMParameter("MMPT_STRUCTURE_CATEGORY_LABEL_AXIS_DISTANCE");i>0&&(We.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 n=St["b"].Factories.ModelFactory.getModelById(ae,i);if(n!==null&&n!==undefined){var a=St["b"].Factories.ModelFactory.getParentContainer(ae.firstObjectGrid,n)[0];if(a!==null&&a!==undefined){if(se.id!==a.id){var r=a.extendedModel.maxValueRowLabelStructure[n.row];if(r!==null&&r!==undefined){var o=ge+Q+Math.max(r[0]+r[1],r[2]);Me=Math.max(Me,o)}}}}}}}var l=me.height-Me-Q-we.length*Re-se.extendedModel.maxValueRowLabelStructureBottom[ie.row];if(l>0){if(e!==null){if(e.legendOrientation==="Bottom"){Me+=l}else if(e.legendOrientation==="Mid"){Me+=Math.round(l/2)}}else{if(ne.axisAlignmentCategory==="End"){Me+=l}else if(ne.axisAlignmentCategory==="Mid"){Me+=Math.round(l/2)}}}}function layoutAxis(e,t){var i=Ve.getModel();var n=ne.dimensionLabelModel.calculatedEmptySpaces;var a=We.getModel().extendedModel;var r=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesSum(a);var o=we.length*Re+r;i.position={y:Me,x:e-Ce};i.dimension={width:xe,height:o};if(je.length===0){Ve.setPosition({y:Me,x:e});i.paintAxis=Le;t[Ve.getId()]=Ve;return}var l,s,d,c=0;if(Ee){var u=0;var p=undefined;var g=undefined;for(var m=0,h=0;m<we.length;m++){if(we[m]===null){continue}var f=Re;var v=n[we[m]];if(v!==undefined&&m+1==v.positionCnt){if(v.position==="start"&&v.axisSplit===true){u+=v.space_px}else if(v.axisSplit===false){f+=v.space_px}}var b=St["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(we[m],Pe,h++);if(b===null||b.hide){continue}var T=St["b"].Layout.Common.getExpressionForAxisSegment(ne.expressions,b);var E=T.node.usedRuledEntry;var x=T.expr.notation===U.AXIS;var C,y,M,S,O;if(E.valueType==="FACTOR_NONE"||!x&&!E.referenceUsed){M=s="Actual";C=w.getDataType(M).subtypes.ACT0.settings.p;C=l={pattern:C.otherFill1,background:C.otherFill2,border:C.otherBorder};y=d=F.AREA;S=U.AXIS;O="diagonal"}else{if(T.expr.notation===U.ELEMENT_AXIS){y=d=T.expr.referenceConcept}else{y=d=T.expr.concept}S=T.expr.notation;M=s=x?E.baseDataType:E.referenceDataType;if(M==null){M=s=Tt["a"].dataType}var L;var A=tt[T.node.key];for(var _=0;_<A.length;_++){var I=A[_];if(I.dataId_dim===b.value){L=I.instanceOf==="StructureWaterfallModel"&&(I.waterfallType===0||I.waterfallType===1||I.waterfallType===2);break}}C=l=St["b"].Layout.Common.getNotationColorStructure(E,y,x,T.node.value>=0,L,false);O=St["b"].Layout.Common.getOtherPattern(E,S,y,x)}if(i.segments.length===0){i.segments.push({concept:y,y:Me+u,pattern:C.pattern,background:C.background,border:C.border,dataType:M,segLen:f,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(M!==g.dataType||y!==g.concept||C.pattern!==g.pattern||C.border!==g.border||C.background!==g.background||D===true||R===true){i.segments.push({concept:y,y:Me+u,pattern:C.pattern,background:C.background,border:C.border,dataType:M,segLen:f,otherPattern:O});g=i.segments[i.segments.length-1]}else{g.segLen+=f}}if(v!==undefined){if(v.axisSplit===false){u+=v.space_px}}u+=Re;var v=n[we[m]];if(v!==undefined&&m+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=S}else{var u=0;var p=undefined;var g=undefined;for(var m=0,h=0;m<we.length;m++){if(we[m]===null){continue}var f=Re;var v=n[we[m]];if(v!==undefined&&m+1==v.positionCnt){if(v.position==="start"&&v.axisSplit===true){u+=v.space_px}else if(v.axisSplit===false){f+=v.space_px}}var b=St["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(we[m],Pe,h++);if(b===null||b.hide){continue}var C,y,M;M=s="Actual";C=w.getDataType(M).subtypes.ACT0.settings.p;C=l={pattern:C.otherFill1,background:C.otherFill2,border:C.otherBorder};y=d=F.AREA;if(i.segments.length===0){i.segments.push({concept:y,y:Me+u,pattern:C.pattern,background:C.background,border:C.border,dataType:M,segLen:f});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:y,y:Me+u,pattern:C.pattern,background:C.background,border:C.border,dataType:M,segLen:f});g=i.segments[i.segments.length-1]}else{g.segLen+=f}}if(v!==undefined){if(v.axisSplit===false){u+=v.space_px}}u+=Re;var v=n[we[m]];if(v!==undefined&&m+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 N=0;i.segments.forEach(function(e){N+=e.segLen});if(N<i.dimension.height){var P=i.dimension.height-N-c;P>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:P})}i.paintAxis=Le;t[i.id]=Ve}function defineAxisSeparators(n){var e=Ve.getModel();var a=We.getModel();var t=a.extendedModel.selectedKeyfigure.split(".").pop();var i=Be[t];var r=a.extendedModel;var o=r.separatorCategory;var l=r.separatorDataType;var s=r.separatorTimeType;var d=We.getLayout().getColumns();var c=a.children;var u=r.displayType===I.NONE;var p=ne.dimensionLabelModel.calculatedEmptySpaces;function getAutoNegLen(e){if(u){return n}else{var t=c[e],i=t?St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(t).x:0;return n-i-a.position.x}}if(i&&(o||l||s)){var g=getSeparatorParameters(n);var m=St["b"].Layout.Common.getChangeSeparators(we,t,o,l,s,Pe,We,re,d);var h={};var f=-1;for(var v=0;v<m.length;v++){h[m[v].category]=m[v];if(m[v].category>f){f=m[v].category}}var b=0;if(c.length>0){for(var v=0;v<=f;v++){var T=h[v];var E=c[v*d].dataId_dim;var x=p[E];if(x!==undefined&&v+1==x.positionCnt){if(x.position==="start"){b+=x.space_px}}if(T!==undefined){var C;var y=e.position.y+b;if(g.autoLen){C=getAutoNegLen(T.dimLabelIdx)}else{C=g.neg}e.separators.push({y:y,neg:C,pos:g.pos,color:g.color,width:g.lineWidth,zIndex:T.zIndex})}b+=Re;var x=p[E];if(x!==undefined&&v+1==x.positionCnt){if(x.position==="end"){b+=x.space_px}}}}}var M=getTotalSeparatorParameters(n);var S=St["b"].Layout.Common.getTotalsSeparators(we,M.totalAutoLen&&!u,M.subtotalAutoLen&&!u,M.totalValAutoLen&&!u,Pe,We,re,d);var h={};var f=-1;for(var v=0;v<S.length;v++){h[S[v].category]=S[v];if(S[v].category>f){f=S[v].category}}var b=0;if(c.length>0){for(var v=0;v<=f;v++){var T=h[v];var E=c[v*d].dataId_dim;var x=p[E];if(x!==undefined&&v+1==x.positionCnt){if(x.position==="start"){b+=x.space_px}}if(T!==undefined){var y=e.position.y+b;var O,L,A,_;if(T.type==="T"){L=M.totalPos;A=M.totalColor;_=M.totalLineWidth;if(M.totalAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=M.totalNeg}}else if(T.type==="S"){L=M.subtotalPos;A=M.subtotalColor;_=M.subtotalLineWidth;if(M.subtotalAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=M.subtotalNeg}}else{L=M.totalValPos;A=M.totalValColor;_=M.totalValLineWidth;if(M.totalValAutoLen){O=getAutoNegLen(T.dimLabelIdx)}else{O=M.totalValNeg}}e.separators.push({y:y,neg:O,pos:L,color:A,width:_,zIndex:T.zIndex})}b+=Re;var x=p[E];if(x!==undefined&&v+1==x.positionCnt){if(x.position==="end"){b+=x.space_px}}}}}function getSeparatorParameters(e){var t=We.getModel().extendedModel;var i=0;var n=0,a=false;if(t.sepFromNotation){var r=parseFloat(w.getParameter("FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA"));i=Math.round(e-pe-be+be*r);a=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))}a=t.sepLengthStartAuto}if(t.sepEndFromNotation){n=Math.round((pe+me.width-e)*parseFloat(w.getParameter("FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA")))}else{n=t.sepLengthEndUnit==="%"?Math.round((pe+me.width-e)*parseFloat(t.sepLengthEnd_factor)):mm2pix(parseFloat(t.sepLengthEnd_mmpt))}return{neg:i,pos:n,autoLen:a,color:w.getParameter("COLOR_STRUCTURE_SEPARATOR"),lineWidth:convertNMParameterForMultiple("MMPT_STRUCTURE_SEPARATOR_SIZE")}}function getTotalSeparatorParameters(n){var e=We.getModel().extendedModel;function getNegNM(e){return(n-pe)*parseFloat(w.getParameter(e))}function getNegDim(e,t,i){return e==="%"?(n-pe)*parseFloat(t):mm2pix(parseFloat(i))}function getPosNM(e){if(ie.scrollingData){return ie.scrollingData.scrollingHor?(pe+ie.scrollingData.realWidth-n)*parseFloat(w.getParameter(e)):(pe+me.width-n)*parseFloat(w.getParameter(e))}else{return(pe+me.width-n)*parseFloat(w.getParameter(e))}}function getPosDim(e,t,i){if(e==="%"){if(ie.scrollingData){return ie.scrollingData.scrollingHor?(pe+ie.scrollingData.realWidth-n)*parseFloat(t):(pe+me.width-n)*parseFloat(t)}else{return(pe+me.width-n)*parseFloat(t)}}else{return mm2pix(parseFloat(i))}}var t,i,a,r,o,l,s,d,c;if(e.sepTotalFromNotation){i=getNegNM("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");a=w.getParameter("CHECK_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA")==="true"}else{i=getNegDim(e.sepTotalLengthStartUnit,e.sepTotalLengthStart_factor,e.sepTotalLengthStart_mmpt);a=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:a,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 n in He){var a=He[n].scalingData;t=Math.max(t,a.maxLabelWidthPos);i=Math.max(i,a.maxLabelWidthNeg)}return{min:e-Ce-i,max:e+Ce+t}}function layoutRepresentations(e,t,i){var n=1;var a=[];var r=[];var o=0;var l=getPercentStackTotalValues();var s={},d={};var c={};var u=null;var p=ne.stackMode&&ne.stackLabelAlignment==="Displaced";var g=je.length>0?je[0].id.split(".")[2]:"0";var m=We.getModel().extendedModel;for(var h=0;h<je.length;h++){if(je[h].instanceOf==="ValueModel"){continue}var f=je[h];var v=Ze[h];var b=0;var T=f.id.split(".")[2];if(T!==g){o++}if(we.length>0){while(we[o]!==f.dataId_dim){o++}}g=T;if(f.isNaN||f.valueType==="FACTOR_NONE"){v.hideLabel=true;var E=St["b"].Layout.Common.getHighlight(ne,v,St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(E&&E.highlight){E.highlight.active=false}continue}var x=Fe[h].usedRuledEntry;var C=Be[f.dataId_expr];setRepresentationColor(f,C,x);var y=Ge[C.id];var M=ae.globalZoom[y];var S=Math.floor(h/ne.expressions.length);var O=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(m,S);f.position.y+=Re*o+O+P+Me;var L=St["b"].Layout.Common.cumulateReferencePointerByRepFactor(f,M,ne);f.position.x=e+L;f.dimension.width=Math.abs(Math.round(f.value*M));if(f.isStack&&u===null){u=f.dimension.height;p=p||ne.stackMode&&ne.stackLabelAlignment==="Automatic"&&u<Ye[h].dimension.height}r.push(Xe[h]);if(f.isOutlier){a.push(h);s[f.dataId_expr]=undefined;if(f.waterfallType===2){d[f.dataId_expr]=undefined}c[f.dataId_expr]=undefined;if(f.instanceOf==="BarModel"){}else if(f.instanceOf==="NeedleModel"){f.dimension.height=Math.max(f.dimension.height,N)}}else{if(f.instanceOf!=="StructureWaterfallModel"){if(f.value<0){f.position.x-=f.dimension.width;if(L<=0){f.position.x+=n}}if(L<0&&f.value>0){f.position.x+=n}}switch(f.instanceOf){case"BarModel":if(f.isStack){if(Ie){if(f.value>0||!De&&0===f.value){var A=l[f.dataId_dim].pos||1;f.position.x=e+Math.round(f.stackModel.startOn/A*M);var _=e+Math.round((f.stackModel.startOn+f.value)/A*M)}else{var A=l[f.dataId_dim].neg;var _=e-Math.round(f.stackModel.startOn/A*M)+1;f.position.x=e-Math.round((f.stackModel.startOn+f.value)/A*M)+1}f.dimension.width=Math.abs(_-f.position.x)}else{f.position.x=e+Math.round(f.stackModel.startOn*M);f.dimension.width=Math.abs(Math.round((f.stackModel.startOn+f.value)*M)+e-f.position.x);if(f.value<0){f.position.x-=f.dimension.width;if(L<=0){f.position.x+=n}}else if(L<0&&f.value>0){f.position.x+=n}}}break;case"NeedleModel":f.lineWidth=N;St["b"].Layout.Common.setNotationShape(Xe[h],x,f.notation,f.concept,false);b=Math.ceil(f.needleSize/2);f.dimension.height=Math.max(f.dimension.height,N);break;case"StructureLineModel":St["b"].Layout.Common.setNotationShape(Xe[h],x,f.notation,f.concept,true);b=Math.ceil(Math.max(f.needleSize,f.lineWidth)/2);if(c[f.dataId_expr]){var I=c[f.dataId_expr];I.nextPosition={x:f.value<0?f.position.x:f.position.x+f.dimension.width,y:f.position.y+Math.floor(f.dimension.height/2)};f.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[f.dataId_expr]=f;break;case"StructureWaterfallModel":f.position.x=e+Math.round((f.relativeValue-f.value)*M)+L;f.dimension.width=Math.abs(e+Math.round(f.relativeValue*M)+L-f.position.x);if(f.value<0){f.position.x-=f.dimension.width}setWaterfallConnections(f,s[f.dataId_expr],d[f.dataId_expr]);s[f.dataId_expr]=f;if(f.waterfallType===2){d[f.dataId_expr]=f}f.dimension.width++;break}}i[f.id]=Xe[h];layoutValueLabel(h,b,C.valueLabelBackground,p,M,e,i);if(!f.isOutlier&&v&&!v.hideLabel){if(f.value>0||!De&&0===f.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}];St["b"].Layout.Common.sortRepresentations(r,D,false);return a}function getPercentStackTotalValues(){var e={};if(ne.stackType==="%"){for(var t=0;t<qe.length;t++){var i=qe[t];var n=i.representation.dataId_dim;e[n]={pos:i.value,neg:0}}for(var t=0;t<Je.length;t++){var i=Je[t];var n=i.representation.dataId_dim;if(e[n]===undefined){e[n]={pos:0,neg:i.value}}else{e[n].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===U.ELEMENT||t.notation===U.ELEMENT_HEADER||t.notation===U.ELEMENT_AXIS){var n=e.waterfallType===0||e.waterfallType===1||e.waterfallType===2;e.color=St["b"].Layout.Common.getNotationColorStructure(i,t.concept,true,e.value>=0,n,false)}else{if(e.instanceOf==="StructureWaterfallModel"){var n=e.waterfallType===0||e.waterfallType===2;e.color=St["b"].Layout.Common.getNotationColorStructure(i,F.AREA,true,e.value>=0,n,true)}else{var a=w.getDataType("Actual").subtypes.ACT0.settings.p;e.color={pattern:a.otherFill1,background:a.otherFill2,border:a.otherBorder}}}}function setWaterfallConnections(e,t,i){if(t){var n;if(e.waterfallType===0){n=e.value>=0?e.position.x:e.position.x+e.dimension.width}else{n=e.value>=0?e.position.x+e.dimension.width:e.position.x}var a=t.value>0||!De&&0===t.value?t.position.x+t.dimension.width-1:t.position.x;if(n===a){var r=t.position.y;var o=e.position.y+e.dimension.height;e.rowConnectionPos={x1:n,x2:n,y1:r,y2:o}}}if(e.waterfallType===2&&i){var n=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=n;e.rowConnectionPos.x4=n;e.rowConnectionPos.y3=l;e.rowConnectionPos.y4=s}}function layoutValuesRepresentationLabel(e,t){var i=0;var n=je.length>0?je[0].id.split(".")[2]:"0";var a=We.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=Fe[r].usedRuledEntry;var d=Be[o.dataId_expr];var c=Math.floor(r/ne.expressions.length);var u=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getEmptySpacesBeforePosition(a,c);var p=l.id.split(".")[2];if(p!==n){i++}if(we.length>0){while(we[i]!==l.dataId_dim){i++}}n=p;if(o&&!o.hideLabel){o.showBackground=d.valueLabelBackground;o.backgroundColor=S.colorLabelBackground;o.backgroundTransparency=j;if(d.notation===U.ELEMENT||d.notation===U.ELEMENT_HEADER||d.notation===U.ELEMENT_AXIS){var g=St["b"].Layout.Common.getNotationColorStructure(s,d.concept,true,l.value>=0,false,false);o.color=g.pattern}else{var m=w.getDataType("Actual").subtypes.ACT0.settings.p;l.color={pattern:m.otherFill1,background:m.otherFill2,border:m.otherBorder}}l.position.y+=Re*i+u+P+Me;o.position.y=l.position.y+Math.round((l.dimension.height-o.dimension.height)/2);if(Le){if(l.value>0||!De&&0===l.value){o.position.x=e+Ce+z}else{o.position.x=e-Ce-z;o.textAnchor="end"}}else{o.position.x=e;o.textAnchor="middle"}}t[o.id]=Qe[r]}}function layoutValueLabel(e,t,i,n,a,r,o){var l=je[e];if(l.instanceOf==="ValueModel"){return}var s=Ze[e];s.hideLabel=s.hideLabel||ne.stackMode&&l.isStack&&ne.stackLabelVisibility===false&&s.dimension.width>l.dimension.width;if(s.hideLabel){var d=St["b"].Layout.Common.getHighlight(ne,s,St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(d&&d.highlight){d.highlight.active=false}}if(s&&!s.hideLabel){s.showBackground=i;s.backgroundColor=S.colorLabelBackground;s.backgroundTransparency=j;if(!l.isOutlier){if(l.isStack){s.position.y=n?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(a*getPercentStackValue(l,2))}else{s.position.x=r+Math.round(a*(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<Ce&&Object.keys(l.referencePointer).length===0&&l.instanceOf!=="StructureWaterfallModel"){s.position.x=l.position.x+Ce+z+t}else{s.position.x=l.position.x+l.dimension.width+z+t}}else{if(l.dimension.width<Ce&&Object.keys(l.referencePointer).length===0&&l.instanceOf!=="StructureWaterfallModel"){s.position.x=l.position.x+l.dimension.width-Ce-z-t}else{s.position.x=l.position.x-z-t}s.textAnchor="end"}}o[s.id]=Qe[e]}}}function layoutTotals(i,s){function helper(e,t,i){for(var n=0;n<e.length;n++){var a=e[n].representation;var r=e[n].label;if(r&&!r.hideLabel){r.position.y=a.position.y+Math.round((a.dimension.height-r.dimension.height)/2);i(r,a);r.showBackground="transparent";r.backgroundColor=S.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,at,function(e,t){e.position.x=t.position.x+t.dimension.width+z;i.max=Math.max(i.max,e.position.x+e.dimension.width)});helper(Je,ot,function(e,t){e.position.x=t.position.x-z;e.textAnchor="end";i.min=Math.min(i.min,e.position.x-e.dimension.width)})}function layoutOutliers(e,t,i,n){var a=0;var r=Math.round(xe/2);var o=t+r;var l=t-r-a;for(var s=0;s<e.length;s++){var d=je[e[s]];var c=Ze[e[s]];var u=Be[d.dataId_expr];d.symbolSize=h[d.valueType];if(c&&!c.hideLabel){if(u.outlierStyle==="value-symbol"){if(d.value>=0){c.position.x=o+z;var p=i.max-M-c.position.x-c.dimension.width;d.dimension.width=u.outlierSymbols&&p>=y?y:0;d.position.x=i.max-d.dimension.width-M}else{c.position.x=l-z;c.textAnchor="end";var p=c.position.x-c.dimension.width-M-i.min;d.dimension.width=u.outlierSymbols&&p>=y?y:0;d.position.x=i.min}}else{if(d.value>=0){c.position.x=i.max;c.textAnchor="end";d.position.x=o+M;var p=c.position.x-c.dimension.width-z-d.position.x;d.dimension.width=u.outlierSymbols&&p>=y?y:0}else{c.position.x=i.min;var p=l-M-c.position.x-c.dimension.width-z;d.dimension.width=u.outlierSymbols&&p>=y?y:0;d.position.x=l-M-d.dimension.width}}c.position.y=d.position.y+Math.round((d.dimension.height-c.dimension.height)/2);n[c.id]=Qe[e[s]]}else{var g=me.width-q-o;var m=l-M-Te-q-pe;if(d.value>=0){d.dimension.width=u.outlierSymbols&&g>=y?y:0;d.position.x=o+M}else{d.dimension.width=u.outlierSymbols&&m>=y?y:0;d.position.x=l-M-d.dimension.width}}}}function hideOverlappingLabels(){var e={};for(var t in Be){e[t]=Be[t].valueLabelOpt.split(".")[1]==="Dynamic"}for(var t in Be){if(!Be[t].valueLabelOverlapSelf){St["b"].Layout.Common.hideExpressionOverlappingLabels(it[t],Pe,ne,J,ee)}}if(ne.stackMode&&!ne.stackLabelOverlapSelf){St["b"].Layout.Common.hideExpressionOverlappingLabels(nt.concat(rt),Pe,ne,J,ee)}St["b"].Layout.Common.hideOverlappingLabels(Ze,nt,rt,ie,Pe,e,J,ee)}function getLegendOffsets(){var e={top:0,bottom:0};var t=se.extendedModel.maxValueRowLabelStructure[ie.row];e.top=Me-t[0];var i=K+(Oe?X:0);e.bottom=Me+Ve.getDimension().height+i;return e}function layoutLegend(e,t,i){for(var n=0;n<lt.length;n++){var a=lt[n];var r=a.valueRowLabelPosition.split(".")[1];if(r==="1"||r==="2"||r==="3"){a.position.y+=t.top}else if(r==="4"||r==="5"||r==="6"){a.position.y+=t.bottom}a.position.x+=t.side;i[a.id]=st[n];if(a.showConnector&&(ye===null||r!=="2")){layoutLegendConnector(a,r,i)}}}function layoutLegendConnector(e,t,i){var n=t==="1"||t==="2"||t==="3";var a=(t==="4"||t==="5"||t==="6")&&Le===true;var r=e.id.split(".");var o=Me+Ve.getDimension().height;for(var l=0;l<dt.length;l++){var s=dt[l];if(s.id.split(".")[3]===r[2]){var d=Be[e.dataId_expr];var c;if(d.representation===m.VALUE){c=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(Ze,e.dataId_expr,n,true)}else{c=St["b"].Layout.Common.getFirstNonZeroRepresentationByExprId(je,e.dataId_expr,n,false)}if(c===null){if(Le){a=true}else{break}}var u=!a&&(c.instanceOf==="BarModel"||c.instanceOf==="StructureWaterfallModel");var p=u&&c.instanceOf==="StructureWaterfallModel";var g=!a&&c.instanceOf==="NeedleModel";s.dimension.width=Y;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?Y-1:0}else if(u){s.position.x-=c.value>0||!De&&0===c.value?Y:-1}else{s.position.x-=Math.floor(Y/2)}if(n){s.position.y=e.position.y+e.dimension.height+K;s.dimension.height=(a?Me:u||g?c.position.y+Math.round(c.dimension.height/2):c.position.y)-s.position.y}else{s.position.y=a?o:c.position.y+(u||g?Math.round(c.dimension.height/2):c.dimension.height);s.dimension.height=e.position.y-K-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(ye!==null){var i=ze.getModel();var n=je[ye];var a=Be[n.dataId_expr];var r=Fe[ye].usedRuledEntry;var o=a.notation===U.HEADER;var l=false;i.dataType=o?r.baseDataType:r.referenceDataType;if(a.notation===U.ELEMENT_HEADER){var s=a.referenceConcept}else{var s=a.concept}i.color=St["b"].Layout.Common.getNotationColorStructure(r,s,o,n.value>=0,l,false);i.otherPattern=St["b"].Layout.Common.getOtherPattern(r,a.notation,s,o);i.concept=s;i.referenceUsed=r.referenceUsed;i.notation=a.notation;var d=null;for(var c=0;c<lt.length;c++){if(lt[c].dataId_expr===n.dataId_expr){d=lt[c];break}}i.dimension.width=Math.round((d===null?oe.measureTextDim(a.name,p).width:d.dimension.width)*1.1);i.dimension.height=v;i.position.y=Me-T-v;i.position.x=e-Math.round(i.dimension.width/2);t[i.id]=ze}}function layoutScalingHelpers(e,t,i){var n=Ve.getModel();for(var a=0;a<pt.length;a++){var r=pt[a];var o=gt[a];var l=Ge[r.expressionId];var s=Math.round(r.value*ae.globalZoom[l]);if(!isFinite(s)){s=0}r.dimension={width:s,height:n.dimension.height};r.position={x:e,y:n.position.y};r.lineWidth=W;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<mt.length;p++){if(mt[p].id.indexOf(u)>=0){d=mt[p];c=ht[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 n,a;if(ne.stackLine==="Start"){var r=getEdgeStackBar(i,false);n=Ve.getPosition().y;a=r.position.y+r.dimension.height;t.position.y+=l.top+se.extendedModel.maxValueRowLabelStructure[ie.row][0]}else{var r=getEdgeStackBar(i,true);n=r.position.y;a=Ve.getPosition().y+Ve.getDimension().height;t.position.y=a+e.arrowHeight+K}e.position.y=n;e.dimension.height=a-n;t.textAnchor="middle";t.hideLabel=false}for(var t=0;t<ft.length;t++){var i=ft[t];var n=i.getModel();var a=vt[t];a.hideLabel=true;if(Ae&&n.id.indexOf("pos")!==-1){setStackLineData(n,a,true);e[i.getId()]=i;e[bt[t].getId()]=bt[t]}else if(_e&&n.id.indexOf("neg")!==-1){setStackLineData(n,a,false);e[i.getId()]=i;e[bt[t].getId()]=bt[t]}}}function setDataForScrolling(e){var t=me.width;var i=me.height;var n=t;var a=Ve.getPosition().y+Ve.getDimension().height;var r=Ve.getPosition().y;var o=0,l=0;var s=We.getPosition().x+We.getDimension().width;var d=s;var c=false;for(var u in He){if(He[u].manualScaling){c=true;break}}for(var p=0;p<lt.length;p++){var g=lt[p];var m="structureLegendType."+g.valueRowLabelPosition.split(".")[1];r=Math.min(r,g.position.y);if(H.indexOf(m)!==-1){var h=V/2;if(r>g.position.y-h){r=r-h;a=a+h}}else if(k.indexOf(m)!==-1){a=Math.max(a,g.position.y+g.dimension.height+$/2)}var f=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(g).x;if(Be[g.dataId_expr].legendInGrid){o=Math.min(o,f);s=Math.max(s,f+g.dimension.width)}else{l=Math.min(l,f);d=Math.max(d,f+g.dimension.width)}}for(var p=0;p<vt.length;p++){var v=vt[p];r=Math.min(r,v.position.y);a=Math.max(a,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 E=b.position.x+b.dimension.width;if(b.needleSize!==undefined){if(b.value>0||!De&&0===b.value){T=b.position.x;E=E+Math.round(b.needleSize/2)}else{T=b.position.x-Math.round(b.needleSize/2)}}var x=T-Te;T=x<0?x:T;o=Math.min(o,T);s=Math.max(s,E)}if(!v.hideLabel){var f=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var x=f-Te;f=x<0?x:f;o=Math.min(o,f);s=Math.max(s,f+v.dimension.width);var C=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;l=Math.min(l,f-C);d=Math.max(d,f+v.dimension.width+C)}}for(var p=0;p<qe.length;p++){var v=qe[p].label;if(!v.hideLabel){var f=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var C=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;s=Math.max(s,f+v.dimension.width);d=Math.max(d,f+v.dimension.width+C)}}for(var p=0;p<Je.length;p++){var v=Je[p].label;if(!v.hideLabel){var f=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(v).x;var C=v.isHighlighted?Math.round(v.dimension.width*(G-1)/2):0;var x=f-Te;f=x<0?x:f;o=Math.min(o,f);l=Math.min(l,f-C)}}for(var p=0;p<ut.length;p++){var y=ut[p].getModel();if(y.hide||y.active===false){continue}var M=St["b"].Layout.Common.getMaxPosition(y,true,convertNMParameterForMultiple);r=Math.min(r,M.position.y);a=Math.max(a,M.position.y+M.dimension.height);if(y.text.moved||y.percent.moved||y.absolute.moved){s=Math.max(s,M.position.x+M.dimension.width)}}for(var S=0;S<mt.length;S++){var O=mt[S];r=Math.min(r,O.position.y);a=Math.max(a,O.position.y+O.dimension.height)}if(c&&s-o>t){o-=q;s+=q;l-=q;d+=q}n=s-o;if(n>t||l>o||d<s){l=Math.min(l,o);d=Math.max(d,s);n=d-l;updatePanelsPositionsForLeftOffset(l,e)}B={width:0,height:a-r+Q+K};var L,A=2,_=!ie.disableScrolling&&a-i>A,I=!ie.disableScrolling&&n-t>A;if(he){var D=ie.border.left.width+ie.padding.left,R=ie.border.top.width+ie.padding.top,N=St["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};L={width:me.width,height:me.height,realWidth:n,realHeight:a,scrollingVer:_,scrollingHor:I,x:D,y:R,id:N};ie.scrollingData.children[N]=L}else{ie.scrollingData={width:ce.width,height:ce.height,realWidth:n,realHeight:a,scrollingVer:_,scrollingHor:I,x:ue.x,y:ue.y,id:ie.id};L=ie.scrollingData;var P=$e.getModel().dimension;ie.scrollingData.scrollingVer&&(P.height=a);ie.scrollingData.scrollingHor&&(P.width=n)}Ne.legend!==null&&(L.scrollingHorRef=St["b"].Layout.Common.extractLinkedChartIds(Ne.legend.linkedCharts,ie.id))}function updatePanelsPositionsForLeftOffset(e,t){for(var i=0;i<t.length;i++){var n=t[i].getModel();if(n.instanceOf==="StructureWaterfallModel"){n.position.x-=e;n.rowConnectionPos.x1-=e;n.rowConnectionPos.x2-=e;if(n.rowConnectionPos.x3!==undefined){n.rowConnectionPos.x3-=e;n.rowConnectionPos.x4-=e}}else if(n.instanceOf==="StructureLineModel"){n.position.x-=e;if(n.nextPosition.x!==0){n.nextPosition.x-=e}if(n.previousPosition.x!==0){n.previousPosition.x-=e}}else if(n.instanceOf==="CompareModel"&&n.active){n.fromPosition.x-=e;n.toPosition.x-=e;n.preferredPosition.x-=e;n.position.x-=e;if(n.absolute.legend!==a.NONE){n.absolute.position.x-=e}if(n.percent.legend!==a.NONE){n.percent.position.x-=e}if(n.text.legend!==a.NONE&&n.text.text!==""){n.text.position.x-=e}}else if(n.instanceOf!=="ContainerModel"&&n.instanceOf!=="BackGroundModel"){n.position.x-=e}}}function collectData(e){te=false;ae=e[0].getController().getRootModel();oe=e[0].getPainter();le=St["b"].Factories.ModelFactory.getParentContainer(ae.firstObjectGrid,ie);se=le[0];var t=le[1];if(ie.multiplePath!==undefined&&t&&t.extendedModel&&t.extendedModel.instanceOf==="MultipleContainerModel"){C=true;de=t}if(!se.extendedModel.maxValueRowLabelStructureBottom){console.warn("maxValueRowLabelStructureBottom is not defined",se.extendedModel);se.extendedModel.maxValueRowLabelStructureBottom=[]}readParameters();sortOutChildren(e);var i=We.getModel().extendedModel.displayType!==I.NONE;for(var n=0;n<ne.expressions.length&&!Le;n++){Le=ne.expressions[n].representation!==m.VALUE||i}var a=We.getLayout().getColumns();var r=We.getModel().children;for(var n=0;n<r.length;n+=a){we.push(r[n].dataId_dim)}if(ie.multiplePath!=undefined){Pe=St["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(re.dataModel,ie.multiplePath,0,true,ie.isMultipleTotal)}else{Pe=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(re.dataModel,0)}Ue=new Array(je.length);Fe=new Array(je.length);fillDataNodesAndHashes();fillStackData(et);fillScalingGroupData()}function readParameters(){x=C?de.extendedModel.fontSize:w.getParameterParsed("FONT_SIZE_CHART");O=n.pt2pix(x);p=i+" "+O+"px '"+t+"'";r=w.getParameterParsed(ne.timeFactor);y=convertNMParameterForMultiple("MMPT_STRUCTURE_SYMBOL_SIZE");N=convertNMParameterForMultiple("MMPT_STRUCTURE_NEEDLE_LINE_SIZE");l=convertNMParameterForMultiple("MMPT_STRUCTURE_LINE_SIZE");d=convertNMParameterForMultiple("MMPT_STRUCTURE_THIN_LINE_SIZE");L=w.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");G=w.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");A=convertNMParameterForMultiple("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");c=convertNMParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISPLACEMENT_DISTANCE");M=convertNMParameter("MMPT_STRUCTURE_OUTLIER_DISTANCE");_=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");E=convertNMParameter("MMPT_STRUCTURE_HEADER_TEXT_SPACE");W=convertNMParameterForMultiple("MMPT_SCALING_HELPER_LINE_SIZE");z=convertNMParameter("MMPT_STRUCTURE_VALUE_LABEL_ELEMENT_DISTANCE");X=convertNMParameterForMultiple("MMPT_STRUCTURE_LEGEND_MIN_CONNECTOR_LENGTH");Y=convertNMParameterForMultiple("MMPT_STRUCTURE_LEGEND_CONNECTOR_WIDTH");K=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=he?St["b"].Utils.Constants.Parameters.idContainerContent+"."+ie.id:undefined;for(var i=0;i<e.length;i++){var n=e[i];var a=n.getModel();var r=a.instanceOf;if(r==="BarModel"){je.push(a);Xe.push(n);if(a.isStack){et.push(a)}a.nestedContainerId=t}else if(r==="NeedleModel"||r==="StructureLineModel"||r==="StructureWaterfallModel"||r==="ValueModel"){je.push(a);Xe.push(n);a.nestedContainerId=t}else if(r==="LabelModel"){if(a.id.indexOf("stack_sum")>0){var o=a.id.split(".").pop();if(o==="pos"){nt.push(a);at.push(n)}else if(o==="neg"){rt.push(a);ot.push(n)}else{Ye.push(a);Ke.push(n)}}else if(a.id.indexOf("valueRowLabel")>=0){lt.push(a);st.push(n)}else if(a.id.indexOf("scalingHelperLabel")>=0){mt.push(a);ht.push(n)}else if(a.id.indexOf("stackLineLabel")>=0){vt.push(a);bt.push(n)}else{Ye.push(a);Ke.push(n)}a.nestedContainerId=t}else if(r==="RowConnectorModel"){dt.push(a);ct.push(n);a.nestedContainerId=t}else if(r==="AxisModel"){Ve=n;a.nestedContainerId=t}else if(r==="DataTypeAnnotatorModel"){ze=n;a.nestedContainerId=t}else if(r==="BackGroundModel"){$e=n}else if(r==="CompareModel"){ut.push(n);a.nestedContainerId=t}else if(r==="ContainerModel"){if(a.extendedModel.instanceOf==="DimensionLabelModel"){We=n}a.nestedContainerId=t}else if(r==="ScalingHelperModel"){pt.push(a);gt.push(n);a.nestedContainerId=t}else if(r==="StackLineModel"){ft.push(n);a.nestedContainerId=t}}}function fillStackData(e){var t={};var i=99,n=0;Ie=e.length>0&&ne.stackType==="%";for(var a=0;a<e.length;a++){var r=e[a];if(t[r.dataId_dim]===undefined){t[r.dataId_dim]=[]}t[r.dataId_dim].push(r);if(r.stackOrder<i){i=r.stackOrder;n=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 a=0;a<l.length;a++){var m=l[a];var h=m.value>0||!De&&0===m.value;m.stackModel={startOn:h?s:d};if(m.valueType!=="FACTOR_NONE"&&!m.isNaN){if(h){s=s+m.value;c+=m.value;p=m}else{d=d+m.value;u+=m.value;g=m}}m.sequence=n}if(c>0||c===0&&p!==null){qe.push({value:c+l[0].referencePointerSum,label:getTotalLabelByDimId(nt,l[0].dataId_dim),representation:p});Ae=true}if(u<0){Je.push({value:u+l[0].referencePointerSum,label:getTotalLabelByDimId(rt,l[0].dataId_dim),representation:g});_e=true}}}function getTotalLabelByDimId(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.dataId_dim===t){return n}}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<ne.expressions.length;e++){var t=ne.expressions[e].id.split(".").pop();tt[t]=[];it[t]=[]}var i=-1;var n=false,a=false;for(var e=0;e<je.length;e++){var r=je[e];Ue[e]=St["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(r.dataId_dim,Pe,Math.floor(e/ne.expressions.length));Fe[e]=getExprNode(Ue[e],r.dataId_expr);if(Be[r.dataId_expr]===undefined){for(var o=0;o<ne.expressions.length;o++){var l=ne.expressions[o];if(r.dataId_expr===l.id.split(".").pop()){Be[r.dataId_expr]=l;break}}}var s=r.id.split(".")[2];var d,c;do{d=Ye[++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]=Ke[i]}if(tt[r.dataId_expr]===undefined){console.warn("structure.fillDataNodesAndHashes")}tt[r.dataId_expr].push(r);it[r.dataId_expr].push(Ze[e]);n=n||r.value>0;a=a||r.value<0}De=a&&!n}function fillScalingGroupData(){var e={};var t=null;Ge={};ke={};He={};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<ne.expressions.length;i++){var n=ne.expressions[i];var a=St["b"].Factories.ViewFactory.getScalingGroupByChartExpression(n,re,ie,ae);Ge[n.id]=a;if(ke[a]!==undefined){e[ke[a]].push(n);continue}var r=a;if(n.isStack){if(t===null){t=n.id}r=Ge[t]}if(e[r]===undefined){e[r]=[]}if(a!==r&&e[a]!==undefined){e[r]=e[r].concat(e[a]);delete e[a]}e[r].push(n);if(ke[a]===undefined||a!==r){ke[a]=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 m=St["b"].Utils.Calculator.resolveQvVars(g.scalingGroup);if(m===o&&b[g.scalingGroup]&&!b[g.scalingGroup].auto&&b[g.scalingGroup].manualFactor!=null){u=g.scalingGroup}if(p.isStack&&ne.stackMode){c=true}else{var h=p.id.split(".").pop();s=s.concat(tt[h]);d=d.concat(it[h])}}var f=u!==null;var v=c?qe.concat(Je):[];He[o]={representations:s,valueLabels:d,stackRepresentations:v,exprs:e[o],originalScalingGroup:u,manualScaling:f}}}function getAvailableSpace(){var e=ie.border,t=ie.padding;me.width=ce.width-e.left.width-e.right.width-t.left-t.right;me.height=ce.height-e.top.width-e.bottom.width-t.top-t.bottom;return Math.max(me.width-Te-q*2,ve)}this.getPreferredLayoutSize=function(){return B}};St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Table=St["b"].Layout.Table||{};St["b"].Layout.Table.CompareLayoutHelpers={layoutCompares:function(e,R,t,i,n){var N=St["b"].DataObjects.RuntimeDO;var a=St["b"].Utils.Calculator.Converter;var r=a.mm2pix(n*N.getParameterParsed("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH"));var o=a.mm2pix(n*N.getParameterParsed("MMPT_HIGHLIGHT_ARROW_SIZE"));var l=a.mm2pix(n*N.getParameterParsed("MMPT_HIGHLIGHT_PIN_SIZE"));var P=St["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 f=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!==P.AXIS){var g=c.dataId_expr}else{var g=u.dataId_expr}for(var m=0;m<i.length;m++){if(i[m].getModel().id.split(".")[2]===g){p=i[m].getPosition().x+Math.round(i[m].getDimension().width/2)}}var h=calculateCompareLayout(c,u,w.offset.y,p-1);w.fromPosition=h.fromPosition;w.toPosition=h.toPosition;d.setPosition(h.position);d.setDimension(h.dimension);w.preferredDimension=h.dimension;w.preferredPosition=h.position;var v=calculateCompareTextLayout(h);w.percent.position=v.percentPosition;w.absolute.position=v.absolutePosition;w.text.position=v.textPosition;w.ellipseArray=v.ellipse;w.ellipseStrokeWidth=r;w.arrowType=h.arrowType;var b=w.compareStyle;if(b===P.NOTATION){b=N.getParameter("COMPARE_DEFAULT_TYPE")}if(b===P.ARROW){w.headBaseSize=o;w.headWidth=N.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,n,a,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,m=0;var h=a;if(n<w.midMaxHeight){p=(w.midMaxHeight-n)/2}if(e===3){g=c/2+n/2+2}else if(e===2){if(t===1){g=p+f.fSize/2+n/2}else{if(i===1){g=n/2;m=n}else{g=c/2+n/2}}}else if(e===1){if(t===1){if(i!==1){g=p+n/2}}else if(t===2){g=f.fSize/2}else if(t===0){if(i===1){m=n}else if(i===2){g=n/2*-1;m=n}else if(i===0){g=n/2+c/2}}}else if(t===2){if(i===1){g=n/2*-1}}else if(t===1){if(i===1){g=n/2*-1}else if(i===2){g=(n/2+f.fSize/2)*-1}}else if(i===3){g=(n/2+u/2)*-1}else if(i===2){g=(n/2+u/2)*-1}else if(i===1){g=(n/2+u/2)*-1}if(w.text.moved&&w.text.legend!==P.NONE&&w.text.text!==""){h=l.x+w.text.dimension.width/2}else if(w.percent.moved&&w.percent.legend!==P.NONE){h=o.x+w.percent.dimension.width/2}else if(w.absolute.moved&&w.absolute.legend!==P.NONE){h=s.x+w.absolute.dimension.width/2}d.x=Math.round(h);d.y=Math.round(r-g);d.width=Math.round(w.maxWidth);d.height=Math.round(w.topMaxHeight+w.midMaxHeight+w.bottomMaxHeight+m);return d}function calculateCompareTextLayout(e){var t;var i={x:0,y:0},n={x:0,y:0},a={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!==P.NONE){if(w.absolute.legend===P.START){d=d+1}else if(w.absolute.legend===P.MID){c=c+1}else if(w.absolute.legend===P.END){u=u+1}}if(w.percent.legend!==P.NONE){if(w.percent.legend===P.START){d=d+1}else if(w.percent.legend===P.MID){c=c+1}else if(w.percent.legend===P.END){u=u+1}}if(w.text.legend!==P.NONE&&w.text.text!==""){if(w.text.legend===P.START){d=d+1}else if(w.text.legend===P.MID){c=c+1}else if(w.text.legend===P.END){u=u+1}}var p=1;if(w.ellipse){p=parseFloat(N.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"))}if(w.absolute.legend!==P.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!==P.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!==P.NONE){n.x=Math.round(r-w.percent.dimension.width/2);if(e.dimension.width<w.percent.dimension.width&&d+c+u===1&&w.percent.legend!==P.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){n.x=e.position.x+e.dimension.width+g}else{n.x=e.position.x-g-w.percent.dimension.width}w.percent.moved=true}n.y=setPercentPosition(o,l,d,c,u)}if(w.text.legend!==P.NONE&&w.text.text!==""){a.x=Math.round(r-w.text.dimension.width/2);if(e.dimension.width<w.text.dimension.width&&d+c+u===1&&w.text.legend!==P.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){a.x=e.position.x+e.dimension.width+g}else{a.x=e.position.x-g-w.text.dimension.width}w.text.moved=true}a.y=setTextPosition(o,l,d,c,u)}if(w.ellipse){t=setEllipse(d,c,u,l,r,o,n,a,i)}return{absolutePosition:i,percentPosition:n,textPosition:a,ellipse:t}}function setPercentPosition(e,t,i,n,a){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===P.START){if(i===2){if(w.text.legend===P.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===P.MID){if(n===3){c=e+l/2-r.height}else if(n===2){c=e+l/2-r.height}else if(n===1){c=e-l/2}}else{if(a===3){c=e+2+t/2+s/2-r.height/2}else if(a===2||a===1){if(w.absolute.legend===P.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,n,a){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===P.START){c=e-t/2-o-d}else if(w.text.legend===P.MID){c=e-l/2}else{c=e+2+t/2+s-r.height+d}return Math.round(c)}function setAbsolutePosition(e,t,i,n,a){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===P.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===P.MID){if(n===3){d=e-r.height/2}else if(n===2){if(w.text.legend===P.MID&&w.text.text!==""){d=e}else{d=e-l/2}}else if(n===1){d=e-l/2}}else{if(a===3){d=e+2+t/2+s}else if(a===2||a===1){d=e+2+t/2+s}}return Math.round(d)}function revertLegend(){if(w.absolute.originalLegend&&w.absolute.originalLegend===P.AUTO){w.absolute.legend=w.absolute.originalLegend;delete w.absolute.originalLegend}if(w.percent.originalLegend&&w.percent.originalLegend===P.AUTO){w.percent.legend=w.percent.originalLegend;delete w.percent.originalLegend}if(w.text.originalLegend&&w.text.originalLegend===P.AUTO){w.text.legend=w.text.originalLegend;delete w.text.originalLegend}}function calculateCompareLayout(e,t,i,n){var a=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!==P.AXIS){if(e.instanceOf==="NeedleModel"){a=e.needleSize/2;o=e.needleSize/2}}if(t!==P.AXIS){if(t.instanceOf==="NeedleModel"){r=t.needleSize/2;l=t.needleSize/2}}var u=0,p=0;if(e===P.AXIS||w.compareFromCat===P.AXIS){u=n}else if(e.value>0){if(w.compareFromStart===P.END){u=Math.round(e.position.x+e.dimension.width-a)}else{u=Math.round(e.position.x)}}else{if(w.compareFromStart===P.END){u=Math.round(e.position.x+a)}else{u=Math.round(e.position.x)}}if(t===P.AXIS||w.compareToCat===P.AXIS){p=n}else if(t.value>0){if(w.compareToStart===P.END){p=Math.round(t.position.x+t.dimension.width-r)}else{p=Math.round(t.position.x)}}else{if(w.compareToStart===P.END){p=Math.round(t.position.x+r)}else{p=Math.round(t.position.x)}}var g={x:0,y:0};var m={x:0,y:0};g.x=u;m.x=p;if(e!==P.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!==P.AXIS){if(t.instanceOf!=="NeedleModel"){m.y=Math.round(t.position.y+t.dimension.height/2)}else{if(g.y+i+o>t.position.y){m.y=Math.round(t.position.y+t.dimension.height/2+l)}else{m.y=Math.round(t.position.y+t.dimension.height/2-l)}}}if(e===P.AXIS||w.compareFromCat===P.AXIS){g.y=m.y}else if(t===P.AXIS||w.compareToCat===P.AXIS){m.y=g.y}if(u>p){var h=u;u=p;p=h;i=i+g.y-m.y;h=g;g=m;m=h}if(m.x<=g.x){var f=true;i=i+g.y-m.y}else{var f=false;i=i+m.y-g.y}var v=p-u;var b;var T=w.font.fSize;var E=0;var x=0;if(w.ellipse){E=parseFloat(N.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"));var C=parseFloat(N.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));x=Math.round(w.maxWidth*C*2)}if(w.ellipse){if(v>x+2*T+1){b=0}else if(v>T){b=1}else{b=2}}else{var y=w.compareStyle;if(y===P.NOTATION){y=N.getParameter("COMPARE_DEFAULT_TYPE")}if(y===P.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===P.END||w.compareLegend===P.START){var M=R.length-1;var S=R[M].getModel();if(S.isNaN){M--;while(M>=0){S=R[M].getModel();if(!S.isNaN){M=0}M--}}var O=w.midMaxHeight;var L=w.topMaxHeight;var A=O-d;if(A<0){A=0}var _=L+A/2;if(w.ellipse){_=_*E}var I=0;if(S.instanceOf!=="RodModel"&&S.instanceOf!=="NeedleModel"){I=S.position.y+S.dimension.height}else{I=S.position.y+S.needleSize}I=I+_+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===P.FROM){var D=0;if(e!==P.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===P.TO){var D=0;if(t!==P.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=m.y+w.offset.y}s={x:u,y:Math.round(D)}}else{var D=0;if(f){D=m.y+i-E/2}else{D=g.y+i-E/2}s={x:u,y:Math.round(D)}}return{dimension:{width:v,height:d},position:s,fromPosition:g,toPosition:m,arrowType:b}}},setTextAndDimensions:function(e,t,i,n,a){var m=St["b"].DataObjects.RuntimeDO;var h=St["b"].DataObjects.DocumentDO.getPainter();var r=new St["b"].Utils.Calculator(i);r.setCondenseRoot(i.dataModel.baseNode);if(i.dataModel.dimSize===1){r.setCondenseLevel(1)}else{r.setCondenseLevel(0)}var f=St["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=St["b"].Layout.Common.getCompareToAndFrom(v,a,r,t);v.compareFrom=s.compareFrom;v.compareTo=s.compareTo;if(v.compareFrom===f.AXIS&&v.compareTo===f.AXIS){v.active=false;v.hide=true;continue}St["b"].Models.Actions.ViewModelActions.CompareModel.setText(v,i,a);if(v.compareFrom&&v.compareTo){var d=r.setupCompareFormulas(v,a.multiplePath,a.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},n={width:0,height:0};var a=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!==f.NONE){v.absolute.moved=false;t=h.measureTextDim(v.absolute.text,s);var e=Math.max(t.width,e);if(v.absolute.legend===f.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==f.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==f.AXIS){u=v.compareTo.position.x}d=Math.abs(u-c);var p=t.width;if(v.ellipse){var g=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.absolute.originalLegend=v.absolute.legend;if(p<d){v.absolute.legend=f.START;a+=t.height}else{v.absolute.legend=f.END;o+=t.height}}else{if(v.absolute.legend===f.START){a+=t.height}else if(v.absolute.legend===f.MID){r+=t.height}else{o+=t.height}}}if(v.percent.legend!==f.NONE){v.percent.moved=false;i=h.measureTextDim(v.percent.text,s);e=Math.max(i.width,e);if(v.percent.legend===f.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==f.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==f.AXIS){u=v.compareTo.position.x}d=Math.abs(c-u);var p=i.width;if(v.ellipse){var g=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.percent.originalLegend=v.percent.legend;if(p<d){v.percent.legend=f.START;a+=i.height}else{v.percent.legend=f.END;o+=i.height}}else{if(v.percent.legend===f.START){a+=i.height}else if(v.percent.legend===f.MID){r+=i.height}else{o+=i.height}}}if(v.text.legend!==f.NONE&&v.text.text!==""){v.text.moved=false;n=h.measureTextDim(v.text.text,s);if(n.height===0){n.height=l.fSize}e=Math.max(n.width,e);if(v.text.legend===f.AUTO){var d=0;var c=0,u=0;if(v.compareFromCat!==f.AXIS){c=v.compareFrom.position.x}if(v.compareToCat!==f.AXIS){u=v.compareTo.position.x}d=Math.abs(c-u);var p=n.width;if(v.ellipse){var g=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));p=p*g*2}v.text.originalLegend=v.text.legend;if(p<d){v.text.legend=f.START;a+=n.height}else{v.text.legend=f.END;o+=n.height}}else{if(v.text.legend===f.START){a+=n.height}else if(v.text.legend===f.MID){r+=n.height}else{o+=n.height}}}if(v.ellipse){var g=parseFloat(m.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));e=Math.round(e*g*2)}}return{absDim:t,percDim:i,textDim:n,topMaxHeight:a,midMaxHeight:r,bottomMaxHeight:o,maxWidth:e}}},displaceCompares:function(e,t){var i=St["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var n=e.slice(0);n=n.sort(sortAsc);for(var a=0;a<n.length;a++){var r=n[a].getModel();if(!r.active){continue}var o=St["b"].Layout.Common.getMaxPosition(r,true,t);var l=o.position;var s=o.dimension;for(var d=a+1;d<n.length;d++){var c=n[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=St["b"].Layout.Common.getMaxPosition(c,true,t);var p=u.position;var g=u.dimension;var m=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var h=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(m&&h){var f=l.y+s.height-p.y;c.displacement=f;c.displaced=true;c.position.y+=f;if(c.absolute.legend!==i.NONE){c.absolute.position.y+=f}if(c.percent.legend!==i.NONE){c.percent.position.y+=f}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.y+=f}if(c.ellipse){c.ellipseArray.y+=f}}}}}};var st=r(64);var dt=r(494);St["b"].Layout.Table=St["b"].Layout.Table||{};St["b"].Layout.Table.TableLayout=function(e,t){var i="table";var n=e!=null?e:1,a=t!=null?t:1;var I=new St["b"].Utils.Format.LabelFormatter;var x=St["b"].DataObjects.RuntimeDO;var y=rt["a"].notation;var D=rt["a"].interpretation;var R=rt["a"].tableRepresentation;var N=rt["a"].labelHorizontalAlignment;var P=rt["a"].labelVerticalAlignment;var m=rt["a"].tableLegend;var c=x.getParameterParsed("FONT_SIZE_CHART");var w=lt["a"].pt2pix(c);var U=x.getParameter("FONT_FAMILY");var F=x.getParameter("FONT_STYLE_CHART");function mm2pix(e){return lt["a"].mm2pix(c*e)}function convertNMParameter(e){return mm2pix(x.getParameterParsed(e))}var M=convertNMParameter("MMPT_TABLE_AXIS_WITH_NOTATION");var S=convertNMParameter("MMPT_TABLE_AXIS_WITHOUT_NOTATION");var b=convertNMParameter("MMPT_TABLE_HEADER_WITH_NOTATION");var T=convertNMParameter("MMPT_TABLE_HEADER_WITHOUT_NOTATION");var E=x.getParameter("COLOR_TITLE_BOTTOM_BORDER");var h=convertNMParameter("MMPT_AGGREGATION_BORDER_HEIGHT");var f=x.getParameter("COLOR_AGGREGATION_BORDER");var v=x.getParameter("AGGREGATION_ALIGNMENT");var u=mm2pix(.02);var p=convertNMParameter("MMPT_TABLE_HEADER_LABEL_DISTANCE_TOP");var C=convertNMParameter("MMPT_TABLE_HEADER_LABEL_DISTANCE_BOTTOM");var r=convertNMParameter("MMPT_TABLE_HEADER_ELEMENT_DISTANCE");var o=0;var O=Math.max(C,convertNMParameter("MMPT_TABLE_HEADER_TEXT_SPACE"));var B=convertNMParameter("MMPT_TABLE_ELEMENT_BAR_HEIGHT");var H=convertNMParameter("MMPT_TABLE_ELEMENT_SYMBOL_WIDTH");var d=Math.round(H/2);var L=convertNMParameter("MMPT_TABLE_LINE_SIZE");var l=convertNMParameter("MMPT_TABLE_NEEDLE_LINE_SIZE");var k=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 A=convertNMParameter("MMPT_TABLE_COLUMN_WIDTH");var V=parseFloat(x.getParameter("FACTOR_STRUCTURE_LABEL_BACKGROUND_TRANSPARENCY"));var _=convertNMParameter("MMPT_TABLE_VALUE_BOTTOM_BORDER_SIZE");var $=x.getParameter("COLOR_BOTTOM_BORDER");var W=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_NORMAL");var z=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_NORMAL");var j=x.getParameter("CHECK_TABLE_SUBTOTALS_FAT")==="true"?"bold":"normal";var X=convertNMParameter("MMPT_TABLE_SUBTOTAL_BOTTOM_BORDER_SIZE");var Y=x.getParameter("COLOR_SUBTOTAL_BOTTOM_BORDER");var K=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_SUBTOTAL");var Z=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_SUBTOTAL");var Q=x.getParameter("CHECK_TABLE_TOTALS_FAT")==="true"?"bold":"normal";var q=convertNMParameter("MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE");var J=x.getParameter("COLOR_TOTAL_BOTTOM_BORDER");var ee=convertNMParameter("MMPT_TABLE_DISTANCE_AFTER_TOTAL");var te=convertNMParameter("MMPT_TABLE_TOP_DISTANCE_TOTAL");var ie=x.getParameter("CHECK_TABLE_TOTALS_WITHOUT_VALUES_FONT_BOLD")==="true"?"bold":"normal";var ne=convertNMParameter("MMPT_TABLE_TOTAL_BOTTOM_BORDER_SIZE");var ae=x.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 me=[];var he=[];var fe={};var ve=[];var be=[];var Te={};var Ee=[];var xe;var Ce;var ye,Me,Se;var Oe,Le;var Ae,_e,Ie;var De,Re,Ne;var Pe=[];var we;var Ue=false;var Fe=[];var Be,He;var ke,Ge;var Ve,$e;var We,ze;var je;var Xe;var Ye=[];var Ke=[];var Ze=[];var Qe=[];var qe=[],Je=[],et,tt;this.getRows=function(){return n};this.setRows=function(e){n=e};this.getColumns=function(){return a};this.setColumns=function(e){a=e};this.getType=function(){return i};this.layoutPanels=function(e,t,i,n){var a={};if(e.length===0){return a}Ce=a;if(pe){collectAllData(e,n);pe=false}Be=i;He=t;var r=Ae.border,o=Ae.padding;ke={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};xe.setPosition({x:0,y:0});xe.setDimension({width:Be.width,height:Be.height});a[xe.getId()]=xe;if(Me===null||Me.dataModel===null||Me.dataModel.baseNode.nodes.length===0){Ae.scrollingData={width:Be.width,height:Be.height,realWidth:Be.width,realHeight:Be.height,scrollingVer:false,scrollingHor:false,x:He.x,y:He.y,id:Ae.id};return a}switch(ye.buildUp){case at.PREINIT:getCurrentCellDialogDefinition();aggregateHeaderLabels();setupRowAndSpacingData();tt=dt["a"].measureComment(Ot["a"].getTranslation("ENTER_COMMENT"),w,undefined,_e.fixRowHeight).width+5;setupHeaderRows();hideNonMinMaxLabels();setupOtherRows();calculateAutoWidths1Pass();updateGlobalTableSizes1Pass();break;case at.INIT:updateGlobalTableSizes2Pass();calculateAutoWidths2Pass();recalculateRowHeights();cutElementsToWidth();updateGlobalTableSizes1Pass();break;case at.AXIS_ZOOM:updateGlobalTableSizes2Pass();layoutCells();calculateRelativeValues();calculateScalingFactors();adjustAxisFactorToGlobalZoom();break;case at.LEGEND:break;case at.DRAW:for(var l=0;l<De.length;l++){if(De[l].IsHidden){continue}for(var s=0;s<$e;s++){var d=Ne[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(Ke[l]){if(Ke[l].representation===R.VALUE){layoutValueColumnElements(l)}else if(Ke[l].representation===R.LIST||Ke[l].representation===R.COMMENT||Ke[l].representation===R.FLAG){layoutCommentElements(l)}else{layoutGraphicalColumnElements(l)}}}if(me.length>0){St["b"].Layout.Common.setCompareMetaInformation(me,true,w,convertNMParameter,_e,mm2pix);St["b"].Layout.Table.CompareLayoutHelpers.setTextAndDimensions(me,he,Me,ye,Ae);St["b"].Layout.Table.CompareLayoutHelpers.layoutCompares(me,he,a,ge,c);St["b"].Layout.Table.CompareLayoutHelpers.displaceCompares(me,convertNMParameter)}layoutScalingHelpers();setDataForScrolling();break}return a};function collectAllData(e,t){Ie=t;Ae=t.getModel();We=ot["a"].idTableContent+"."+Ae.id;ze=ot["a"].idTableHead+"."+Ae.id;for(var i=0;i<e.length;i++){var n=e[i];var a=n.getModel();if(a.instanceOf==="BarModel"||a.instanceOf==="NeedleModel"||a.instanceOf==="StructureLineModel"||a.instanceOf==="StructureWaterfallModel"){he.push(n)}else if(a.instanceOf==="AxisModel"){a.nestedContainerId=We;ge.push(n)}else if(a.instanceOf==="CompareModel"){a.nestedContainerId=We;me.push(n)}else if(a.instanceOf==="ScalingHelperModel"){ve.push(n)}else if(a.instanceOf==="LabelModel"){if(a.id.indexOf("scalingHelperLabel")>=0){be.push(n)}else{fe[n.getId()]=n}}else if(a.instanceOf==="DataTypeAnnotatorModel"){Ee.push(n)}else if(a.instanceOf==="BackGroundModel"){xe=n}else if(a.instanceOf==="InlineModel"){Te[a.id]=n}}_e=Ae.extendedModel;_e.zoom={};Ue=_e.dimensionLabelModel.repeatNotation==="on"||_e.dimensionLabelModel.repeatNotation==="notation"&&x.getParameter("CHECK_TABLE_REPEAT_NOTATION")==="true";De=_e.columnDefinitions;Re=_e.rowDefinitions;Ne=_e.tableCellData;we=Ue?Re.length-1:Re.length;Ve=_e.headerRows;$e=_e.headerRows-1;Me=it["a"].getContextByCid(_e.contextId);ye=e[0].getController().getRootModel();Oe=St["b"].Factories.ModelFactory.getParentContainer(ye.firstObjectGrid,Ae);Le=Oe[0].extendedModel;Se=e[0].getPainter();if(Me===null||Me.dataModel===null||Me.dataModel.baseNode.nodes.length===0){return}Xe=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(Me.dataModel,0);for(var r=0;r<_e.dimensionColumns.length;r++){if(De[_e.dimensionColumns[r]].exprId.substr(0,3)!=="dim"){console.warn("oh noes!",_e.dimensionColumns,De[_e.dimensionColumns[r]].exprId);for(var i=0;i<De.length;i++){if(De[i].exprId.substr(0,3)==="dim"){_e.dimensionColumns[r]=i}}break}}fillIndexArrays()}function fillIndexArrays(){if(Ye&&Ye.length){return true}for(var e=0;e<_e.columns;e++){if(De[e].exprId===""||De[e].exprId.substr(0,3)==="dim"){Ye.push(null);Ze.push(null);Ke.push(null)}else{for(var t=0;t<Me.columns.length;t++){if(Me.columns[t].id.split(".").pop()===De[e].exprId){Ye.push(Me.columns[t]);Ze.push(t);break}}for(var t=0;t<_e.expressions.length;t++){if(_e.expressions[t].id.split(".").pop()===De[e].exprId){Ke.push(_e.expressions[t]);break}}}}if(Ye.length!==De.length||Ke.length!==De.length){console.warn("blam!: _col2Expr",Ye,De.length,Ke);return false}var i=0;for(var e=0;e<_e.headerRows;e++){Qe.push(null)}for(var e=_e.headerRows;e<we;e++){var n=Re[e];if(n.type==="empty"||n.nodePath===null||n.nodePath===""&&Xe[i].path!==""){Qe.push(null)}else if(Xe[i]){Qe.push(Xe[i].ref)}else{Me=null;break}i++}if(Ue){Qe.push(null)}if(i!==Xe.length){console.warn("blam!: _row2DimNode",Xe,Re.length,Re);Me=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,n=-1;for(;i<De.length;i++){var a=Ne[e][i],r=Ne[e][i+1],o=a&&a.elements[0],l=r&&r.elements[0];if(!o||!l||l.hideLabel||o.hideLabel||o.text!==l.text){break}var s=e>0?Ne[e-1][t].elements[0]:undefined,d=e>0?Ne[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=St["b"].Layout.Common.getHighlight(_e,o,rt["a"].highlightType.LEGEND);if(p&&p.highlight){o.isHighlighted=false;if(e===$e-1){p.highlight.active=false}}var g=St["b"].Layout.Common.getHighlight(_e,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]=h;if(o.text!==""){a.border.bottom=h;a.borderColor=f;r.border.bottom=h;r.borderColor=f}}if(!De[i+1].IsHidden){n=i+1}}if(n>-1){var m=Ne[e][n].elements[0];if(m){m.hideLabel=false;m.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=_e.headerRows;t<we;t++){var i=Re[t];i.type=getRowType(t);i.spacing_top=0;switch(i.type){case"":i.spacing_bottom=W;i.topDistance=z;break;case"total":i.spacing_bottom=ee;i.topDistance=te;break;case"subtotal":i.spacing_bottom=K;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(Ue){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 n=Qe[i];if(n){var a=n.nodes[Ze[e]].usedRuledEntry;t=Q==="bold"&&a.interpretation===D.TOTAL||j==="bold"&&a.interpretation===D.SUBTOTAL}}return t};for(var i=0;i<_e.headerRows;i++){Re[i].height=0}for(var n=0;n<De.length;n++){var a=Ne[$e][n].elements[0];if(!a||De[n].IsHidden){continue}if(Ke[n]&&(Ke[n].notation===y.HEADER||Ke[n].notation===y.ELEMENT_HEADER)){a.dimension.height=b}else{a.dimension.height=T}Re[$e].height=Math.max(Re[$e].height,a.dimension.height);a.nestedContainerId=ze;if(Ue){Re[we].height=Re[$e].height;Ne[we][n].elements[0].nestedContainerId=ze}e[n]=t(n)}for(var r=0;r<$e;r++){var o=r>0&&ce[r-1]>0?u:0;for(var n=0;n<De.length;n++){if(De[n].IsHidden){continue}var l=Ne[r][n].elements[0];if(l){if(e[n]){l.fontWeight="bold"}var s=l.fontWeight+" "+w+"px "+U;l.dimension=Se.measureTextDim(l.text,s);l.nestedContainerId=ze;var d=l.dimension.height;if(!l.hideLabel){var c=r===$e-1?O:C;Re[r].height=Math.max(Re[r].height,d+Ne[r][n].border.bottom+o+p+c)}}}}}function hideNonMinMaxLabels(){function processSingleCol(e){var t=null,i=null;var n=null,a=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(n===null){n=c;i=l;a=c;t=l}else if(c>n){if(i!==t){i.hideLabel=true;var u=St["b"].Layout.Common.getHighlight(_e,i,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}i=l;n=c}else if(c<a){if(i!==t){t.hideLabel=true;var u=St["b"].Layout.Common.getHighlight(_e,t,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}t=l;a=c}else{l.hideLabel=true;var u=St["b"].Layout.Common.getHighlight(_e,l,rt["a"].highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}}}}for(var e=0;e<De.length;e++){var t=Ke[e];if(t&&t.instanceOf==="ChartExpressionModel"&&t.valueLabelOpt.substr(0,6)==="MinMax"){processSingleCol(e)}}}function setupOtherRows(){var e,t,i,n=N.LEFT;prepareForComments();if(_e.dimensionLabelModel!==undefined&&_e.dimensionLabelModel.alignment!==""){n=_e.dimensionLabelModel.alignment}for(var a=0;a<$e;a++){for(var r=0;r<De.length;r++){if(_e.dimensionColumns.indexOf(r)!==-1){if(De[r].IsHidden){continue}var o=Ne[a][r];var l=o.elements[0];if(l&&l.hierarchyLvl!==undefined){l.dimension.width+=l.hierarchyLvl*le}}}}for(var a=Ve;a<we;a++){qe[a]||(qe[a]=[]);var s=Re[a];s.height=0;s.singleLineHeight=0;s.singleLineElementsHeight=0;if(s.type==="empty"){for(var d=0;d<De.length;d++){Ne[a][d].border={top:0,bottom:0,left:0,right:0}}continue}var c=getBordersAndLabelDataForDim(a),u=false;for(var p=0;p<De.length;p++){var g=Ne[a][p],m=void 0;g.inContentCell=true;if(De[p].IsHidden){g.border={top:0,bottom:0,left:0,right:0};continue}if(_e.dimensionColumns.indexOf(p)!==-1){e=g.elements[0];e&&(e.nestedContainerId=We);if(e===undefined||e.text===""&&u===false){continue}u=true;if(e.hierarchyLvl!==undefined){n=N.LEFT}e.horizontalAlign=n;e.verticalAlign=P.MIDDLE;e.fontSize=w;e.fontWeight=c.fontWeight;e.dimension=Se.measureTextDim(e.text,c.fontWeight+" "+w+"px "+U);if(e.hierarchyLvl!==undefined){e.dimension.width+=e.hierarchyLvl!=undefined?e.hierarchyLvl*le:0}m=e.dimension.height+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,m);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,e.dimension.height)}else{if(Ke[p].representation===R.VALUE){e=getLabel(a,p);i=0;if(e){var h=Qe[a].nodes[Ze[p]].usedRuledEntry;if(h.valueType==="FACTOR_NONE"){e.hideLabel=true;var f=St["b"].Layout.Common.getHighlight(_e,e,rt["a"].highlightType.VALUE,true);if(f&&f.highlight){f.highlight.active=false}}if(e.hideLabel!==true){e.horizontalAlign=N.MIDDLE;e.verticalAlign=P.MIDDLE;e.fontSize=w;if(h.interpretation===D.TOTAL){e.fontWeight=Q}else if(h.interpretation===D.SUBTOTAL){e.fontWeight=j}else{e.fontWeight=c.fontWeight}e.dimension=Se.measureTextDim(e.text,c.fontWeight+" "+w+"px "+U);e.nestedContainerId=We;i=e.dimension.height}}m=i+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,m);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,i)}else if(Ke[p].representation===R.BAR||Ke[p].representation===R.NEEDLE||Ke[p].representation===R.WATERFALL||Ke[p].representation===R.LINE||Ke[p].representation===R.SYMBOL||Ke[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=We;if(g.elements[v].instanceOf==="LabelModel"){e=g.elements[v]}else if(g.elements[v].instanceOf==="BarModel"||g.elements[v].instanceOf==="StructureWaterfallModel"){t=B}else if(g.elements[v].instanceOf==="NeedleModel"||g.elements[v].instanceOf==="StructureLineModel"){t=H}}var h=Qe[a].nodes[Ze[p]].usedRuledEntry;if(h.valueType==="FACTOR_NONE"){e.hideLabel=true;var f=St["b"].Layout.Common.getHighlight(_e,e,rt["a"].highlightType.VALUE,true);if(f&&f.highlight){f.highlight.active=false}}if(e&&e.hideLabel!==true){e.horizontalAlign=N.MIDDLE;e.verticalAlign=P.MIDDLE;e.fontSize=w;if(h.interpretation===D.TOTAL){e.fontWeight=Q}else if(h.interpretation===D.SUBTOTAL){e.fontWeight=j}else{e.fontWeight=c.fontWeight}e.dimension=Se.measureTextDim(e.text,c.fontWeight+" "+w+"px "+U);i=e.dimension.height}m=Math.max(i,t)+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,m);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,i,t)}else if(Ke[p].representation===R.LIST){var b=getOtherRepresentationType(a,p);if(a===Ve){var T="normal "+w+"px '"+U+"'",E="bold "+w+"px '"+U+"'",x={width:0,height:0,widthBold:0,heightBold:0,maxWidth:0};for(var C=0;C<b.listContent.length;C++){var y=b.listContent[C].originalDescription;if(I.checkVariable(y)){y=I.parseLabel(y)}var M=Se.measureTextDim(y,T);x.height=Math.max(x.height,M.height);x.width=Math.max(x.width,M.width);M=Se.measureTextDim(y,E);x.heightBold=Math.max(x.heightBold,M.height);x.widthBold=Math.max(x.widthBold,M.width)}ue[p]=x}var S=ue[p];if("bold"===c.fontWeight){b.dimension.height=S.heightBold;b.dimension.width=S.widthBold}else{b.dimension.height=S.height;b.dimension.width=S.width}b.triangle.dimension={width:.8*w,height:.8*w};S.maxWidth=Math.max(S.maxWidth,b.dimension.width+b.triangle.dimension.width);b.fontSize=w;b.font=U;b.fontStyle=F;b.lineHeight=w+ot["a"].textLineSpacing;b.fontWeight=c.fontWeight;b.nestedContainerId=We;m=Math.max(b.dimension.height,b.triangle.dimension.height)+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,m);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,b.dimension.height,b.triangle.dimension.height)}else if(Ke[p].representation===R.COMMENT){var O=getOtherRepresentationType(a,p);O.fontSize=w;O.font=U;O.fontStyle=F;O.lineHeight=w+ot["a"].textLineSpacing;O.fontWeight=c.fontWeight;O.nestedContainerId=We;if(O.hide){var L=dt["a"].measureComment(O.placeholderText,w,undefined,_e.fixRowHeight);O.dimension.width=L.width+5;O.dimension.height=L.height;O.lines=1}else{var y=O.text;if(I.checkVariable(y)){y=I.parseLabel(y).toString()}var A=dt["a"].measureCommentMinWidth(y,w,_e.fixRowHeight);O.fixedWidth=De[p].columnFix;O.dimension.width=Math.max(tt,A.width);O.lines=A.lines}}else if(Ke[p].representation===R.FLAG){var _=getOtherRepresentationType(a,p);_.dimension.height=10;_.dimension.width=10;_.fontSize=w;_.font=U;_.fontStyle=F;_.lineHeight=w+ot["a"].textLineSpacing;_.fontWeight=c.fontWeight;_.nestedContainerId=We;m=_.dimension.height+c.borders.top+c.borders.bottom+s.topDistance;s.singleLineHeight=Math.max(s.singleLineHeight,m);s.singleLineElementsHeight=Math.max(s.singleLineElementsHeight,_.dimension.height)}}g.border=st["a"].deepCopy(c.borders);g.borderColor=c.borderColor;s.height=Math.max(s.height,m||0);qe[a][p]=m}}}function prepareForComments(){dt["a"].setSpanFont("normal "+w+"px '"+U+"'");dt["a"].setSpanHTML("&nbsp;")}function calculateAutoWidths1Pass(){var e=Ae.border,t=Ae.padding,i=Ae.dimension.width-getSumOfColumnSpacing()-e.left.width-e.right.width-t.left-t.right,n=[R.LIST,R.COMMENT,R.FLAG];Ae.dimension.widthWithoutSpacing=i;for(var a=0;a<De.length;a++){var r={};var o=Ke[a],l=De[a];if(l.IsHidden){r={width:0,minWidth:0,maxWidth:0}}else{var s=l.columnFix===false||l.defWidth===-1||_e.columnMode==="autoContent"||l.defWidthType==="w";var d=_e.dimensionColumns.indexOf(a)!==-1,c=!d&&n.indexOf(o.representation)!==-1;if(s){r.width=calculateColumnAutoWidths(a);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:A}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:A}}Pe.push(r)}for(var a=0;a<De.length;a++){if(Pe[a].width>=0){De[a].width=Pe[a].width}}}function calculateAutoWidths2Pass(){var s=Ae.dimension.widthWithoutSpacing,d=function(e,t){return e+t.width},c=function(e,t){return e+t},u=Pe.reduce(d,0),p=s-u;if(p!==0){Pe.reduce(function(e,t,i){return e||De[i].defWidthType==="w"},false)&&calculateWeightedColumns();calculateDynamicColumns()}calculateAutoWidthsForAggregatedHeaders(Pe);for(var e=0;e<De.length;e++){if(Pe[e].width>=0){De[e].width=Pe[e].width;if(!De[e].IsHidden&&Ke[e]&&Ke[e].representation===R.COMMENT&&!_e.fixRowHeight&&!De[e].columnFix){for(var t=Ve;t<we;t++){var i=Re[t],n=getOtherRepresentationType(t,e),a=Se.checkFormattingInText(Se.checkVariableInText(n.text,"textDiv")),r=dt["a"].measureComment(a,w,Pe[e].width,_e.fixRowHeight),o=getBordersAndLabelDataForDim(t),l=r.height+o.borders.top+o.borders.bottom+i.topDistance;n.dimension.height=r.height;i.height=Math.max(i.height,l)}}}}function calculateWeightedColumns(){Pe.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"){Pe[i].width=Math.max(Pe[i].width,Pe[i].minWidth)}}}function calculateDynamicColumns(){if(_e.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(a,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=Pe.reduce(d,0);p=s-u;var e=p>0?r:a,t=Pe.map(e);o=t.reduce(c,0);if(o){var i=function(e){l(e,function(){Pe[e].width+=t[e]/o*p;Pe[e].maxWidth&&(Pe[e].width=Math.min(Pe[e].width,Pe[e].maxWidth));Pe[e].width=Math.max(Pe[e].width,Pe[e].minWidth)})};for(var n=0;n<De.length;n++){i(n)}}};do{i()}while(p&&t--&&o)}}function recalculateRowHeights(){var e;if("top"===_e.rowAlignment){e=function(){return 0}}else if("mid"===_e.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 n=getBordersAndLabelDataForDim(t);i.height=0;for(var a=0;a<De.length;a++){if(_e.dimensionColumns.indexOf(a)===-1&&!De[a].IsHidden&&Ke[a].representation===R.COMMENT){var r=getOtherRepresentationType(t,a);var o=r.text;if(I.checkVariable(o)){o=I.parseLabel(o).toString()}var l=dt["a"].measureComment(o,w,De[a].width,_e.fixRowHeight);r.dimension.height=l.height;r.lines=l.lines;qe[t][a]=r.dimension.height+n.borders.top+n.borders.bottom+i.topDistance;i.singleLineHeight=Math.max(i.singleLineHeight,w+n.borders.top+n.borders.bottom+i.topDistance);i.singleLineElementsHeight=Math.max(i.singleLineElementsHeight,w)}i.height=Math.max(i.height,qe[t][a]||0,Le.tableRowHeights[Ae.row][t])}i.singleLineOffset=e(i.height,i.singleLineHeight)}}function calculateColumnAutoWidths(e){var t=0;for(var i=0;i<$e;i++){var n=Ne[i][e].elements[0],a=Ne[i][e-1];if(n&&!n.aggregatedHide&&(e===0||!a.elements[0]||!a.elements[0].aggregatedHide)){t=Math.max(t,n.dimension.width)}}if(_e.dimensionColumns.indexOf(e)>=0){for(var i=Ve;i<we;i++){if(Re[i].type==="empty"){continue}var r=Ne[i][e].elements[0];if(r){t=Math.max(t,r.dimension.width)}}}else if(Ke[e].representation===R.LIST){t=Math.max(t,ue[e].maxWidth+2)}else if(Ke[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(Ke[e].representation===R.FLAG){var l=getOtherRepresentationType(Ve,e);t=Math.max(t,l.dimension.width)}else if(Ke[e].representation===R.VALUE){var s=De[e].defMinWidth===-1?A: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=Ke[e];var c=getScalingData(e);var u=c.outlierWidth;var p=c.axisWidth;var g=c.chartSymbolSize*2||H;var s=De[e].defMinWidth===-1?A:De[e].defMinWidth;var m=0;var h=0;var f=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;f=0;if(r&&!r.hideLabel){f=r.dimension.width+k}f+=o.isOutlier?u:g;if(o.value>0||!c.onlyNegatives&&o.value===0){h=Math.max(h,f)}else{m=Math.min(m,-f)}}f=d.axisMid?Math.max(h,Math.abs(m))*2:h-m;t=Math.max(t,f+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 n=Ne[t][i].elements[0];if(n&&n.hideLabel&&n.aggregatedHide){var a=i,r=void 0,o=De[i],l=e[i].width,s=l===-1?o.width:l,d=-1,c=void 0;do{r=Ne[t][a].elements[0];if(r&&!De[a].IsHidden){d=a;c=r}s+=o.spacing_right;o=De[a];l=e[a].width;s+=(l===-1?o.width:l)+o.spacing_left;a++}while(r&&r.hideLabel&&r.aggregatedHide&&r.text===n.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=a}}}}function calculateRelativeValues(){for(var e=0;e<De.length;e++){var t=Ke[e];if(!t||t.representation!==R.WATERFALL){continue}var i=0;var n=0;for(var a=Ve;a<we;a++){var r=getRepresentation(a,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;n=r.value}else if(r.waterfallType===2){if(!r.isNaN&&!r.isOutlier){r.relativeValue=n+r.value;n=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=Ke[t];if(!De[t].IsHidden&&i&&e.indexOf(i.representation)!==-1){var n=calculateAxisAndScalingFactors(t);De[t].axisFactor=n.axisFactor;var a=Ye[t].scalingGroup;if(i.scalingMaximize){a+="."+ye.extensionHash+"."+Ae.id}var r=nt["a"].resolveQvVars(a);if(ye.globalZoom[r]===undefined||ye.globalZoom[r]>n.scalingFactor){ye.globalZoom[r]=n.scalingFactor}if(_e.zoom[r]===undefined||_e.zoom[r]>n.scalingFactor){_e.zoom[r]=n.scalingFactor}}}}function adjustAxisFactorToGlobalZoom(){for(var e=0;e<De.length;e++){var t=De[e],i=Ke[e];if(De[e].IsHidden||!i||!(i.representation===R.WATERFALL)){continue}var n=Ye[e].scalingGroup;if(i.scalingMaximize){n+="."+ye.extensionHash+"."+Ae.id}var a=nt["a"].resolveQvVars(n),r=Fe[e],o=r.invertedValues,l=r.invertedLabelWidths,s=Ne[0][e].afterLayoutingSize.width-Ne[0][e].border.left-Ne[0][e].border.right,d=Math.round(s*t.axisFactor),c=s-d;var u=ye.globalZoom[a],p=0,g=0;for(var m=0;m<o.length;m++){var h=l[m]-Math.round(Math.abs(o[m])*u);if(o[m]<0){g=Math.max(g,h)}else{p=Math.max(p,h)}}var f=false;if(g>c&&p>d){}else if(g>c){t.axisFactor-=(g-c)/s;f=true}else if(p>d){t.axisFactor+=(p-d)/s;f=true}if(f){u=calculateScalingFactor(e,t.axisFactor,s,r);if(ye.globalZoom[a]>u){ye.globalZoom[a]=u}if(_e.zoom[a]>u){_e.zoom[a]=u}}}}function getCurrentCellDialogDefinition(){var e=St["b"].DataObjects.DocumentDO.getExtension(ye.extensionHash).getActiveMover(),t=e?e.getConfig():null,i=Le.tableColWidths[Ae.column]||(Le.tableColWidths[Ae.column]=[]);if(e&&t&&Ie.getId()===t.tableContainer.id&&t.tableContainer.column===Ae.column){var n=t?t.colDef.filter(function(e){return!e.IsHidden}):[];for(var a=0;a<n.length;a++){i[a]={colDef:n[a],columnMode:t.columnMode}}}var r=_e.columnDefinitions.filter(function(e){return!e.IsHidden}).map(function(e){return e.clone()});if(r.length>i.length){for(var a=i.length-1;a<r.length;a++){if(!i[a]){i[a]={colDef:r[a],columnMode:i[0]?i[0].columnMode:Ae.extendedModel.columnMode}}}}var o=_e.columnDefinitions.filter(function(e){return!e.IsHidden});for(var a=0;a<o;a++){o[a].defWidth=i[a].colDef.defWidth;o[a].defWidthType=i[a].colDef.defWidthType;o[a].defMinWidth=i[a].colDef.defMinWidth;o[a].defMinWidthType=i[a].colDef.defMinWidthType;o[a].defMaxWidth=i[a].colDef.defMaxWidth;o[a].defMaxWidthType=i[a].colDef.defMaxWidthType;o[a].columnFix=i[a].colDef.columnFix;Ae.extendedModel.columnMode=i[a].columnMode}}function updateGlobalTableSizes1Pass(){var e=Le.tableColWidths[Ae.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 n=Ae.row;if(!Le.tableRowHeights[n]){Le.tableRowHeights[n]=[];Le.tableRowSpacings[n]=[]}var a=Le.tableRowHeights[n],r=Le.tableRowSpacings[n];for(var i=0;i<Re.length;i++){if(a[i]===undefined||a[i]<Re[i].height){a[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=Le.tableColWidths[Ae.column],i=[],n=[],a=De.filter(function(e,t){if(!e.IsHidden){i.push(Pe[t]);n.push(Ke[t])}return!e.IsHidden});for(var r=0;r<a.length;r++){i[r].width=a[r].width=t[r].colDef.width;if(i[r].minWidth!==undefined&&i[r].minWidth<i[r].width&&n[r]&&e.indexOf(n[r].representation)>-1){i[r].minWidth=i[r].width}a[r].defWidth=t[r].colDef.defWidth;a[r].defWidthType=t[r].colDef.defWidthType;a[r].defMinWidth=t[r].colDef.defMinWidth;a[r].defMinWidthType=t[r].colDef.defMinWidthType;a[r].defMaxWidth=t[r].colDef.defMaxWidth;a[r].defMaxWidthType=t[r].colDef.defMaxWidthType;a[r].columnFix=t[r].colDef.columnFix;Ae.extendedModel.columnMode=t[r].columnMode}var o=Ae.row,l=Le.tableRowHeights[o],s=Le.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 n=Ne[i];var a=n[e].elements[0];if(a&&!a.hideLabel&&a.dimension.width>t.width){var r=getBordersAndLabelDataForDim(i).fontWeight+" "+w+"px '"+U+"'";var o=t.width;var l=e-1;while(l>=0&&n[l].elements[0]&&n[l].elements[0].aggregatedHide&&n[l].elements[0].text===a.text){o+=De[l+1].spacing_left+De[l].width+De[l].spacing_right;l--}a.text=St["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(a.text,o,r);a.dimension=Se.measureTextDim(a.text,r);for(l++;l<e;l++){var s=n[l].elements[0];s.text=a.text;s.dimension.width=a.dimension.width}}}if(_e.dimensionColumns.indexOf(e)>=0){for(var i=Ve;i<we;i++){var a=Ne[i][e].elements[0];if(a&&a.dimension.width>t.width){var r=getBordersAndLabelDataForDim(i).fontWeight+" "+w+"px '"+U+"'";a.text=St["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(a.text,t.width,r)}}}else if(Ke[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 '"+U+"'";for(var u=0;u<d.listContent.length;u++){var p=d.listContent[u];p.description=St["b"].Models.Actions.ViewModelActions.InlineCommentModel.rewriteLabelToWidthBinary(p.originalDescription,c,r)}}}}}function layoutCells(){var e=0,t=0,i=Ge.x,n=Ge.y,a=Le.tableColWidths[Ae.column].map(function(e){return e.colDef.width});if(_e.axisAlignmentCategory!=="Start"){for(var r=0;r<_e.rows;r++){e+=Re[r].height+Re[r].spacing_bottom}e-=Re[Re.length-1].spacing_bottom;e+=getLayoutScalingHelpersHeight();if(e<ke.height){if(_e.axisAlignmentCategory==="End"){n+=ke.height-e}else if(_e.axisAlignmentCategory==="Mid"){n+=Math.round((ke.height-e)/2)}}}if(_e.axisAlignmentElement!=="Start"&&_e.axisAlignmentElement!=="Auto"){for(var o=0;o<_e.columns;o++){if(De[o].IsHidden){t+=a[o]}else{t+=De[o].width+(o===_e.columns-1?0:De[o].spacing_right)}}if(t<ke.width){if(_e.axisAlignmentElement==="End"){i+=ke.width-t}else if(_e.axisAlignmentElement==="Mid"){i+=Math.round((ke.width-t)/2)}}}var l=i,s=n;for(var d=0;d<_e.rows;d++){l=i;s+=Re[d].spacing_top;e=Re[d].height;for(var c=0;c<_e.columns;c++){var u=Ne[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(Ue&&d===_e.rows-2){s+=je}}}function layoutDimColumnElements(e){var t=N.LEFT;if(_e.dimensionLabelModel!==undefined&&_e.dimensionLabelModel.alignment!==""){t=_e.dimensionLabelModel.alignment}for(var i=0;i<we;i++){if(i===$e){continue}var n=Ne[i][e].elements[0];if(n){var a=Ne[i][e].afterLayoutingPosition;var r=Ne[i][e].afterLayoutingSize;var o=getViewById2(fe,n.id);if(n.hierarchyLvl===undefined){if(t===N.MIDDLE){n.position.x=a.x+r.width/2-n.dimension.width/2}else if(t===N.LEFT){n.position.x=a.x}else{n.position.x=a.x+r.width;n.textAnchor="end"}}else{var l=n.hierarchyLvl!=undefined?n.hierarchyLvl*le:0;n.position.x=a.x+l}if(i===$e-1){n.position.y=a.y+r.height-ce[i]-n.dimension.height-O}else if(i<$e){n.position.y=a.y+r.height-ce[i]-n.dimension.height-C}else{n.position.y=getElementYPosition(e,i,n)}Ce[n.id]=o}}}function layoutValueColumnElements(e){for(var t=Ve;t<we;t++){var i=Ne[t][e].elements[0];if(i&&i.hideLabel!=true){var n=Ne[t][e].afterLayoutingPosition;var a=Ne[t][e].afterLayoutingSize;var r=getViewById2(fe,i.id);i.position.x=n.x+a.width;i.textAnchor="end";i.position.y=getElementYPosition(e,t,i);var o=Qe[t].nodes[Ze[e]];var l=o.usedRuledEntry;var s=Ke[e];if(s.notation===y.ELEMENT||s.notation===y.ELEMENT_HEADER||s.notation===y.ELEMENT_AXIS){var d=St["b"].Layout.Common.getNotationColorStructure(l,s.concept,true,o.value>=0,null,null);i.color=d.pattern}else{i.color=x.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}i.showBackground=s.valueLabelBackground;i.backgroundTransparency=V;Ce[i.id]=r}}}function setNotationData(e,t,i,n){var a=Ke[n];var r=null;if(Qe[i]!==null){var o=Qe[i].nodes[Ze[n]];r=o.usedRuledEntry;if(a.notation===y.ELEMENT||a.notation===y.ELEMENT_HEADER||a.notation===y.ELEMENT_AXIS){var l=e.waterfallType===0||e.waterfallType===1||e.waterfallType===2;e.color=St["b"].Layout.Common.getNotationColorStructure(r,a.concept,true,e.value>=0,l,false);t.color=x.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}else{var l=e.waterfallType===0||e.waterfallType===2;if(l){e.color=St["b"].Layout.Common.getNotationColorStructure(r,rt["a"].concept.AREA,true,e.value>=0,l,true);t.color=x.getDataType("Actual").subtypes.ACT0.settings.p.areaFillingcolor}else{var s=x.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=x.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,n){var a=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,n);a=ge[r].getModel();break}}return a}function setOutlierRepresentations(e,t,i,n,a){var r=Ke[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=Ke[t].outlierSymbols?H:0;if(c&&!c.hideLabel){if(r){if(d.value>=0){c.position.x=o+k;d.position.x=n-d.dimension.width}else{c.position.x=l-k-c.dimension.width;d.position.x=a}}else{if(d.value>=0){c.position.x=n-c.dimension.width;d.position.x=o+G}else{c.position.x=a;d.position.x=l-G-d.dimension.width}}}else{if(d.value>=0){if(r){d.position.x=n-d.dimension.width}else{d.position.x=o+G}}else{if(r){d.position.x=a}else{d.position.x=l-G-d.dimension.width}}}if(d.dimension.width>0&&Ke[t].outlierSymbols){Ce[d.id]=e[s].repView}d.symbolSize=H}}function layoutGraphicalColumnElements(e){if(De[e].IsHidden){return}var t=Ye[e];var i=Ke[e];var n=null,a=null;var r;var o=Ne[0][e];var l=t.scalingGroup;if(i&&i.scalingMaximize){l+="."+ye.extensionHash+"."+Ae.id}var s=nt["a"].resolveQvVars(l);var d=ye.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 m=[];var h=0,f=2147483647;var v=0,b=0;var T=i.outlierSymbols?H+G:0;var E=null;var x=false;var C=false;var y=false;var M={normal:null,subTotal:null};var S=Fe[e].onlyNegatives;switch(i.representation){case R.BAR:E=layoutBarColumnElements;break;case R.NEEDLE:E=layoutNeedleColumnElements;x=true;break;case R.WATERFALL:E=layoutWaterfallColumnElements;C=true;break;case R.LINE:E=layoutLineColumnElements;y=true;se=null;de=null;break;case R.SYMBOL:E=layoutLineColumnElements;x=true;break;case R.SYMBOL_LINE:E=layoutLineColumnElements;x=true;y=true;se=null;de=null;break}for(var O=Ve;O<we;O++){o=Ne[O][e];r=getRepresentationAndLabel(O,e);a=r.rep;n=r.label;if(!a||a.valueType==="FACTOR_NONE"){continue}var L=getViewById(he,a.id);var A=getViewById2(fe,n.id);var _=setNotationData(a,n,O,e);if(x||y){St["b"].Layout.Common.setNotationShape(L,_,i.notation,i.concept,y)}g.push({row:O,bar:a,usedRule:_});a.dimension.width=Math.round(Math.abs(a.value)*d);if(a.isOutlier){m.push({rep:a,label:n,repView:L})}else{if(C){a.position.x=p+Math.round((a.relativeValue-a.value)*d);a.dimension.width=Math.abs(p+Math.round(a.relativeValue*d)-a.position.x);if(a.value<0){a.position.x-=a.dimension.width}}else{if(a.value<0){a.position.x=p-a.dimension.width;if(c!==1){a.position.x++}}else{a.position.x=p}}}if(E){E(e,O,a,n,S,x,y,M)}if(n){if(a.value<0||S&&0===a.value){if(!a.isOutlier){f=Math.min(f,n.position.x)}else if(!n.hideLabel){b=Math.max(b,n.dimension.width+T)}}else{if(!a.isOutlier){h=Math.max(h,n.position.x+n.dimension.width)}else if(!n.hideLabel){v=Math.max(v,n.dimension.width+T)}}if(!n.hideLabel){n.position.y=getElementYPosition(e,O,n);n.showBackground=i.valueLabelBackground;n.backgroundTransparency=V;Ce[n.id]=A}}a.zIndex=C||y?300:100;if(!a.isOutlier){Ce[a.id]=L}}var I=setAxis(e,c,p,g);if(h===0){h=I.position.x+I.dimension.width+(v===0?H+G:v+k)}else{h=Math.max(h,I.position.x+I.dimension.width+v+k)}if(f===2147483647){f=I.position.x-(b===0?H+G:b+k)}else{f=Math.min(f,I.position.x-b-k)}setOutlierRepresentations(m,e,I,h,f)}function getMultiLineElementYPosition(e,t,i){var n=Ne[t][e];var a=n.afterLayoutingPosition.y+n.border.top+Re[t].topDistance;var r=n.afterLayoutingSize.height-Re[t].topDistance-n.border.top-n.border.bottom-i.dimension.height;if("bottom"===_e.rowAlignment){a+=r}else if("mid"===_e.rowAlignment){a+=Math.floor(r/2)}return a}function getElementYPosition(e,t,i){var n=Ne[t][e];var a=Re[t];var r=n.afterLayoutingPosition.y+n.border.top+a.topDistance+a.singleLineOffset;r+=Math.floor((a.singleLineElementsHeight-i.dimension.height)/2);return r}function layoutBarColumnElements(e,t,i,n,a){i.dimension.height=B;i.position.y=getElementYPosition(e,t,i);if(n){if(i.value<0||a&&0===i.value){n.position.x=i.position.x-k-n.dimension.width}else{n.position.x=i.position.x+k+i.dimension.width}}}function layoutNeedleColumnElements(e,t,i,n,a){i.dimension.height=H;i.needleSize=H;i.lineWidth=l;i.position.y=getElementYPosition(e,t,i);if(n){if(i.value<0||a&&0===i.value){n.position.x=i.position.x-k-n.dimension.width-d}else{n.position.x=i.position.x+k+i.dimension.width+d}}}function layoutWaterfallColumnElements(e,t,i,n,a,r,o,l){var s=Ne[t][e];s.afterLayoutingSize.height+=s.border.bottom;s.border.bottom=0;var d=i.value<0||a&&0===i.value;i.dimension.height=B;i.position.y=getElementYPosition(e,t,i);if(n){if(d){n.position.x=i.position.x-k-n.dimension.width}else{n.position.x=i.position.x+k+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||!a&&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 m=l.subTotal.position.y+l.subTotal.dimension.height;var h=i.position.y;i.rowConnectionPos.x3=c;i.rowConnectionPos.x4=c;i.rowConnectionPos.y3=m;i.rowConnectionPos.y4=h}l.subTotal=i}else if(i.waterfallType===1){l.subTotal=i}l.normal=i;i.dimension.width++}function layoutLineColumnElements(e,t,i,n,a,r,o){var l=r?H:0;var s=Ne[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=L;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(n){if(i.value<0||a&&0===i.value){n.position.x=i.position.x-k-n.dimension.width-(l===0?0:d)}else{n.position.x=i.position.x+k+i.dimension.width+(l===0?0:d)}}}function layoutCommentElements(e){var t=Ke[e];var i=Ne[0][e];var n=i.afterLayoutingPosition.x+i.border.left;var a=null;if(t.representation===R.LIST){a=layoutListColumnElements}else if(t.representation===R.COMMENT){a=layoutCommentColumnElements}else if(t.representation===R.FLAG){a=layoutFlagColumnElements}for(var r=Ve;r<we;r++){var o=getOtherRepresentationType(r,e);var l=getViewById2(Te,o.id);if(a){a(e,r,o,n)}o.zIndex=101;Ce[o.id]=l}}function getViewById2(e,t){return e[t]||null}function layoutListColumnElements(e,t,i,n){var a=Ne[t][e];i.position.x=n;var r=getElementYPosition(e,t,i);i.position.y=r;i.triangle.position={x:a.afterLayoutingPosition.x+a.afterLayoutingSize.width-1,y:r};i.background={position:{x:n-1,y:a.afterLayoutingPosition.y-1+a.border.top},dimension:a.afterLayoutingSize}}function layoutCommentColumnElements(e,t,i,n){var a=Ne[t][e];i.position.x=n;var r=getMultiLineElementYPosition(e,t,i);i.position.y=r-1;i.background={position:{x:n-1,y:a.afterLayoutingPosition.y-1+a.border.top},dimension:a.afterLayoutingSize}}function layoutFlagColumnElements(e,t,i,n){var a=Ne[t][e];i.position.y=getElementYPosition(e,t,i);i.position.x=Math.round(n+a.afterLayoutingSize.width/2-i.dimension.width/2);i.clickDummy={x:n,y:a.afterLayoutingPosition.y+a.border.top,width:a.afterLayoutingSize.width,height:a.afterLayoutingSize.height};i.lineWidth=1}function calculateAxisAndScalingFactors(e){var t=3;var i=Ke[e];var n=Ne[0][e].afterLayoutingSize.width-Ne[0][e].border.left-Ne[0][e].border.right;var a=getScalingData(e);if(a.maxNegVal===a.maxPosVal&&a.maxPosVal===0){return{axisFactor:.5,scalingFactor:ot["a"].defaultZoomFactor}}if(a.negLabelWidth+a.posLabelWidth>n-t){var r=i.axisMid?.5:a.negLabelWidth/(a.negLabelWidth+a.posLabelWidth);return{axisFactor:r,scalingFactor:0}}var r;if(i.axisMid){r=.5}else{r=calculateAxisFactor(n,a).axisFactor}var o=calculateScalingFactor(e,r,n,a);return{axisFactor:r,scalingFactor:o}}function getScalingData(e){return Fe[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 m=false,t=false,i=false;var h=0,f=0;var v=0,b=0;var n=Ke[e];var a=n.representation===R.NEEDLE||n.representation===R.SYMBOL_LINE||n.representation===R.SYMBOL?Math.ceil(H/2):0;var T=n.representation===R.SYMBOL_LINE||n.representation===R.LINE?Math.ceil(L/2):0;var E=Math.max(a,T);for(var x=Ve;x<we;x++){var C=getRepresentationAndLabel(x,e);if(C.rep&&C.label){if(C.rep.isOutlier&&C.label&&C.rep.valueType!=="FACTOR_NONE"){if(C.rep.value>=0){v=Math.max(v,C.label.hideLabel?H+G:C.label.dimension.width+k)}else{b=Math.max(b,C.label.hideLabel?H+G:C.label.dimension.width+k)}}}if(C.rep){t=t||C.rep.value>0;i=i||C.rep.value<0}}if(i&&!t){m=true;b=Math.max(b,v);v=0}function collectDataFromSingleValue(e,t){var i;var n=0;if(e.instanceOf==="StructureWaterfallModel"){n=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 a=t&&!t.hideLabel?t.dimension.width+k:0;d.push(a+n);return}}else{i=e.value}r.push(e.isOutlier);o.push(i);var a=(t&&!t.hideLabel?t.dimension.width+k+E:0)+n;if(i>0||i>=0&&!m){a=Math.max(a,v);f=Math.max(f,a)}else{a=Math.max(a,b);h=Math.max(h,a)}l.push(a);if(i<p){p=i;g=a}else if(i>c){c=i;u=a}else if(i===0){if(p===0&&m){g=Math.max(g,a)}else if(c===0&&!m){u=Math.max(u,a)}}}for(var x=Ve;x<we;x++){var C=getRepresentationAndLabel(x,e);if(C.rep&&C.label){if(C.rep.valueType!=="FACTOR_NONE"){collectDataFromSingleValue(C.rep,C.label)}}}u=u===0?v:u;g=g===0?b:g;return{axisWidth:n.axisNotation?M:S,chartSymbolSize:E,outliers:r,outlierWidth:n.outlierSymbols?H+G:0,values:o,labelWidths:l,invertedValues:s,invertedLabelWidths:d,maxPosVal:c,maxPosLabel:u,maxNegVal:p,maxNegLabel:g,negLabelWidth:h,posLabelWidth:f,onlyNegatives:m}}function calculateAxisFactor(e,t){var i=7;var n,a;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 m=t.maxNegLabel;e-=t.axisWidth/2;var h,f;h=(e-t.maxNegLabel-t.maxPosLabel)/(t.maxPosVal-t.maxNegVal);if(t.maxPosVal===0&&g===0){f=1}else if(t.maxNegVal===0&&m===0){f=0}else{f=(-t.maxNegVal*h+m)/e}for(var v=0;v<i;v++){r=g;o=m;n=Math.round(e*f);a=e-n;for(var b=0;b<l.length;b++){var T=l[b];var E=s[b]?d+c[b]:Math.round(Math.abs(T)*h)+c[b];if(T>0||!t.onlyNegatives&&T>=0){r=Math.max(r,E)}else{o=Math.max(o,E)}}for(var b=0;b<u.length;b++){var E=p[b]-Math.round(Math.abs(u[b])*h);if(u[b]<0){r=Math.max(r,E)}else{o=Math.max(o,E)}}var x=r-a;var C=o-n;var y=Math.round((C-x)/2);var M=x+C;var S=h-M/e*h;f+=y/e;f=Math.min(Math.max(f,0),1);h-=h-S}return{axisFactor:f,scalingFactor:h}}function calculateScalingFactor(e,t,i,r){var n=r.values;var a=r.labelWidths;var o=r.outliers;var l=Ke[e];var s=null;var d=Math.round(i*t);var c=i-d;if(t===0){c-=Math.floor((l.axisNotation?M:S)/2)}else if(t===1){d-=Math.floor((l.axisNotation?M:S)/2)}function calcFactorNormal(e,t){if(0===e){return}var i=e>0||!r.onlyNegatives&&e>=0?c:d;var n=i-t+.49;var a=n/Math.abs(e);if(s===null||a<s){s=a}}for(var u=0;u<n.length;u++){!o[u]&&calcFactorNormal(n[u],a[u])}return s}function layoutExprLabel(e,t,i){if(e.hideLabel){return}var n=Ne[t][i].afterLayoutingPosition;var a=Ne[t][i].afterLayoutingSize;var r,o,l=i,s;do{l--}while(l>=0&&(s=Ne[t][l].elements[0])&&s&&s.aggregatedHide&&s.text===e.text);l++;if(l<i){o=Ne[t][l];r=o.elements[0]}if(r){var d=v;if(t===$e-1){d=r.valueRowLabelPosition;if(d===""){var c=Ke[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=n.x+a.width;e.textAnchor="end"}else if(d==="center"){e.position.x=Math.round((o.afterLayoutingPosition.x+n.x+a.width-e.dimension.width)/2)}}else{var u=e.valueRowLabelPosition;var p=Ke[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 m.LEFT:e.position.x=n.x;break;case m.CENTER:default:e.position.x=n.x+Math.round((a.width-e.dimension.width)/2);break;case m.RIGHT:e.position.x=n.x+a.width;e.textAnchor="end";break}}else if(p){switch(u){case m.LEFT:e.position.x=n.x;break;case m.CENTER:e.position.x=n.x+Math.round((a.width-e.dimension.width)/2);break;case m.RIGHT:default:e.position.x=n.x+a.width;e.textAnchor="end";break}}}var g=t===$e-1?O:C;e.position.y=n.y+a.height-ce[t]-e.dimension.height-g;Ce[e.id]=getViewById2(fe,e.id)}function layoutAnnotators(){for(var e=0;e<De.length;e++){var t=Ne[$e][e],i=t.elements[0];if(!i||De[e].IsHidden){continue}var n=$e>=1?Ne[$e-1][e].elements[0]:null,a=Ke[e],r=a?a.notation:null,o=r===y.HEADER||r===y.ELEMENT_HEADER;var l=e;if(n&&n.aggregatedHide){var s=-1;do{l++;if(!De[l].IsHidden){s=l}}while((((Ne[$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=a?a.notation:null,g=p===y.HEADER||p===y.ELEMENT_HEADER;if(o!==g){c=false;break}if(g){var m=getColumnNotation(u);if(d.dataType!==m.dataType||d.concept!==m.concept||d.colors.pattern!==m.colors.pattern||d.colors.border!==m.colors.border||d.colors.background!==m.colors.background||d.otherPattern!==m.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 h=Ne[$e][s];i.dimension.width=h.afterLayoutingPosition.x+h.afterLayoutingSize.width-h.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:E,background:"rgb(255,255,255)",border:E}}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;Ce[i.id]=getViewById(Ee,i.id);if(Ue){var f=Ne[Re.length-1][e],v=f.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=f.afterLayoutingPosition.y+f.border.top;Ce[v.id]=getViewById(Ee,v.id)}if(n&&n.aggregatedHide){e=l}}}function getColumnNotation(e){var t=Ke[e];var i=null,n=null,a=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===y.HEADER){i=s.baseDataType;r=t.concept;n=St["b"].Layout.Common.getNotationColorStructure(s,t.concept,true,l.value>=0,null,null);a=St["b"].Layout.Common.getOtherPattern(s,t.notation,t.concept,true)}else{i=s.referenceDataType;r=t.referenceConcept;n=St["b"].Layout.Common.getNotationColorStructure(s,t.referenceConcept,false,l.value>=0,null,null);a=St["b"].Layout.Common.getOtherPattern(s,t.notation,t.referenceConcept,false)}}return{dataType:i,concept:r,colors:n,otherPattern:a}}function layoutAxis(e,t,i,n,a){var r=e.getModel();var o=Ke[t];var l=Ve;while(Re[l]==="empty"){l++}var s=we-1;while(Re[s]==="empty"){s--}var d=Ne[l][t];var c=Ne[s][t];var u=o.notation===y.AXIS||o.notation===y.ELEMENT_AXIS;o.axisNotation=u;if(u){r.dimension.width=M;r.concept=o.concept;r.notation=o.notation;r.segments=[];var p=o.notation===y.AXIS;for(var g=0;g<a.length;g++){var m=Ne[a[g].row][t];var h=p?a[g].usedRule.baseDataType:a[g].usedRule.referenceDataType;if(h==null){h=Tt["a"].dataType}var f=a[g].bar;var v=p?f.waterfallType===0||f.waterfallType===1||f.waterfallType===2:f.waterfallType===0||f.waterfallType===2;var b=!p&&o.referenceUsed?o.referenceConcept:o.concept;var T=St["b"].Layout.Common.getNotationColorStructure(a[g].usedRule,b,p,a[g].bar.value>=0,v,false);var E=St["b"].Layout.Common.getOtherPattern(a[g].usedRule,o.notation,b,p);if(r.segments.length===0){r.segments.push({concept:b,y:m.afterLayoutingPosition.y,pattern:T.pattern,background:T.background,border:T.border,dataType:h,otherPattern:E})}else{var x=r.segments[r.segments.length-1];if(h!==x.dataType||T.pattern!==x.pattern||T.border!==x.border||T.background!==x.background){r.segments.push({concept:b,y:m.afterLayoutingPosition.y-Math.round((Re[a[g].row].spacing_top+Re[a[g].row-1].spacing_bottom)/2),pattern:T.pattern,background:T.background,border:T.border,dataType:h,otherPattern:E})}}}}else{r.dimension.width=S}var C=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(n-C)}Ce[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,n=t.id.replace("scalingHelper","scalingHelperLabel");for(var a=0;a<be.length;a++){if(be[a].getId().indexOf(n)>=0){i=be[a];break}}var r=i.getModel();r.dimension=Se.measureTextDim(r.text,"normal "+w+"px '"+U+"'");return r.dimension.height}}return 0}function layoutScalingHelpers(){var e=convertNMParameter("MMPT_SCALING_HELPER_LINE_SIZE");var t=Ae.border,i=Ae.padding;for(var n=0;n<ve.length;n++){var a=ve[n].getModel();var r=0,o;for(;r<De.length;r++){if(Ke[r]&&a.expressionId===Ke[r].id){o=Ke[r];break}}if(!o){continue}var l=Ye[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+="."+ye.extensionHash+"."+Ae.id}var u=nt["a"].resolveQvVars(c);var p=Math.round(a.value*ye.globalZoom[u]);if(!isFinite(p)){p=0}a.dimension={width:p,height:s.dimension.height};a.position={x:s.position.x,y:Ge.y+t.top.width+i.top+je};a.lineWidth=e;a.lineColor=x.getParameter("COLOR_SCALING_HELPER_"+a.number+"_LINE");a.areaColor=x.getParameter("COLOR_SCALING_HELPER_"+a.number+"_AREA");a.orientation="vertical";Ce[a.id]=ve[n];if(a.legendShow!=="-"){var g,m=a.id.replace("scalingHelper","scalingHelperLabel");for(var d=0;d<be.length;d++){if(be[d].getId().indexOf(m)>=0){g=be[d];break}}var h=g.getModel();h.dimension=Se.measureTextDim(h.text,"normal "+w+"px '"+U+"'");var f=Math.round(h.dimension.width/2);var v=Ne[0][r].afterLayoutingPosition.x;var b=v+Ne[0][r].afterLayoutingSize.width;var T=a.position.y+a.dimension.height+mm2pix(.06);var E=a.position.x+p;h.textAnchor="middle";if(E-f<v){E=v;delete h.textAnchor}if(E+f>b){E=b;h.textAnchor="end"}g.setPosition({x:E,y:T});h.color=a.lineColor;Ce[g.getId()]=g}}}function getBordersAndLabelDataForDim(e){var t={fontWeight:F,borders:{top:0,bottom:0,left:0,right:0},borderColor:$};var i=Qe[e];switch(Re[e].type){case"":t.borders.bottom=_;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 n=i.lvl!=undefined?i.lvl:i.lineLvl;if(Me.rows[n-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 n=i.lvl!=undefined?i.lvl:i.lineLvl;if(Me.rows[n-1].additionsTotalOrder==="dimAdditionOrderType.0"){if(e<we-1){t.borders.bottom=X}}else{if(e!==Ve){t.borders.top=X}}t.borderColor=Y;break;case"totalsWithoutValues":t.fontWeight=ie;if(_e.dimensionLabelModel.categoryEntriesPosition=="summingPosType.1"){t.borders.bottom=ne}else{t.borders.top=ne}t.borderColor=ae;break;case"empty":break}if(Ue&&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),n=getColumnType(t);return i.dimension&&!n.dimension||!i.dimension&&n.dimension||i.delta&&!n.delta||!i.delta&&n.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=Ne[t][e],n=i.elements[0];if(n&&n.aggregatedHide){continue}var a=Ne[t][e-1];if(a){var r=a.elements[0];if(r&&r.aggregatedHide){return true}}var o=Ne[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 n=true;var a=true;for(var r=Ve;r<we;r++){var o=Qe[r];if(o){var l=o.nodes[Ze[e]].usedRuledEntry;if(n){i.delta=l.isDelta;n=false}a=a&&l.interpretation!==D.NORMAL;if(!a){break}}}i.total=a;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(Ue&&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 n=0;for(;n<De.length;n++){if(De[n].exprId.substr(0,3)==="dim"){break}}var a=Ne[e][n].elements[0];if(a.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 n=0;for(;n<De.length;n++){if(De[n].exprId.substr(0,3)==="dim"){break}}var o=Ne[e][n].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 n=Ne[e][t];var a=null;var r=null;for(var o=0;o<n.elements.length;o++){var l=n.elements[o].instanceOf;if(l==="LabelModel"){r=n.elements[o]}else if(i&&l===i){a=n.elements[o]}else if(l==="BarModel"||l==="NeedleModel"||l==="StructureLineModel"||l==="StructureWaterfallModel"){a=n.elements[o]}}return{rep:a,label:r}}function getOtherRepresentationType(e,t){var i=Ne[e][t];var n=null;for(var a=0,r=i.elements.length;a<r;a++){if(i.elements[a].instanceOf==="InlineModel"){n=i.elements[a];break}}return n}function getRepresentation(e,t,i){var n=Ne[e][t];var a=null;for(var r=0;r<n.elements.length;r++){var o=n.elements[r].instanceOf;if(i&&o===i){a=n.elements[r]}else if(o==="BarModel"||o==="NeedleModel"||o==="StructureLineModel"||o==="StructureWaterfallModel"){a=n.elements[r]}}return a}function getLabel(e,t){var i=Ne[e][t].elements;var n=null;for(var a=0;a<i.length;a++){if(i[a].instanceOf==="LabelModel"){n=i[a];break}}return n}function setDataForScrolling(){var e=Ne[Re.length-1][De.length-1];var t=e.afterLayoutingPosition.x+e.afterLayoutingSize.width;var i=e.afterLayoutingPosition.y+e.afterLayoutingSize.height;var n=Ue?Ne[we][0].afterLayoutingSize.height:0;var a=Ae.border,r=Ae.padding;for(var o=0;o<me.length;o++){var l=me[o].getModel();if(l.hide||l.active===false){continue}var s=St["b"].Layout.Common.getMaxPosition(l);i=Math.max(i,s.position.y+s.dimension.height)}var d=2;var c=i-(Ue?je+n:0);var u=ke.height-je-n;var p=c-u>d;Ae.scrollingData={id:Ae.id,width:Be.width,height:Be.height,realWidth:Be.width,realHeight:Be.height,headerHeight:je,scrollingVer:false,scrollingHor:false,x:He.x,y:He.y,children:{}};Ae.scrollingData.children[ze]={id:ze,width:ke.width,height:ke.height,realWidth:t,realHeight:ke.height,scrollingVer:false,scrollingHor:!Ae.disableScrolling&&t-ke.width>d,scrollingHorRef:[We],x:Ge.x+a.left.width+r.left,y:Ge.y+a.top.width+r.top,zIndex:0};Ae.scrollingData.children[We]={id:We,width:ke.width,height:u,realWidth:t,realHeight:c,scrollingVer:!Ae.disableScrolling&&p,scrollingHor:false,scrolling:!Ae.disableScrolling&&(p||t-ke.width>d),overflowHiddenHor:t>ke.width,forwardEvents:ze,x:Ge.x+a.left.width+r.left,y:Ge.y+a.top.width+r.top+je,zIndex:1};if(Ue&&p){var g=c-u;var m=Ne[we];for(var h=0;h<m.length;h++){var f=m[h];f.afterLayoutingPosition.y-=g;for(var v=0;v<f.elements.length;v++){var b=f.elements[v];if(b){b.position.y-=g}}}}}this.getPreferredLayoutSize=function(e,t,i){if(!x.isPrePaint()||(_e.expressions&&_e.expressions.length===0||_e.columns<1)){return{width:0,height:0}}if(et){return et}initGlobalVariables(i);calculateMinSizes(i);var n=Je.reduce(function(e,t,i){return e+t.value+De[i].spacing_left+De[i].spacing_right},0)||0;var a=C+getLayoutScalingHelpersHeight()+Re.reduce(function(e,t){return e+t.height+t.spacing_top+t.spacing_bottom},0)||0;et={width:n,height:a};return et};function initGlobalVariables(e){Se=e.getPainter();_e=e.getModel().extendedModel;Me=it["a"].getContextByCid(_e.contextId);Me&&(Xe=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(Me.dataModel,0));De=_e.columnDefinitions;Re=_e.rowDefinitions;Ne=_e.tableCellData;Ve=_e.headerRows;$e=_e.headerRows-1;Ue=_e.dimensionLabelModel.repeatNotation==="on"||_e.dimensionLabelModel.repeatNotation==="notation"&&x.getParameter("CHECK_TABLE_REPEAT_NOTATION")==="true";we=Ue?Re.length-1:Re.length;Ye=[];Ze=[];Ke=[];Qe=[];Me&&fillIndexArrays()}function calculateMinSizes(e){setupHeaderRows();setupOtherRows();var t=e.getModel().extendedModel.columnDefinitions,i={WIDTH:"mid",MIN:"min",MAX:"max"},a=[];for(var n=0;n<t.length;n++){var r=t[n];if(r.IsHidden){Je[n]={value:0};continue}var o=r.defWidth===-1||r.defWidthType==="w"||r.defWidthType==="%",l=r.columnFix===false||o;if(l){Je[n]={value:calculateColumnAutoWidths(n)};if(r.defWidthType==="%"&&r.defWidth>0){(r.columnFix||_e.columnMode!=="autoGrid")&&appendColDefToPercentWidthCalculation(n,r,i.WIDTH)}else if(!o&&r.columnFix){var s=r.defWidthType==="px"?r.defWidth:lt["a"].mm2pix(r.defWidth);Je[n]={value:Math.max(Je[n].value,s)}}if(r.columnFix===false){if(r.defMinWidthType==="%"&&r.defMinWidth>0){appendColDefToPercentWidthCalculation(n,r,i.MIN)}else if(r.defMinWidth>0){var d=r.defMinWidthType==="px"?r.defMinWidth:lt["a"].mm2pix(r.defMinWidth);Je[n]={value:Math.max(d,Je[n].value),minWidth:d}}if(r.defMaxWidthType==="%"&&r.defMaxWidth>0){appendColDefToPercentWidthCalculation(n,r,i.MAX)}else if(r.defMaxWidth>0){var c=r.defMaxWidthType==="px"?r.defMaxWidth:lt["a"].mm2pix(r.defMaxWidth);Je[n]={value:Math.min(c,Je[n].value),maxWidth:c}}}}else{Je[n]={value:r.defWidthType==="px"?r.defWidth:lt["a"].mm2pix(r.defWidth)}}}var u=0;a.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 n=0,m=a.length;n<m;n++){var h=a[n];if(!h){continue}var r=h.colDef,f=Je[n],v=sumExceptCol(n);for(var b=0,T=h.position.length;b<T;b++){var E=h.position[b];if(E===i.MIN){var d=Math.ceil(r.defMinWidth*v/(100-r.defMinWidth));d=Math.min(d,f.maxWidth||d);g=g||f.minWidth===d||!f.minWidth;f.minWidth=d}else if(E===i.MAX){var c=Math.ceil(r.defMaxWidth*v/(100-r.defMaxWidth));g=g||f.maxWidth===c||!f.minWidth;f.maxWidth=c}else{var s=Math.ceil(r.defWidth*v/(100-r.defWidth));s=Math.min(s,f.maxWidth||s);s=Math.max(s,f.minWidth||s);g=g||f.value!==s;f.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(a){return Je.reduce(function(e,t,i){if(i===a){return e}var n=t.value;t.minWidth&&(n=Math.max(t.minWidth,n));t.maxWidth&&(n=Math.min(t.maxWidth,n));return e+n},0)}function appendColDefToPercentWidthCalculation(e,t,i){var n=a[e];if(typeof n==="undefined"){n=a[e]={}}n.colDef=t;if(i){n.position!==undefined?n.position.push(i):n.position=[i]}}}};var b=function(){function Validator(){}Validator.validate=function(t,e){if(e.required!==true&&(t===""||t===undefined||t===null)){return true}var i=[];(e.min||e.min===0)&&min(e.min);(e.max||e.max===0)&&max(e.max);e.number===true&&number();e.required===true&&required();if(i.length>0){return i}return true;function required(){if(t===""){i.push({name:"required",message:Ot["a"].getTranslation("VALIDATOR_REQUIRED")})}}function number(){if(isNaN(t)){i.push({name:"number",message:Ot["a"].getTranslation("VALIDATOR_NUMBER")})}}function max(e){if(t>parseFloat(e)){i.push({name:"max:"+e,message:Ot["a"].getTranslation("VALIDATOR_MAX",e.toString())})}}function min(e){if(t<parseFloat(e)){i.push({name:"min:"+e,message:Ot["a"].getTranslation("VALIDATOR_MIN",e.toString())})}}};return Validator}();var T=r(323);var E=r(13);var O=r(351);var L=function(){function TableMover(e,t,i,n){this._elemList=new _;this._colHeaderNames=["",Ot["a"].getTranslation("NO."),Ot["a"].getTranslation("NAME"),Ot["a"].getTranslation("FIX"),Ot["a"].getTranslation("WIDTH"),Ot["a"].getTranslation("MIN_WIDTH"),Ot["a"].getTranslation("MAX_WIDTH"),Ot["a"].getTranslation("HIDE_SHORT"),Ot["a"].getTranslation("ACT_WIDTH")];this._dropDownElementsModeValues=[Ot["a"].getTranslation("COLUMNMODE_AUTOCONTENT"),Ot["a"].getTranslation("COLUMNMODE_AUTOGRID"),Ot["a"].getTranslation("COLUMNMODE_MANUAL")];this._colDefInternal=[];this._initialValue={tableContainer:{},extendedModel:{},colDef:[]};this._extension=e;this._tableContainer=t;this._extendedModel=i||t.extendedModel;this._showDraggers=n;this.open()}TableMover.prototype.open=function(){var o=this;var e=function(){var e=o._extension.getController().getRootPanel().getPainter(),t=e.getContainerScrollPosition(o._tableContainer.id,o._extension.getId());if(t&&t.left!==0){t.left=0;e.setContainerScrollPosition(o._tableContainer.id,o._extension.getId(),t)}},t=function(){var e=function(){var e=document.createElement("fieldset");e.className="twoFields twoFields-left";var t=document.createElement("legend");t.textContent=Ot["a"].getTranslation("COLUMNS");var i=T["a"].createDropdown(TableMover._dropDownElementsModeKeys,o._dropDownElementsModeValues,o._extendedModel.columnMode,{classList:"HiCoSelect"});l.columnMode=i.components.dropdown;l.columnMode.addEventListener("change",function(){for(var e=0,t=l.columns;e<t.length;e++){var i=t[e];i.selectPresetValues()}l.splitEvenButton.disabled=l.columnMode.options[l.columnMode.selectedIndex].value==="autoContent"});var n=T["a"].createButton('<img src="'+Se["a"].imgPath+"table.png"+'"/>',{classList:"HiCoButton"});St["b"].UI.Tooltip.createTooltip(n.components.button,function(){return{text:Ot["a"].getTranslation("SPLIT_COLUMNS_EVENLY")}});l.splitEvenButton=n.components.button;l.splitEvenButton.disabled=l.columnMode.options[l.columnMode.selectedIndex].value==="autoContent";l.splitEvenButton.addEventListener("click",function(){o.splitEven()});e.appendChild(t);e.appendChild(i.htmlnode);e.appendChild(n.htmlnode);return e},t=function(){var e=document.createElement("fieldset");e.className="twoFields twoFields-right";var t=document.createElement("legend");t.textContent=Ot["a"].getTranslation("ROWS");e.appendChild(t);var i=document.createElement("div");i.style.maxWidth="120px";i.style.display="inline-block";var n=T["a"].createCheckBox(o._extendedModel.fixRowHeight,Ot["a"].getTranslation("FIX_HEIGHT"));l.fixHeight=n.components.checkbox;i.appendChild(n.htmlnode);e.appendChild(i);i=document.createElement("div");i.style.display="inline-flex";i.style.paddingTop="2px";i.style.cssFloat="right";var a=document.createElement("div");a.style.cssFloat="left";a.style.marginRight="5px";a.innerHTML=Ot["a"].getTranslation("VERTICAL_ALIGNMENT");var r=T["a"].createVertiaclAlignmentChooser(o._extendedModel.rowAlignment);l.rowVerticalAlignment=r.components.input;i.appendChild(a);i.appendChild(r.htmlnode);e.appendChild(i);return e},i=function(){var e=l.columnTableHead=document.createElement("table"),t=document.createElement("thead"),i=document.createElement("tr");for(var n=0;n<o._colHeaderNames.length;n++){var a=document.createElement("th");a.innerHTML=o._colHeaderNames[n];a.style.width=TableMover._colWidth[n]+"px";i.appendChild(a)}t.appendChild(i);e.appendChild(t);return e},n=function(){var e=document.createElement("div");e.style.overflowX="auto";e.style.maxHeight="300px";e.style.width="100%";var t=l.columnTableBody=document.createElement("table");e.appendChild(t);return e},a=function(){var e=document.createElement("table"),t=document.createElement("tr");var i=document.createElement("th");i.style.width=TableMover._colWidth[0]+TableMover._colWidth[1]+"px";t.appendChild(i);i=document.createElement("th");i.textContent=Ot["a"].getTranslation("SUM");i.style.textAlign="left";i.style.width=TableMover._colWidth[2]+TableMover._colWidth[3]+"px";t.appendChild(i);l.colTableFooter.sumWidth.element=i=document.createElement("th");i.textContent="-";i.style.textAlign="right";i.style.width=TableMover._colWidth[4]+"px";St["b"].UI.Tooltip.createTooltip(i,function(){return{text:o.createTooltipInfo(l.colTableFooter.sumWidth.value)}});t.appendChild(i);i=document.createElement("th");i.style.width=TableMover._colWidth[5]+TableMover._colWidth[6]+TableMover._colWidth[7]+"px";t.appendChild(i);l.colTableFooter.sumActWidth.element=i=document.createElement("th");i.textContent="-";i.style.textAlign="right";i.style.width=TableMover._colWidth[8]+"px";St["b"].UI.Tooltip.createTooltip(i,function(){return{text:o.createTooltipInfo(l.colTableFooter.sumActWidth.value,undefined,l.colTableFooter.sumActBorders.value)}});t.appendChild(i);e.appendChild(t);return e};o._dialogbox=document.createElement("div");o._dialogbox.id="tableMoverDialog";var r=document.createElement("div");r.className="twoFields";r.appendChild(e());r.appendChild(t());o._dialogbox.appendChild(r);o._dialogbox.appendChild(i());o._dialogbox.appendChild(n());o._dialogbox.appendChild(a());o._dialog=St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("TABLE"),o._dialogbox,[{text:Ot["a"].getTranslation("OKAY"),handler:function(){if(o.applyChanges(true)){o.close()}}},{text:Ot["a"].getTranslation("CLOSE"),handler:function(){o.close()}}],{className:"HiCo table-mover",draggable:true,modal:false,width:"700px",minwidth:"650px",maxwidth:"900px"})};this._extension.setMode(St["b"].Utils.Enums.EMode.EDIT_GRID);this._extension.setActiveMover(this);this._colDefInternal=this._extendedModel.columnDefinitions.map(function(e){return e.clone()});this._initialValue.tableContainer=this._tableContainer;this._initialValue.extendedModel=this._extendedModel;this._initialValue.colDef=this._colDefInternal;var l=this._elemList;e();if(this._showDraggers){this.createOverlayDiv();this.createColumnResizersAndDraggers();this.updateColumnResizersAndDraggersPositions()}t();this.updateDialog()};TableMover.prototype.close=function(){this._elemList.overlayDiv&&this._elemList.overlayDiv.parentNode.removeChild(this._elemList.overlayDiv);this._dialog&&St["b"].$(this._dialog).remove();this._extension.setActiveMover(null);if(!E["a"].IsOpen){this._extension.setMode(St["b"].Utils.Enums.EMode.DEFAULT,true)}if(this._extension.ignoreShowCondition&&document.getElementById("cellDialog")===null){this._extension.ignoreShowCondition=false;St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}};TableMover.prototype.reset=function(){this._tableContainer=this._initialValue.tableContainer;this._extendedModel=this._initialValue.extendedModel;this._colDefInternal=this._initialValue.colDef;this._extendedModel.columnDefinitions=this._initialValue.colDef;this._elemList.columnMode.select(this._extendedModel.columnMode);this._elemList.splitEvenButton.disabled=this._extendedModel.columnMode==="autoContent";this._elemList.fixHeight.checked=this._extendedModel.fixRowHeight;this._elemList.rowVerticalAlignment.select(this._extendedModel.rowAlignment);this.calcNewWidth()};TableMover.prototype.updateColumnResizersAndDraggersPositions=function(){var e=this._extendedModel.tableCellData[0]&&this._extendedModel.tableCellData[0][0]?this._extendedModel.tableCellData[0][0].afterLayoutingPosition.x:0;var t=this._colDefInternal.filter(function(e){return!e.IsHidden}),i=this._elemList.draggerDivs.filter(function(e){return!!e}),n=this._elemList.resizerDivs.filter(function(e){return!!e});for(var a=0;a<t.length;a++){var r=t[a];i[a].style.left=e+"px";i[a].style.width=r.width+"px";e+=r.width+r.spacing_left+r.spacing_right;n[a].style.left=e-3+"px"}};TableMover.prototype.updateDialog=function(){var u=this;var s=this._elemList;var p=function(e,t,i){var n=document.createElement("td");t&&(n.style.width=t+"px");i&&n.appendChild(i);e.appendChild(n);return n},d=function(e,a,r,o,l,t,i){var n=function(){var e=parseFloat(r[o].value);isNaN(e)&&(e=undefined);if(b.validate(e||"",{number:true,min:0})===true){r[o].value=a[o]=(e||"").toString()}else{r[o].value=a[o]}},s=function(e){var t=a[l];var i=e.target;a[l]=i.options[i.selectedIndex].value;if(a[l]==="w"){r[o].value="1";r.columnFix.checked=false;r.columnFix.disabled=true;return}if(t==="w"){r[o].value="";r.columnFix.disabled=false;return}if(r[o].value===""||r[o].value==="0"||r[o].value==="-1"){return}var n=lt["a"].convertToPixel(r[o].value,u._tableWidthWithoutSpacing,t);switch(a[l]){case"px":r[o].value=TableMover.floorTwoDigits(n);break;case"mm":r[o].value=TableMover.floorTwoDigits(lt["a"].pix2mm(n));break;case"%":r[o].value=TableMover.floorTwoDigits(lt["a"].pix2pct(n,u._tableWidthWithoutSpacing));break;case"w":r[o].value="";break;default:console.log("We got an unknown unit '"+a[l]+"'. How could that happen?");return}a[o]=parseFloat(r[o].value)};var d=a[o]===-1?"":a[o],c=T["a"].createInputWithDropdown(d,i,i,a[l],"auto");r[o]=c.components.input;r[o].addEventListener("change",function(){n()});St["b"].UI.Tooltip.createTooltip(r[o],function(){return{text:u.createTooltipInfo(r[o],r[l])}});r[l]=c.components.dropdown;r[l].addEventListener("change",function(e){s(e)});return p(e,TableMover._colWidth[t],c.htmlnode)};s.columnTableBody&&St["b"].$(s.columnTableBody).empty();s.columns=[];this._tableWidthWithoutSpacing=this._tableContainer.dimension.widthWithoutSpacing;var c=it["a"].getContextByCidOrThrow(this._extendedModel.contextId);var g=0,m=0,h=0;this._colDefInternal.forEach(function(t,e){var i=new A(u.countVisibleColumns.bind(u),s),n=document.createElement("tr");var a=p(n,TableMover._colWidth[0]);a.innerHTML='<i class="lui-icon lui-icon--draggable"></i>';a=p(n,TableMover._colWidth[1]);a.style.textAlign="right";a.textContent=(e+1).toString();a=p(n,TableMover._colWidth[2]);var r;if(t.exprId.startsWith("dim")){r=c.rows.filter(function(e){return e.id===c.id+"."+t.exprId.split(".")[0]})}else{r=c.columns.filter(function(e){return e.id===c.id+"."+t.exprId})}a.textContent=(new St["b"].Utils.Format.LabelFormatter).parseLabel(r[0].name);var o=T["a"].createCheckBox(t.columnFix);i.columnFix=o.components.checkbox;a=p(n,TableMover._colWidth[3],o.htmlnode);a.style.textAlign="center";var l=TableMover.dropDownElementsUnits.slice();l.push("w");d(n,t,i,"defWidth","defWidthType",3,l);!t.IsHidden&&(g+=lt["a"].convertToPixel(t.defWidth>=0?t.defWidth:0,u._tableWidthWithoutSpacing,t.defWidthType));d(n,t,i,"defMinWidth","defMinWidthType",4,TableMover.dropDownElementsUnits);d(n,t,i,"defMaxWidth","defMaxWidthType",5,TableMover.dropDownElementsUnits);o=T["a"].createCheckBox(t.isHidden);i.isHidden=o.components.checkbox;a=p(n,TableMover._colWidth[7],o.htmlnode);a.style.textAlign="center";a=p(n,TableMover._colWidth[8]);a.style.textAlign="right";a.innerHTML=t.isDataColumnHidden?Ot["a"].getTranslation("HIDDEN"):TableMover.roundTwoDigitsWithRoundingSymbol(t.width+t.spacing_left+t.spacing_right,"px");St["b"].UI.Tooltip.createTooltip(a,function(){return{text:u.createTooltipInfo(t.isDataColumnHidden?"-":t.width,undefined,t.spacing_left+t.spacing_right)}});m+=t.width;h+=t.spacing_left+t.spacing_right;s.columns.push(i);s.columnTableBody.appendChild(n);i.columnFix.addEventListener("change",function(){i.onChangeColumnFix()});i.defWidth.addEventListener("change",function(){i.onChangeColumnFix()});i.defWidthType.addEventListener("change",function(){i.onChangeColumnFix()});i.defMinWidth.addEventListener("change",function(){i.validateMinMaxColumns()});i.defMinWidthType.addEventListener("change",function(){i.validateMinMaxColumns()});i.defMaxWidth.addEventListener("change",function(){i.validateMinMaxColumns()});i.defMaxWidthType.addEventListener("change",function(){i.validateMinMaxColumns()});i.isHidden.addEventListener("change",function(){i.onChangeIsHidden()});i.selectPresetValues()});St["b"].$(s.columnTableBody).sortable("destroy").sortable({axis:"y",cursor:"s-resize",distance:3,tolerance:"pointer",handle:".lui-icon--draggable",stop:function(){var e=[];for(var t=0;t<s.columnTableBody.childNodes.length;t++){var i=s.columnTableBody.childNodes[t],n=parseInt(i.childNodes[1].innerText)-1;e.push(u._extendedModel.columnDefinitions[n])}u._extendedModel.columnDefinitions=e;u.calcNewWidth()}});s.colTableFooter.sumWidth.value=TableMover.roundTwoDigits(g);s.colTableFooter.sumWidth.element.innerHTML=TableMover.roundTwoDigitsWithRoundingSymbol(g,"px");s.colTableFooter.sumActWidth.value=TableMover.roundTwoDigits(m);s.colTableFooter.sumActBorders.value=TableMover.roundTwoDigits(h);s.colTableFooter.sumActWidth.element.innerHTML=TableMover.roundTwoDigitsWithRoundingSymbol(m+h,"px")};TableMover.prototype.createTooltipInfo=function(e,t,i){var n=e instanceof HTMLInputElement,a=t?t.options[t.selectedIndex].value:"px";var r="",o=n?e.value:e;if(o==="-"){return Ot["a"].getTranslation("HELP_HIDDEN_COLUMN_BY_DISPLAY_CONDITION")}if(o===""||a==="w"){return r}n&&(o=parseFloat(e.value));var l=lt["a"].convertToPixel(o,this._tableWidthWithoutSpacing,a),s=lt["a"].convertFromPixel(l,this._tableWidthWithoutSpacing);var d=function(e,t){var i=TableMover.roundTwoDigitsWithRoundingSymbol(e,t);return a===t?"<b>"+i+"</b>":i},c=function(e){return'<span style="white-space: nowrap">'+e+"</span>"};r+=c(d(s.px,"px"))+"<br>";r+=c(d(s.mm,"mm"))+"<br>";r+=c(d(s.pct,"%"));if(i!==undefined){r+="<hr/>"+c("Border: "+TableMover.roundTwoDigitsWithRoundingSymbol(i,"px"))}return r};TableMover.prototype.splitEven=function(){var e=this._extendedModel.columnDefinitions,t=this.countVisibleColumns(),i=TableMover.floorTwoDigits(100/t);for(var n=0;n<e.length;n++){if(this._elemList.columns[n].isHidden.checked){e[n].defWidth=-1;e[n].defWidthType="px";e[n].columnFix=false}else{e[n].defWidth=i;e[n].defWidthType="%";e[n].columnFix=true}e[n].isHidden=this._elemList.columns[n].isHidden.checked}this._elemList.columnMode.select("manual");this.calcNewWidth()};TableMover.prototype.countVisibleColumns=function(){var e=0;for(var t=0,i=this._colDefInternal.length;t<i;t++){if(!this._elemList.columns[t].isHidden.checked){e++}}return e};TableMover.floorTwoDigits=function(e){return Math.floor(e*100)/100};TableMover.roundTwoDigits=function(e){return Math.round(e*100)/100};TableMover.roundTwoDigitsWithRoundingSymbol=function(e,t){var i=TableMover.roundTwoDigits(e);return(i!==e?"&#8776;":"")+i+" "+t};TableMover.prototype.calcNewWidth=function(){var e=this;if(this._showDraggers){this._extension.paint()}window.HiCoMVCInit.paintingPromise.addCallback(function(){e._colDefInternal=e._extendedModel.columnDefinitions.map(function(e){return e.clone()});e.updateDialog();if(e._showDraggers){O["b"].getPromise().then(function(){e.createOverlayDiv();e.createColumnResizersAndDraggers();e.updateColumnResizersAndDraggersPositions()})}})};TableMover.prototype.applyChanges=function(e){var t=this._extendedModel.columnDefinitions.map(function(e){return e.clone()}),i=this._elemList.columns,n=[];var a=false;this._extendedModel.columnMode=this._elemList.columnMode.options[this._elemList.columnMode.selectedIndex].value;this._extendedModel.rowAlignment=this._elemList.rowVerticalAlignment.selectedValue();this._extendedModel.fixRowHeight=this._elemList.fixHeight.checked;for(var r=0;r<t.length;r++){var o=t[r];o.defWidth=i[r].defWidth.value===""?-1:parseFloat(i[r].defWidth.value);o.defWidthType=i[r].defWidthType.options[i[r].defWidthType.selectedIndex].value;o.columnFix=i[r].columnFix.checked;o.defMaxWidth=i[r].defMaxWidth.value===""?-1:parseFloat(i[r].defMaxWidth.value);o.defMaxWidthType=i[r].defMaxWidthType.options[i[r].defMaxWidthType.selectedIndex].value;o.defMinWidth=i[r].defMinWidth.value===""?-1:parseFloat(i[r].defMinWidth.value);o.defMinWidthType=i[r].defMaxWidthType.options[i[r].defMinWidthType.selectedIndex].value;o.isHidden=i[r].isHidden.checked;a=a||!i[r].defMinWidth.disabled&&i[r].minMaxValidationError;n.push(o)}if(!a){this._extendedModel.columnDefinitions=n;if(e){if(this._showDraggers){this._extension.paint()}}else{this.calcNewWidth()}this._extension.getController().updateLayoutDefinition()}else{j["a"].warning(Ot["a"].getTranslation("MIN_HAVE_TO_BE_SMALLER_THAN_MAX"))}return!a};TableMover.prototype.createOverlayDiv=function(){this.clearOverlayDiv();var e={width:this._tableContainer.dimension.width+"px",height:this._tableContainer.dimension.height+"px",backgroundColor:TableMover._containerColor};this._elemList.overlayDiv=document.createElement("div");this._elemList.overlayDiv.className="tableOverlay";St["b"].Utils.DOM.setStyle(this._elemList.overlayDiv,e);document.getElementById(this._tableContainer.id+"_"+this._extension.getId()).appendChild(this._elemList.overlayDiv)};TableMover.prototype.clearOverlayDiv=function(){this._elemList.draggerDivs=[];this._elemList.resizerDivs=[]};TableMover.prototype.createColumnResizersAndDraggers=function(){var p=this;var g=this._elemList;var i=this._extendedModel.tableCellData[0]&&this._extendedModel.tableCellData[0][0]?this._extendedModel.tableCellData[0][0].afterLayoutingPosition.y:0;var n=function(e,t){var i=g.resizerDivs.indexOf(t.helper.context);if(i>-1){var n=p._colDefInternal[i],a=Math.max(0,n.width+(t.position.left-t.originalPosition.left));switch(n.defWidthType){case"px":n.defWidth=a;n.columnFix=true;break;case"mm":n.defWidth=lt["a"].pix2mm(a);n.columnFix=true;break;case"%":n.defWidth=lt["a"].pix2pct(a,p._tableWidthWithoutSpacing);n.columnFix=true;break}p._extendedModel.columnDefinitions[i]=n}p.calcNewWidth()},t=function(e,t){var i=t.helper.context,n=g.overlayDiv.getBoundingClientRect();var a=false;for(var r=0,o=g.draggerDivs;r<o.length;r++){var l=o[r];if(!l||l===i){continue}var s=false;if(!a){var d=n.left+l.offsetLeft,c=n.top+l.offsetTop;s=e.pageX>d&&e.pageX<d+l.offsetWidth&&e.pageY>c&&e.pageY<c+l.offsetHeight}l.style.backgroundColor=s?TableMover._draggedColor:TableMover._containerColor;a=a||s}},a=function(e,t){var i=null,n=0;var a=t.helper.context,r=g.overlayDiv.getBoundingClientRect();for(;n<g.draggerDivs.length;n++){var o=g.draggerDivs[n];if(!o||o===a){continue}o.style.backgroundColor=TableMover._containerColor;var l=r.left+o.offsetLeft,s=r.top+o.offsetTop,d=e.pageX>l&&e.pageX<l+o.offsetWidth&&e.pageY>s&&e.pageY<s+o.offsetHeight;if(d){i=d;break}}if(i){var c=g.draggerDivs.indexOf(a);if(c>-1){var u=p._extendedModel.columnDefinitions[n].clone();p._extendedModel.columnDefinitions[n]=p._extendedModel.columnDefinitions[c].clone();p._extendedModel.columnDefinitions[c]=u}p.calcNewWidth()}else{p.updateColumnResizersAndDraggersPositions()}},e=function(){var e=document.createElement("div");e.className="tableResizer";e.style.height=o+"px";e.style.top=i+"px";var t=document.createElement("hr");t.style.backgroundColor=TableMover._resizerColor;e.appendChild(t);g.overlayDiv.appendChild(e);g.resizerDivs.push(e);St["b"].$(e).draggable({axis:"x",cursor:"e-resize",containment:g.overlayDiv,stop:n})},r=function(){var e=document.createElement("div");e.className="tableDragger";e.style.top=i+"px";e.style.height=o+"px";e.style.backgroundColor=TableMover._containerColor;e.style.position="absolute";g.overlayDiv.appendChild(e);g.draggerDivs.push(e);St["b"].$(e).draggable({axis:"x",cursor:"crosshair",containment:g.overlayDiv,drag:t,stop:a})};var o=0;for(var l=0,s=this._extendedModel.rowDefinitions;l<s.length;l++){var d=s[l];o+=d.height+d.spacing_top+d.spacing_bottom}o=Math.min(o,this._tableContainer.dimension.height);for(var c=0,u=this._colDefInternal;c<u.length;c++){var m=u[c];if(!m.IsHidden){e();r()}else{g.resizerDivs.push(null);g.draggerDivs.push(null)}}};TableMover.prototype.getConfig=function(){return{colDef:this._extendedModel.columnDefinitions.map(function(e){return e.clone()}),columnMode:this._extendedModel.columnMode,tableContainer:this._tableContainer}};TableMover._colWidth=[10,20,192,25,90,90,90,40,85];TableMover.dropDownElementsUnits=["px","mm","%"];TableMover._dropDownElementsModeKeys=["autoContent","autoGrid","manual"];TableMover._resizerColor="rgba(37,157,187,1.0)";TableMover._containerColor="rgba(217,217,217,0.2)";TableMover._draggedColor="rgba(37,157,187,0.2)";return TableMover}();var A=function(){function ColItems(e,t){this.oldElementValue={isFixed:undefined,defWidth:undefined,defWidthType:undefined};this._countVisibleColumns=e;this._elemList=t}ColItems.prototype.onChangeColumnFix=function(){var e=this.columnFix.checked;this.defMinWidth.disabled=e;this.defMinWidthType.disabled=e;this.defMaxWidth.disabled=e;this.defMaxWidthType.disabled=e;if(e){this.defMaxWidth.value="";this.defMaxWidthType.selectedIndex=0;this.defMinWidth.value="";this.defMinWidthType.selectedIndex=0}this.removeInvalidClass()};ColItems.prototype.onChangeIsHidden=function(e){if(!e&&this._countVisibleColumns()===0){this.isHidden.checked=false;j["a"].warning(Ot["a"].getTranslation("NOT_POSSIBLE_TO_HIDE_ALL_COLUMNS"))}else{this.removeInvalidClass();var t=this.isHidden.checked;this.columnFix.disabled=t||this.defWidthType.options[this.defWidthType.selectedIndex].value==="w";this.defWidth.disabled=t;this.defWidthType.disabled=t;this.defMinWidth.disabled=t;this.defMinWidthType.disabled=t;this.defMaxWidth.disabled=t;this.defMaxWidthType.disabled=t;if(t){this.oldElementValue.isFixed===undefined&&(this.oldElementValue.isFixed=this.columnFix.checked);this.columnFix.checked=false}else{this.columnFix.checked=this.oldElementValue.isFixed;this.oldElementValue.isFixed=undefined;this.onChangeColumnFix();this.selectPresetValues()}}};ColItems.prototype.removeInvalidClass=function(){this.defMinWidth.classList.remove("invalid");this.defMinWidthType.classList.remove("invalid");this.defMaxWidth.classList.remove("invalid");this.defMaxWidthType.classList.remove("invalid")};ColItems.prototype.selectPresetValues=function(){if(this.isHidden.checked){this.onChangeIsHidden(true)}else{var e=this._elemList.columnMode.options[this._elemList.columnMode.selectedIndex].value;this.defMinWidth.disabled=false;this.defMinWidthType.disabled=false;this.defMaxWidth.disabled=false;this.defMaxWidthType.disabled=false;if(e==="autoContent"){if(!L.dropDownElementsUnits[this.defWidthType.selectedIndex]){this.oldElementValue.defWidthType=this.defWidthType.options[this.defWidthType.options.selectedIndex].value;this.defWidthType.selectedIndex=0}this.defWidthType.updateOptions(L.dropDownElementsUnits,L.dropDownElementsUnits)}else{var t=St["b"].Utils.GlobalFunctions.deepCopy(L.dropDownElementsUnits);t.push("w");this.defWidthType.updateOptions(t,t)}var i=this.defWidthType.options[this.defWidthType.selectedIndex].value;if(e==="autoContent"){this.oldElementValue.defWidth===undefined&&(this.oldElementValue.defWidth=this.defWidth.value);this.defWidth.value="";this.defWidth.disabled=true;this.oldElementValue.defWidthType===undefined&&(this.oldElementValue.defWidthType=i);this.defWidthType.select(L.dropDownElementsUnits[0]);this.defWidthType.disabled=true;this.oldElementValue.isFixed===undefined&&(this.oldElementValue.isFixed=this.columnFix.checked);this.columnFix.checked=false;this.columnFix.disabled=true}else{this.oldElementValue.defWidth!==undefined&&(this.defWidth.value=this.oldElementValue.defWidth);this.oldElementValue.defWidth=undefined;this.defWidth.disabled=false;this.oldElementValue.defWidthType!==undefined&&this.defWidthType.select(this.oldElementValue.defWidthType);this.defWidthType.disabled=false;this.oldElementValue.isFixed!==undefined&&(this.columnFix.checked=this.oldElementValue.isFixed);this.oldElementValue.isFixed=undefined;this.columnFix.disabled=i==="w";if(i==="w"){this.columnFix.checked=false}this.onChangeColumnFix()}}};ColItems.prototype.validateMinMaxColumns=function(){this.removeInvalidClass();this.minMaxValidationError=false;var e=parseFloat(this.defMinWidth.value),t=parseFloat(this.defMaxWidth.value);if(e>=0&&t>=0&&!this.defMinWidth.disabled&&this.defMinWidthType.value==="%"===(this.defMaxWidthType.value==="%")){var i=lt["a"].convertToPixel(parseFloat(this.defMinWidth.value),100,this.defMinWidthType.options[this.defMinWidthType.selectedIndex].value),n=lt["a"].convertToPixel(parseFloat(this.defMaxWidth.value),100,this.defMaxWidthType.options[this.defMaxWidthType.selectedIndex].value),a=b.validate(i,{number:true,max:n});if(a!==true){this.minMaxValidationError=true;if(!this.defMinWidth.classList.contains("invalid")){this.defMaxWidth.classList.add("invalid");this.defMinWidthType.classList.add("invalid");this.defMaxWidthType.classList.add("invalid")}}}};return ColItems}();var _=function(){function ElemList(){this.columns=[];this.colTableFooter={sumWidth:{value:undefined,element:undefined},sumActBorders:{value:undefined},sumActWidth:{value:undefined,element:undefined}};this.resizerDivs=[];this.draggerDivs=[]}return ElemList}();St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Time=St["b"].Layout.Time||{};St["b"].Layout.Time.CompareLayoutHelpers={layoutCompares:function(e,t,i,P,n,a,r,o){var w=St["b"].DataObjects.RuntimeDO;var l=St["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=St["b"].Utils.Constants.TypeValues.indicator;var p=P.getModel().position.y-.5;var U=St["b"].Utils.Constants.TypeValues.indicator;for(var g=0;g<e.length;g++){var m=e[g];var f=m.getModel();if(f.active===false){continue}var F=n.extendedModel;var h=f.compareFrom;var v=f.compareTo;if(h&&v){if(h!==U.AXIS||v!==U.AXIS){f.hide=false}var b={absDim:f.absolute.dimension,percDim:f.percent.dimension,textDim:f.text.dimension,maxWidth:f.maxTextWidth,maxHeight:f.ellipseHeight};if(f.offset.x==-1){f.offset.x=0}var T=p;var E=calculateCompareLayout(h,v,f,T,b);var x=calculateCompareTextLayout(E,b.absDim,b.percDim,b.textDim,b.maxWidth);f.fromPosition=E.fromPosition;f.toPosition=E.toPosition;m.setPosition(E.position);m.setDimension(E.dimension);f.preferredDimension=E.dimension;f.preferredPosition=E.position;f.absolute.position=x.absolute;f.percent.position=x.percent;f.text.position=x.text;f.ellipseArray=x.ellipse;f.ellipseStrokeWidth=s;f.arrowType=E.arrowType;var C=f.compareStyle;if(C===u.NOTATION){C=w.getParameter("COMPARE_DEFAULT_TYPE")}if(C===u.ARROW){f.headBaseSize=d;f.headWidth=w.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*d;f.headLength=d}else{f.headBaseSize=c;f.headWidth=w.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*c;f.headLength=c}revertLegend();i[m.getId()]=m}f.compareFrom=null;f.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(f.absolute.originalLegend&&f.absolute.originalLegend===U.AUTO){f.absolute.legend=f.absolute.originalLegend;delete f.absolute.originalLegend}if(f.percent.originalLegend&&f.percent.originalLegend===U.AUTO){f.percent.legend=f.percent.originalLegend;delete f.percent.originalLegend}if(f.text.originalLegend&&f.text.originalLegend===U.AUTO){f.text.legend=f.text.originalLegend;delete f.text.originalLegend}}function calculateCompareTextLayout(e,t,i,n,a){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=f.dimension.width;var p=f.compareConnectorSize;if(u<p){u=p}var g=0;var m=0;var h=0;if(f.percent.legend!==U.NONE){if(f.percent.legend===U.START){g+=1}else if(f.percent.legend===U.MID){h+=1}else if(f.percent.legend===U.END){m+=1}}if(f.text.legend!==U.NONE&&f.text.text!==""){if(f.text.legend===U.START){g+=1}else if(f.text.legend===U.MID){h+=1}else if(f.text.legend===U.END){m+=1}}if(f.absolute.legend!==U.NONE){if(f.absolute.legend===U.START){g+=1}else if(f.absolute.legend===U.MID){h+=1}else if(f.absolute.legend===U.END){m+=1}}if(f.percent.legend!==U.NONE){o.x=setPosition(d,u,f.percent.dimension,f.percent.legend);o.y=setPositionY(c,f.percent.dimension,h+g+m,U.PERCENT,e)}if(f.absolute.legend!==U.NONE){r.x=setPosition(d,u,f.absolute.dimension,f.absolute.legend);r.y=setPositionY(c,f.absolute.dimension,h+g+m,U.ABSOLUTE,e)}if(f.text.legend!==U.NONE&&f.text.text!==""){l.x=setPosition(d,u,f.text.dimension,f.text.legend);l.y=setPositionY(c,f.text.dimension,h+g+m,U.TEXT,e)}if(f.ellipse){s=setEllipse(g,h,m,f,u,d,c,o,l,r)}return{text:l,absolute:r,percent:o,ellipse:s}}function setPositionY(e,t,i,n,a){var r=0;e=e-t.height/4;var o;if(n===U.TEXT){o=f.text}else if(n===U.ABSOLUTE){o=f.absolute}else if(n===U.PERCENT){o=f.percent}var l=t.height;if(f.ellipse){l=f.font.fSize*parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"))}if(a.dimension.height<l&&i===1&&o.legend!==U.AUTO){if(f.positive){r=e+t.height/4-a.dimension.height/2-t.height+t.height/4-1}else{r=e+t.height/4+a.dimension.height/2+1}}else{if(i===3){if(n===U.TEXT){r=e-t.height/2-t.height+t.height/4}else if(n===U.ABSOLUTE){r=e-t.height/2+t.height/4}else if(n===U.PERCENT){r=e+t.height/2+t.height/4}}else if(i===2){if(n===U.TEXT){r=e-t.height/2}else if(n===U.ABSOLUTE){if(f.text.legend!==U.NONE&&f.text.text!==""){r=e+t.height/2}else{r=e-t.height/2}}else if(n===U.PERCENT){r=e+t.height/2}}else if(i===1){if(n===U.TEXT){r=e}else if(n===U.ABSOLUTE){r=e}else if(n===U.PERCENT){r=e}}}return r}function setEllipse(e,t,i,n,a,r,o,l,s,d){var c=parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH"));var u=[];var p=n.topMaxHeight*2;var g=n.midMaxHeight*2;var m=n.bottomMaxHeight*2;if(e===1){var h={x:0,y:0,width:0,height:0};if(n.absolute.legend===U.START){h.x=d.x+n.absolute.dimension.width/2;h.y=d.y+n.absolute.dimension.height/2;h.width=n.absolute.dimension.width*c*2;h.height=n.absolute.dimension.height}else if(n.percent.legend===U.START){h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.width=c*n.percent.dimension.width*2;h.height=n.percent.dimension.height}else{h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.width=n.text.dimension.width*c*2;h.height=n.text.dimension.height}h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else if(e===2){if(n.text.legend===U.START&&n.text.text!==""){if(n.absolute.legend===U.START){var h={x:0,y:0,width:0,height:0};h.x=d.x+n.absolute.dimension.width/2;h.y=d.y;h.height=n.text.dimension.height+n.absolute.dimension.height;h.width=p;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{if(t===0&&i===0){var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y;h.width=Math.max(n.percent.dimension.width*c*2,n.text.dimension.width*c*2);h.height=n.percent.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{var h={x:0,y:0,width:0,height:0};h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.height=n.text.dimension.height;h.width=n.text.dimension.width*c*2;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h);var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.height=n.percent.dimension.height;h.width=n.percent.dimension.width*c*2;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}}else if(n.absolute.legend===U.START){var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y;h.height=n.percent.dimension.height+n.absolute.dimension.height;h.width=p;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}else if(e===3){var h={x:0,y:0,width:0,height:0};h.x=r-p/2;h.y=o;h.width=p;h.height=n.absolute.dimension.height+n.percent.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}if(t===1){var h={x:0,y:0,width:0,height:0};if(n.absolute.legend===U.MID){h.x=d.x+n.absolute.dimension.width/2;h.y=d.y+n.absolute.dimension.height/2;h.width=n.absolute.dimension.width*c*2;h.height=n.absolute.dimension.height}else if(n.percent.legend===U.MID){h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.width=n.percent.dimension.width*c*2;h.height=n.percent.dimension.height}else{h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.width=n.text.dimension.width*c*2;h.height=n.text.dimension.height}h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else if(t===2){if(n.text.legend===U.MID&&n.text.text!==""){if(n.absolute.legend===U.MID){var h={x:0,y:0,width:0,height:0};h.x=d.x+n.absolute.dimension.width/2;h.y=d.y;h.height=n.absolute.dimension.height+n.text.dimension.height;h.width=g;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{if(i===0&&e===0){var h={x:0,y:0,width:0,height:0};h.x=s.x+n.text.dimension.width/2;h.y=l.y;h.height=n.text.dimension.height+n.percent.dimension.height;h.width=Math.max(n.text.dimension.width*c*2,n.percent.dimension.width*c*2);h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{var h={x:0,y:0,width:0,height:0};h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.width=n.text.dimension.width*c*2;h.height=n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h);var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.width=n.percent.dimension.width*c*2;h.height=n.percent.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}}else if(n.absolute.legend===U.MID){var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y;h.width=g;h.height=n.absolute.dimension.height+n.percent.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}else if(t===3){var h={x:0,y:0,width:0,height:0};h.x=r+a/2-1;h.y=o;h.width=g;h.height=n.absolute.dimension.height+n.percent.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}if(i===1){var h={x:0,y:0,width:0,height:0};if(n.absolute.legend===U.END){h.x=d.x+n.absolute.dimension.width/2;h.y=d.y+n.absolute.dimension.height/2;h.width=n.absolute.dimension.width*c*2;h.height=n.absolute.dimension.height}else if(n.percent.legend===U.END){h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.width=n.percent.dimension.width*c*2;h.height=n.percent.dimension.height}else{h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.width=n.text.dimension.width*c*2;h.height=n.text.dimension.height}h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else if(i===2){if(n.text.legend===U.END&&n.text.text!==""){if(n.absolute.legend===U.END){var h={x:0,y:0,width:0,height:0};h.x=d.x+n.absolute.dimension.width/2;h.y=d.y;h.width=m;h.height=n.absolute.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{if(e===0&&t===0){var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y;h.width=Math.max(n.percent.dimension.width*c*2,n.text.dimension.width*c*2);h.height=n.percent.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}else{var h={x:0,y:0,width:0,height:0};h.x=s.x+n.text.dimension.width/2;h.y=s.y+n.text.dimension.height/2;h.width=n.text.dimension.width*c*2;h.height=n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h);var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y+n.percent.dimension.height/2;h.width=n.percent.dimension.width*c*2;h.height=n.percent.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}}else if(n.absolute.legend===U.END){var h={x:0,y:0,width:0,height:0};h.x=l.x+n.percent.dimension.width/2;h.y=l.y;h.width=m;h.height=n.absolute.dimension.height+n.percent.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}}else if(i===3){var h={x:0,y:0,width:0,height:0};h.x=r+a+m/2;h.y=o;h.width=m;h.height=n.absolute.dimension.height+n.percent.dimension.height+n.text.dimension.height;h.x=Math.round(h.x);h.y=Math.round(h.y);h.width=Math.round(h.width);h.height=Math.round(h.height);u.push(h)}return u}function calculateCompareLayout(e,t,i,n,a){var r="";var o="";var l=St["b"].Utils.Constants.TypeValues.timeRepresentation;var s;var d=i.dimension.width;if(e!==U.AXIS){var c=St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(F,e.dataId_expr);r=c.representation}if(t!==U.AXIS){var c=St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(F,t.dataId_expr);r=c.representation}var u=0;var p=0;var g=0;var m=0;if(e!==U.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!==U.AXIS){if(t.instanceOf==="TimeLineModel"){p=t.dimension.height/2;m=t.dimension.height/2}else if(t.instanceOf==="RodModel"){p=t.needledim.height/2;m=t.needledim.height/2}}var h;var f;if(e===U.AXIS||i.compareFromCat===U.AXIS){h=n}else if(e.value>=0){if(i.compareFromStart===U.START){if(e.instanceOf!=="NeedleModel"&&e.instanceOf!=="TimeLineModel"&&e.instanceOf!=="RodModel"){h=Math.round(e.position.y+g+e.dimension.height)}else{h=n}}else{h=Math.round(e.position.y+g)}}else{if(i.compareFromStart===U.START){if(e.instanceOf!=="NeedleModel"&&e.instanceOf!=="TimeLineModel"&&e.instanceOf!=="RodModel"){h=Math.round(e.position.y)}else{h=n}}else{h=Math.round(e.position.y+e.dimension.height-g)}}if(t===U.AXIS||i.compareToCat===U.AXIS){f=n}else if(t.value>=0){if(i.compareToStart===U.START){if(t.instanceOf!=="NeedleModel"&&t.instanceOf!=="TimeLineModel"&&t.instanceOf!=="RodModel"){f=Math.round(t.position.y+m+t.dimension.height)}else{f=n}}else{f=Math.round(t.position.y+m)}}else{if(i.compareToStart===U.START){if(t.instanceOf!=="NeedleModel"&&t.instanceOf!=="TimeLineModel"&&t.instanceOf!=="RodModel"){f=Math.round(t.position.y)}else{f=n}}else{f=Math.round(t.position.y+t.dimension.height-m)}}var v={x:0,y:0};var b={x:0,y:0};v.y=h;b.y=f;var T=i.offset.x;if(i.compareLegend===U.START){i.offset.x=-1}else if(i.compareLegend===U.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!==U.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!==U.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===U.AXIS||i.compareFromCat===U.AXIS){v.x=b.x}if(t===U.AXIS||i.compareToCat===U.AXIS){b.x=v.x}var E=false;if(f<h){var x=h;h=f;f=x;x=v;v=b;b=x}if(b.x<=v.x){E=true}i.offset.x=T;var C=f-h;var y;var M=i.font.fSize;var S=0;if(i.ellipse){S=i.font.fSize*parseFloat(w.getParameter("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT"))}if(C>S+2*M+1){y=0}else if(C>M){y=1}else{y=2}if(i.compareLegend===U.START){var O=P.getModel().position.x;var L=i.midMaxHeight;var A=i.topMaxHeight;var _=i.bottomMaxHeight;var I=L-d;if(I<0){I=0}var D=_-I/2;if(D<0){D=0}var R=D+I/2;s={x:Math.round(O-R-d+i.offset.x),y:h}}else if(i.compareLegend===U.END){var O=P.getModel().position.x+P.getModel().dimension.width;var L=i.midMaxHeight;var A=i.topMaxHeight;var _=i.bottomMaxHeight;var I=L-d;if(I<0){I=0}var N=A-I/2;var D=_-I/2;if(N<0){N=0}if(D<0){D=0}var R=N+I/2;s={x:Math.round(O+R+i.offset.x),y:h}}else if(i.compareLegend===U.FROM){if(e!==U.AXIS){s={x:Math.round(e.position.x+e.dimension.width/2+i.offset.x-d/2),y:h}}else{s={x:v.x+i.offset.x-d/2,y:h}}}else if(i.compareLegend===U.TO){if(t!==U.AXIS){s={x:Math.round(t.position.x+t.dimension.width/2+i.offset.x-d/2),y:h}}else{s={x:b.x+i.offset.x-d/2,y:h}}}else{if(E){s={x:b.x+i.offset.x,y:h}}else{s={x:v.x+i.offset.x,y:h}}}return{dimension:{width:d,height:C},position:s,fromPosition:v,toPosition:b,arrowType:y}}function setPosition(e,t,i,n){var a=0;var r=f.topMaxHeight;var o=f.bottomMaxHeight;if(n===U.START){a=e-t/2-r/2-i.width/2}else if(n===U.MID){a=e-i.width/2}else{a=e+t/2+o/2-i.width/2}return Math.round(a)}},setTextAndDimension:function(e,t,i,n,a){var r=St["b"].DataObjects.DocumentDO.getPainter();var o=null;var l=new St["b"].Utils.Calculator(n);l.setCondenseRoot(n.dataModel.baseNode);if(n.dataModel.dimSize===1){l.setCondenseLevel(1)}else{l.setCondenseLevel(0)}var s=St["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=St["b"].Layout.Common.getCompareToAndFrom(u,a,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}St["b"].Models.Actions.ViewModelActions.CompareModel.setText(u,n,a);if(u.compareFrom&&u.compareTo){var g=l.setupCompareFormulas(u,a.multiplePath,a.isMultipleTotal);if(g){u.active=true}else{u.active=false}}else{u.active=false}var m=St["b"].Layout.Common.getTimeTextDimensions(u,r);u.absolute.dimension=m.absDim;u.percent.dimension=m.percDim;u.text.dimension=m.textDim;u.topMaxHeight=m.left;u.midMaxHeight=m.mid;u.bottomMaxHeight=m.right;u.maxHeight=m.maxHeight}function compareUpdater(){if(u.linkType===1){if(u.fromAbsolutePosition!==s.AXIS&&u.fromAbsolutePosition.notReversed!==true){o=o||St["b"].Models.Actions.DataModelActions.getMultipleDimensions(n.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||St["b"].Models.Actions.DataModelActions.getMultipleDimensions(n.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||St["b"].Models.Actions.DataModelActions.getMultipleDimensions(n.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||St["b"].Models.Actions.DataModelActions.getMultipleDimensions(n.dataModel,0);if(o.length>u.toAbsolutePosition.groupIndex){u.toAbsolutePosition.groupIndex=o.length-u.toAbsolutePosition.groupIndex-1;u.toAbsolutePosition.notReversed=true}}}},calculateSpaceForCompares:function(e,a,t,i,n,r){var o=[0,0];var l;var s=St["b"].Utils.Constants.TypeValues.indicator;function getRep(e){for(var t=0;t<a.length;t++){var i=a[t].getModel();var n=i.dataId_dim+"#"+i.dataId_expr;if(n===e){return{representation:i,i:t}}}return{representation:a[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 m=0;m<a.length;m++){var h=a[m].getModel();var f=h.id.split(".");var v=f[2];if(v==="0"){var b=parseInt(r(h.labelPosition,m,false,i));if(b<g){g=b}}else{break}}var T=l.midMaxHeight;var E=l.topMaxHeight;var x=l.bottomMaxHeight;var C=T-c;if(C<0){C=0}var y=E-C/2;var M=x-C/2;if(y<0){y=0}if(M<0){M=0}var S=y+C+M;g=Math.abs(g);p=Math.round(g+S+c-l.offset.x)}else if(l.compareLegend===s.END){var g=0;for(var m=0;m<a.length;m++){var h=a[m].getModel();var f=h.id.split(".");var v=f[2];if(v==="0"){var b=parseInt(r(h.labelPosition,m,false,i));if(b<g){g=b}}else{break}}var T=l.midMaxHeight;var E=l.topMaxHeight;var x=l.bottomMaxHeight;var C=T-c;if(C<0){C=0}var y=E-C/2;var M=x-C/2;if(y<0){y=0}if(M<0){M=0}var S=y+C+M;g=Math.abs(g);p=Math.round(g+S+c+l.offset.x)}else if(l.compareLegend===s.FROM){var h=getRep(l.from);var O=h.i;var L=h.representation;var A=L.instanceOf==="RodModel"||L.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(L.labelPosition,O,A,i));b+=i/2;var T=l.midMaxHeight;var E=l.topMaxHeight;var x=l.bottomMaxHeight;var C=T-c;if(C<0){C=0}var y=E-C/2;var M=x-C/2;if(y<0){y=0}if(M<0){M=0}var S=y+C+M;b=Math.abs(b);var S=y+C+M;if(l.offset.x<0){p=Math.round(b+l.offset.x-c/2-S/2)}else{p=Math.round(b+l.offset.x+c/2+S/2)}if(p<0){p=Math.abs(p)}else{p=0}}else if(l.compareLegend===s.TO){var h=getRep(l.to);var O=h.i;var L=h.representation;var A=L.instanceOf==="RodModel"||L.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(L.labelPosition,O,A,i));b+=i/2;var T=l.midMaxHeight;var E=l.topMaxHeight;var x=l.bottomMaxHeight;var C=T-c;if(C<0){C=0}var y=E-C/2;var M=x-C/2;if(y<0){y=0}if(M<0){M=0}var S=y+C+M;b=Math.abs(b);var S=y+C+M;if(l.offset.x<0){p=Math.round(b+l.offset.x-c/2-S/2)}else{p=Math.round(b+l.offset.x+c/2+S/2)}if(p<0){p=Math.abs(p)}else{p=0}}else{if(l.offset.x<0){var _=l.offset.x*-1;if(l.compareOffsetPoint===s.TO){var h=getRep(l.to)}else{var h=getRep(l.from)}var O=h.i;var L=h.representation;var A=L.instanceOf==="RodModel"||L.instanceOf==="NeedleModle"?true:false;var b=parseInt(r(L.labelPosition,O,A,i));b+=i/2;if(l.labelPosition===s.START){c=l.maxTextWidth+c/2;p=b-_-c}else if(l.labelPosition===s.MID){c=Math.max(l.maxTextWidth/2,c/2);p=b-_-c}else{p=b-_-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=St["b"].Utils.Constants.TypeValues.indicator;function intersect(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}function sortAsc(e,t){return e.getModel().displacePriority-t.getModel().displacePriority}var n=e.slice(0);n=n.sort(sortAsc);for(var a=0;a<n.length;a++){var r=n[a].getModel();if(!r.active){continue}var o=St["b"].Layout.Common.getMaxPosition(r,false,t);var l=o.position;var s=o.dimension;for(var d=a+1;d<n.length;d++){var c=n[d].getModel();if(!c.active||r.displacePriority===-1&&c.displacePriority===-1){continue}var u=St["b"].Layout.Common.getMaxPosition(c,false,t);var p=u.position;var g=u.dimension;var m=intersect(l.x,l.x+s.width,p.x,p.x+g.width);var h=intersect(l.y,l.y+s.height,p.y,p.y+g.height);if(m&&h){var f=l.x+s.width-p.x;c.displacement=f;c.displaced=true;c.position.x+=f;if(c.absolute.legend!==i.NONE){c.absolute.position.x+=f}if(c.percent.legend!==i.NONE){c.percent.position.x+=f}if(c.text.legend!==i.NONE&&c.text.text!==""){c.text.position.x+=f}if(c.ellipse){for(var v=0;v<c.ellipseArray.length;v++){c.ellipseArray[v].x+=f}}}}}}};var I=r(604);St["b"].Layout=St["b"].Layout||{};St["b"].Layout.CategorySizeCalculator=new function(){this.getCategorySizes=function(e,t,i,n,a,r,o,l,s,d,c){var u=St["b"].Utils.Calculator.Converter;var p=St["b"].DataObjects.RuntimeDO;var g=0;o=u.mm2pix(o*i);var m=[];var h={startStart:0,startEnd:0,midStart:0,midEnd:0,endStart:0,endEnd:0};var f=0;for(var v=0;v<e.length;v++){var b=e[v].extendedModel;var T=St["b"].DataObjects.ContextRepo.getContextByCid(b.contextId);var E=c!=undefined?c[v]:p.getParameterParsed(St["b"].Models.Actions.ModelActions.ContextModel.getTimeFactor(T));var x;if(T===null){continue}else{if(s!=undefined){x=St["b"].Models.Actions.DataModelActions.getMultipleDimensionsByPath(T.dataModel,s,0,true,d)}else{x=St["b"].Models.Actions.DataModelActions.getMultipleDimensions(T.dataModel,0)}}g=Math.max(g,x.length);var C=collectReprentationsDimensions(b,E,x,l,t,m,i,n,a);var y=C.dims;var M=C.barSizes;fillMissingMasterPositions(y,"A","R","Q",M);fillMissingMasterPositions(y,"R","A","Q",M);fillMissingMasterPositions(y,"Q","A","R",M);var S=Math.max(y.A.start,y.R.start,y.Q.start);var O=Math.max(y.A.mid,y.R.mid,y.Q.mid);var L=Math.max(y.A.end,y.R.end,y.Q.end);f=Math.max(f,S,O,L);updateDimensionHalves(h,y,S,O,L)}var A=Math.round(r*f);var _=getCategorySize(h,m,A,f,u.mm2pix(n*i));var I=0;for(var v=0;v<e.length;v++){I=Math.max(I,getCategoryDistance(e[v],o,h,i))}var D,R,N;if(h.startStart!==0){D=h.startStart;R=D+A;N=D+A*2}else if(h.midStart!==0){D=h.startStart;R=h.midStart;N=R+A}else{D=h.startStart;R=h.midStart;N=h.endStart}return{categorySize:_,categoryDistance:I,categoryCount:g,positionCount:m.length,startOffset:D,midOffset:R,endOffset:N,totalLength:(_+I+I)*g}};function getExpressionIndex(e,t){var i=-1;for(var n=0;n<e.nodes.length;n++){if(e.nodes[n].key===t){i=n;break}}return i}function collectReprentationsDimensions(e,t,i,n,a,r,o,l,s){var d=St["b"].DataObjects.RuntimeDO;var c=St["b"].Utils.Calculator.Converter;var u={};var p={};var g={};var m={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 h=0;h<e.expressions.length;h++){var f=e.expressions[h];var v=i.length>0?getExpressionIndex(i[0].ref,f.id.split(".").pop()):null;var b=f.isStack&&e.stackMode?e.stackLabelPosition:n==="time"?f.labelPosition:f.currPosition;b=a[b];if(r.indexOf(b)===-1){r.push(b)}var T=true;for(var E=0;E<i.length;E++){var x=i[E].ref.nodes[v];if(!x||isNaN(x.value)){continue}var C=x.usedRuledEntry.valueType;var y;if(C==="FACTOR_AMOUNT"){y=m.A}else if(C==="FACTOR_QUANTITY"){y=m.Q}else if(C==="FACTOR_RELATION"){y=m.R}else{continue}T=false;if(u[C]===undefined){var M=d.getValueTypeFactor(C);u[C]=M;p[C]=c.mm2pix(l*t*M*o);g[C]=c.mm2pix(s*t*M*o)}var S=b==="start"||b==="mid"||b==="end"?p[C]:g[C];y[b]=Math.max(y[b],S)}if(T){var C="FACTOR_AMOUNT";var y=m.A;if(u[C]===undefined){var M=d.getValueTypeFactor(C);u[C]=M;p[C]=c.mm2pix(l*t*M*o);g[C]=c.mm2pix(s*t*M*o)}var S=b==="start"||b==="mid"||b==="end"?p[C]:g[C];y[b]=Math.max(y[b],S)}}return{dims:m,barSizes:p}}function fillMissingMasterPositions(e,t,i,n,a){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[n].start!==0){e[t].start=e[n].start}else{e[t].start=a[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[n].end!==0){e[t].end=e[n].end}else{e[t].end=a[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[n].mid!==0){e[t].mid=e[n].mid}else{e[t].mid=a[r]||0}}}function updateDimensionHalves(e,t,i,n,a){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(n!==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(a!==0){for(var u in t){var p=t[u];var m=Math.round(p.end/2);var h=Math.round(p.endEnd/2);var f=m;d=Math.max(d,Math.max(f,h-f));c=Math.max(c,p.end-m+p.endEnd-h)}e.endStart=Math.max(e.endStart,d);e.endEnd=Math.max(e.endEnd,c)}}function getCategorySize(e,t,i,n,a){var r=0;if(t.length===1){r=n}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=a}return r}function getCategoryDistance(e,t,i,n){var a=St["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:a.mm2pix(l*n))}};var pe=r(90);St["b"].Layout=St["b"].Layout||{};St["b"].Layout.Common={getTimeKey:function(e){var t=St["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,n,e,a,r,o){var l=St["b"].Utils.Constants.TypeValues.concept;var s=St["b"].Utils.Constants.TypeValues.notation;var d=St["b"].DataObjects.RuntimeDO;var c=e&&i.valueRating==="+"||!e&&i.valueRating==="-";var t;var u;var p;var g;var m={};var h;function getNMColor(e,t){if(e){if(a===s.AXIS||a===s.HEADER){if(c){m.border=t.positiveOtherBorder;m.pattern=t.positiveOtherFill1;m.background=t.positiveOtherFill1}else{m.border=t.negativeOtherBorder;m.pattern=t.negativeOtherFill1;m.background=t.negativeOtherFill1}}else{switch(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(c){m.border=t.positiveOtherBorder;m.pattern=t.positiveOtherFill1;m.background=t.positiveOtherFill2}else{m.border=t.negativeOtherBorder;m.pattern=t.negativeOtherFill1;m.background=t.negativeOtherFill2}break;case l.COLOR:case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(c){m.border=t.positiveColorBorder;m.pattern=t.positiveColorFill1;m.background=t.positiveColorFill2}else{m.border=t.negativeColorBorder;m.pattern=t.negativeColorFill1;m.background=t.negativeColorFill2}break}}}else{if(r!==undefined){if(a===s.AXIS||a===s.HEADER){if(r===0||r===2){if(n===l.AREA||n===l.AREA_COLOR||n===l.AREA_SHAPE||n===l.AREA_COLOR_SHAPE){if(c){m.border=t.positiveOtherBorder;m.pattern=t.positiveOtherFill1;m.background=t.positiveOtherFill2;m.axisBorder=t.positiveOtherBorder;m.axisPattern=t.positiveOtherFill1;m.axisBackground=t.positiveOtherFill2;m.otherPattern=t.otherArea}else{m.border=t.negativeOtherBorder;m.pattern=t.negativeOtherFill1;m.background=t.negativeOtherFill2;m.axisBorder=t.negativeOtherBorder;m.axisPattern=t.negativeOtherFill1;m.axisBackground=t.negativeOtherFill2;m.otherPattern=t.otherArea}}else{if(c){m.border=t.positiveOtherBorder;m.pattern=t.positiveOtherFill1;m.background=t.positiveOtherFill2;m.axisBorder=t.positiveOtherBorder;m.axisPattern=t.positiveOtherFill1;m.axisBackground=t.positiveOtherFill2;m.otherPattern=t.otherOther}else{m.border=t.negativeOtherBorder;m.pattern=t.negativeOtherFill1;m.background=t.negativeOtherFill2;m.axisBorder=t.negativeOtherBorder;m.axisPattern=t.negativeOtherFill1;m.axisBackground=t.negativeOtherFill2;m.otherPattern=t.otherOther}}}if(r===1){if(n===l.AREA||n===l.AREA_COLOR||n===l.AREA_SHAPE||n===l.AREA_COLOR_SHAPE){m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill2;m.axisBorder=t.otherBorder;m.axisPattern=t.otherFill1;m.axisBackground=t.otherFill2;m.otherPattern=t.otherArea}else{m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill2;m.axisBorder=t.otherBorder;m.axisPattern=t.otherFill1;m.axisBackground=t.otherFill2;m.otherPattern=t.otherOther}}}else{switch(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(r===0||r===2){if(c){m.border=t.positiveOtherBorder;m.pattern=t.positiveOtherFill1;m.background=t.positiveOtherFill2}else{m.border=t.negativeOtherBorder;m.pattern=t.negativeOtherFill1;m.background=t.negativeOtherFill2}}else{m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill2}break;case l.COLOR:case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR_SHAPE:if(c){m.border=t.positiveColorBorder;m.pattern=t.positiveColorFill1;m.background=t.positiveColorFill2}else{m.border=t.negativeColorBorder;m.pattern=t.negativeColorFill1;m.background=t.negativeColorFill2}}}}else{if(a===s.AXIS||a===s.HEADER){if(n===l.AREA_COLOR||n===l.COLOR||n===l.AREA_COLOR_SHAPE||n===l.COLOR_SHAPE){if(n===l.AREA_COLOR||n===l.AREA_COLOR_SHAPE){m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill1;m.axisBorder=t.colorBorder;m.axisPattern=t.colorFill1;m.axisBackground=t.colorFill2;m.otherPattern=t.otherArea}else{m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill1;m.axisBorder=t.colorBorder;m.axisPattern=t.colorFill1;m.axisBackground=t.colorFill2;m.otherPattern=t.otherOther}}else{if(n===l.AREA||n===l.AREA_SHAPE){m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill1;m.axisBorder=t.otherBorder;m.axisPattern=t.otherFill1;m.axisBackground=t.otherFill1;m.otherPattern=t.otherArea}else{m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill1;m.axisBorder=t.otherBorder;m.axisPattern=t.otherFill1;m.axisBackground=t.otherFill1;m.otherPattern=t.otherOther}}}else{switch(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:m.border=t.otherBorder;m.pattern=t.otherFill1;m.background=t.otherFill2;break;case l.AREA_COLOR:case l.AREA_COLOR_SHAPE:case l.COLOR:case l.COLOR_SHAPE:m.border=t.colorBorder;m.pattern=t.colorFill1;m.background=t.colorFill2;break}}}}if(a===s.ELEMENT_AXIS){u=d.getDataType(i.referenceDataType);p=i.referenceSubType;g=St["b"].Layout.Common.getTimeKey(i.referenceTimeType);m=getNMColorAxis(e,u.subtypes[p].settings[g],m,o)}else{u=d.getDataType(i.baseDataType);p=i.baseSubType;g=St["b"].Layout.Common.getTimeKey(i.timeType);m=getNMColorAxis(e,u.subtypes[p].settings[g],m,n)}return m}function getNMColorAxis(e,t,i,n){if(a!==s.HEADER&&e){if(e){switch(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(n===l.AREA||n===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(n===l.AREA_COLOR||n===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&&a===s.HEADER){switch(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(n===l.AREA||n===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(n===l.AREA_COLOR||n===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(n){case l.AREA:case l.AREA_SHAPE:case l.SHAPE:if(n===l.AREA||n===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(n===l.AREA_COLOR||n===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(a===s.AXIS||a===s.HEADER){u=d.getDataType("Actual");p="ACT0";g="p";if(n===l.AREA||n===l.AREA_COLOR||n===l.AREA_SHAPE||n===l.AREA_COLOR_SHAPE){h=u.subtypes[p].settings[g].otherArea}else{h=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:h}}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:h}}}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:h}}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:h}}}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:h}}}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:h}}}else{t=getNMColor(false,u.subtypes[p].settings[g])}}}else{u=d.getDataType(i.baseDataType);p=i.baseSubType;g=St["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&&(a===s.ELEMENT_HEADER||a===s.ELEMENT_AXIS)){var f={};u=d.getDataType(i.referenceDataType);p=i.referenceSubType;g=St["b"].Layout.Common.getTimeKey(i.referenceTimeType);if(n===l.AREA||n===l.AREA_COLOR||n===l.AREA_SHAPE||n===l.AREA_COLOR_SHAPE){h=u.subtypes[p].settings[g].otherArea}else{h=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=h}else{t.axisBorder=i.referenceColorDeltaMinusBorder;t.axisPattern=i.referenceColorDeltaMinusPattern;t.axisBackground=i.referenceColorDeltaMinus;t.otherPattern=h}}else{f=getNMColorAxis(true,u.subtypes[p].settings[g],f,o);t.axisBorder=f.axisBorder;t.axisPattern=f.axisPattern;t.axisBackground=f.axisBackground;t.otherPattern=f.otherPattern}}else{if(i.referenceColorIndividual){t.axisBorder=i.referenceColorBorder;t.axisPattern=i.referenceColorPattern;t.axisBackground=i.referenceColor;t.otherPattern=h}else{f=getNMColorAxis(false,u.subtypes[p].settings[g],f,o);t.axisBorder=f.axisBorder;t.axisPattern=f.axisPattern;t.axisBackground=f.axisBackground;t.otherPattern=f.otherPattern}}}return t},getNotationColorStructure:function(e,n,t,i,a,r){var o=St["b"].Utils.Constants.TypeValues.concept;var l=St["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(n){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(n){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":St["b"].Layout.Common.getTimeKey(e.timeType);if(e.isDelta||!e.baseColorIndividual&&a){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":St["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,n,a){var r=St["b"].DataObjects.RuntimeDO;var o=e.getModel();var l=St["b"].Utils.Constants.TypeValues.concept;var s=St["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=St["b"].Layout.Common.getTimeKey(t.timeType);if(n===l.AREA_COLOR_SHAPE||n===l.AREA_SHAPE||n===l.SHAPE||n===l.COLOR_SHAPE){o.shapeSymbol=c.settings[u].symbolShape}else{o.shapeSymbol=c.settings[u].symbolOther}if(a){if(n===l.AREA_COLOR_SHAPE||n===l.AREA_SHAPE||n===l.AREA||n===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=St["b"].Layout.Common.getTimeKey(t.timeType);o.shapeSymbol=c.settings[u].symbolOther;if(a){o.lineStyle=c.settings[u].lineOther}}},getNotationShape:function(e,t,i){var n=St["b"].DataObjects.RuntimeDO;var a=St["b"].Utils.Constants.TypeValues.concept;var r=St["b"].Utils.Constants.TypeValues.notation;var o;if(t===r.ELEMENT||t===r.ELEMENT_HEADER||t===r.ELEMENT_AXIS){var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["b"].Layout.Common.getTimeKey(e.timeType);if(i===a.AREA_COLOR_SHAPE||i===a.AREA_SHAPE||i===a.SHAPE||i===a.COLOR_SHAPE){o=s.settings[d].symbolShape}else{o=s.settings[d].symbolOther}}else{var l=n.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["b"].Layout.Common.getTimeKey(e.timeType);o=s.settings[d].symbolOther}return o},getOtherPattern:function(e,t,i,n){var a=St["b"].DataObjects.RuntimeDO;var r=St["b"].Utils.Constants.TypeValues.concept;var o=St["b"].Utils.Constants.TypeValues.otherPattern;if(n===false){if(i===r.AREA||i===r.AREA_COLOR||i===r.AREA_SHAPE||i===r.AREA_COLOR_SHAPE){if(e.referenceUsed===false){var l=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherArea}else{var l=a.getDataType(e.referenceDataType);var s=l.subtypes[e.referenceSubType];var d=St["b"].Layout.Common.getTimeKey(e.referenceTimeType);var c=s.settings[d].otherArea}}else{if(e.referenceUsed===false){var l=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherOther}else{var l=a.getDataType(e.referenceDataType);var s=l.subtypes[e.referenceSubType];var d=St["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=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["b"].Layout.Common.getTimeKey(e.timeType);var c=s.settings[d].otherArea}else{var l=a.getDataType(e.baseDataType);var s=l.subtypes[e.baseSubType];var d=St["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 n=new Array(t.length);var a=0;for(var r=0;r<e.length;r++){var o=e[r].getModel();var l=parseInt(o.id.split(".")[2]);a=Math.max(a,l);for(var s=0;s<t.length;s++){if(!i&&o.positioning===t[s].pos||i&&o.labelPosition===t[s].pos){if(n[s]==undefined){n[s]=[]}if(n[s][l]==undefined){n[s][l]=[]}n[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<n.length;r++){for(var s=0;s<=a;s++){if(n[r]&&n[r][s]){n[r][s].sort(sortHelper);var d=0;var c=Math.min(3,n[r][s].length);for(;d<c;d++){n[r][s][d].zIndex=t[r].z+d*3}for(;d<n[r][s].length;d++){n[r][s][d].zIndex=t[r].z}}}}},hideMinMaxLabels:function(e,t,i){var n=i.expressions;var a=null,r=null;for(var o=0;o<n.length;o++){var l=n[o];if(l.valueLabelOpt.substr(0,6)==="MinMax"){var s=l.id.substr(l.id.lastIndexOf(".")+1);a=null;r=null;for(var d=0;d<e.length;d++){var c=e[d];if(!c.isOutlier&&c.dataId_expr===s){if(a===null){a=c;r=c}else if(c.value>a.value){a=c}else if(c.value<r.value){r=c}}}for(var d=0;d<t.length;d++){var u=t[d];if(a!==null&&u.dataId_expr===s){u.hideLabel=u.dataId_dim!==a.dataId_dim&&u.dataId_dim!==r.dataId_dim;if(u.hideLabel){var p=St["b"].Layout.Common.getHighlight(i,u,St["b"].Utils.Constants.TypeValues.VALUE,true);if(p&&p.highlight){p.highlight.active=false}}}}}}},hideMinMaxTotals:function(e,t,i){var n;var a;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(St["b"].Layout.Common.getLastStackElement(s,l.dataId_dim));l=o;s=[];s.push(o)}else{s.push(o)}}}r.push(St["b"].Layout.Common.getLastStackElement(s,o.dataId_dim));for(var d=0;d<r.length;d++){if(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(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(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}}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}}}}for(var d=0;d<t.length;d++){var c=t[d];c.hideLabel=!(c.dataId_expr===n.dataId_expr&&c.dataId_dim===n.dataId_dim||c.dataId_expr===a.dataId_expr&&c.dataId_dim===a.dataId_dim);if(c.hideLabel){var u=St["b"].Layout.Common.getHighlight(i,c,St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(u&&u.highlight){u.highlight.active=false}}}},hideStackedValueLabels:function(e,t,i){var n=new St["b"].Utils.Calculator(t);var a=t.dataModel.baseNode.nodes;for(var r=0;r<a.length;r++){for(var o=0;o<a[r].nodes.length;o++){if(!isNaN(a[r].nodes[o].value)){var l=St["b"].Factories.ModelFactory.setupFunctionValueLabel(e,a[r].nodes[o],a[r].value,t,r,n);if(!l){break}}}if(e.instanceOf==="ChartModel"){i[r].hideLabel=l;if(i[r].hideLabel){var s=St["b"].Layout.Common.getHighlight(e,i[r],St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}if(l&&i[r+a.length]!==undefined){i[r+a.length].hideLabel=l;if(i[r+a.length].hideLabel){var s=St["b"].Layout.Common.getHighlight(e,i[r+a.length],St["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=St["b"].Layout.Common.getHighlight(e,i[r].getModel(),St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(s&&s.highlight){s.highlight.active=false}}if(l&&i[r+a.length]!==undefined){i[r+a.length].getModel().hideLabel=l;if(i[r+a.length].getModel().hideLabel){var s=St["b"].Layout.Common.getHighlight(e,i[r+a.length].getModel(),St["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,n=null;var a=false;for(var r=0;r<e.length&&!a;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;n=t.nodes[s];a=true}else if(i===null){i=o;n=t.nodes[s]}break}}}}return{expr:i,node:n}},getFirstNonZeroRepresentationByExprId:function(e,t,i,n){var a=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){a=o;break}else if(a===null){a=o;if(n){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){a=o;break}else if(a===null){a=o;if(n){break}}}}}return a},boxesOverlap:function(e,t,i,n){function intersect1D(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}return intersect1D(e.x-n,e.x+e.width+n,t.x-n,t.x+t.width+n)&&intersect1D(e.y-i,e.y+e.height+i,t.y-i,t.y+t.height+i)},labelsOverlap:function(e,t,i,n){var a=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(e);var r=St["b"].Models.Actions.ViewModelActions.LabelModel.getBox(t);return St["b"].Layout.Common.boxesOverlap(a,r,i,n)},hideOverlappingLabels:function(e,t,i,n,r,a,o,l){function getLowerPriorityLabel(e,t,i,n){if(i&&n){var a=s(e.dataId_dim);var r=s(t.dataId_dim);if(a<r){return t}else if(a>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 a={};return function(e){var t=a[e];if(t!==undefined){return t}for(var i=0,n=r.length;i<n;i++){if(r[i].path===e){a[e]=i;return i}}a[e]=r.length;return r.length}}();var d=n.extendedModel;var c=d.stackMode&&d.stackShowLabel.split(".")[1]==="Dynamic";var u=c;var p=[];var g=[];for(var m=0,h=e.length;m<h;m++){var f=e[m];if(!f.hideLabel){g.push(f);var v=a[f.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(St["b"].Utils.GlobalFunctions.createArray(b.length,c));var m=0,h=g.length;while(m<h){var T=g[m];for(var E=0;E<m;E++){var x=g[E];if(!x.hideLabel&&x.dataId_expr!==T.dataId_expr&&St["b"].Layout.Common.labelsOverlap(x,T,o,l)&&(p[m]||p[E])){var C=getLowerPriorityLabel(x,T,p[E],p[m]);C.hideLabel=true;var y=St["b"].Layout.Common.getHighlight(d,C,St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(y&&y.highlight){y.highlight.active=false}}}m++}}},hideExpressionOverlappingLabels:function(e,t,i,n,a){function getLowerPriorityLabel(e,t){var i=r[e.dataId_dim];var n=r[t.dataId_dim];return i<n?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&&St["b"].Layout.Common.labelsOverlap(d,u,n,a)){var p=getLowerPriorityLabel(d,u);p.hideLabel=true;var g=St["b"].Layout.Common.getHighlight(i,p,St["b"].Utils.Constants.TypeValues.highlightType.VALUE,true);if(g&&g.highlight){g.highlight.active=false}break}}}},getChangeSeparators:function(e,t,i,n,a,r,o,l,s){var d=[];var c=o.getModel().children;var u=null,p;var g=null,m=null;var h=o.getModel().extendedModel.categoryEntriesPosition===St["b"].Utils.Constants.TypeValues.summingPos.START;var f=o.getModel().extendedModel.orientation===St["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,E=0;b<e.length;b++){if(e[b]===null){continue}var x=St["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(e[b],r,E++);if(x===null||x.hide){continue}p=e[b].split("@");var C;for(var y=0;y<x.nodes.length;y++){if(x.nodes[y].key===t){C=x.nodes[y].usedRuledEntry;break}}if(g!==null){if(n&&g!==C.baseDataType||a&&m!==C.timeType){var M;var S=getLabelIndex(b);var O=getLabelIndex(b-1);if(S===null){M=(b-1)*s+O}else if(O===null){M=b*s+S}else{var L=c[b*s+S].position;var A=c[(b-1)*s+O].position;if(f){M=L.y>=A.y?b*s+S:(b-1)*s+O}else{M=L.x<=A.x?b*s+S:(b-1)*s+O}}d.push({category:b,dimLabelIdx:M,zIndex:310})}else if(i&&u!==null){var _=0;for(;_<l.rows.length&&p[_]===u[_];_++){}if(_<l.rows.length-1){var I=b,D=_;if(T[_]||v&&e[I-1]===null){if(h){while(e[I-1]===null){I--}}else{if(e[I-1]===null){I--}}}else{if(!h){I=b-1}}D=getLabelIndex(I);D=D===null?_:D;d.push({category:h?I:I+1,dimLabelIdx:I*s+D,zIndex:310})}}}g=C.baseDataType;m=C.timeType;u=p}return d},getTotalsSeparators:function(e,t,i,n,a,r,o,l){var s=[];var d=r.getModel().children;var c=r.getModel().extendedModel.categoryEntriesPosition===St["b"].Utils.Constants.TypeValues.summingPos.START;function getDimNode(e,t){var i=d[e];return St["b"].Models.Actions.DataModelActions.getDimensionNodeFromArray(i.dataId_dim,a,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 n=0;n<=t;n++){var a=d[e+n];if(a.text!==""){return e+n}}}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,m=-1,h=-1;var f=u*l;if(e[u]===null){for(var v=0;v<l;v++){var b=d[f+v];if(b.catWithoutTotal&&b.text!==""){h=v;break}}}else{for(var v=0;v<l;v++){var b=d[f+v];if(g===-1&&b.isTotal&&b.text!==""){g=v}if(m===-1&&b.isSubtotal&&b.text!==""){m=v}}p++}if(g>=0){var T=getDimNode(f+g,p);var E=isSeparatorTop(T);if(!E&&u<e.length-1||E&&u>0){var x=E?u:u+1;var C={type:"T",category:x,zIndex:312};if(t){C.dimLabelIdx=getLabelIndex(f,g,T)}s.push(C)}}if(m>=0){var T=getDimNode(f+m,p);var E=isSeparatorTop(T);if(!E&&u<e.length-1||E&&u>0){var x=E?u:u+1;var C={type:"S",category:x,zIndex:311};if(i){C.dimLabelIdx=getLabelIndex(f,m,T)}s.push(C)}}if(h>=0){var x=c?u+1:u;var C={type:"TV",category:x,zIndex:313};if(n){C.dimLabelIdx=getLabelIndex(f,h,null)}s.push(C)}}return s},getLinkGroups:function(e,t,i){var n={axis:false,legend:null};var a=e.extensionHash+"."+t;function processLG(e){if(e.linkedType===i){if(n.legend===null&&e.type==="legend"){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===a){n.legend=e;break}}}else if(!n.axis&&e.type==="axis"){for(var t=0;t<e.linkedCharts.length;t++){if(e.linkedCharts[t]===a){n.axis=true;break}}}}}for(var r in e.linkGroups){processLG(e.linkGroups[r]);if(n.axis&&n.legend!==null){break}}if(e.linkGroupsMultiple){for(var o=0;o<e.linkGroupsMultiple.length;o++){processLG(e.linkGroupsMultiple[o]);if(n.axis&&n.legend!==null){break}}}return n},getLinkedContainers:function(e,t,i){var n=i?i.id:null;var a=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(a);if(d===n){r.push(i)}else{var c=St["b"].Factories.ModelFactory.getModelById(t,d);if(c&&c.extendedModel&&c.extendedModel.instanceOf===o){var u=St["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,n,a,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(a.dataId_dim===c.dataId_dim&&s===c.dataId_expr){l=c.isStack;break}}if(a.instanceOf===o){if(l){a.referencePointer[s]=n[n.waterfallStartReference][s]}else{a.referencePointer[s]=i[s]}}else{a.referencePointer[s]=e.referencePointer[s]}}},initStackValues:function(e,t){var i={};e.length>0&&(i.waterfallStartReference=e[0].dataId_dim);var n=null;for(var a=0;a<e.length;a++){var r=e[a];if(n!==r.dataId_dim){n=r.dataId_dim;i[r.dataId_dim]={}}if(e[a].isStack===true){i[r.dataId_dim][r.dataId_expr]=e[a].value}}return i},initFirstWaterfallValues:function(e,t){var i=t.instanceOf==="TimeChartModel"?"TimeWaterfallModel":"StructureWaterfallModel";var n={},a;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(n[s]===undefined){n[s]=null}if(s===o.dataId_expr){a=t.expressions[l]}}if(a.reference!==undefined&&a.reference!=="Zero"){for(var l=0;l<e.length;l++){var d=e[l];if(d.dataId_expr===a.reference&&d.dataId_dim===o.dataId_dim){if(d.active!==undefined){if(n[a.reference]===undefined){n[a.reference]=null}}break}}if(n[a.reference]===null){if(d.instanceOf===i){n[a.reference]=d.relativeValue}else{n[a.reference]=d.value}}}}return n},resortRepresentationExpressionsByReference:function(e,t){var i=[];var n=[];for(var a=0;a<e.length;a++){var r=e[a];i.push(r)}var o=0;while(n.length<t.expressions.length&&o<100){for(var a=0;a<t.expressions.length;a++){var l=t.expressions[a].id.split(".").pop();if(t.expressions[a].reference==="Axis"){t.expressions[a].reference="Zero"}var s=false;for(var d=0;d<t.expressions.length;d++){if(t.expressions[d].id.split(".").pop()===t.expressions[a].reference){s=true}}if(t.expressions[a].reference==="Zero"||s===false){if(n.indexOf(l)===-1){n.push(l)}}else{for(var d=0;d<n.length;d++){if(t.expressions[a].reference===n[d]){if(n.indexOf(l)===-1){n.push(l);break}}}}}o++}if(o>=100){q["a"].warn("Endless loop interrupted at LayoutCommon: resortRepresentationExpressionsByReference()")}n=St["b"].Utils.GlobalFunctions.array_unique(n);for(var d=0;d<n.length;d++){for(var a=0;a<i.length;a++){var c=a%t.expressions.length;if(i[a].dataId_expr===n[d]){i.splice(a-c+d,0,i[a]);i.splice(a+1,1)}}}return i},setReferencePointer:function(e,t,i){var n=this.resortRepresentationExpressionsByReference(e,i);var a=this.initFirstWaterfallValues(t,i);var r=this.initStackValues(n,i);for(var o=0;o<n.length;o++){var l=n[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(a[u.reference]!==null){g=a[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 m=l.instanceOf===d?r.waterfallStartReference:l.dataId_dim;for(var h in r[m]){l.referencePointer[h]=r[m][h]}}this.setLowerExpressionReferencePointer(p,i,a,r,l,n)}}}},cumulateReferencePointer:function(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(t.instanceOf==="TableModel"&&n.instanceOf==="InlineModel"){continue}var a=0;if(n.referencePointer&&Object.keys(n.referencePointer).length){for(var r in n.referencePointer){a+=n.referencePointer[r]}n.referencePointerSum=a}else{n.referencePointerSum=0}}},cumulateReferencePointerByRepFactor:function(e,t,i){if(e.referencePointer&&Object.keys(e.referencePointer).length){var n=0;for(var a in e.referencePointer){if(i.instanceOf==="TimeChartModel"){n+=parseInt(e.referencePointer[a]*t)}else{n+=Math.round(e.referencePointer[a]*t)}}return n}else{return 0}},getTimeTextDimensions:function(e,t){var i=e.font.fWeight+" "+e.font.fSize+"px "+e.font.fType;var n={width:0,height:0},a={width:0,height:0},r={width:0,height:0};var o=St["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){n=t.measureTextDim(e.absolute.text,i)}else{n=e.absolute.dimension}l+=n.height;if(e.absolute.legend===o.START){s=Math.max(s,n.width)}else if(e.absolute.legend===o.MID){d=Math.max(d,n.width)}else if(e.absolute.legend===o.END){c=Math.max(c,n.width)}}if(e.percent.legend!==o.NONE){if(t){a=t.measureTextDim(e.percent.text,i)}else{a=e.percent.dimension}l+=a.height;if(e.percent.legend===o.START){s=Math.max(s,a.width)}else if(e.percent.legend===o.MID){d=Math.max(d,a.width)}else if(e.percent.legend===o.END){c=Math.max(c,a.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:n,percDim:a,textDim:r,left:s,mid:d,right:c,maxHeight:l}},parseCompareVariable:function(e,t){var i=null;if(isNaN(t)){var n=pe["a"];var a={};e.addQvVariables(a,false);i=n.resolveVariables(e,e.encode(t),a,null,null,false)}else{i=parseFloat(t)}if(isNaN(i)){return Number.NaN}return i-1},getPreviousStackElement:function(e,t){var i=e;var n=i.getModel().id.split(".")[2];if(i.getModel().stackOrder===0){return St["b"].Utils.Constants.TypeValues.indicator.AXIS}for(var a=0;a<t.length;a++){var r=t[a];var o=r.getModel().id.split(".")[2];if(n===o&&i.getModel().stackOrder>r.getModel().stackOrder){i=r;break}}return i},setCompareMetaInformation:function(e,t,i,n,a,r){for(var o=0;o<e.length;o++){var l=e[o].getModel?e[o].getModel():e[o];St["b"].Layout.Common.setCompareBasicMetaInformation(l,t,i,n,r);St["b"].Layout.Common.setIsHighlighted(a,l,St["b"].Utils.Constants.TypeValues.highlightType.COMPARE)}},setCompareBasicMetaInformation:function(e,t,i,n,a){var r=St["b"].DataObjects.RuntimeDO;var o=St["b"].Utils.Constants.TypeValues.indicator;var l=St["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=n("MMPT_HIGHLIGHT_PIN_SIZE")}else{e.compareConnector=r.getParameter("CONNECTOR_ARROW_HEAD");s=r.getParameterParsed("FACTOR_HIGHLIGHT_ARROW_HEAD")*n("MMPT_HIGHLIGHT_ARROW_SIZE")}if(e.compareConnector===l.CIRCLE){e.compareConnectorColor=r.getParameter("CON_CIRCLE_COLOR");e.compareConnectorSize=n("MMPT_CIRCLE_AREA_SIZE");e.compareConnectorBorderColor=r.getParameter("CON_CIRCLE_BORDER_COLOR");e.compareConnectorBorderSize=n("MMPT_CIRCLE_BORDER_SIZE")}else if(e.compareConnector===l.TRIANGLE){e.compareConnectorColor=r.getParameter("CON_TRIANGLE_COLOR");e.compareConnectorSize=n("MMPT_TRIANGLE_AREA_SIZE");e.compareConnectorBorderColor=r.getParameter("CON_TRIANGLE_BORDER_COLOR");e.compareConnectorBorderSize=n("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=a(c)}else{e.dimension.width=s;e.offset.x=a(c)}},getCompareToAndFrom:function(n,e,a,t){var i=null;var r=null;var o=e.extendedModel;if(n.from==="axis"||n.fromAbsolutePosition==="axis"||n.compareFromCat==="axis"){i="axis"}if(n.to==="axis"||n.toAbsolutePosition==="axis"||n.compareToCat==="axis"){r="axis"}function isRepSource(e){var t;if(n.compareFromPos==="position"){n.fromAbsolutePosition.groupIndex=St["b"].Layout.Common.parseCompareVariable(a,n.positionFromInput);t=e.absolutePosition.groupIndex==n.fromAbsolutePosition.groupIndex&&e.absolutePosition.positionInGroup==n.fromAbsolutePosition.positionInGroup}else{var i=St["b"].Layout.Common.decodeCompareVariable(n.from,a);t=e.dataId_dim+"#"+e.dataId_expr===i}return t&&!e.isNaN&&e.valueType!=="FACTOR_NONE"}function isRepTarget(e){var t;if(n.compareToPos==="position"){n.toAbsolutePosition.groupIndex=St["b"].Layout.Common.parseCompareVariable(a,n.positionToInput);t=e.absolutePosition.groupIndex==n.toAbsolutePosition.groupIndex&&e.absolutePosition.positionInGroup==n.toAbsolutePosition.positionInGroup}else{var i=St["b"].Layout.Common.decodeCompareVariable(n.to,a);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=St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(o,s.dataId_expr);if(St["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=St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.getExpressionByShortId(o,s.dataId_expr);if(St["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"){n.positionToInput=(r.absolutePosition.groupIndex+1).toString();n.to=r.dataId_dim+"#"+r.dataId_expr}else if(r==="axis"&&n.to===""&&i!=="axis"&&n.from!==""){n.to=n.from}if(i&&i!=="axis"){n.positionFromInput=(i.absolutePosition.groupIndex+1).toString();n.from=i.dataId_dim+"#"+i.dataId_expr}else if(i==="axis"&&n.from===""&&r!=="axis"&&n.to!==""){n.from=n.to}return{compareFrom:i,compareTo:r}},decodeCompareVariable:function(e,t){var i=e.split("#");var n=i[1];var a=i[0].split("@");var r=[];var o=pe["a"];var l={};t.addQvVariables(l,false);for(var s=0;s<a.length;s++){var d=a[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+"#"+n;return r},getLastStackElement:function(e,t){var i;var n;var a=-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>a&&e[o].isNaN===false){i=e[o];a=e[o].stackOrder}if(e[o].value<0&&e[o].stackOrder>r&&e[o].isNaN===false){n=e[o];r=e[o].stackOrder}}}}return{pos:i,neg:n}},setIsHighlighted:function(e,t,i,n){var a=pe["a"];var r=St["b"].Utils.Constants.TypeValues.highlightType;var o=St["b"].Utils.Constants.TypeValues.indicator;var l=St["b"].DataObjects.ContextRepo.getContextByCid(e.contextId);var s=new St["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=St["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(l,t.dataId_expr)}var p=s.setupHighlightFormulas(c,t,u,n);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 m=o.STACK;g="#"+t.id.split(".").pop()+"#"}else{var m=o.LABEL}}else{var m=o.ELEMENT}if(c.value.category===o.TEXT){var h=c.value.path.split("@");for(var f=0;f<h.length;f++){if(h[f][0]==="$"&&h[f][1]==="("&&h[f][h[f].length-1]===")"){var v={};s.addQvVariables(v,false);h[f]=a.resolveVariables(s,h[f],v,null,null,false)}}h=h.join("@");if(h+"#"+c.value.keyfigure===t.dataId_dim+"#"+g&&m===c.value.type){c.active=true;return true}}else{var n=c.value.position;if(n[0]==="$"&&n[1]==="("&&n[n.length-1]===")"){var v={};s.addQvVariables(v,false);n=a.resolveVariables(s,n,v,null,null,false)}var b=parseInt(t.id.split(".").pop());var T=parseInt(t.id.split(".")[2]);if(t.isStack&&m===o.LABEL){T=parseInt(t.id.split(".")[3])}if(t.isStackSum&&m===o.STACK){T=parseInt(t.id.split(".")[3]);b="#"+t.id.split(".").pop()+"#"}if(parseInt(n)-1===T&&c.value.inGroup===b&&m===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 h=c.categoryLabel.path.split("@");for(var f=0;f<h.length;f++){if(h[f][0]==="$"&&h[f][1]==="("&&h[f][h[f].length-1]===")"){var v={};s.addQvVariables(v,false);h[f]=a.resolveVariables(s,h[f],v,null,null,false)}}h=h.join("@");if(h===t.dataId_dim&&t.text!==""){var E=c.categoryLabel.elements.split("@");for(var f=0;f<E.length;f++){if(E[f]===t.text){c.active=true;return true}}}}else{var n=c.categoryLabel.position;if(n[0]==="$"&&n[1]==="("&&n[n.length-1]===")"){var v={};s.addQvVariables(v,false);n=a.resolveVariables(s,n,v,null,null,false)}var x=parseInt(t.id.split(".")[1].match(/\d+/g));if(parseInt(n)-1===x){var E=c.categoryLabel.elements.split("@");for(var f=0;f<E.length;f++){if(E[f]===t.text){c.active=true;return true}}}}}}return false},getHighlight:function(e,t,i,n){var a=St["b"].Utils.Constants.TypeValues.highlightType;var r=St["b"].Utils.Constants.TypeValues.indicator;if(n){var o=new St["b"].Utils.Calculator(null);var l=pe["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 a.VALUE:var c=St["b"].DataObjects.ContextRepo.getContextByCid(e.contextId);var u=St["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 m=0;m<g.length;m++){if(g[m][0]==="$"&&g[m][1]==="("&&g[m][g[m].length-1]===")"){var h={};o.addQvVariables(h,false);g[m]=l.resolveVariables(o,g[m],h,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 f=d.value.position;if(f[0]==="$"&&f[1]==="("&&f[f.length-1]===")"){var h={};o.addQvVariables(h,false);f=l.resolveVariables(o,f,h,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(f)-1===v&&d.value.inGroup===b&&p===d.value.type){return{highlight:d,index:s}}}break;case a.COMPARE:if(d.compare.id===t.id){return{highlight:d,index:s}}break;case a.CATEGORY_LABEL:if(d.categoryLabel.category===r.TEXT){var g=d.categoryLabel.path.split("@");for(var m=0;m<g.length;m++){if(g[m][0]==="$"&&g[m][1]==="("&&g[m][g[m].length-1]===")"){var h={};o.addQvVariables(h,false);g[m]=l.resolveVariables(o,g[m],h,null,null,false)}}g=g.join("@");if(g===t.dataId_dim&&t.text!==""){return{highlight:d,index:s}}}else{var f=d.categoryLabel.position;if(f[0]==="$"&&f[1]==="("&&f[f.length-1]===")"){var h={};o.addQvVariables(h,false);f=l.resolveVariables(o,f,h,null,null,false)}var T=parseInt(t.id.split(".")[1].match(/\d+/g));if(parseInt(f)-1===T){return{highlight:d,index:s}}}break;case a.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 n=e.position.x;var a=e.position.x+e.dimension.width;var r=e.position.y;var o=e.position.y+e.dimension.height;var l=St["b"].Utils.Constants.TypeValues.indicator;if(e.absolute.legend!==l.NONE){n=Math.min(e.absolute.position.x,n);a=Math.max(e.absolute.position.x+e.absolute.dimension.width,a);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){n=Math.min(e.percent.position.x,n);a=Math.max(e.percent.position.x+e.percent.dimension.width,a);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!==""){n=Math.min(e.text.position.x,n);a=Math.max(e.text.position.x+e.text.dimension.width,a);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=St["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++){n=Math.min(e.ellipseArray[c].x-e.ellipseArray[c].width/2-d,n);a=Math.max(e.ellipseArray[c].x+e.ellipseArray[c].width/2+2*d,a);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{n=Math.min(e.ellipseArray.x-e.ellipseArray.width/2,n);a=Math.max(e.ellipseArray.x+e.ellipseArray.width/2,a);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=a-n;var p=o-r;return{position:{x:n,y:r},dimension:{width:u,height:p}}},layoutClickBackground:function(e,t){var i=32;var n=5;var a=5;var r=St["b"].DataObjects.RuntimeDO;var o=St["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(St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){e.image1=null;e.text1=""}else{e.image1=Se["a"].imgPath+"mouse_left_click.png";e.text1=r.getTranslation("TO_DEFINE_CELL_CONTENT")}e.image2=Se["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+n+Math.max(s.width,d.width);if(c>e.dimension.width){c=i;n=0;e.text1=null;e.text2=null;s={height:0,width:0};d={height:0,width:0}}var u=Math.max(i,s.height)+a+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+n;var m=e.position.y+Math.round((e.dimension.height-u)/2);var h=!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()?m+i+a:(e.dimension.height-u)/2;var f=0,v=0;if(s.height>i){f=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:m+f};e.image2Pos={x:p,y:h+f};e.text1Dim=s;e.text2Dim=d;e.text1Pos={x:g,y:m+v};e.text2Pos={x:g,y:h+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 D=r(559);St["b"].Factories=St["b"].Factories||{};St["b"].Factories.UIFactory={createDialog:function(e,t,i,n){n=St["b"].$.extend({width:"100%",maxwidth:"400px",minwidth:"200px",modal:true,draggable:false,center:true,resizable:false,className:""},n);var a=createOverlay(n.modal),r=createWindow(),o=createHeader(e),l=createBody(t),s=createFooter(i,a);r.appendChild(o);r.appendChild(l);r.appendChild(s);a.appendChild(r);document.body.appendChild(a);r.classList.add(n.center?"center":"nocenter");if(n.center){var d=r.getBoundingClientRect();r.style.marginTop="-"+d.height/2+"px";r.style.marginLeft="-"+d.width/2+"px"}return a;function createWindow(){var e=document.createElement("div");e.className="lui-dialog "+n.className;e.style.width=n.width;e.style.maxWidth=n.maxwidth;e.style.minWidth=n.minwidth;e.style.boxShadow="none";if(n.draggable){St["b"].$(e).draggable({handle:".lui-dialog__header, .lui-dialog__footer"})}if(St["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(St["b"].Factories.UIFactory.isIE(10)||St["b"].Factories.UIFactory.isIE(11)){t.style.alignItems="center"}if(document.getElementsByClassName("lui-modal-background").length===0&&n.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 n=T["a"].createButton(e).htmlnode;St["b"].$(n).click({target:i},t);return n}function createDefaultOkButton(e){return createButton("OK",function(){St["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}};St["b"].Factories.DialogFactory={createConfirmationDialog:function(e,t,i,n){var a=function(e){St["b"].$(e.data.target).remove()},r=i?{text:St["b"].Utils.Translations.getTranslation("CONFIRM_YES"),handler:typeof i==="function"?i:a}:undefined,o=n?{text:St["b"].Utils.Translations.getTranslation("CANCEL"),handler:typeof n==="function"?n:a}:undefined;var l=[];r&&l.push(r);o&&l.push(o);St["b"].Factories.UIFactory.createDialog(e,t,l)},createMissingVariableDialog:function(e){var t=St["b"].Utils.Translations.getTranslation("VARIABLE_MISSING_TITLE");var i=St["b"].Utils.Translations.getTranslation("VARIABLE_MISSING_BODY",e);St["b"].Factories.UIFactory.createDialog(t,i)},createMissingKeyDialog:function(e,t,i){var n=St["b"].Utils.Translations.getTranslation("KEY_MISSING_TITLE",t);var a=St["b"].Utils.Translations.getTranslation("KEY_MISSING_BODY",e,i);St["b"].Factories.UIFactory.createDialog(n,a)},createMissingFieldDialog:function(){var e=St["b"].Utils.Translations.getTranslation("FIELD_MISSING_TITLE");var t=St["b"].Utils.Translations.getTranslation("FIELD_MISSING_BODY");St["b"].Factories.UIFactory.createDialog(e,t)},createDuplicateChartNameDialog:function(){var e=St["b"].Utils.Translations.getTranslation("DUPLICATE_CHARTNAME_TITLE");var t=St["b"].Utils.Translations.getTranslation("DUPLICATE_CHARTNAME_BODY");St["b"].Factories.UIFactory.createDialog(e,t)},createDuplicateEntriesDialog:function(){var e=St["b"].Utils.Translations.getTranslation("DUPLICATE_ENTRIE_TITLE");var t=St["b"].Utils.Translations.getTranslation("DUPLICATE_ENTRIE_BODY");St["b"].Factories.UIFactory.createDialog(e,t)},createDiffNotationManualNotificationDialog:function(e,t,i){var n=St["b"].Utils.Translations.getTranslation;var a=n("NOTATION_MANUAL_DIFFERS");var r=typeof t==="string"?t:""+"<h4>"+n("ATTENTION")+"</h4>"+"<p>"+n("NOTATION_MANUAL_DIFFERS_OVERWRITE_CENTRAL_MESSAGE")+"</p>"+"<p>"+n("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>"+n("CHANGED_AT")+":</b> "+e[o].date+"</div>"+"\t\t<div><b>"+n("CHANGED_BY")+":</b> "+e[o].user+"</div>"+"</fieldset>"}r+="</div>";var l=[{text:n("OK"),handler:function(e){St["b"].$(e.data.target).remove();i&&i()}}];St["b"].Factories.UIFactory.createDialog(a,r,l,{maxwidth:"550px"})}};St["b"].Utils.ExpressionParser=new function(){var d=this;var a="[^$.|?*+(){}";var y=5;var v=5;var M=7;var f=4;var i="tclt:";var n="tccm:";var r="tcfl:";var S="tc;;";var O="tc$$";var p="tc§#";var g="tc§§";var L="tc##";var b=";;";var T="";var A="";var E="";var x=[];setupDefinitionCheckRegex();d.getType=function(e){var t=getTypeInternal(e);if(t!==null){return t.type}else{return null}};d.parseInlineCommentQVExpression=function(e,t,i,n,a){var r=getTypeInternal(e);if(r===null){r={type:t.representation}}switch(r.type){case St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST:return parseList(e,t,i.extendedModel);case St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT:return parseComment(e,t,i,n,a);case St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG:return parseFlag(e,t,i.extendedModel)}return null};d.getDefaultValue=function(e){var t=e.indexOf(S);return getDefaultValueInternal(e,t)};d.getOverwrite=function(e){var t=getTypeInternal(e);if(t==null){return null}var i=e.indexOf(S);var n=e.substring(y,i);return getCharBooleanValue(n,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,n=e.rows.length;i<n;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(L)>0?L:O;var n=e.substring(e.indexOf(i)+i.length).split(b);var a=null,r=null,o=null;if(n.length===2){o=parseInt(n[0].replace("K",""))-1;r=parseInt(n[1].replace("K",""))-1}else if(n.length===3){a=parseInt(n[0].replace("C",""))-1;o=parseInt(n[1].replace("K",""))-1;r=parseInt(n[2].replace("K",""))-1}else{return null}if(typeof o!=="number"||o<0||typeof r!=="number"||r<0){j["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(a!==null&&c===a||a===null){var p=u.expressions;var g=p[o];var m=p[r];var h=void 0,f=void 0;if(g){h=g.saveName||g.id.split(".").pop().replace("expr","");s=u}if(m){f=m.saveName||m.id.split(".").pop().replace("expr","");d=u}if(h&&f){return{copyChartModel:s,copyExpression:g,copySaveName:h,valueChartModel:d,valueExpression:m,valueSaveName:f}}}}}return null};function parseCopy(e,t,i,n){var a=d.getCopyData(e,t);if(a!==null){var r=a.copyExpression;var o=a.valueExpression;var l=null;if(r.commonTable){l=St["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(r.commonTable,n.dataId_dim,r.representation,a.copyChartModel,a.copySaveName,r.addKeyVariable,true)}else{l=St["b"].DataObjects.InlineCommentRepo.getSingleComment(i,n.dataId_dim,r.representation,a.copyChartModel,a.copySaveName,r.addKeyVariable)}if(l&&(l.value==="true"||l.value===true)){var s=null;if(o.commonTable){s=St["b"].DataObjects.InlineCommentRepo.getSingleCommonComment(o.commonTable,n.dataId_dim,o.representation,a.valueChartModel,a.valueSaveName,o.addKeyVariable,true)}else{s=St["b"].DataObjects.InlineCommentRepo.getSingleComment(i,n.dataId_dim,o.representation,a.valueChartModel,a.valueSaveName,o.addKeyVariable)}if(s){return s.value}}}return null}function parseComment(e,t,i,n,a){var r=e.indexOf(S);var o=e.substring(y,r);var l=r-y;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 m=false;var h=true;var f=s.overwrite;var v=null;var b="";var T=s.transport;var E=St["b"].DataObjects.RuntimeDO.getTranslation("ENTER_COMMENT");if(checkWithRegex(e,A)===true){for(var x=0;x<M;x++){var C=null;if(x>=l){}else{C=o.charAt(x)}d=parseFunction(d,x,0,C,s.visible,getCharBooleanValue);c=parseFunction(c,x,1,C,s.edit,getCharBooleanValue);u=parseFunction(u,x,2,C,s.mandatory,getCharBooleanValue);h=parseFunction(h,x,3,C,s.release,getCharBooleanValue);f=parseFunction(f,x,4,C,s.overwrite,getCharBooleanValue);v=parseFunction(v,x,5,C,s.number,getCharNumberValue);if(v!==null){p=v===1;g=v===2}m=parseFunction(m,x,6,C,false,getCharBooleanValue);if(m){b=parseCopy(e,i,n,a)}}if(e.indexOf(L)>e.indexOf(O)){E=e.substring(e.indexOf(O)+O.length,e.indexOf(L))}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:h,overwrite:f,maxLength:s.maxLength,listContent:undefined,type:St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT,saveName:s.saveName,placeholderText:E}}function parseList(e,t,i){var n=e.indexOf(S);var a=e.substring(y,n);var r=n-y;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 m=o.transport;if(checkWithRegex(e,T)===true){for(var h=0;h<v;h++){var f=null;if(h>=r){}else{f=a.charAt(h)}l=parseFunction(l,h,0,f,o.visible,getCharBooleanValue);s=parseFunction(s,h,1,f,o.edit,getCharBooleanValue);d=parseFunction(d,h,2,f,o.mandatory,getCharBooleanValue);c=parseFunction(c,h,3,f,o.release,getCharBooleanValue);u=parseFunction(u,h,4,f,o.overwrite,getCharBooleanValue)}g=getDefaultValueInternal(e,n);if(o.listContentDefault!==null&&o.listContentDefault!=="choose"){g=o.listContentDefault}if(e!==0&&x[e]!=undefined){p=x[e]}else{p=parseInlineCommentListEntries(e,o.listContent,t.name);if(e!==0){x[e]=p}}}else{}return{visible:l,edit:s,mandatory:d,number:null,isDate:null,value:g,transport:m,release:c,overwrite:u,listContent:p,maxLength:0,type:St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST,saveName:o.saveName}}function parseFlag(e,t,i){var n=e.indexOf(S);var a=e.substring(y,n);var r=n-y;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,E)===true){for(var m=0;m<f;m++){var h=null;if(m>=r){}else{h=a.charAt(m)}l=parseFunction(l,m,0,h,o.visible,getCharBooleanValue);s=parseFunction(s,m,1,h,o.edit,getCharBooleanValue);g=parseFunction(g,m,2,h,o.mandatory,getCharBooleanValue);d=parseFunction(d,m,3,h,o.release,getCharBooleanValue);c=parseFunction(c,m,4,h,o.overwrite,getCharBooleanValue)}u=getDefaultValueInternal(e,n);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:St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG,saveName:o.saveName}}function parseFunction(e,t,i,n,a,r){var o=e;if(t===i){if(n!==null){o=r(n)}else{o=a}}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:St["b"].Utils.Constants.TypeValues.transport.BACKEND};i.listContent.push({description:St["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE"),key:"choose",originalDescription:St["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 n=e.indexOf(O);if(n>-1){n+=O.length}else{n=e.length}var a=e.substring(n,e.length);var r=a.split(g);var o=[];o.push({description:St["b"].DataObjects.RuntimeDO.getTranslation("CHOOSE"),key:"choose",originalDescription:St["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]===""){St["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 n="";if(i>-1){n=e.substring(t+O.length,i)}return n}function getTypeInternal(e){var t=e.substr(0,y);switch(t){case i:return{type:St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST,parmLen:v};case n:return{type:St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT,parmLen:M};case r:return{type:St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG,parmLen:f}}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(S)+"){1}";T+="([\\d\\w-]*";T+=escapeForRegex(O)+"){1}";T+="(";T+="(.*";T+=escapeForRegex(p)+"){1}";T+="(.*";T+=escapeForRegex(g)+"){1}";T+=")*";A=escapeForRegex(n);A+="[01]{5}[012][01]"+escapeForRegex(S)+".*"+escapeForRegex(O)+"(.*"+escapeForRegex(L)+")?"+"((C[\\d]{2};;)?K[\\d]{2};;K[\\d]{2})?";E=escapeForRegex(r);E+="([01]*";E+=escapeForRegex(S)+"){1}";E+="([01]?";E+=escapeForRegex(O)+"){1}"}function checkWithRegex(e,t){if(e.indexOf(i)>-1||e.indexOf(n)>-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 n=e.charAt(i);if(a.indexOf(n)===-1){t+=n}else{t+="\\"+n}}return t}};var R=r(466);var P=r(584);St["b"].Utils=St["b"].Utils||{};St["b"].Utils.Calculator=St["b"].Utils.Calculator||{};St["b"].Utils.Calculator.FormulaTester=new function(){this.testFormulaFromOutside=function(){var o=new St["b"].Utils.Calculator;var e=St["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 n={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,n);e=e.splice(t.length,e.length);function checkModeOffTest(e,t){var i=[];var n=0;var a=0;for(var r=0;r<e.length;r++){a=o.calculateFomulaCFM(e[r],t,e[r].formula,"1",false);i.push(a)}for(var r=0;r<i.length;r++){if(i[r].toString()!==e[r].testResult){n++;console.log("Test failed, ",e[r]," Result : ",i[r].toString())}}console.log("Test finished - Tests done: ",r," - Result: failed with ",n," errors")}}};var w=r(605);var U=r(354);St["b"].Utils=St["b"].Utils||{};St["b"].Utils.Calculator=St["b"].Utils.Calculator||{};St["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 n=t.length;if(t[0]==="'"&&t[n-1]==="'"||t[0]==='"'&&t[n-1]==='"'){t=t.substr(1,n-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 n=i==="+"?"#":"§";e=setCharAt(e,t,n);continue}if(e[t-1]==="("){var n=i==="+"?"#":"§";e=setCharAt(e,t,n);continue}var a=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){a=true}}}if(a===true){var n=i==="+"?"#":"§";e=setCharAt(e,t,n)}}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 n=String(e).search(/^\s*((\d+(\.\d+)?)|(\.\d+))([eE][\+-]?\d+)?\s*$/)!=-1;var a=String(e).search(/^\s*((\d+(\,\d+)?)|(\,\d+))([eE][\+-]?\d+)?\s*$/)!=-1;if(n===true||a===true){if(a===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 n=0;for(var a=0;a<=i;a++){if(e[a]==="("){n++;continue}else if(e[a]===")"){n--;continue}if(n===0&&a!==i){t=false;break}}}return t}function findOperator(e){var t=[];var i=0;var n=false;var a=false;for(var r=0;r<e.length;r++){if(e[r]==="("){i++;continue}if(e[r]===")"){i--;continue}if(e[r]==="'"&&!a){if(!n||e[r-1]!=="\\"){n=!n}}else if(e[r]==='"'&&!n){if(!a||e[r-1]!=="\\"){a=!a}}if(!n&&!a&&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 n="+";if(t<0){n="-"}if(i===n){return true}if(i==="-"&&n==="+"){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 F=r(173);var Le=r(52);St["b"].Utils=St["b"].Utils||{};St["b"].Utils.DragAndDropProvider=function(e){var f=e.getCanvasDO().getDOMElement();var c=e;var t=St["b"].Utils.Calculator.Converter;var v=null;var b=null;var T=null;var u=null;var p=null;var g=false;var E;var i=false;this.setup=function(){St["b"].$(f).mousedown(mouseDown);St["b"].$(f).single_double_click(mouseClick,function(){});St["b"].$(f).mouseup(mouseUp);St["b"].$(f).mousemove(mouseMove);St["b"].$(f).mouseleave(mouseLeft)};function getRelativeMousePosition(e){var t=St["b"].$(f).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===Le["a"].EDIT_COMMENT||t===Le["a"].EDIT_SETTINGS){return}var i=c.getController().getRootModel().rootContainerModel;var n=c.getController().getRootPanel();var a=getRelativeMousePosition(e);var r={x:e.clientX,y:e.clientY};var o=St["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=St["b"].Factories.ViewFactory.getViewById(n,s.view);break}}if(b===null){return}if(b.id.indexOf("object")!==-1&&b.id.indexOf("comment")!==-1){c.setMode(St["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};E=document.getElementById("select##"+b.id+"##compareOffset");if(E){E.style.color=""}p={x:b.offset.x,y:b.offset.y};g=b.isUserLayouted;T=a;e.stopImmediatePropagation()}function mouseUp(e){if(v===null){return}if(!moveModel(e,"endDragging")){return}i=true;releaseDraggedElements();c.getController().updateLayoutDefinition();St["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 n=v.getController().getRootModel();var a=St["b"].Factories.ModelFactory.getParentContainer(n.firstObjectGrid,b)[0];var r=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(a,n);r.x+=a.scrollingData.scrollLeft;r.y+=a.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+a.dimension.width-5&&i.y>r.y+5&&i.y<r.y+a.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(E){E.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 m=b.id.replace("containerModel","");var h=St["b"].$(f).find('g[id^="'+m+'_"]')[0];moveArrow(h,i.x-T.x,i.y-T.y,b.type);T=i;return true}function moveArrow(e,t,i,n){if(n==="structure"||n==="table"){for(var a=0;a<e.childNodes.length;a++){if(e.childNodes[a].nodeName==="polyline"||e.childNodes[a].nodeName==="polygon"){var r=e.childNodes[a].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[a].nodeName==="polygon"){r[o]=(parseFloat(r[o])+parseFloat(i)).toString()}}r=r.join(",");e.childNodes[a].setAttribute("points",r)}else if(e.childNodes[a].nodeName==="ellipse"){e.childNodes[a].cy.baseVal.value+=i}else if(e.childNodes[a].nodeName==="text"){St["b"].$(e.childNodes[a]).attr("y",St["b"].$(e.childNodes[a]).attr("y")*1+i*1)}else if(e.childNodes[a].nodeName==="circle"){e.childNodes[a].cy.baseVal.value+=i}else if(e.childNodes[a].nodeName==="rect"){e.childNodes[a].y.baseVal.value+=i}}}else if(n==="time"){for(var a=0;a<e.childNodes.length;a++){if(e.childNodes[a].nodeName==="polyline"||e.childNodes[a].nodeName==="polygon"){var r=e.childNodes[a].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[a].nodeName==="polygon"){r[o]=(parseFloat(r[o])+parseFloat(t)).toString()}}r=r.join(",");e.childNodes[a].setAttribute("points",r)}else if(e.childNodes[a].nodeName==="ellipse"){e.childNodes[a].cx.baseVal.value+=t}else if(e.childNodes[a].nodeName==="text"){St["b"].$(e.childNodes[a]).attr("x",St["b"].$(e.childNodes[a]).attr("x")*1+t*1)}else if(e.childNodes[a].nodeName==="circle"){e.childNodes[a].cx.baseVal.value+=t}else if(e.childNodes[a].nodeName==="rect"){e.childNodes[a].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(E){E.value=parseFloat(b.displayOffset).toFixed(4)}if(St["b"].UI.IndicationDialog.isOpen()){St["b"].UI.IndicationDialog.getDialog().update()}b=null;v=null;T=null}function raiseDragEvents(e,t,i,n,a){var r=new St["b"].Utils.DragEventArgs(c,b,e,i,n,a);if(v.getActions()[t]!==undefined){c.getController().dispatch(v.getActions()[t],r)}return r}};St["b"].Utils=St["b"].Utils||{};St["b"].Utils.DragEventArgs=function(e,t,i,n,a,r){this.extension=e;this.draggedModel=t;this.dragTargetPosition=i;this.dragTargetAbsolutePosition=n;this.dragTargetPercentPosition=a;this.dragTargetTextPosition=r;this.handled=false;this.cancelDragging=false;this.outOfBounds=false};var se=r(1107);St["b"].Utils=St["b"].Utils||{};St["b"].Utils.EditorCommon=function(e){var t=this,i=e.extension,n=e.model,a=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:n,container:a,parentContainer:r,currDiv:o,currParent:l,controller:s,ckEditorEditField:d}};t.setNewFields=function(e){if(e){d=e}};t.getSavedAlignment=function(){switch(n.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(){St["b"].UI.Tooltip.closeLastTooltip();c.createNewElements();var e=c.replaceEditor();e.on("instanceReady",function(e){St["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){St["b"].Utils.InitDynamicCssClasses("dialog")}c.afterCommandExec(e)});e.on("paste",function(e){if(St["b"].DataObjects.DocumentDO.getDocSettings(true).pasteWithoutFormat.value==="true"){var t=document.createElement("div");t.innerHTML=e.data.dataValue;e.data.dataValue=St["b"].Utils.DOM.removeFormatFromText(t)}})};t.createCkEditorInstance=function(){var e=St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().copyCommentState;if(!St["b"].DataObjects.DocumentDO.getConnector().isPublished&&e&&!Object(V["q"])(e)&&e.documentHash){se["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(Le["a"].DEFAULT);St["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false)},onCancel:function(){St["b"].DataObjects.DocumentDO.getConnector().applyDocumentValues([{key:"copyCommentState",value:undefined}]).then(function(){u()})}})}else{u()}};if(n.instanceOf==="InlineModel"){c=new St["b"].Utils.InlineCommentEditor(t)}else if(n.instanceOf==="LabelModel"){if(n.id.indexOf("comment")!==-1){c=new St["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}};St["b"].Utils.CommentEditor=function(e){var r=this,l=new nt["a"](null),n=e,s=null,i=false;r.instanceOf=function(){return"CommentEditor"};function touchmoveEvent(){i=true}function leaveEvent(e){if(i||s.extension.getMode().id!==Le["a"].EDIT_COMMENT.id){i=false;return}var t=St["b"].$(e.target)["context"];if(!n.isPartOfCKE(t)){r.leaveEditor()}}r.createNewElements=function(){s=n.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=St["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);n.setNewFields(i);s=n.getData()};r.replaceEditor=function(){var e=St["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,n=t===1&&i>1||t>1&&i===1;switch(e.data.name){case"clearComment":var a=CKEDITOR.instances[s.ckEditorEditField.id];a.setData("");runAfterPreChecks();break;case"removeComment":if(!n){St["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_MESSAGE"),function(e){St["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(n){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=n.getData();t.focus();n.setCaretPosition(t);St["b"].$(document.body).bind("mousedown",leaveEvent);St["b"].$(document.body).bind("touchmove",touchmoveEvent);St["b"].$(document.body).bind("touchend",leaveEvent)};r.leaveEditor=function(){var e=CKEDITOR.instances[s.ckEditorEditField.id],t=s.controller,i=t.getRootModel(),n=e.getData(),a=St["b"].DataObjects.CommentRepo.getCommentById(s.parentContainer.extendedModel.commentId,s.extension.getId()),r=a.currContent.grid[s.container.row][s.container.column];if(s.model&&r){var o=false;if(n===""){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{n=n.replace(/[\n\r]/g,"");s.model.text=l.encode(n);o=s.model.text!==r.text;r.text=s.model.text}s.extension.setMode(Le["a"].DEFAULT);i.isCompareMode=false;St["b"].DataObjects.CommentRepo.updateCommentRepository(s.extension);if(o){a.exists_in_db&&!r.originalLastModified&&(r.originalLastModified=r.lastModified);r.lastModified=C["a"].createFormattedDate();r.lastModifiedBy=St["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:a.id,currCommentCell:r})}else{se["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();St["b"].$(document.body).unbind("mousedown",leaveEvent);St["b"].$(document.body).unbind("touchmove",touchmoveEvent);St["b"].$(document.body).unbind("touchend",leaveEvent);St["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false);St["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))}};St["b"].Utils.InlineCommentEditor=function(e){var n=this,t=new nt["a"](null),r=St["b"].DataObjects.InlineCommentRepo,a=e,l=null,o=-1,s=null,d=false,c=null,u=false,p=St["b"].DataObjects.DocumentDO.getPainter();n.instanceOf=function(){return"InlineCommentEditor"};n.getAlignment=function(){return c};n.getText=function(){return l.model.originalText===l.model.placeholderText?"":unescape(t.decode(l.model.originalText))};n.createNewElements=function(){l=a.getData();c=a.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(n.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";a.setNewFields(e);l=a.getData()};n.replaceEditor=function(){return CKEDITOR.inline(l.ckEditorEditField,{maxCharCount:l.model.maxLength})};n.afterCommandExec=function(e){switch(e.data.name){case"clearComment":var t=CKEDITOR.instances[l.ckEditorEditField.id];t.setData("");runAfterPreChecks();break;case"removeComment":St["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_CONTENT_DELETE_MESSAGE"),function(e){St["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){n.leaveEditor()}}};n.editorReady=function(e){var t=e.editor;l=a.getData();s=t.getSnapshot();setEditorEvents(t);t.focus();a.setCaretPosition(t);St["b"].$(document.body).bind("mousedown",leaveEvent);St["b"].$(document.body).bind("touchmove",touchMoveEvent);St["b"].$(document.body).bind("touchend",leaveEvent);if(l.model.fontWeight==="bold"){t.execCommand("bold")}};n.leaveEditor=function(){var e=CKEDITOR.instances[l.ckEditorEditField.id],t=l.controller;if(e&&l.extension){var i=false;if(l.model){var n=e.getData(),a=n;n=n.replace(/(\r\n|\n|\r)/g,"");n=new nt["a"](null).encode(n);if(l.model.originalText!==n){i=true;setData(l.model,n,a,l.extension)}St["b"].Utils.DOM.enableInlineCommentRows()}l.extension.setMode(Le["a"].DEFAULT);var r=l.model.id.split(".")[0],o=p.getContainerScrollPosition(r,l.extension.getId());e.fire("blur");e.destroy();St["b"].$(document.body).unbind("mousedown",leaveEvent);St["b"].$(document.body).unbind("touchmove",touchMoveEvent);St["b"].$(document.body).unbind("touchend",leaveEvent);St["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(false);i&&t.dispatch("updateInlineCommentsOnAutoSave",{extension:l.extension,model:l.model,container:l.container});St["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=St["b"].$(e.target)["context"];var i=true;if(a.isPartOfCKE(t)){i=false}if(i){n.leaveEditor()}}}function setData(e,t,i,n){r.setInlineComment(e,t,n);e.originalText=i;var a="start";switch(c){case"left":a="start";break;case"center":a="center";break;case"right":a="end";break}e.textAnchor=a}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 n=i-o;o=i;if(o===-1){o=i}if(t.config.maxCharCount>-1&&i>t.config.maxCharCount&&n>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){j["a"].warning(Ot["a"].getTranslation("TOAST_COMMENT_MAX_LENGTH_REACHED",e.config.maxCharCount));d=false;e.loadSnapshot(s);a.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=St["b"].Utils.DOM.strip(t).replace(/^([\t\r\n]*)$/,"");return t.length}};St["b"].Utils.Format.DateChecker=new function(){var i=this;var n="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 a=null;var r=null;var m=null;constructor();function constructor(){setupDateFormat()}i.getDateFormat=function(){return n};i.setDateFormat=function(e){n=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(a===null||r===null||m===null){return false}if(a!==2){return false}if(r!==2){return false}if(m!==2&&m!==4){return false}return true};function setupDateFormat(){c=n.replace(/D/g,"").replace(/M/g,"").replace(/Y/g,"");if(c.length>0){c=c[0]}else{c=null}var e=n.split(c);for(var t=0;t<e.length;t++){if(e[t].substr(0,1)==="D"){u=t;a=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;m=e[t].length}}}function buildDateFormatRegex(){var e="(0?[1-9]|[12][0-9]|3[01])";var t="(0?[1-9]|1[012])";var i=m===4?"((19|20)\\d\\d)":"(\\d\\d)";var n="";if(u===0){n=e}if(p===0){n=t}if(g===0){n=i}var a="";if(u===1){a=e}if(p===1){a=t}if(g===1){a=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 n+l+a+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 n=parseInt(t[p]);var a=parseInt(t[g]);if(m===2){if(a<0||a>99){return false}if(a>60){a=1900+a}else{a=2e3+a}}var r=new Array("31","28","31","30","31","30","31","31","30","31","30","31");if(isLeapyear(a)==true){r[1]="29"}if(i<0||i>r[n-1]){return false}if(n<0||n>12){return false}if(o===true){if(a<l||a>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 n=(i-t)/864e5;if(n==1){return false}else{return true}}};St["b"].Utils=St["b"].Utils||{};St["b"].Utils.Format=St["b"].Utils.Format||{};St["b"].Utils.Format.NumberFormat=St["b"].Utils.Format.NumberFormat||{formatNumber:function(e,t,i,n,a){var r=-1,o="";var l=n===true?0:t.numberFormat.decimal;l=a===undefined?l:a;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]=")"}St["b"].$.each(e,function(e,t){o+=String(t)});return o}};St["b"].Utils=St["b"].Utils||{};St["b"].Utils.Format=St["b"].Utils.Format||{};St["b"].Utils.Format.LabelFormatter=function(){var e=this;var t=St["b"].DataObjects.DocumentDO.getDocSettings();var n={numberFormat:{decimal:St["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){e=e.toString();var t=unescape(e);var i=getRegex();var n,a,r;while(n=i.exec(t)){var o=n[0].substring(2,n[0].length-1);r=St["b"].DataObjects.DocumentDO.getVariableById(o);if(r!==null){if(r.value){a=r.value}else{a=""}var l=new RegExp("\\$\\("+o+"\\)","g");e=e.replace(l,a)}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 n=t.indexOf(i);while(n!==-1){var a=-1;for(var r=n+1;r<t.length;r++){if(t[r]===")"){a=r;break}}if(a===-1){break}var o=a-n+1;var l=t.substr(n,o);var s=t.substr(0,n);var d="";if(t.length>a+1){d=t.substr(a+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;n=t.indexOf(i)}return t}function execContextData(e){var t=St["b"].Models.Actions.ModelActions.ContextModel.getContextDataByName(e[0],e[1],e[2]);var i=St["b"].Utils.Format.NumberFormat.formatNumber(t,n,1);return i}function execDate(e){var t=new Date;var i=t.getDate()+"."+(t.getMonth()+1)+"."+t.getFullYear();return i}};var de=r(227);St["b"].Utils.InitDynamicCssClasses=function(e){var l,t='url("'+de["c"]+"ckeditor/plugins/icons",i='url("'+de["c"]+"ckeditor/skins/moono-lisa/images",n=[{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}],a=[{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=n;break;case"dialog":l=a;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(de["c"]+l[i].filename)>-1){var n=t.cssRules||t.rules;for(var a=n.length-1;a>=0;a--){var r=n[a];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(a);t.insertRule(o,a)}}s=true}}catch(e){s=true}}}}function doAgain(){runIt();!s&&window.setTimeout(doAgain,500)}window.setTimeout(doAgain,0)};St["b"].Utils=St["b"].Utils||{};St["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,n,a){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;a(e)},n)});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,n,a){return i<e-a||i>e+a||n<t-a||n>t+a}};var ce=r(30);var ue=r(1188);var ge=St["b"].Utils.Painter.SVGPainter=function(){var R=St["b"].DataObjects.RuntimeDO;var i;var T=rt["a"].timeRepresentation,E=rt["a"].notation,p=rt["a"].concept,g=rt["a"].shape,v=rt["a"].otherPattern,x=rt["a"].line,m=dt["a"],f={};var X=R.isPrinting()||R.isNPrinting()?1e4:600,h=R.isPrinting()?0:2e3;var C="";var S=R.getParameterParsed("FONT_SIZE_CHART");var b,N,y;var P,w;var A,M,O;var n,a;var e=document.createElement("canvas");var L=e.getContext("2d");var _=null;var u=null;var o=null;var I=null;var r=null;var l=null;var Y={};var D=null;var K=null;var Z=null;var s=null;var U={};var F={};var B={movingScrollbar:false,leftScrollContainer:false};var H={};var k=this;var G=[];var V=14;var $={right:false,left:false};var d={};var c=document.createElement("div");var W="",z="",j;this.init=function(){var e=St["b"].DataObjects.DocumentDO.getConnector().getMainContainer();if(!s){s=document.createElement("div");s.className="HiCoTextClass measureTextDiv";s.style.display="none";document.body.appendChild(s)}if(K&&e===K||e===null){return}K=e;Z=St["b"].$(K).offset()};this.checkVariableInText=checkVariableInText;this.checkFormattingInText=checkFormattingInText;this.handleScrolling=handleScrolling;this.createDOMElement=function(e,t,i){if(_!==null&&_.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;_=document.createElement("div");_.id=e;_.style.width=t;_.style.height=i;_.className="unselectable";_.appendChild(u);return _};this.resetState=function(){b=R.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");N=R.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");y=R.getParameterParsed("MMPT_HIGHLIGHT_ELLIPSE_STROKE_WIDTH");P=R.getParameter("COLOR_HIGHLIGHT");w=R.getParameter("COLOR_HIGHLIGHT_ELLIPSE");n=R.getParameter("COLOR_COMPARE_POSITIVE");a=R.getParameter("COLOR_COMPARE_NEGATIVE");A=R.getParameter("FONT_FAMILY");M=R.getParameter("FONT_STYLE_CHART");S=R.getParameterParsed("FONT_SIZE_CHART");O=lt["a"].pt2pix(S);j=lt["a"].mm2pix(S*R.getParameterParsed("MMPT_COMMENT_LABEL_DISTANCE"));U={};F={};Y={};B.movingScrollbar=false;B.leftScrollContainer=false;H={};var e=window["CKEDITOR"];if(e&&e.instances){for(var t in e.instances){var i=e.instances[t];i.fire("blur");i.destroy()}}St["b"].UI.Tooltip.closeLastTooltip()};this.paintContainer=function(e){var t=e.getModel();var i=e.getController();var n=i.getRootModel();paintBorders(e);if(t.extendedModel!==null){var a=t.extendedModel;window.HiCoMVCInit.paintingPromise.addCallback(function(){if(St["b"].DataObjects.DocumentDO.getAllExtensions().some(function(e){return e.getId()===n.extensionHash})){le.exportModel(t,n)}});if(a.instanceOf==="TableModel"){this.drawTable(e)}else if(a.instanceOf==="ContainerCommentGridModel"&&a.isTextEditable&&a.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT&&R.getAllowIcon(a.allowBottom)){var r=e.getLayout().getCommentSize(e),o=t.dimension.height-j*2-r;if(o>S){var l=r+j;var s=t.children[t.children.length-1];var d=(s?s.zIndex:t.zIndex)+1;var c=St["b"].Utils.Constants.Parameters.idContainerContent+"."+t.id;var u=t.scrollingData.children&&t.scrollingData.children[c];if(u){k.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()!==Le["a"].READ_ONLY&&o>0){for(var m=0;m<t.extendedModel.gridColumns.length;m++){var h=t.children[m];var f=h.children.filter(function(e){return e.id.startsWith(h.id+".commentText.")})[0];var v=document.createElementNS("http://www.w3.org/2000/svg","rect");v.id=t.id+".background."+m;v.setAttributeNS(null,"class","HiCoCommentGridBackground");v.setAttributeNS(null,"width",f.dimension.width);v.setAttributeNS(null,"height",o);v.setAttributeNS(null,"x",h.position.x+f.position.x);v.setAttributeNS(null,"y",l);v.setAttributeNS(null,"fill",f.backgroundColor);addToElementsBuffer(v,d)}}if(u){k.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,n,a,r,o,l,s,d,c,u,p,g,m){var h=r.split(" ");var f=document.createElementNS("http://www.w3.org/2000/svg","text");a=checkVariableInText(a);if(n.width===undefined){n.width=k.measureTextDim(a,r).width}var v;var b=r.match(/'([^']+)'/);if(b!=null){v=b[1]}var T=h[1];var E="normal";var x="normal";if(r.indexOf("bold")>-1){E=h[0]}if(r.indexOf("italic")>-1&&r.indexOf("bold")===-1){T=h[2];x=h[1]}if(r.indexOf("bold")>-1&&r.indexOf("italic")>-1){T=h[2];x=h[1]}if(r.indexOf("underline")>-1){f.setAttributeNS(null,"text-decoration",h[h.length-1])}f.style.fontFamily=v!==null?v:"";f.style.fontSize=T;f.style.fontWeight=E;f.style.fontStyle=x;if(c){f.style.cursor="pointer"}if(e.indexOf("compare")!==-1){f.style.cursor="pointer"}if(d!==undefined&&d!==null){e+="_"+d}f.id=e;f.setAttributeNS(null,"x",i.x.toString(10));f.setAttributeNS(null,"y",(i.y+n.height-Math.round(n.height/4)).toString(10));if(e.indexOf("dimensionchart")!==-1){f.addEventListener("mouseover",function(e){var t=e.target.parentNode.id.split("_");var i=t[0].replace(ot["a"].idTableContent+".","").replace(ot["a"].idContainerContent+".","");var n=t[1];St["b"].UI.CycleMenu.createCycleDIV(n,i)})}if(l!=null){f.setAttributeNS(null,"text-anchor",l)}if(o!==undefined&&o!==null){var C=rgb2hex(o);o=C.color;f.setAttributeNS(null,"fill",o)}var y=document.createTextNode(a);f.appendChild(y);if(e.indexOf("chart")!==-1&&e.indexOf("commentReference")!==-1){var M=_.parentNode.parentNode;St["b"].$(M).attrchange({trackValues:true,callback:function(){if(St["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){St["b"].DataObjects.CommentRepo.clearCommentReferenceViews(t)}}}}}})}if(s!==null&&s!==undefined){addToGroupsBuffer(s,f,t)}else{addToElementsBuffer(f,t)}var S;if(l==="middle"){S={x:i.x-n.width/2,y:i.y}}else if(l==="end"){S={x:i.x-n.width,y:i.y}}else{S={x:i.x,y:i.y}}paintSingleRect(e+"_boundingRect",t-2,S,n,"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;f.appendChild(O)}else if(p!=null){var L=St["b"].$(f);L.data("originalText",p);L.data("extensionId",g)}if(m&&f.id.indexOf(".representation.")>0){var A=St["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(m).obj;window.setTimeout(function(){return St["b"].UI.Tooltip.createTooltip(f,A)},1e3)}}function paintBorders(e){var t=e.getBorder(),i=e.getDimension(),n=0,a=0,r=300;var o=i.width,l=i.height;if(t.top.width>0){paintSingleLine("",r,{x1:n,y1:a,x2:o,y2:a},t.top.color,t.top.width,"")}if(t.left.width>0){paintSingleLine("",r,{x1:n,y1:a,x2:n,y2:l},t.left.color,t.left.width,"")}if(t.right.width>0){o-=t.right.width;paintSingleLine("",r,{x1:o,y1:a,x2:o,y2:l},t.right.color,t.right.width,"")}if(t.bottom.width>0){l-=t.bottom.width;paintSingleLine("",r,{x1:n,y1:l,x2:o,y2:l},t.bottom.color,t.bottom.width,"")}}function createOtherPattern(e,t,i,n,a,r,o){var l=document.createElementNS("http://www.w3.org/2000/svg","pattern");l.id=n;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(a===null||a===undefined){a=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(a!==0){l.setAttributeNS(null,"patternTransform","rotate("+-a+",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===n){St["b"].$(d.children[c]).remove()}}}d.appendChild(l)}function drawEmptyOtherPattern(e,t,i){if(i.highlight===true){e.setAttributeNS(null,"fill",P)}return e}function drawFilledOtherPattern(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttributeNS(null,"x","-20");n.setAttributeNS(null,"y","-10");n.setAttributeNS(null,"width",(t*200).toString());n.setAttributeNS(null,"height",(t*200).toString());n.setAttributeNS(null,"fill",i.highlight===true?P:i.pattern);e.appendChild(n);return e}function drawChessOtherPattern(e,t,i){var n=-20;var a=-10;while(n<=20){while(a<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x",n.toString());r.setAttributeNS(null,"y",a.toString());r.setAttributeNS(null,"width","5");r.setAttributeNS(null,"height","5");r.setAttributeNS(null,"fill",i.highlight===true?P:i.pattern);a+=10;e.appendChild(r)}n+=5;if(a%10===0){a=-5}else{a=-10}}return e}function drawDiagonalOtherPattern(e,t,i){var n=10;var a=-20;while(a<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttributeNS(null,"stroke-width",t);r.setAttributeNS(null,"x1",n);r.setAttributeNS(null,"y1","-10");r.setAttributeNS(null,"x2",a);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?P:i.pattern);n+=5;a+=5;e.appendChild(r)}return e}function buildDataPointsForPolyline(e){var t=-20;var i=[];for(var n=0;n<=8;n++){i.push(e+","+t);if(n%2==0){e-=5}else{e+=5}t+=5}return i.join(" ")}function drawZickzackOtherPattern(e,t,i){var n=-20;while(n<=25){var a=n;var r=document.createElementNS("http://www.w3.org/2000/svg","polyline");var o=buildDataPointsForPolyline(a);r.setAttributeNS(null,"points",o);r.setAttributeNS(null,"fill",i.background);r.setAttributeNS(null,"stroke-width",t);r.setAttributeNS(null,"stroke",i.highlight===true?P:i.pattern);n+=5;e.appendChild(r)}return e}function drawDiamondOtherPattern(e,t,i){var n=20;var a=-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",n);r.setAttributeNS(null,"y1","-20");r.setAttributeNS(null,"x2",a);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?P:i.pattern);n+=10;a+=10;e.appendChild(r)}var n=-20;var a=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",n);r.setAttributeNS(null,"y1","-20");r.setAttributeNS(null,"x2",a);r.setAttributeNS(null,"y2","20");r.setAttributeNS(null,"stroke",i.highlight===true?P:i.pattern);n+=10;a+=10;e.appendChild(r)}return e}function drawCircleOtherPattern(e,t,i){var n=-20;var a=-10;while(n<=20){while(a<=20){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");r.setAttributeNS(null,"cx",n);r.setAttributeNS(null,"cy",a);r.setAttributeNS(null,"r",t);r.setAttributeNS(null,"fill",i.highlight===true?P:i.pattern);a+=10;e.appendChild(r)}n+=5;if(a%10===0){a=-5}else{a=-10}}return e}this.drawTable=function(e){var t=e.getModel();var i=t.extendedModel;var n=i.cellSelection;if(n.rowLength>0&&n.columnLength>0){var a=i.tableCellData[n.startRow][n.startColumn].afterLayoutingPosition;var r=i.tableCellData[n.startRow+n.rowLength-1][n.startColumn+n.columnLength-1];var o=r.afterLayoutingPosition;var l=r.afterLayoutingSize;var s=o.x-a.x+l.width;var d=o.y-a.y+l.height;paintSingleRectTable("tableSelection"+t.id,300,a,{height:d,width:s},"stroke",P)}var c=false,u=false;var p=ot["a"].idTableContent+"."+t.id;var g=ot["a"].idTableHead+"."+t.id;for(var m=0;m<i.rows;m++){for(var h=0;h<i.columns;h++){var f=i.tableCellData[m][h];if(f.inContentCell&&!u){c&&(this.endNestedContainer(),c=false);this.beginNestedContainer(p,t.scrollingData.children[p]);u=true}else if(!c&&!f.inContentCell){u&&(this.endNestedContainer(),u=false);this.beginNestedContainer(g,t.scrollingData.children[g]);c=true}var v=f.afterLayoutingPosition;var b=f.afterLayoutingSize;var T;var E=t.id+"."+m+"."+h;if(f.border.left>0){T={x1:v.x,y1:v.y,x2:v.x,y2:v.y+b.height};paintSingleLine(E+".left.line",300,T,f.borderColor,f.border.left,t.id+".line")}if(f.border.right>0){var x=v.x+b.width-f.border.right;T={x1:x,y1:v.y,x2:x,y2:v.y+b.height};paintSingleLine(E+".right.line",300,T,f.borderColor,f.border.right,"")}if(f.border.top>0){T={x1:v.x,y1:v.y,x2:v.x+b.width,y2:v.y};paintSingleLine(E+".top.line",300,T,f.borderColor,f.border.top,"")}if(f.border.bottom>0){var C="",y;if(m<i.headerRows-1&&h<i.columnDefinitions.length-1&&(i.tableCellData[m][h].elements[0]&&i.tableCellData[m][h].elements[0].hideLabel)){y=i.tableCellData[m][h+1].afterLayoutingPosition.x;C=".annotationLabel"}else{y=v.x+b.width;if(m<i.headerRows-1){C=".annotationLabel"}}var M=v.y+b.height-f.border.bottom;T={x1:v.x,y1:M,x2:y,y2:M};paintSingleLine(E+C+".bottom.line",300,T,f.borderColor,f.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 n=0;n<t.separators.length;n++){var a=t.separators[n];var r=a.y-Math.floor(a.width/2);var o={x1:i-a.neg,y1:r,x2:i+a.pos,y2:r};paintSingleLine(t.id+".separator."+n,a.zIndex,o,a.color,a.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 n=0;n<t.segments.length;n++){var s=t.segments[n];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=(n===l?t.dimension.height+t.position.y:t.segments[n+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_"+n,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_"+n,t.zIndex-1,o,d,"fill",c)}paintSingleRectTable(t.id+n,t.zIndex,o,d,"stroke",s.border)}}else{var l=t.segments.length-1;for(var n=0;n<t.segments.length;n++){var o={x1:t.position.x,y1:t.segments[n].y,x2:t.position.x};if(t.segments[n].segLen!==undefined){o.y2=t.segments[n].y+t.segments[n].segLen}else{o.y2=n===l?t.dimension.height+t.position.y:t.segments[n+1].y}paintSingleLine(t.id+n,t.zIndex,o,t.segments[n].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,n,a,r,o){var l;if(e!==undefined){l=e.axisBorder}if(n==="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,n,a,r,o,l,s){if(n==="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(n){var a=function(e,t){for(var i=0;i<e.length;i++){if(e[i]===t){return true}}return false};var r=[];St["b"].$.each(n.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(n.layoutType==="time"||n.layoutType==="elementType.2"){var i=t.labelPosition;if(i===-1||i===undefined){i=t.positioning}if(r.length==0){r.push(i)}else{if(!a(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(!a(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(a(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 n=e.getModel();var a=e.getController();var r=a.getRootModel();var o=St["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,e.getModel());var l=o[0];var s=St["b"].DataObjects.ContextRepo.getContextByCid(e.getModel().contextId);var d=St["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=St["b"].Factories.ModelFactory.getSelectedKeyfigure(l);var g=getHighestPriorityPositioning(l);var m=isAxisNotationAndNotationType(s,l,g).axisNotation;var h=isAxisNotationAndNotationType(s,l,g).notationTypeId;var f={};var v={};if(n.separators.length>0){var b=n.position.y+Math.floor(n.dimension.height/2);for(var T=0;T<n.separators.length;T++){var E=n.separators[T];var x=E.x-Math.floor(E.width/2);var C={x1:cordCorrectionSVG(x)+.001,y1:b-E.pos,x2:cordCorrectionSVG(x),y2:b+E.neg};paintSingleLine(n.id+".separator."+T,E.zIndex,C,E.color,E.width,n.id)}}if(n.paintAxis===false){return}var y=getAxisDataType(p,l,g,h);y.id=e.getModel().id;if(m===true){var M={};var S={};S.height=i.height;S.width=i.width-2;M.y=t.y-i.height/2;M.x=t.x;f.x=t.x;f.y=t.y;v.height=i.height;v.width=i.width;defineAxisDatatypeParts(y,f,v,u,h,"Time",e.getModel().zIndex,l)}else{var O=ot["a"].colorDraw;var L=t.x;var A=t.y;var _=L;var I=y.number;for(var T=0;T<I;T++){var D=u;if(i.height/2>1){t.y=A-i.height/2;t.x=_;i.width=D;paintSingleRect(e.getModel().id,e.getModel().zIndex,t,i,"fill",O)}else{var R=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getAxisSplit(l.extendedModel,T+1);if(R!==undefined&&R!==null){var N=R.space_px;if(R.axisSplit===true){if(R.position==="start"){var P={x1:_+N,y1:t.y-1,x2:_+N+D,y2:t.y-1};paintSingleLine(n.id,n.zIndex,P,O,1)}else{var P={x1:_,y1:t.y-1,x2:_+D,y2:t.y-1};paintSingleLine(n.id,n.zIndex,P,O,1)}}else{var P={x1:_,y1:t.y-1,x2:_+D+N,y2:t.y-1};paintSingleLine(n.id,n.zIndex,P,O,1)}}else{var N=0;var P={x1:_,y1:t.y-1,x2:_+D,y2:t.y-1};paintSingleLine(n.id,n.zIndex,P,O,1)}_=_+D+N}}}};function defineAxisPartColor(e,t,i){var n;if(e===E.AXIS){if(t.baseColors[i].fillingColor===undefined){n={axisBorder:t.baseColors[i].axisBorder,axisPattern:t.baseColors[i].axisPattern,axisBackground:t.baseColors[i].axisBackground,otherPattern:t.baseColors[i].otherPattern}}}else if(e===E.ELEMENT_AXIS){n={axisBorder:t.referenceColors[i].axisBorder,axisPattern:t.referenceColors[i].axisPattern,axisBackground:t.referenceColors[i].axisBackground,otherPattern:t.referenceColors[i].otherPattern}}return n}function defineAxisDatatypeParts(e,t,i,n,a,r,o,l){var s=e.number;var d=false;var c=parseInt(e.dataTypeOccurence[0]);var u=false;var p=0;i.width=n*parseInt(e.dataTypeOccurence[p]);for(var g=0;g<s;g++){if(c===0){p+=1;c=parseInt(e.dataTypeOccurence[p]);i.width=n*parseInt(e.dataTypeOccurence[p])}if(c===1){u=true;d=true}c-=1;var m=St["b"].Models.Actions.ExtendedModelActions.DimensionLabelModel.getAxisSplit(l.extendedModel,g+1);var h=defineAxisPartColor(a,e,g);if(r==="Time"){var f=0;if(m!==undefined&&m!==null){f=m.space_px;if(m.axisSplit===true){if(m.position==="start"){t.x+=f}}else{i.width+=f}}}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,h.axisBorder,i.height)}else{var v={x:t.x,y:t.y-1},b={width:i.width,height:i.height-1};paintAxisBorder(h,v,b,r,e.dataTypes[g],e.id+".axisNotation"+g,o-1,a);paintAxisFilling(h,v,b,r,e.dataTypes[g],e.id+".axisNotation"+g,e.representationConcept,o,h.otherPattern)}u=false}if(r==="Time"){if(m!==undefined&&m!==null){if(m.axisSplit===true&&m.position==="end"){t.x+=f}}if(d===true){t.x=t.x+i.width;i.width=0;d=false}}}}function getAxisDataType(e,t,n,a){var r=[];var o=[];var l=[];var s=[];var d=[];var c=0;var u=0;var p=0;var g=false;var m=0;var h=[];var f="Area";var v=null;St["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"){m++;if(v===null){if((t.labelPosition==n||t.positioning==n)&&(t.notation===E.AXIS||t.notation===E.ELEMENT_AXIS)){v=t.dataId_expr}}if((t.labelPosition==n||t.positioning==n)&&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===E.ELEMENT_AXIS){f=t.referenceConcept}else{f=t.concept}if(a===E.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}}}h.push({baseColors:r,referenceColors:o,dataTypes:s,dataTypeOccurence:l,representationConcept:f,isDelta:g})}});var i=m/t.extendedModel.expressions.length;var b={baseColors:r,referenceColors:o,dataTypes:s,dataTypeOccurence:l,representationConcept:f,isDelta:g,newAxis:h,number:i};breakAxisWithEmptySpaces(t,b,i);return b}function breakAxisWithEmptySpaces(e,t,i){var n=[];var a=e.extendedModel.dimensionLabelModel.calculatedEmptySpaces;for(var r in a){var o=a[r];var l=o.position;var s=o.positionCnt;if(l=="start"){s--}if(n.indexOf(s)===-1){n.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(n.length>0&&d!==0){var c=0;var u=[];var p=[];var g=0;for(var m=0;m<t.dataTypes.length;m++){var h=t.dataTypeOccurence[m];var f=false;for(var v=0;v<n.length;v++){var b=n[v];var T=g+h;if(b>g&&b<T){f=true;c++}if(f===true){var E=b-g;var x=h-E;u.push(t.dataTypes[m]);u.push(t.dataTypes[m]);p.push(E);p.push(x);n.splice(v,1);break}}if(f===false){u.push(t.dataTypes[m]);p.push(t.dataTypeOccurence[m])}g+=h}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(),n=null,a=null,l=null;if(o.dynamicOpacity){l={mouseover:function(){this.setAttributeNS(null,"fill-opacity",.5);n&&n.setAttributeNS(null,"opacity",.5);a&&a.setAttributeNS(null,"opacity",.5)},mouseout:function(){this.setAttributeNS(null,"fill-opacity",0);n&&n.setAttributeNS(null,"opacity",0);a&&a.setAttributeNS(null,"opacity",0)}}}if(o.text!==""){var s=M+" "+O+"px '"+A+"'";var d=J["b"](r.getController().getRootModel().firstObjectGrid,o)[0];if(d.layoutType==="placeholder"){if(St["b"].DataObjects.RuntimeDO.getUser().permissions.indexOf("Designer")>-1){this.paintInitial(r)}return}if(o.text==="Click"||o.text===R.getTranslation("CLICK")){if(o.image1){n=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){a=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 n=document.createElementNS("http://www.w3.org/2000/svg","image");var a=r.getModel().zIndex+400;n.id=r.getId();n.setAttributeNS("http://www.w3.org/1999/xlink","href",e);n.setAttributeNS(null,"width",dimCorrectionSVG(i.width));n.setAttributeNS(null,"height",dimCorrectionSVG(i.height));n.setAttributeNS(null,"x",cordCorrectionSVG(t.x));n.setAttributeNS(null,"y",cordCorrectionSVG(t.y));if(o.dynamicOpacity){n.setAttributeNS(null,"opacity","0");n.style.pointerEvents="none"}addToElementsBuffer(n,a);return n}};this.paintUrl=function(e){var t=e.getModel();var i=o.getIframesBuffer();var n=i[t.id];if(!n){var a=e.getController().getRootModel();n=document.createElement("iframe");n.setAttribute("id",a.extensionHash+"_"+t.id+"_iFrame");n.setAttribute("src",t.url||"about:blank");n.style.height=t.dimension.height+"px";n.style.width=t.dimension.width+"px";n.style.borderWidth="0";i[t.id]=n}else{var r=t.url||"about:blank";n.getAttribute("src")!==r&&n.setAttribute("src",r);n.style.height!==t.dimension.height+"px"&&(n.style.height=t.dimension.height+"px");n.style.width!==t.dimension.width+"px"&&(n.style.width=t.dimension.width+"px")}addToDivsBuffer(n)};function createTextDiv(e){var t=e.getModel();var i=checkFormattingInText(checkVariableInText(t.text,"textDiv"));var n=document.createElement("div");n.id=t.id;n.className="comment HiCoTextClass";n.style.width=t.dimension.width+"px";n.style.height=t.dimension.height+"px";n.style.top=t.position.y+"px";n.style.left=t.position.x+"px";n.style.fontSize=t.fontSize+"px";n.style.fontFamily=t.font;n.style.fontWeight=t.fontWeight;n.style.fontStyle=t.fontStyle;n.style.zIndex=t.zIndex;n.style.postion="absolute";var a=St["b"].Factories.ModelFactory.getParentContainer(e.getController().getRootModel().firstObjectGrid,t);var r=null,o=null;for(var l=0;l<a.length;l++){if(a[l].extendedModel.instanceOf==="CommentModel"){o=a[l]}else if(a[l].extendedModel.instanceOf==="ContainerCommentGridModel"){r=a[l];break}}if(r){if(r.extendedModel.isTextEditable){n.style.background=t.backgroundColor;n.classList.add("isEditable");createTouchDummy(n,e,function(){!St["b"].Utils.Mobile.isTouchDevice&&St["b"].$(n.parentElement).draggable("enable")},function(){!St["b"].Utils.Mobile.isTouchDevice&&St["b"].$(n.parentElement).draggable("disable")})}else{if(isClickBehaviorEnabled(r.extendedModel)){n.style.cursor="pointer"}}}if(t.dimension.width>0&&t.dimension.height>0){n.innerHTML=i;if(i===""){n.classList.add("isEmpty")}else{var s=St["b"].DataObjects.DocumentDO.getApi().GlobalFeatureManager.Actions;if(s&&s.isEnabled&&s.Feature.supports("GoToURL")){var d=n.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:n,parent:o,parentGrid:r}}this.paintComment=function(e){var t=e.getModel();if(t.id.indexOf("commentText")!==-1){var i=createTextDiv(e);var n=e.getController().getRootModel();var a=St["b"].Factories.ModelFactory.getParentContainer(n.firstObjectGrid,e.getModel())[0];var r=St["b"].DataObjects.CommentRepo.getCommentById(i.parentGrid.extendedModel.commentId,n.extensionHash).currContent.grid[a.row][a.column];window.setTimeout(function(){return St["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,n,a,r){var o=r/2;var l={x:0,y:0};var s=St["b"].Layout.CommentReference.getReferenceCollisionOffset(e,i,r,t);if(n.extendedModel.instanceOf==="TimeChartModel"){if(t.instanceOf==="CompareModel"){l.y=i.position.y;l.x=i.position.x;if(a.align.x==="right"||a.align.x==="left"){l.x-=s}}else{l.y=i.position.x;l.x=i.position.y;if(a.align.x==="right"){l.x-=s;l.x*=-1}if(a.align.y==="top"){l.y+=s;l.y*=-1}if(a.align.y==="bottom"){l.y+=s}if(a.align.x==="left"){l.x-=s}}}else{l.y=i.position.y;l.x=i.position.x;if(t.instanceOf!=="CompareModel"){if(a.align.x==="left"){l.x*=-1}if(a.align.y==="bottom"){l.y*=-1}}if(a.align.x==="left"){l.x-=s}if(a.align.x==="right"){l.x+=s}if(a.align.y==="bottom"){l.y+=s}if(a.align.y==="top"){l.y-=s}}l.x-=o;l.y-=o;return l};function hideShowScrolledReferences(e,t,i,n){var a=n&&n.textContent==="";a&&(n.innerHTML="&nbsp;");var r=n.getBoundingClientRect();var o=t;a&&(n.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+".",""),n=r.getChartById(i.split(".")[0].split("_")[0]);var o=Y[i]||[];if(n.layoutType==="grid"){recursivelySearchCommentReferences(n)}function recursivelySearchCommentReferences(e){var t=e.children;for(var i=t.length;i--;){var n=t[i];if(n.layoutType==="grid"){recursivelySearchCommentReferences(n)}else{var a=Y[n.id+"_"+r.getId()];a&&(o=o.concat(a))}}}function getScrollDiv(e){var t=e;while(t.tagName!=="svg"){t=t.parentNode}var i=t.parentNode,n=i.parentNode;return n&&n.tagName==="DIV"||n.className==="tc-scroll"?i:null}if(o.length>0){for(var a=0;a<o.length;a++){var l=o[a].divElement,s=St["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 m=s.y+s.borderOffset.y;var g=c;do{m-=g.scrollTop}while(g!==u&&(g=g.parentNode));l.style.top=m+j+"px"}}hideShowScrolledReferences(l,c,s.targetExtension.getId(),s.referencedElement)}}}function createTouchDummy(e,a,r,t){var o=a.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 n=document.createElement("i");$.left&&(n.style.left="16px");n.style.position="absolute";n.className="fa fa-pencil-square-o";n.setAttribute("aria-hidden","true");i.appendChild(n);paintDeleteCommentIcon(i,a,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 n=t.getController(),a=n.getRootModel(),r=St["b"].Factories.ModelFactory.getParentContainer(a.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(){n.dispatch("deleteRemoveRow",{model:o,extension:n.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,n,a,r,o,l){var s=e.id.split("."),d="DIV_"+s[0]+"_"+s[1]+"_"+s[2]+"_"+n,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=X;var u=l.reference[n],p=St["b"].DataObjects.DocumentDO.getExtension(s[2]),g=p.getController(),m=St["b"].DataObjects.DocumentDO.getExtension(u.extension),h=m?m.getController().getRootModel():null,f=St["b"].Factories.ModelFactory.getParentContainer(g.getRootModel().firstObjectGrid,r),v=0,b=null,T={x:0,y:0},E=null;for(var x=f.length;x--;){if(f[x].extendedModel.instanceOf==="ContainerCommentGridModel"){b=f[x];break}}var C=b&&b.extendedModel.isTextEditable;c.style.cursor=C?"move":"default";if(C){St["b"].Layout.CommentReference.setDraggable(c,i.id,l);St["b"].$(c).on("contextmenu",function(e){contextMenuFunction(e.originalEvent)});St["b"].Utils.Mobile.onTouchHold(c,800,contextMenuFunction)}if(a){var y=St["b"].Factories.ModelFactory.getModelById(h,u.chartId);if(y){var M=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(y,h);var S=this.convertOffsets(m,a,u,y,o,v);var O=t.x+M.x+o.x+S.x-parseInt(c.style.width)/2,L=t.y+M.y+o.y+S.y-parseInt(c.style.height)/2,A={xStart:t.x+M.x,yStart:t.y+M.y};if(y.scrollingData.headerHeight!=undefined&&(a.nestedContainerId==undefined||a.nestedContainerId.indexOf(ot["a"].idTableContent)>=0)){A.yStart+=y.scrollingData.headerHeight}var _=null,I=null;if(a.instanceOf==="CompareModel"){var D=u.elementType.split("#");if(D[1]==="text"){var R=D.pop();_=St["b"].$(m.getAdapter().getContainerElement()).find('[id="'+a.id+"."+R+'"]')[0];_&&(I=_.parentNode.parentNode)}else{var N=St["b"].$(m.getAdapter().getContainerElement()).find('g[id^="'+a.id+'"]')[0];if(N){for(var P=0;P<N.children.length;P++){if(N.children[P].tagName===D[1]){_=N.children[P];I=_.parentNode.parentNode;break}}}}}else{var w=St["b"].$(m.getAdapter().getContainerElement()).find('[id^="'+a.id+'"]');for(var P=0;P<w.length;P++){var U=w[P];if(w[P].tagName!=="pattern"&&(!U.id||!U.id.endsWith("_boundingRect"))&&(U.id&&U.id.split("$")[0]===a.id)){_=w[P];I=_.parentNode;break}}}if(_){getScrollDiv(I);if(E){var F=y.id.split(".")[0]+"_"+m.getId();if(Y[F]===undefined){Y[F]=[]}for(var P=0;P<Y[F].length;P++){if(Y[F][P].divElement.id===c.id){Y[F].splice(P,1);break}}Y[F].push({divElement:c})}var B=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(y,h);var H=0,k=0;if(y.scrollingData.children){var G=y.scrollingData.children[a.nestedContainerId];if(G){H+=G.scrollLeft;k+=G.scrollTop}}var V=y.border,$=y.padding;T={x:V.left.width+$.left,y:V.top.width+$.top};var W=St["b"].Connector.ConnectorHelper.Settings.borderOfExtensionRoot;c.style.left=O+(B.x-M.x-H)+W+"px";c.style.top=L+(B.y-M.y-k)+W+"px";K.appendChild(c);hideShowScrolledReferences(c,I,m.getId(),_)}}}else{var z=Q["a"].getAbsoluteReferencePosition(u);c.style.left=z.x;c.style.top=z.y;K.appendChild(c)}var j=St["b"].DataObjects.DocumentDO.getExtension(u.extension).getAdapter().getContainerElementCoordinates();c.setAttribute("extension-x",j.x-Z.left);c.setAttribute("extension-y",j.y-Z.top);St["b"].$.data(c,{currComment:i,currCommentCell:l,selectedReference:n,extension:p,targetExtension:m,objectId:s[0],fixReferenceModel:r,referencePoints:o,referencedElement:_,x:O,y:L,containerPos:A?A:undefined,borderOffset:T,offset:S,posCnt:St["b"].DataObjects.CommentRepo.getMoveablePosCounter()});function getScrollDiv(e){if(e){var t=e.parentNode;if(t&&t.tagName==="DIV"&&t.className==="tc-scroll"){E=e}else if(t&&t.id===m.getId()){}else{getScrollDiv(t)}}}function contextMenuFunction(e){var t=St["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=St["b"].Layout.CommentReference.ReferenceRepresentation.svg,n=i.getReferenceSize(t.text).refLabelDistance,a=!(e.showFixReference===false||e.movedReferenceCounter===0),r=document.getElementById(e.id),o=i.create(t.text,a);r&&i.setActive(r,a);if(o){if(t.id.indexOf("object")!==-1&&t.id.indexOf("commentReference")!==-1){return o}else{o.id=e.id;o.style.paddingTop=n+j+"px";o.style.paddingLeft=n+"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 n=e.getDimension();i.x+=2;var a=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*y);if(t.textAnchor==="middle"){this.paintEllipse(e,i.x-3,i.y+n.height/2-2,n.width*b,n.height*N,P,false,s)}else if(t.textAnchor==="end"){this.paintEllipse(e,i.x-n.width/2,i.y+n.height/2-2,n.width*b,n.height*N,P,false,s)}else{this.paintEllipse(e,i.x+n.width/2-2,i.y+n.height/2-2,n.width*b,n.height*N,P,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=St["b"].Factories.ModelFactory.getModelById(a,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 m=0;m<p.length;m++){if(p[m]===t.text){g=c.extendedModel.columnDefinitions[m];break}}u=g.width-n.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*y);if(t.textAnchor==="middle"){d.x=i.x-3}else if(t.textAnchor==="end"){d.x=i.x-n.width/2-2}else{d.x=i.x+n.width/2-2}d.y=i.y+n.height/2-1;d.width=n.width;d.height=n.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 h=checkVariableInText(t.text);if(t.id.indexOf("dimensionchart")==-1&&St["b"].Utils.DOM.checkForHTML(h)===true){drawTextHTML(e)}else{if(t.showBackground==="inverted"){var f=St["b"].Factories.ModelFactory.getModelById(a,o);drawTextInverted(e,f)}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(ue["a"].container,t,e.getId());ce["unmountComponentAtNode"](i);i.id=e.getId();ue["a"].renderAtNode({inactive:St["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(St["b"].$.browser.mozilla){t.x-=1;t.y-=2;i.height=i.height*1.1}if(St["b"].$.browser.msie){t.y-=2;i.height=i.height*1.1}if(St["b"].$.browser.webkit){t.x-=2;t.y-=2;i.width+=2;i.height=i.height*1.1}var n=e.backgroundColor;var a=n.indexOf("rgb(");var r=n.indexOf(")");if(a!==-1&&r!==-1){n="rgba("+n.substring(a+4,r)+","+(1-e.backgroundTransparency)+")"}paintSingleRect(e.id,e.zIndex-10,t,i,"fill",n)}function drawTextHTML(e){var t=e.getModel();var i={x:t.position.x,y:t.position.y};var n={width:t.dimension.width,height:t.dimension.height};var a=t.fontSize+"px '"+(t.font!=""?t.font:A)+"'";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=St["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 m=0;var h=0;for(var f=0;f<g.length;f++){var v=g[f];var b=v.text;var T=v.bold;var E=v.italic;var x=v.underline;var C=0;var y=(T?"bold ":"normal ")+(E?"italic ":"")+a+(x?" underline":"");var M=measureTextDim(b,y);i.x=u;m=M.height;var S=getTotalOffset(y,g);C=getOffsetPositionX(t,S);C-=1;var O=m-M.height;i.x+=C+h;i.y+=O;n.height=M.height;var L=null;if(t.color&&t.color.pattern){L=t.color.pattern}paintText(e.getId()+"_"+f,e.getModel().zIndex,i,n,b,y,L,null,null,p,o,t.tooltip,l,s);m=M.height;h+=M.width}i.y+=t.fontSize+t.lineSpacing}}function getTotalOffset(e,t){var i=e;var n=0;var a=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;n=measureTextDim(t[s].text,i);a+=n.width}return a}function getOffsetPositionY(e,t,i){if(e.verticalAlign===St["b"].Utils.Constants.TypeValues.labelVerticalAlignment.MIDDLE){return 0}else if(e.verticalAlign===St["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===St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.MIDDLE){return i.width/2-t/2}else if(e.horizontalAlign===St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment.RIGHT){return i.width-t}else{return 0}}}function drawTextInverted(e,t){var i=e.getModel();for(var n=0;n<t.children.length;n++){if((t.children[n].instanceOf=="TimeColumnModel"||t.children[n].instanceOf=="BarModel")&&t.children[n].dataId_expr==i.dataId_expr&&t.children[n].dataId_dim==i.dataId_dim&&i.id.split(".").pop()!="neg"&&i.id.split(".").pop()!="pos"){var a=t.children[n];if(a.isStack===true&&t.extendedModel.stackLabelAlignment=="In-Line"){var r=a.color.pattern;if(a.dataType==="Budget"){r=a.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&&a.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[n].dataId_dim){drawText(e,this);break}}}function drawText(e){var t=e.getModel();var i={x:t.position.x,y:t.position.y};var n=checkVariableInText(t.text);var a=isClickBehaviorEnabled(t);var r=t.originalText;var o=e.getController().getRootModel().extensionHash;if(t.instanceOf==="InlineModel"){a=!t.edit;if(r===t.placeholderText||t.text===r){r=null}}var l=/\n|<br>|<br \/>|<br\/>/;var s=n.split(l);var d=s.length;var c=t.fontWeight+" "+t.fontSize+"px '"+(t.font!=""?t.font:A)+"'";var u=t.id.indexOf(".buttonText")>0;for(var p=0;p<d;p++){var g=k.measureTextDim(s[p],c,t.lineSpacing);var m=getOffsetPositionX(t,g.width);var h=getOffsetPositionY(t,g,d);var f=i.x+m-.5;if(d>1){if(p>0){i.y=i.y+h+t.fontSize+t.lineSpacing}}if(!isNaN(f)&&!isNaN(i.y)){var v={x:f,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,a||u,t.tooltip,r,o)}}}function isAxisNotationAndNotationType(e,t,i){var n=false;var a=undefined;for(var r=0;r<t.extendedModel.expressions.length;r++){if(t.extendedModel.expressions[r].labelPosition===i&&t.extendedModel.expressions[r].axisNotation){n=true;a=t.extendedModel.expressions[r].notation}}return{axisNotation:n,notationTypeId:a}}this.paintList=function(e){var t=e.getModel();if(t.hide){return}var i=e.getController().getRootModel().extensionHash;var n=t.fontWeight+" "+t.fontSize+"px '"+t.font+"'";var a=t.originalText;if(t.text===0||t.text==="0"||t.text===a){a=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,n,t.color.pattern,null,null,null,!t.edit,t.tooltip,a,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 n=t.lineHeight-t.fontSize,a=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=a+"px";o.style.height=t.dimension.height+"px";o.style.top=t.position.y-n+.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=St["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=St["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(e).obj;window.setTimeout(function(){return St["b"].UI.Tooltip.createTooltip(o,p)},1e3)}return o}function setEllipsis(e,t){var i=t.fontWeight+" "+t.fontSize+"px '"+t.font+"'";m.setSpanFont(i);m.setSpanHTML(e);e=m.reduceToFirst();if(m.countBlockLevelElements(e)>0){var n=document.createElement("div");n.innerHTML=e;var a=n.firstChild;if(a.tagName==="OL"||a.tagName==="UL"){a.firstChild.innerHTML+="..."}else{a.innerHTML+="..."}e=n.innerHTML}else{e+="..."}return e}function applyBiggestFontSize(e){var t=m.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 n=i;if(t){var a=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);n=d>n?d:n}else{for(var c=0;c<l.children.length;++c){var d=parseInt(l.children[c].style.fontSize);n=d>n?d:n}}}}e.style.fontSize=n+"px";if(t){var u=e.innerHTML;e.innerHTML=a;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 n=2;var a=[{x:t.position.x+n,y:Math.round(t.position.y+t.dimension.height/2)},{x:Math.round(t.dimension.width/2-n),y:Math.round(t.dimension.height/2-n+t.lineWidth)},{x:Math.round(t.dimension.width/2-n+t.lineWidth),y:2*n-t.dimension.height-t.lineWidth}];paintPath(t.id+"##tick",t.zIndex+1,a,null,"stroke",t.color.pattern,null,null,null,i,null,!t.edit,null)}G.push({groupId:i+"_"+e.getController().getRootModel().extensionHash+"_svg",toolTipModel:St["b"].DataObjects.InlineCommentRepo.getRepoAndRepresentationByViewModel(e).obj})};this.isEllipsis=function(e,t){var i,n=0,a;if("text"===e.tagName){a=e.style.fontWeight+" "+e.style.fontSize+" "+e.style.fontFamily;i=e.getComputedTextLength()}else{a="normal "+e.style.fontSize+" "+e.style.fontFamily;i=e.clientWidth;n=e.clientHeight}m.setSpanFont(a);m.setSpanHTML(t);var r=m.getSpanWidth();return r>i||n!==0&&r>n};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 n=t.position;var a={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!==E.AXIS){if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){paintSingleRect(t.id,o,n,a,"forecast",t.color,null,null,t.otherPattern,null,i)}else{var l=t.otherPattern===v.EMPTY?t.color.background:r?P:t.color.pattern;paintSingleRect(t.id,o,n,a,"fill",l,null,null,null,null,i)}paintSingleRect(t.id,t.zIndex,n,a,"stroke",r?P:t.color.border,null,null,null,null,i)}else{var l=r?P:t.color.border;paintSingleRect(t.id,o,n,a,"fill",l,null,null,null,null,i);paintSingleRect(t.id,t.zIndex,n,a,"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 n=Math.floor(i/2);var a=[];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-n;var d=l+n;if(t.value>=0){a=[{x:o,y:s},{x:r,y:l},{x:o,y:d},{x:o,y:s}]}else{a=[{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,a,"fill",c?P:t.color.pattern,null);paintSinglePolygonTable(t.id,t.zIndex,a,"stroke",c?P: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===E.AXIS||t.notation===E.HEADER){paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",P,null,null,null,null,i);paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",P,null,null,null,null,i)}else{if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var n={border:P,pattern:P,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",n,null,null,t.otherPattern,null,i)}else{var n=t.otherPattern===v.FILLED?P:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",n,null,null,t.otherPattern,null,i)}paintSingleRectTable(t.id,t.zIndex,t.position,t.dimension,"stroke",P,null,null,null,null,i)}}else{if(t.notation===E.AXIS||t.notation===E.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 n={border:t.color.border,pattern:t.color.pattern,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",n,null,null,t.otherPattern,null,i)}else{var n=t.otherPattern===v.FILLED?t.color.pattern:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",n,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 n=i.getRootModel();var a="";var r=isClickBehaviorEnabled(t);var o=t.id.split(".");var l=o[0];var s=St["b"].Factories.ModelFactory.getModelById(n,l);var d=s.extendedModel.expressions;for(var c=0;c<d.length;c++){if(t.dataId_expr===d[c].id.split(".").pop()){a=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((a===T.LINE||a===T.SYMBOL_LINE)&&t.isNextOutlier===false){var m=this.getLineChartCords(e,a);var h=t.zIndex-2;var f=u?P:t.color.pattern;if(t.dataType==="Actual"||t.concept==="conceptType.1"||t.dataType==="Budget"||t.dataType==="Forecast"){if(m.length===3){paintPolyLine(e.getId(),h,[m[1],m[0]],"stroke",f,p,g,null,null,null,null,r);paintPolyLine(e.getId(),h,[m[1],m[2]],"stroke",f,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),h,m[1],p/2,"fill",f,null,null,null,null,null,r)}else if(e.getNextPosition().x!==0){paintPolyLine(e.getId(),h,[m[0],m[1]],"stroke",f,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),h,m[0],p/2,"fill",f,null,null,null,null,null,r)}else if(e.getPreviousPosition().x!==0){paintPolyLine(e.getId(),h,[m[1],m[0]],"stroke",f,p,g,null,null,null,null,r);paintSingleCircle(e.getId(),h,m[1],p/2,"fill",f,null,null,null,null,null,r)}}}if(a!==T.LINE){selectRodHead(e,u)}}};this.paintLineChartTable=function(e){var t=e.getModel();var i=t.highlightedCompare||t.isHighlighted;var n=isClickBehaviorEnabled(t);if(t.isOutlier){paintOutlierTable(e)}else{if(t.lineWidth!==0){var a=this.getLineChartCordsTable(e);var r=i?P:t.color.pattern;paintPolyLine(t.id,t.zIndex-2,a,"stroke",r,t.lineWidth,t.lineStyle,null,null,null,null,n)}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 n=e.getPreviousPosition().y;var a=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);a+=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+a)/2+d/2),y:(n+r)/2+s/2},{x:parseInt(a+d/2),y:r+s/2},{x:parseInt((a+o)/2+d/2),y:(r+l)/2+s/2}]}else if(o!==0){t=[{x:parseInt(a+d/2),y:r+s/2},{x:parseInt((a+o)/2+d/2),y:(r+s+l)/2}]}else if(i!==0){t=[{x:parseInt((i+a)/2+d/2),y:(n+r)/2+s/2},{x:parseInt(a+d/2),y:r+s/2}]}return t};this.getLineChartCordsTable=function(e){var t=[];var i=e.getDimension().height/2+e.getPosition().y;var n=e.getModel().value<0?e.getPosition().x:e.getPosition().x+e.getDimension().width;var a=e.getPreviousPosition().x;var r=e.getNextPosition().x;if(a!==0&&r!==0){t=[{x:Math.floor((a+n)/2),y:Math.floor((e.getPreviousPosition().y+i)/2)},{x:n,y:Math.floor(i)},{x:Math.floor((r+n)/2),y:Math.floor((e.getNextPosition().y+i)/2)}]}else if(a!==0){t=[{x:Math.floor((a+n)/2),y:Math.floor((e.getPreviousPosition().y+i)/2)},{x:n,y:Math.floor(i)}]}else if(r!==0){t=[{x:n,y:Math.floor(i)},{x:Math.floor((r+n)/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 n={x1:i.position.x,y1:i.position.y,x2:i.position.x,y2:i.position.y+i.dimension.height};paintSingleLine(i.id,i.zIndex,n,i.color,i.dimension.width,i.id)}else{var a=e.getModel().representationId.split(".");var r=a[0];var o=e.getController().getRootModel();var l=St["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 m=e.getDimension();if(e.getModel().valueRowLabelPosition&&e.getModel().valueRowLabelPosition.split(".")[0].substr(0,4)==="Left"){if(p.x!=0&&p.y!=0){var h=p.x;if(d===T.LINE){h+=g}var f=e.getModel().labelEndPositionX;var v={x:f,y:cordCorrectionSVG(t.y)};var b={width:h-v.x,height:m.height};var n={x1:v.x,y1:v.y,x2:v.x+b.width,y2:v.y-1e-4};paintSingleLine(r+"."+e.getId(),e.getModel().zIndex,n,u,b.height,e.getId())}}else if(e.getModel().valueRowLabelPosition&&e.getModel().valueRowLabelPosition.split(".")[0].substr(0,5)==="Right"){var h=p.x;if(d===T.LINE){h=h+g/2}else{h=h+g}var f=e.getModel().labelEndPositionX;var v={x:f,y:cordCorrectionSVG(t.y)};var b={width:h-v.x,height:m.height};var n={x1:v.x,y1:v.y-.001,x2:v.x+b.width,y2:v.y};paintSingleLine(r+"."+e.getId(),e.getModel().zIndex,n,u,b.height,e.getId())}}}};function getConnectorColor(e){var t=ot["a"].colorActualBorder;var i=ot["a"].colorForecastBorder;var n=ot["a"].colorPreviousBorder;var a=e.getModel().concept;var r="";var o=e.getModel().dataType;var l=e.getModel().baseColorSettings;var s=St["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(a===p.AREA){if(o==="Actual"){r=t}else if(o==="dataType.2"){r="rgb(50,50,50)"}else if(o==="Budget"){r=n}else if(o==="Forecast"){r=i}}else if(a===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(a===p.AREA_SHAPE){if(o==="Actual"){r=t}else if(o==="Budget"){r=n}else if(o==="Forecast"){r=i}else if(o==="dataType.2"){r="black"}}else if(a===p.AREA_COLOR||a===p.AREA_COLOR_SHAPE||a===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 n={border:t.color.border,pattern:t.color.pattern,background:t.color.background};paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"forecast",n,null,null,t.otherPattern)}else{var n=t.otherPattern===v.FILLED?t.color.pattern:t.color.background;paintSingleRectTable(t.id+"_fill",t.zIndex-1,t.position,t.dimension,"fill",n)}}};this.paintNeedle=function(e){var t=e.getPosition();var i=e.getDimension();var n=e.getModel();if(n.isNaN){return}var a=isClickBehaviorEnabled(n);var r=n.highlightedCompare||n.isHighlighted;if(n.isOutlier===true){paintOutlierTable(e)}else{var o=n.lineWidth;if(n.valueType==="FACTOR_NONE"){o=0}var l=n.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(n.id+"_line",n.zIndex-2,c,r?P:"rgb(0,0,0)",o,null,a);if(n.value>=0){n.needlepos.x=t.x+i.width-Math.floor(s)}else{n.needlepos.x=t.x-Math.round(s)}n.needlepos.y=t.y+Math.round(i.height/2-l/2);n.needledim.height=l;n.needledim.width=l;selectRodHeadTable(e,r)}};function drawShapeForConceptShape(e,t,i,n,a){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,n,2,null,t,a,o);break;case g.TRIANGLE:drawPinTriColored(s,d,i,n,null,l,t,a,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,n,2,45,t,a,o);break;case g.CIRCLE:drawPinRoundColored(s,d,i,n,2,t,a,o)}}this.paintRod=function(e){var t=e.getModel();if(t.isNaN){return}var i=t.highlightedCompare||t.isHighlighted;var n=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 a={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,a,i?P:"rgb(0,0,0)",t.lineDim.width,null,n);selectRodHead(e,i)}};function selectRodHead(e,t){var i=e.getModel();var n=i.dataType;var a=i.shapeSymbol;var r=i.needleSize!==undefined&&i.needleSize!==null?i.needleSize:i.dimension.width;if(i.zIndex<=200){i.zIndex+=200}drawShapeForConceptShape(a,e,r,n,t)}function selectRodHeadTable(e,t){var i=e.getModel();var n=i.needlepos;if(i.zIndex<=200){i.zIndex+=200}switch(i.shapeSymbol){case g.SQUARE:drawPinQuadColoredTable(n.x,n.y,0,e,t);break;case g.DIAMOND:drawPinQuadColoredTable(n.x,n.y,45,e,t);break;case g.TRIANGLE:drawPinTriColoredTable(n.x,n.y,0,e,t);break;case g.CIRCLE:drawPinRoundColoredTable(n.x,n.y,i.needleSize,e,t)}}function drawPinRoundColoredTable(e,t,i,n,a){var r=n.getModel();var o=isClickBehaviorEnabled(r);var l=a?P:r.color.pattern;var s=a?P:r.color.border;var d={x:e+i/2,y:t+i/2};var c=r.notation;var u=c===E.ELEMENT||c===E.ELEMENT_HEADER||c===E.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,n,a){var r=n.getModel();var o=isClickBehaviorEnabled(r);var l=r.zIndex;var s=a?P:r.color.pattern;var d=a?P:r.color.border;var c={x:e,y:t};var u=r.notation;var p=u===E.ELEMENT||u===E.ELEMENT_HEADER||u===E.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 n={width:t.dimension.width>=1?t.dimension.width-1:0,height:t.dimension.height>=1?t.dimension.height-1:0};var a=isClickBehaviorEnabled(t);var r=t.highlightedCompare||t.isHighlighted;t.color["highlight"]=r?true:false;var o=r?P:t.color.border;var l=r?P:t.color.pattern;var s=t.concept;var d=t.notation;if(t.isOutlier===true){calcOutlier(e,d,t.isAxisNotationAndCorrectPosition,r)}else if(n.width>.5||n.width<-.5){var c=t.zIndex+1;if(d===E.AXIS){paintSingleRect(e.getId(),t.zIndex,i,n,"fill",r?P: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,n,"stroke",o,null,null,null,null,a);if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){paintSingleRect(e.getId(),t.zIndex,i,n,"forecast",t.color,null,null,t.otherPattern,null,a)}else{var u=t.otherPattern===v.FILLED?l:t.color.background;paintSingleRect(e.getId(),t.zIndex,i,n,"fill",u,null,null,null,null,a)}}else{paintSingleRect(e.getId(),c,i,n,"stroke",o,null,null,null,null,a);paintSingleRect(e.getId(),t.zIndex,i,n,"fill",l,null,null,null,null,a)}}}};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 n,a;if(t.highlightedCompare||t.isHighlighted){n=a=P}else{n=t.color.pattern;a=t.color.border}var r=t.position;var o=t.dimension;if((t.notation===E.ELEMENT||t.notation===E.ELEMENT_HEADER||t.notation===E.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",a,null,null,null,null,i);if(t.otherPattern!==v.FILLED&&t.otherPattern!==v.EMPTY){var l={border:a,pattern:n,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?n: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",n,null,null,null,null,i);paintSingleRectTable(t.id,t.zIndex+1,r,o,"stroke",a,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 n={x:t.position.x,y:t.dimension.height>=0?t.position.y:t.position.y+t.dimension.height};paintSingleRect(t.id,1,n,i,"fill",t.areaColor);var a={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,a,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 n=Math.abs(t.dimension.width);var a=t.dimension.width>=0?t.position.x:t.position.x-n;var r={width:n,height:t.dimension.height};var o={x:a,y:t.position.y};paintSingleRectTable(t.id,t.zIndex+i,o,r,"fill",t.areaColor);var l=Math.floor(t.lineWidth/2);var a=t.position.x+t.dimension.width-l;var s={x1:a,y1:t.position.y,x2:a,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 n=i.position.x;var a=i.position.y;if(i.orientation==="vertical"){if(i.id.substr(-3)==="pos"){t={x1:n-i.dimension.width+1,y1:i.position.y,x2:n-i.dimension.width+1,y2:i.position.y+i.dimension.height}}else{t={x1:n,y1:i.position.y,x2:n,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:n,y:a},{x:n+r,y:a-i.arrowHeight},{x:n-r,y:a-i.arrowHeight},{x:n,y:a}]}else{var o=a+i.dimension.height-1;t=[{x:n,y:o},{x:n+r,y:o+i.arrowHeight},{x:n-r,y:o+i.arrowHeight},{x:n,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);a=a+Math.floor(i.dimension.height/2);if(i.arrowPosition==="Start"){t=[{x:n,y:a},{x:n-i.arrowWidth,y:a-l},{x:n-i.arrowWidth,y:a+l},{x:n,y:a}]}else{var s=n+i.dimension.width-1;t=[{x:s,y:a},{x:s+i.arrowWidth,y:a-l},{x:s+i.arrowWidth,y:a+l},{x:s,y:a}]}paintSinglePolygonTable(i.id+"_arrow",i.zIndex,t,"fill",i.color,null,i.id+"_arrow")}};function paintSingleLine(e,t,i,n,a,r,o){if(n===undefined||n===null){n="rgb(250,0,120)"}var l=rgb2hex(n);n=l.color;var s={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2};if(s.x1===s.x2){s.x1+=a/2;s.x2+=a/2}else if(s.y1===s.y2){s.y1+=a/2;s.y2+=a/2}var d=document.createElementNS("http://www.w3.org/2000/svg","line");d.setAttributeNS(null,"stroke-width",a);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",n);d.id=e;if(o){d.style.cursor="pointer"}addToElementsBuffer(d,t)}function paintSingleLineCentered(e,t,i,n,a,r,o){if(n===undefined||n===null){n="rgb(250,0,120)"}var l=rgb2hex(n);n=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",a);p.setAttributeNS(null,"x1",s);p.setAttributeNS(null,"y1",c);p.setAttributeNS(null,"x2",d);p.setAttributeNS(null,"y2",u);p.setAttributeNS(null,"stroke",n);p.id=e;if(o){p.style.cursor="pointer"}addToElementsBuffer(p,t)}function paintSinglePolygon(e,t,i,n,a,r,o,l,s,d,c){if(n!=="forecast"){if(a===undefined||a===null){a="rgb(250,0,120)"}var u=rgb2hex(a);a=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(n==="stroke"){var g=[0,0];if(r==="line1"||r==="1"||r===x.SOLID){g=[-1,-1]}else if(r==="line2"||r===x.DASHED){g=[4,4]}else if(r==="line3"||r===x.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",a);if(s!==null&&s!==undefined){p.setAttributeNS(null,"stroke-width",s)}p.setAttributeNS(null,"fill","none")}else if(n==="fill"){if(u.alpha!==undefined&&u.alpha!==null){p.setAttributeNS(null,"fill-opacity",u.alpha)}p.setAttributeNS(null,"fill",a)}var m="";if(d){for(var h=0;h<i.length;h++){m+=i[h].x+","+i[h].y+","}}else{for(var h=0;h<i.length;h++){m+=cordCorrectionSVG(i[h].x)+","+cordCorrectionSVG(i[h].y)+","}}m=m.substr(0,m.length-1);p.setAttributeNS(null,"points",m);if(c){var f=document.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=c;p.appendChild(f)}if(o!==null&&o!==undefined){addToGroupsBuffer(o,p,t)}else{addToElementsBuffer(p,t)}}function paintSinglePolygonTable(e,t,i,n,a,r,o,l,s){if(n!=="forecast"){var d=rgb2hex(a);a=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(n==="stroke"){var u=[0,0];if(r==="line1"||r==="1"||r===x.SOLID){u=[-1,-1]}else if(r==="line2"||r===x.DASHED){u=[10,4]}else if(r==="line3"||r===x.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",a);if(s!==null&&s!==undefined){c.setAttributeNS(null,"stroke-width",s)}c.setAttributeNS(null,"fill","none")}else if(n==="fill"){if(d.alpha!==undefined&&d.alpha!==null){c.setAttributeNS(null,"fill-opacity",d.alpha)}c.setAttributeNS(null,"fill",a)}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,n,a,r,o,l,s,d,c){if(n==0){return}if(a!=="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(a==="stroke"){p.setAttributeNS(null,"stroke",r);p.setAttributeNS(null,"fill","none");if(c!==null&&c!==undefined){p.setAttributeNS(null,"stroke-width",c)}}else if(a==="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",n);if(d!==null&&d!==undefined){addToGroupsBuffer(d,p,t)}else{addToElementsBuffer(p,t)}}function paintSingleCircle(e,t,i,n,a,r,o,l,s,d,c,u,p){if(n==0){return}if(a!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}var m=document.createElementNS("http://www.w3.org/2000/svg","circle");m.id=e;if(u){m.style.cursor="pointer"}if(a==="stroke"){m.setAttributeNS(null,"stroke",r);if(c!==null&&c!==undefined){m.setAttributeNS(null,"stroke-width",c)}m.setAttributeNS(null,"fill","none")}else if(a==="fill"){if(g.alpha!==undefined&&g.alpha!==null){m.setAttributeNS(null,"fill-opacity",g.alpha)}m.setAttributeNS(null,"fill",r)}else if(a==="forecast"){var h=Math.random();createOtherPattern("forecast","2",r,e+h,l,s);m.setAttributeNS(null,"fill","url('"+C+"#"+e+h+"')")}else if(a==="clip"||a==="clear"){var f=document.createElementNS("http://www.w3.org/2000/svg","clipPath");f.id="clip"+e}m.setAttributeNS(null,"cx",cordCorrectionSVG(i.x));m.setAttributeNS(null,"cy",cordCorrectionSVG(i.y));m.setAttributeNS(null,"r",n);if(e.indexOf("object")!==-1&&e.indexOf("commentReference")!==-1){return m}if(d!==null&&d!==undefined){addToGroupsBuffer(d,m,t)}else{if(f!==undefined&&f!==null){f.appendChild(m);addToElementsBuffer(f,t)}else{addToElementsBuffer(m,t)}}}function paintPolyLine(e,t,i,n,a,r,o,l,s,d,c,u){if(i.length===0){return}if(a===undefined||a===null){a="rgb(250,0,120)"}var p=rgb2hex(a);a=p.color;var g=document.createElementNS("http://www.w3.org/2000/svg","polyline");g.id=e;if(u){g.style.cursor="pointer"}if(n==="stroke"){var m=[0,0];if(o==="line1"||o==="1"||o===x.SOLID){m=[-1,-1]}else if(o==="dashed"||o===x.DASHED){m=[10,4]}else if(o==="dotted"||o===x.DOTTED){m=[1,2]}else if(o==="line4"){m=[1,1,1,1]}if(m[0]>0&&m[1]>0){g.setAttributeNS(null,"stroke-dasharray",m)}g.setAttributeNS(null,"stroke",a);g.setAttributeNS(null,"stroke-width",r);g.setAttributeNS(null,"fill","none")}else if(n==="fill"){g.setAttributeNS(null,"fill",a);if(p.alpha!==undefined&&p.alpha!==null){g.setAttributeNS(null,"fill-opacity",p.alpha)}}else if(n==="forecast"){var h=Math.random();createOtherPattern("forecast","2",a,e+h,null,c);g.setAttributeNS(null,"fill","url('"+C+"#"+e+h+"')")}if(s!==null&&s!==undefined){var f="";for(var v=0;v<s.length-1;v++){f+=s[v]+","}f+=s[s.length-1];g.setAttributeNS(null,"stroke-dasharray",f)}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,n,a,r,o,l,s,d){var c=rgb2hex(a);a=c.color;var u=document.createElementNS("http://www.w3.org/2000/svg","polyline");u.id=e;if(n==="stroke"){var p=[0,0];if(o==="line1"||o==="1"||o===x.SOLID){p=[-1,-1]}else if(o==="dashed"||o===x.DASHED){p=[10,4]}else if(o==="dotted"||o===x.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",a);u.setAttributeNS(null,"stroke-width",r);u.setAttributeNS(null,"fill","none")}else if(n==="fill"){u.setAttributeNS(null,"fill",a);if(c.alpha!==undefined&&c.alpha!==null){u.setAttributeNS(null,"fill-opacity",c.alpha)}}if(s!==null&&s!==undefined){var g="";for(var m=0;m<s.length-1;m++){g+=s[m]+","}g+=s[s.length-1];u.setAttributeNS(null,"stroke-dasharray",g)}if(d===true){u.setAttributeNS(null,"stroke-linecap","round")}var h="";for(var m=0;m<i.length;m++){h+=i[m].x+.5+","+(i[m].y+.5)+","}h=h.substr(0,h.length-1);u.setAttributeNS(null,"points",h);if(l!==null&&l!==undefined){addToGroupsBuffer(l,u,t)}else{addToElementsBuffer(u,t)}}function paintSingleEllipse(e,t,i,n,a,r,o,l,s){if(i.length===0){return}if(a===undefined||a===null){a="rgb(250,0,120)"}var d=rgb2hex(a);a=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(n==="stroke"){var u=[0,0];if(r==="line1"||r==="1"||r===x.SOLID){u=[-1,-1]}else if(r==="line2"||r===x.DASHED){u=[10,4]}else if(r==="line3"||r===x.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",a);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(n==="fill"){c.setAttributeNS(null,"fill",a);if(d.alpha!==undefined&&d.alpha!==null){c.setAttributeNS(null,"fill-opacity",d.alpha)}}else if(n==="forecast"){var p=Math.random();createOtherPattern("forecast","2",a,e+p,null,s);c.setAttributeNS(null,"fill","url('"+C+"#"+e+p+"')")}var g=cordCorrectionSVG(i.cx);var m=cordCorrectionSVG(i.cy);var h=cordCorrectionSVG(i.rx);var f=cordCorrectionSVG(i.ry);if(h%1!==0&&g%1!==0){g=parseInt(g)}c.setAttributeNS(null,"cx",g);c.setAttributeNS(null,"cy",m);c.setAttributeNS(null,"rx",h);c.setAttributeNS(null,"ry",f);if(o!==null&&o!==undefined){addToGroupsBuffer(o,c,t)}else{addToElementsBuffer(c,t)}}function paintSingleRect(e,t,i,n,a,r,o,l,s,d,c,u,p){if(n.width==0||n.height==0){return}if(a!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}if(n.width<0){i.x+=n.width;n.width=-n.width}if(n.height<0){i.y+=n.height;n.height=-n.height}var m=document.createElementNS("http://www.w3.org/2000/svg","rect");m.id=e;if(c){m.style.cursor="pointer"}if(a==="stroke"){var h=[0,0];if(o==="line1"||o==="1"||o===x.SOLID){h=[-1,-1]}else if(o==="line2"||o===x.DASHED){h=[10,4]}else if(o==="line3"||o===x.DOTTED){h=[6,2,6,4]}else if(o==="line4"){h=[1,1,1,1]}if(h[0]>0&&h[1]>0){m.setAttributeNS(null,"stroke-dasharray",h)}m.setAttributeNS(null,"stroke-width","1");m.setAttributeNS(null,"stroke",r);m.setAttributeNS(null,"fill","none")}else if(a==="fill"){if(g.alpha!==undefined&&g.alpha!==null){m.setAttributeNS(null,"fill-opacity",g.alpha)}m.setAttributeNS(null,"fill",r)}else if(a==="forecast"){var f=Math.random();createOtherPattern("forecast","2",r,e+f,l,s);m.setAttributeNS(null,"fill","url('"+C+"#"+e+f+"')")}else if(a==="clip"||a==="clear"){var v=document.createElementNS("http://www.w3.org/2000/svg","clipPath");v.id="clip"+e}m.setAttributeNS(null,"width",dimCorrectionSVG(n.width));m.setAttributeNS(null,"height",dimCorrectionSVG(n.height));if(n.width>1){m.setAttributeNS(null,"x",cordCorrectionSVG(i.x));m.setAttributeNS(null,"y",cordCorrectionSVG(i.y));if(a==="fill"){m.setAttributeNS(null,"width",dimCorrectionSVG(n.width)-1);m.setAttributeNS(null,"height",dimCorrectionSVG(n.height)-1);m.setAttributeNS(null,"x",cordCorrectionSVG(i.x)+.5);m.setAttributeNS(null,"y",cordCorrectionSVG(i.y)+.5)}}else{m.setAttributeNS(null,"x",dimCorrectionSVG(i.x));m.setAttributeNS(null,"y",dimCorrectionSVG(i.y))}if(l!==undefined&&l!==null){var b="rotate("+l+","+cordCorrectionSVG(i.x+n.width/2)+","+cordCorrectionSVG(i.y+n.height/2)+")";m.setAttributeNS(null,"transform",b)}if(u!=null){var T=document.createElementNS("http://www.w3.org/2000/svg","title");T.textContent=u;m.appendChild(T)}if(p){for(var E in p){m["on"+E]=p[E]}}if(d!==null&&d!==undefined){addToGroupsBuffer(d,m,t)}else if(v!==undefined&&v!==null){v.appendChild(m);addToElementsBuffer(v,t)}else{addToElementsBuffer(m,t)}}function paintSingleRectTable(e,t,i,n,a,r,o,l,s,d,c,u){if(n.width<=0||n.height<=0){return}else if(n.width===1){var p=a==="forecast"?r.border:r;var g={x1:i.x,y1:i.y,x2:i.x,y2:i.y+n.height};paintSingleLine(e,t,g,p,n.width,e)}else if(n.width===1||n.height===1){var p=a==="forecast"?r.border:r;var g={x1:i.x,y1:i.y,x2:i.x+n.width,y2:i.y};paintSingleLine(e,t,g,p,n.height,e)}if(a!=="forecast"&&r!=="none"){if(r===undefined||r===null){r="rgb(250,0,120)"}var m=rgb2hex(r);r=m.color}var h=document.createElementNS("http://www.w3.org/2000/svg","rect");if(e.indexOf("compare")!==-1){h.style.cursor="pointer"}h.id=e;if(c){h.style.cursor="pointer"}if(a==="stroke"){var f=[0,0];if(o==="line1"||o==="1"||o===x.SOLID){f=[-1,-1]}else if(o==="line2"||o===x.DASHED){f=[10,4]}else if(o==="line3"||o===x.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(a==="fill"){if(m.alpha!==undefined&&m.alpha!==null){h.setAttributeNS(null,"fill-opacity",m.alpha)}h.setAttributeNS(null,"fill",r)}else if(a==="forecast"){var v=Math.random();createOtherPattern("forecast","2",r,e+v,l,s,true);h.setAttributeNS(null,"fill","url('"+C+"#"+e+v+"')")}else if(a==="clip"||a==="clear"){var b=document.createElementNS("http://www.w3.org/2000/svg","clipPath");b.id="clip"+e}h.setAttributeNS(null,"width",n.width-1);h.setAttributeNS(null,"height",n.height-1);h.setAttributeNS(null,"x",i.x+.5);h.setAttributeNS(null,"y",i.y+.5);if(l!==undefined&&l!==null){h.setAttributeNS(null,"transform","rotate("+l+","+(i.x+.5+n.width/2)+","+(i.y+.5+n.height/2)+")")}if(u!=null){var T=document.createElementNS("http://www.w3.org/2000/svg","title");T.textContent=u;h.appendChild(T)}if(d!==null&&d!==undefined){addToGroupsBuffer(d,h,t)}else if(b!==undefined&&b!==null){b.appendChild(h);addToElementsBuffer(b,t)}else{addToElementsBuffer(h,t)}}function paintPath(e,t,i,n,a,r,o,l,s,d,c,u,p){if(i.length===0){return}if(a!=="forecast"){if(r===undefined||r===null){r="rgb(250,0,120)"}var g=rgb2hex(r);r=g.color}var m=document.createElementNS("http://www.w3.org/2000/svg","path");m.id=e;if(u){m.style.cursor="pointer"}if(a==="stroke"){var h=[0,0];if(o==="line1"||o==="1"||o===x.SOLID){h=[-1,-1]}else if(o==="line2"||o===x.DASHED){h=[10,4]}else if(o==="line3"||o===x.DOTTED){h=[6,2,6,4]}else if(o==="line4"){h=[1,1,1,1]}if(h[0]>0&&h[1]>0){m.setAttributeNS(null,"stroke-dasharray",h)}if(c!==null&&c!==undefined){m.setAttributeNS(null,"stroke-width",c)}else{m.setAttributeNS(null,"stroke-width","1")}m.setAttributeNS(null,"stroke",r);m.setAttributeNS(null,"fill","none")}else if(a==="fill"){m.setAttributeNS(null,"fill",r);if(g.alpha!==undefined&&g.alpha!==null){m.setAttributeNS(null,"fill-opacity",g.alpha)}}else if(a==="forecast"){var f=Math.random();createOtherPattern("forecast","2",r,e+f,null,s);m.setAttributeNS(null,"fill","url('"+C+"#"+e+f+"')")}else if(a==="clip"||a==="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}m.setAttributeNS(null,"d",b);if(l!==undefined&&l!==null){m.setAttributeNS(null,"transform","rotate("+l+","+Math.round(n.x)+","+Math.round(n.y)+")")}if(p){var E=document.createElementNS("http://www.w3.org/2000/svg","title");E.textContent=p;m.appendChild(E)}if(d!==null&&d!==undefined){addToGroupsBuffer(d,m,t)}else if(v!==undefined&&v!==null){v.appendChild(m);addToElementsBuffer(v,t)}else{addToElementsBuffer(m,t)}return m}function drawPinRoundColored(e,t,i,n,a,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?P:s.color.pattern;var g=o?P:s.color.border;paintSingleCircle(r.getId(),s.zIndex,u,i/2,"stroke",g,null,null,null,null,null,l);if(s.notation===E.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,n,a,r,o,l,s){var d=o.getModel();var c={x:e,y:t};var u={width:i,height:i};var p=l?P:d.color.pattern;var g=l?P:d.color.border;paintSingleRect(o.getId(),d.zIndex,c,u,"stroke",g,null,r,null,null,s);if(d.notation===E.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,n,a,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 m={x:p+c/2+1,y:u+c/2};var h=l?P:d.color.pattern;var f=l?P:d.color.border;paintPath(o.getId(),d.zIndex,g,m,"stroke",f,null,-90+r,null,null,null,s);if(d.notation===E.AXIS){paintPath(o.getId(),d.zIndex-1,g,m,"fill",h,null,-90+r,null,null,null,s)}else{if(d.otherPattern!==v.FILLED&&d.otherPattern!==v.EMPTY){paintPath(o.getId(),d.zIndex-1,g,m,"forecast",d.color,null,-90+r,d.otherPattern,null,null,s)}else{var f=d.otherPattern===v.FILLED?h:d.color.background;paintPath(o.getId(),d.zIndex-1,g,m,"fill",f,null,-90+r,null,null,null,s)}}}function drawPinTriColoredTable(e,t,i,n,a){var r=n.getModel();var o=isClickBehaviorEnabled(r);var l=r.needleSize*1.1;var s;var d=a?P:r.color.pattern;var c=a?P: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===E.ELEMENT||p===E.ELEMENT_HEADER||p===E.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,n){var a=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=a.x+parseInt(r.width/2)-parseInt(o/2);var s=a.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,n)}function paintOutlier(e,t,i,n,a,r,o,l,s){if(n.height===0||n.width===0){return}var d;var c=n.height;var u;var p=n.width;if(p<0){p=-p}var g=s?P:l.pattern;var m=s?P:l.border;var h;if(o==="vertical"){h=lt["a"].mm2pix(R.getParameter("MMPT_TIME_OUTLIER_DISTANCE")*S)}else{h=lt["a"].mm2pix(R.getParameter("MMPT_STRUCTURE_OUTLIER_DISTANCE")*S)}var f=[];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 E=0;var x=0;var C=0;var y=0;var M=0;if(o=="vertical"){if(a===true){x=i.y-h;y=x;C=x-c}else{x=i.y+h;y=x+c;C=x}b=i.x;E=b;T=parseInt(b+p);M=parseInt(b+p/2)}else if(o==="horizontal"){if(a===true){b=i.x+h+2;T=b+c;E=b}else{b=i.x-h;T=b;E=b-c}x=i.y;C=x-2;y=C+n.height;M=(C+y)/2}if(a===true){if(o=="vertical"){f=[{x:E,y:y},{x:M,y:C},{x:T,y:y},{x:E,y:y}];paintSinglePolygon(t,e,f,"stroke",m,null);paintSinglePolygon(t,e-1,f,"fill",g,null)}else if(o==="horizontal"){f=[{x:E,y:C},{x:T,y:M},{x:E,y:y},{x:E,y:C}];paintSinglePolygon(t,e,f,"stroke",m,null);paintSinglePolygon(t,e-1,f,"fill",g,null)}}else{if(o=="vertical"){f=[{x:E,y:C},{x:M,y:y},{x:T,y:C},{x:E,y:C}];paintSinglePolygon(t,e,f,"stroke",m,null);paintSinglePolygon(t,e-1,f,"fill",g,null)}else if(o==="horizontal"){f=[{x:T,y:C},{x:E,y:M},{x:T,y:y},{x:T,y:C}];paintSinglePolygon(t,e,f,"stroke",m,null);paintSinglePolygon(t,e-1,f,"fill",g,null)}}}}this.paintCompare=function(e){var t=e.getModel();if(t.active===false){return}var i=ot["a"].colorCompareLine,n=ot["a"].colorCompareText,a=e.getPosition(),r=e.getDimension(),o=St["b"].Utils.Constants.TypeValues.indicator,l=St["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 m=a.y+Math.round(r.height/2);var h;var f=t.positive?0:180;h=getCompareColor(t,o);var v=t.headBaseSize;var b=t.headWidth;var T=t.headLength;var E=[{x:u,y:c},{x:u,y:m}];paintPolyLineTable(t.id,t.zIndex,E,"stroke",i,"1","",s);var E=[{x:g,y:p},{x:g,y:m}];paintPolyLineTable(t.id,t.zIndex,E,"stroke",i,"1","",s);var x=(u+g)/2;var C=t.compareStyle;if(C===o.NOTATION){C=R.getParameter("COMPARE_DEFAULT_TYPE")}if(C===o.ARROW){if(t.arrowType==0){this.paintPixelArrow(e,h,x,m,r.width,v,T,b,f,s)}else{if(t.arrowType==1){this.paintPixelArrow(e,h,x,m,r.width,v,T,b,f,s)}else{this.paintPixelArrow(e,h,x,m,r.width,v,0,0,f,s)}}}else{var y={width:r.width,height:v};var M={x:a.x+.5,y:m-Math.round(v/2)};paintSingleRectTable("pinCompare."+t.id,t.zIndex,M,y,"fill",h,null,null,null,s)}if(t.compareConnector===l.CIRCLE){var S=m;var C=t.compareStyle;if(C===o.NOTATION){C=R.getParameter("COMPARE_DEFAULT_TYPE")}if(C!==o.ARROW){S=m-Math.round(v/2)+v/2}paintCircleConnector(t,S,p,g,c,u,s)}else if(t.compareConnector===l.TRIANGLE){paintTriangleConnector(t,a,r,s,u,c,g,p,f)}if(t.ellipse===true){var O=t.ellipseArray.x;var L=t.ellipseArray.y;var A=t.ellipseArray.height;var _=t.ellipseArray.width;this.paintEllipse(e,O,L,_/2,A*N,w,true,t.ellipseStrokeWidth,s,t.zIndex+10)}if(t.absolute.legend!==o.NONE){var y={height:t.font.fSize,width:t.absolute.dimension.width};var M={x:t.absolute.position.x,y:t.absolute.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".absolute",t.zIndex+10,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}M={x:t.absolute.position.x,y:t.absolute.position.y};paintText(t.id+".absolute",t.zIndex+20,M,y,t.absolute.text,d,n,null,s)}if(t.percent.legend!==o.NONE){var y={height:t.font.fSize,width:t.percent.dimension.width};var M={x:t.percent.position.x,y:t.percent.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".percent",t.zIndex+10,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}M={x:t.percent.position.x,y:t.percent.position.y};paintText(t.id+".percent",t.zIndex+20,M,y,t.percent.text,d,n,null,s)}if(t.text.legend!==o.NONE&&t.text.text!==""){var y={height:t.font.fSize,width:t.text.dimension.width};var M={x:t.text.position.x,y:t.text.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".text",t.zIndex+10,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,s)}M={x:t.text.position.x,y:t.text.position.y};paintText(t.id+".text",t.zIndex+20,M,y,t.text.text,d,n,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,P,false,t.ellipseStrokeWidth,s,t.zIndex)}}};function setHighlightEllipse(e){var t=e.getModel();var i=[];var n=St["b"].Utils.Constants.TypeValues.indicator;if(t.text.isHighlighted&&t.text.legend!==n.NONE&&t.text.text!==""){var a={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};a.x=t.text.position.x+t.text.dimension.width/2;a.y=t.text.position.y+t.text.dimension.height/2-1;a.width=t.text.dimension.width*b;a.realWidth=t.text.dimension.width;a.height=t.text.dimension.height*N;a.realHeight=t.text.dimension.height;a.type=n.TEXT;a.pos=t.text.legend;i.push(a)}if(t.absolute.isHighlighted&&t.absolute.legend!==n.NONE){var a={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};a.x=t.absolute.position.x+t.absolute.dimension.width/2;a.y=t.absolute.position.y+t.absolute.dimension.height/2-1;a.width=t.absolute.dimension.width*b;a.realWidth=t.absolute.dimension.width;a.height=t.absolute.dimension.height*N;a.realHeight=t.absolute.dimension.height;a.type=n.ABSOLUTE;a.pos=t.absolute.legend;i.push(a)}if(t.percent.isHighlighted&&t.percent.legend!==n.NONE){var a={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null,pos:null};a.x=t.percent.position.x+t.percent.dimension.width/2;a.y=t.percent.position.y+t.percent.dimension.height/2-1;a.width=t.percent.dimension.width*b;a.realWidth=t.percent.dimension.width;a.height=t.percent.dimension.height*N;a.realHeight=t.percent.dimension.height;a.type=n.PERCENT;a.pos=t.percent.legend;i.push(a)}function intersect(e,t,i,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}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 a={x:0,y:0,width:0,height:0,realWidth:0,realHeight:0,type:null};a.x=(l.x+s.x)/2;a.y=l.y<s.y?l.y+s.realHeight/2:s.y+l.realHeight/2;a.realWidth=Math.max(l.realWidth,s.realWidth);a.realHeight=l.realHeight+s.realHeight;a.width=a.realWidth*b;a.height=a.realHeight*N;i.splice(o,1);o=0;i.splice(r,1);r=0;i.push(a)}}}return i}function paintCircleConnector(e,t,i,n,a,r,o){var l={x:n,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:a};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:n,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,n,a,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 m=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{var m=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,n);paintSinglePolygonTable(e.id,e.zIndex+2,m,"stroke",e.compareConnectorBorderColor,"solid",n,null,e.compareConnectorBorderSize);g=Math.round(t.x-e.compareConnectorSize+i.width);u=Math.round(t.x+e.compareConnectorSize+i.width);if(s===180){m=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{m=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,n);paintSinglePolygonTable(e.id,e.zIndex+2,m,"stroke",e.compareConnectorBorderColor,"solid",n,null,e.compareConnectorBorderSize);c=Math.round(r-e.compareConnectorSize/2);p=Math.round(r+e.compareConnectorSize/2);g=Math.round(a-e.compareConnectorSize);u=Math.round(a+e.compareConnectorSize);d=r;if(s===180){m=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{m=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,null);paintSinglePolygonTable(e.id,e.zIndex+2,m,"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){m=[{x:u,y:c},{x:u,y:p},{x:g,y:d},{x:u,y:c}]}else{m=[{x:g,y:c},{x:g,y:p},{x:u,y:d},{x:g,y:c}]}paintSinglePolygonTable(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,null);paintSinglePolygonTable(e.id,e.zIndex+2,m,"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 n=ot["a"].colorCompareText;var a=e.getPosition();var r=e.getDimension();var o=St["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=a.x+r.width/2;var m;var h=t.positive?90:270;m=getCompareColor(t,o);var f=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 E=a.y+t.preferredDimension.height/2;var x=t.compareStyle;if(x===o.NOTATION){x=R.getParameter("COMPARE_DEFAULT_TYPE")}if(x===o.ARROW){if(t.arrowType==0){this.paintPixelArrow(e,m,g,E,r.height,f,b,v,h,l)}else{var C=0;if(t.arrowType==1){this.paintPixelArrow(e,m,g,E+C,r.height,f,b,v,h,l)}else{this.paintPixelArrow(e,m,g,E+C,r.height,f,0,0,h,l)}}}else{var y={width:f,height:r.height};var M={x:g-f/2,y:a.y};paintSingleRect("pinCompare."+t.id,t.zIndex,M,y,"fill",m,null,null,null,l)}if(t.compareConnector==="circle"){paintCircleConnectorTime(t,g+.5,c,d,p,u,l)}else if(t.compareConnector==="triangle"){paintTriangleConnectorTime(t,a,r,l,parseFloat(d),parseFloat(c),parseFloat(u),parseFloat(p),h)}if(t.ellipse===true){for(var S=0;S<t.ellipseArray.length;S++){var O=t.ellipseArray[S].x;var L=t.ellipseArray[S].y-1;var A=t.ellipseArray[S].height;var _=t.ellipseArray[S].width;this.paintEllipse(e,O,L,_/2,A*N,w,true,t.ellipseStrokeWidth,l,t.zIndex+20)}}if(t.absolute.legend!==o.NONE){var y={height:t.font.fSize,width:t.absolute.dimension.width};var M={x:t.absolute.position.x,y:t.absolute.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".absolute",t.zIndex+20,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}M={x:t.absolute.position.x,y:t.absolute.position.y};paintText(t.id+".absolute",t.zIndex+30,M,y,t.absolute.text,s,n,null,l)}if(t.percent.legend!==o.NONE){var y={height:t.font.fSize,width:t.percent.dimension.width};var M={x:t.percent.position.x,y:t.percent.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".percent",t.zIndex+20,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}M={x:t.percent.position.x,y:t.percent.position.y};paintText(t.id+".percent",t.zIndex+30,M,y,t.percent.text,s,n,null,l)}if(t.text.legend!==o.NONE&&t.text.text!==""){var y={height:t.font.fSize,width:t.text.dimension.width};var M={x:t.text.position.x,y:t.text.position.y-1.5};if(t.ellipse===false){paintSingleRect(t.id+".text",t.zIndex+20,M,y,"fill","rgb(255,255,255,0.7)","solid",0,null,l)}M={x:t.text.position.x,y:t.text.position.y};paintText(t.id+".text",t.zIndex+30,M,y,t.text.text,s,n,null,l)}if(t.absolute.isHighlighted||t.text.isHighlighted||t.percent.isHighlighted){var I=setHighlightEllipse(e);for(var S=0;S<I.length;S++){this.paintEllipse(e,I[S].x,I[S].y,I[S].width,I[S].height,P,false,t.ellipseStrokeWidth,l,t.zIndex)}}};function paintTriangleConnectorTime(e,t,i,n,a,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 m=[{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 m=[{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,m,"fill",e.compareConnectorColor,null,n,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,m,"stroke",e.compareConnectorBorderColor,"solid",n,null,e.compareConnectorBorderSize,true);c+=i.height;p+=i.height;if(s===270){m=[{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)},{x:cordCorrectionSVG(u),y:cordCorrectionSVG(c)},{x:d,y:cordCorrectionSVG(p)},{x:cordCorrectionSVG(g),y:cordCorrectionSVG(c)}]}else{m=[{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,m,"fill",e.compareConnectorColor,null,n,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,m,"stroke",e.compareConnectorBorderColor,"solid",n,null,e.compareConnectorBorderSize,true);c=Math.round(r-e.compareConnectorSize);c=cordCorrectionSVG(c);u=Math.round(a+e.compareConnectorSize/2);u=cordCorrectionSVG(u);p=Math.round(r+e.compareConnectorSize);p=cordCorrectionSVG(p);g=Math.round(a-e.compareConnectorSize/2);g=cordCorrectionSVG(g);d=g+e.compareConnectorSize/2;d=roundToHalf(d);if(s===270){m=[{x:g,y:c},{x:u,y:c},{x:d,y:p},{x:g,y:c}]}else{m=[{x:d,y:c},{x:u,y:p},{x:g,y:p},{x:d,y:c}]}paintSinglePolygon(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,null,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,m,"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){m=[{x:g,y:c},{x:u,y:c},{x:d,y:p},{x:g,y:c}]}else{m=[{x:d,y:c},{x:u,y:p},{x:g,y:p},{x:d,y:c}]}paintSinglePolygon(e.id,e.zIndex+1,m,"fill",e.compareConnectorColor,null,null,null,null,true);paintSinglePolygon(e.id,e.zIndex+2,m,"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,n,a,r,o){var l={x:t,y:a};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:n,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:a};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,n,a,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:n,ry:a/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,n,a,r,o,l,s,d){i=i*1;n=n*1;a=a*1;r=r*1;o=o*1;l=l*1;var c=0;var u=0;var p=0;var g=0;var m=0;var h=0;var f=0;var v=0;var b=0;var T=0;if(s===0){c=i-a/2;p=n-r/2;u=i+a/2-o;g=n+r/2;m=i+a/2;h=n;f=u-1;v=n-l/2;b=u-1;T=n+l/2}else if(s===90){c=i-r/2;p=n-a/2+o;u=i+r/2;g=n+a/2;m=i;h=n-a/2;f=i-l/2;v=p+1;b=i+l/2;T=p+1}else if(s===180){c=i-a/2+o;p=n-r/2;u=i+a/2;g=n+r/2;m=i-a/2;h=n;f=c+1;v=n-l/2;b=c+1;T=n+l/2}else if(s===270){c=i-r/2;p=n-a/2;u=i+r/2;g=n+a/2-o;m=i;h=n+a/2;f=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 E=[{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,E,"fill",t,null,d==undefined?e.getId():d);E=[{x:m,y:h},{x:f,y:v},{x:b,y:T},{x:m,y:h}];paintSinglePolygon(e.getId(),e.getModel().zIndex+10,E,"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,n=ot["a"].colorRowConnectorWidth,a=e.getDimension();if(a.width!==0||a.height!==0){var r={x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2};paintSingleLine(e.getId(),e.getModel().zIndex,r,i,n,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,n,e.getId())}}};this.resizeDrawingArea=function(e){var t=e.getAdapter();var i=e.getCanvasDO().getBCR();var n=i.width,a=i.height;var r=e.getController().getRootPanel();r.setDimension({width:n,height:a});_=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");_.appendChild(u)}u.setAttribute("width",n.toString());u.setAttribute("height",a.toString());_.width=n;_.height=a;if(St["b"].Components.LayoutEditor.isOpen()&&[Le["a"].EDIT_GRID,Le["a"].EDIT_SETTINGS].indexOf(e.getMode())!==-1){St["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 n=e.indexOf(")");var a=e.substring(i+4,n);a=a.split(",");var r=a[0];var o=a[1];var l=a[2];for(var s=0;s<a.length;s++){a[s]=a[s].replace(/\s+/g,"")}if(a.length>=4){return d[e]={color:"#"+toHex(r)+toHex(o)+toHex(l),alpha:a[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 n=t.split(" ");var a=n[1];if(t.indexOf("italic")>-1){a=n[2]}i=parseInt(a.replace("px",""))}return i}function checkVariableInText(e,t){e=e.toString();if(!i){i=new St["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===z){return W}t.innerHTML=z=e;for(var i=0,n=t.children.length;i<n;i++){var a=t.children[i];if(a.style.fontSize===""){switch(a.tagName){case"H1":a.style.fontSize="24px";break;case"H2":a.style.fontSize="18px";break;case"H3":a.style.fontSize="14px";break;case"H4":a.style.fontSize="12px";break;case"H5":a.style.fontSize="10px";break;case"H6":a.style.fontSize="8px";break}}if(a.tagName==="P"){a.outerHTML="<div>"+a.innerHTML+"</div>"}}return W=t.innerHTML}function measureTextDim(e,t,i){e=e.toString();if(!e||!e.trim()){return{width:0,height:0}}e=checkVariableInText(e);var n=t;var a,r,o,l;if(n===undefined){a=O+"px";n=M+" "+a+" '"+A+"'"}else{var s=n.split(" ");var d=s[1];if(n.indexOf("italic")>-1){d=s[2]}if(s.length<3||d.indexOf("px")===-1){q["a"].warn("painter.measureTextDim: badly formatted font string",n);a=O+"px";n=M+" "+a+" '"+A+"'"}}if(f[n]===undefined){f[n]=measureFontHeight("Gg",n)}var c=f[n];var u=/\n|<br>|<br \/>|<br\/>/;var p=e.split(u);var g=c*p.length+(i!=undefined?i*(p.length-1):0);if(n.indexOf("italic")!==-1){var s=n.split(" ");if(n.indexOf("bold")!==-1){r=s[0];l=s[1];a=s[2]?s[2]:"13px";o=s[3]?s[3]:"Arial";n=r+" "+l+" "+a+" "+o}else{l=s[0];a=s[1]?s[1]:"13px";o=s[2]?s[2]:"Arial";n=l+" "+a+" "+o}}var m=0;L.font=n;for(var h=0;h<p.length;h++){m=Math.max(m,L.measureText(p[h]).width)}return{width:Math.ceil(m),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,n){return e>i&&e<n||i>e&&i<t||e===i||t===n}for(var t=0;t<e.length;t++){for(var i=0;i<e.length;i++){var n=e[t];var a=e[i];if(t===i||n.dataId_dim!==a.dataId_dim){continue}var r=n.width*b;var o=a.width*b;var l=n.height*N;var s=a.height*N;var d=intersect(n.x-r,n.x+r,a.x-o,a.x+o);var c=intersect(n.y-l/2,n.y+l/2,a.y-s/2,a.y+s/2);if(d&&c){if(n.type==="structure"){n.x=n.x<a.x?n.x+r/2+n.labelSignDistance+o/2+2*n.strokeWidth:a.x+o/2+a.labelSignDistance+r/2+2*a.strokeWidth;n.y=(n.y+a.y)/2;n.width=n.width+a.width+n.labelSignDistance;n.height=Math.max(n.height,a.height)}else if(n.type==="table"){var u=(n.width/2+n.labelSignDistance+a.width/2)/2;n.x=n.x<a.x?n.x+u:a.x+u;n.y=(n.y+a.y)/2;n.width=n.width+a.width+n.labelSignDistance;n.height=Math.max(n.height,a.height)}else if(n.type==="time"){n.x=(n.x+a.x)/2;n.y=(n.y+a.y)/2;n.width=Math.max(n.width,a.width);n.height=n.height+a.height+n.labelSignDistance}e.splice(i,1);t=0;break}}}for(var t=0;t<e.length;t++){var p=e[t];k.paintEllipse(p.view,p.x,p.y,p.width*b,p.height*N,P,false,p.strokeWidth)}}this.updateDom=function(e){_=e.getDOMElement();u=_.firstChild;C=location.href;e.clearElementsBuffer();o=e};this.clear=function(){for(var e=_.childNodes.length;e>1;e--){St["b"].$(_.lastChild).remove()}St["b"].$(u).empty();o.clearElementsBuffer()};this.completePainting=function(){var e=document.createDocumentFragment();appendElements(o.getElementsBufferComplete(),e,"");_.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 n in e.groups){var a=e.groups[n];a.elements.sort(sortByZIndex);var r=document.createElementNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"id",n);for(var o=0;o<a.elements.length;o++){r.appendChild(a.elements[o].element)}var l=G.filter(function(e){return n===e.groupId})[0];if(l){window.setTimeout(function(){return St["b"].UI.Tooltip.createTooltip(r,l.toolTipModel)},1e3)}e.elements.push({element:r,zIndex:a.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 m=e.children[g].scrollingData.zIndex;p.push({id:g,zIndex:m!==undefined?m:0})}p.sort(sortByZIndex);for(var o=0;o<p.length;o++){var h=p[o].id;appendElements(e.children[h],d.innerContainer,h)}}function createContainer(t,e,i,n){(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 a=document.createElement("div");a.style.position="absolute";a.style.width=t.width+"px";a.style.height=t.height+"px";a.id=e+"_"+i;if(e.startsWith("chart")&&e.match(/^chart[0-9]+$/)||e.startsWith("chartgrid01")){var r=St["b"].DataObjects.DocumentDO.getExtension(i),o=r.getChartById(e);if(o){a.dataset.id=o.name||r.getAdapter().getServerId()+"_"+o.id;if(false){var l}}addCellBackground(o,a,i)}var s=undefined;if(n){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;a.appendChild(s)}if(t.scrollingVer||t.scrollingHor||t.scrolling){return createScrollContainer(s,a,t,i)}else{a.style.top=t.y+"px";a.style.left=t.x+"px";a.style.overflow="hidden";if(t.forwardEvents){a.onmouseenter=function(e){forwardEvent(e,t.forwardEvents,i)};a.onmouseleave=function(e){forwardEvent(e,t.forwardEvents,i)};a.addEventListener("wheel",function(e){forwardEvent(e,t.forwardEvents,i)},false);a.addEventListener("touchstart",function(e){forwardEvent(e,t.forwardEvents,i)},false);a.addEventListener("touchmove",function(e){forwardEvent(e,t.forwardEvents,i)},false)}return{svgContainer:s,innerContainer:a,outerContainer:a}}}function createScrollContainer(e,l,s,o){F[l.id]=s;var d=document.createElement("div"),t=!St["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,n;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(n=getScrollbarHor(s,l,d));n.style.width=Math.max(s.width/s.realWidth*s.width,30)+"px";n.style.left="0px";n.style.display="block"}var a=setTimeout(function(){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(n.style.display="none")},h);d.onmouseenter=function(e){if(H[l.id]){return}a&&clearTimeout(a);B.leftScrollContainer=false;if(!(St["b"].Utils.Mobile.isIOS&&document.querySelector('.comment > [contenteditable="true"]'))){s.scrollingVer&&(i.style.display="block");s.scrollingHor&&(n.style.display="block")}s.forwardEvents&&forwardEvent(e,s.forwardEvents,o)};d.onmouseleave=function(e){B.leftScrollContainer=true;if(!B.movingScrollbar){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(n.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 n=(l.scrollLeft+t)/(l.scrollWidth-s.width);triggerCustomEvent(l.parentNode,{leftPct:n,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}}if(s.scrollingVer||s.scrollingHor){l.addEventListener("scroll",function(){if(s.forwardEvents){var e=k.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(H[l.id]){return}g=setTimeout(function(){p=true},500);clearTimeout(r);St["b"].Utils.GlobalVariables.onTouchMove=true;B.leftScrollContainer=false;s.scrollingVer&&(i.style.display="block");s.scrollingHor&&(n.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 n=c-t;var a=u-i;c=t;u=i;if(l.id.indexOf("tableContent.")===0||s.scrollingVer){var r=(l.scrollTop+n)/(l.scrollHeight-s.height);triggerCustomEvent(d,{topPct:r,scrollingData:s,mousePos:{x:e.pageX,y:e.pageY}})}var o=(l.scrollLeft+a)/(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(){B.leftScrollContainer=true;if(!B.movingScrollbar){s.scrollingVer&&(i.style.display="none");s.scrollingHor&&(n.style.display="none")}},1e3);St["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 m=l.id;U[m]===undefined&&(U[m]=[]);s.scrollingHorRef&&s.scrollingHorRef.forEach(registerCallback);s.scrollingVerRef&&s.scrollingVerRef.forEach(registerCallback)}return{svgContainer:e,innerContainer:l,outerContainer:d,scrollbarVer:i,scrollbarHor:n};function registerCallback(r){U[m].push(function(e){var t=k.getContainerScrollDivElement(ot["a"].idContainerContent+"."+r,o);if(t){r=ot["a"].idContainerContent+"."+r}else{t=k.getContainerScrollDivElement(r,o)}if(t){var i=r+"_"+o,n=F[i],a={detail:{leftPct:e.leftPct,topPct:e.topPct,scrollingData:n}};handleScrolling(t,a,false)}})}}function forwardEvent(e,t,i){if(!e){return}var n,a=k.getContainerScrollDivElement(t,i);if(a){if(typeof e.constructor==="function"){n=new e.constructor(e.type,e)}else{if(e.type==="wheel"){n=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));n.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){n=document.createEvent("TouchEvent");n.initUIEvent(e.type,e.bubbles,e.cancelable,window,e.detail)}else{n=document.createEvent("MouseEvent");n.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)}}a.dispatchEvent(n)}}function triggerCustomEvent(e,t,i){handleScrolling(e,{detail:t},true,i)}function handleScrolling(e,t,i,n){var a,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(a===undefined){a=s}else if(s.id.indexOf("CYCLEDIV")!==1){q["a"].warn("Non unique result for container");return}}}if(H[a.id]){return}var d=t.detail.scrollingData,c=St["b"].DataObjects.DocumentDO.getExtension(a.id.split("_").pop());if(t.detail.leftPct!==undefined&&t.detail.leftPct!==null){var u=Math.min(Math.max(0,t.detail.leftPct),1);a.scrollLeft=(a.scrollWidth-d.width)*u;if(r){r.style.left=(d.width-parseInt(r.style.width))*u+"px"}d.scrollLeft=a.scrollLeft;handleScrolledReferences("left",a,c)}else if(t.detail.topPct!==undefined&&t.detail.topPct!==null){var p=Math.min(Math.max(0,t.detail.topPct),1);a.scrollTop=(a.scrollHeight-d.height)*p;if(o){o.style.top=(d.height-parseInt(o.style.height))*p+"px"}d.scrollTop=a.scrollTop;handleScrolledReferences("top",a,c)}n!==false&&saveScrollOffset(c,t);var g=U[a.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=St["b"].DataObjects.DocumentDO.preventScrolling()?undefined:function(e){B.movingScrollbar=true;var t=document.querySelector('.HiCo [contenteditable="true"]');if(t){t.contentEditable=false}var i=parseFloat(s.style.top)||0,n=r.height-parseInt(s.style.height);var a=e.pageY;function moveScrollbar(e){var t=(i+e.pageY-a)/n;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);B.movingScrollbar=false;if(B.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=St["b"].DataObjects.DocumentDO.preventScrolling()?undefined:function(e){B.movingScrollbar=true;var i=parseFloat(l.style.left),n=r.width-parseInt(l.style.width);var a=e.pageX;function moveScrollbar(e){var t=(i+e.pageX-a)/n;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);B.movingScrollbar=false;if(B.leftScrollContainer){t.onmouseleave()}},false)};return l}function addToGroupsBuffer(e,t,i){var n=getRealGroup(e)+"_"+u.id;var a=r[n];if(!a){a=r[n]={zIndex:i,elements:[]}}else if(a.zIndex<i){a.zIndex=i}a.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,n,a){if(!n||n.extendedModel.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE||n.extendedModel.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE||St["b"].DataObjects.DocumentDO.getSettings().documentMode.value==="PRESENTATION"){return}var t=e.getController().getRootModel(),r=e.getController().getRootPanel(),o=t.extensionHash,l=St["b"].DataObjects.DocumentDO.getExtension(o),s=St["b"].Factories.ViewFactory.getViewById(r,n.id),d=St["b"].Factories.ModelFactory.getParentContainer(t.firstObjectGrid,n)[0];if(d.extendedModel.isTextEditable){s.getLayout().setDraggable(l,a);var c=d.id+"_"+o;U[c]=U[c]||[];U[c].push(function(e){var t=a.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){k.paintIcons(l,a,n,d)}})}St["b"].$(a).hover(function(e){if(l.getMode()===Le["a"].EDIT_COMMENT){return}if(d.extendedModel.isDragging){return}if(d.extendedModel.isTextEditable){k.paintIcons(l,a,n,d)}},function(e){var t=e.toElement||e.relatedTarget;if(t&&t.classList&&t.classList.contains("addComment")){St["b"].$(e.toElement).mouseleave(function(e){if(St["b"].$(i).find(e.toElement)[0]===undefined){k.removeAddCommentIcons()}})}else{k.removeAddCommentIcons()}})}this.noPaint=function(e,t){var i=e.getDOMElement();var n=measureTextDim(t);var a=document.createElement("div");a.innerHTML=t;a.style.fontFamily=R.getParameter("FONT_FAMILY");a.style.fontSize=n.height+"px";a.style.fontWeight=R.getParameter("FONT_STYLE_CHART");a.style.left=Math.round((parseInt(i.getAttribute("width"))-n.width)/2)+"px";a.style.top=Math.round((parseInt(i.getAttribute("height"))-n.height)/2)+"px";a.style.width=n.width+"px";a.style.height=n.height+"px";a.style.position="absolute";i.parentNode.appendChild(a)};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 n=t.id;var a=n.indexOf("_bg");if(a===-1){a=n.indexOf("_fill")}if(a>=0){n=n.substring(0,a)}if(t.tagName==="text"||n.indexOf("boundingRect")>=0){a=n.indexOf("$");if(a!==-1){n=n.substring(0,a)}a=n.indexOf("_");if(a!==-1&&n.indexOf("stack_sum")===-1){n=n.substring(0,a)}}if(t.tagName==="rect"&&n.indexOf("##cellBackground")>-1){n=n.replace("##cellBackground","")}s.indexOf(n)===-1&&s.push(n)}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,n){if(document.getElementById("HiCoHighlightedElementBorder")===null){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");a.id="HiCoHighlightedElementBorder";a.setAttributeNS(null,"fill","rgb(211,211,211)");var r=1;var o=2;if(n){o=5;r=2}var l=t.x-r;if(i==="middle"){l-=t.width/2}else if(i==="end"){l-=t.width}a.setAttributeNS(null,"x",l.toString(10));a.setAttributeNS(null,"y",(t.y-o).toString(10));a.setAttributeNS(null,"width",(t.width+o).toString(10));a.setAttributeNS(null,"height",(t.height+o).toString(10));a.style.strokeWidth="1";a.style.stroke="rgb(0, 176, 240)";a.style.strokeDasharray="5, 2";var s=St["b"].$(e.parentNode).find('[id^="'+e.id.split("_")[0]+'"]')[0];if(s){e.parentNode.insertBefore(a,s)}}};this.getMeasuredTextDiv=function(e,t,i,n,a){t=checkVariableInText(t,"textDiv");s.innerHTML=t;s.style.width=e+"px";s.style.fontSize=i+"px";s.style.fontFamily=n;s.style.fontWeight=a;s.style.position="absolute";s.style.display="block";var r=s.clientHeight;s.style.display="none";return r};this.paintIcons=function(i,e,n,a){k.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+a.dimension.width,p=d+a.dimension.height,g=n.dimension.height,m=n.dimension.width;var h=a.extendedModel.allowLeft==="undefined"||R.getAllowIcon(a.extendedModel.allowLeft),f=a.extendedModel.allowTop==="undefined"||R.getAllowIcon(a.extendedModel.allowTop),v=a.extendedModel.allowRight==="undefined"||R.getAllowIcon(a.extendedModel.allowRight),b=a.extendedModel.allowBottom==="undefined"||R.getAllowIcon(a.extendedModel.allowBottom);var T={chartContainerModel:a,model:n,extension:i,parameters:null},E={x:0,y:0},x;if(h){if(s===r){E={x:r,y:o+g/2-V/2}}else{E={x:r-V/2,y:o+g/2-V/2}}if(r>=s&&E.y>=d&&E.y+V/2<=p){x=k.addIcon(t,E);St["b"].$(x).click(function(){T.parameters={position:"left",caller:"commentModel"};i.getController().dispatch("createAddColumn",T);var e=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(a,n.id);var t=a.children[e-1];St["b"].DataObjects.CommentRepo.openEditField(i,t)})}$.left=g<3*V}if(f){if(d===o){E={x:r+m/2-V/2,y:o}}else{E={x:r+m/2-V/2,y:o-V/2}}if(o>=d&&E.x>=s&&E.x<=u){x=k.addIcon(t,E);St["b"].$(x).click(function(){T.parameters={position:"above",caller:"commentModel"};i.getController().dispatch("createAddRow",T);var e=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(a,n.id);var t=a.children[e-a.extendedModel.gridColumns.length];St["b"].DataObjects.CommentRepo.openEditField(i,t)})}}if(v){if(u===r+m){E={x:r+m-V,y:o+g/2-V/2}}else{E={x:r+m-V/2,y:o+g/2-V/2}}if(E.x<=u&&E.y>=d&&E.y+V/2<=p){x=k.addIcon(t,E);St["b"].$(x).click(function(){T.parameters={position:"right",caller:"commentModel"};i.getController().dispatch("createAddColumn",T);var e=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(a,n.id);var t=a.children[e+1];St["b"].DataObjects.CommentRepo.openEditField(i,t)})}$.right=g<3*V}if(b){if(p===o+g){E={x:r+m/2-V/2,y:o+g-V}}else{E={x:r+m/2-V/2,y:o+g-V/2}}if(E.y+V/2<=p&&E.x>=s&&E.x<=u){x=k.addIcon(t,E);St["b"].$(x).click(function(){T.parameters={position:"below",caller:"commentModel"};i.getController().dispatch("createAddRow",T);var e=St["b"].Models.Actions.ViewModelActions.ContainerModel.getChildIndexById(a,n.id);var t=a.children[e+a.extendedModel.gridColumns.length];St["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};St["b"].$(".addComment").remove()};this.getCommentReferenceScrollingElement=function(e,t){return Y[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 n=i.childNodes.length-1;n>=0;n--){var a=i.childNodes[n];if(a.className==="tc-scroll"){return a}}}}return null};this.getContainerContentDivElement=function(e,t){var i=document.getElementById(e+"_"+t);if(i){var n=[ot["a"].idContainerContent+"."+e+"_"+t,ot["a"].idTableContent+"."+e+"_"+t];for(var a=i.childNodes.length-1;a>=0;a--){var r=i.childNodes[a];if(r.className==="tc-scroll"){for(var o=0;o<r.childNodes.length;o++){if(n.indexOf(r.childNodes[o].id)>=0){i=r.childNodes[o];break}}break}else if(n.indexOf(r.id)>=0){i=r;break}}}return i};this.disableContainerScrolling=function(e,t){var i=k.getContainerContentDivElement(e,t);if(i){H[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=k.getContainerContentDivElement(e,t),n=i&&i.parentNode,a=null;if(n&&n.className==="tc-scroll"){a={left:i.scrollLeft,top:i.scrollTop}}return a};this.setContainerScrollPosition=function(e,t,i,n){var a=k.getContainerContentDivElement(e,t),r=a&&a.parentNode,e=a.id;if(r&&r.className==="tc-scroll"){var o=F[e];var l=i.top/(a.scrollHeight-o.height);triggerCustomEvent(r,{topPct:l,scrollingData:o,mousePos:{x:0,y:0}},n)}if(e.indexOf(ot["a"].idTableContent)>=0){e=e.replace(ot["a"].idTableContent,ot["a"].idTableHead);a=document.getElementById(e);r=a&&a.parentNode}if(r&&r.className==="tc-scroll"){var o=F[e];var s=i.left/(a.scrollWidth-o.width);triggerCustomEvent(r,{leftPct:s,scrollingData:o,mousePos:{x:0,y:0}},n)}};function addCellBackground(e,t,i){if(e.cellDefinition&&e.cellDefinition.background.isActive){var n=e.cellDefinition.background;var a=n.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=n.color;r.style.backgroundSize=n.size;a&&St["b"].DataObjects.DocumentDO.getMediaData(a,i).then(function(e){return r.style.backgroundImage='url("'+(e||a)+'")'});r.style.opacity=n.opacity;r.style.backgroundRepeat=n.repeat;r.style.backgroundPositionX=n.positionX;r.style.backgroundPositionY=n.positionY;t.appendChild(r)}}function getCompareColor(e,t){if(e.notation===t.NOTATION){var i=e.positive;if(e.negativeIsPositive){i=!i}return i?n:a}return e.individualColor}};var me=r(254);var he=r(103);var fe=r(320);var ve=r(183);var be=r(283);var Te=r(264);var Ee=r(138);var xe=r(217);var Ce=r(219);var ye=r(175);var Ae=St["b"].Utils.Update.ContextUpdater=new function(){var d;var n;var r;var s=false;var c=false;this.update=function(e,t){d=e;var i=t.getAdapter();n=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){St["b"].DataObjects.DocumentDO.setContextFormulasModifiedFlag()}d.dataContext=Object(me["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){St["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(o,e)}}var i=t.ruleRepository;for(var n=0;n<i.length;n++){var a=i[n];removeFormula(a.conditionFormula);removeFormula(a.appliesFormula)}var r=t.definitionPartArray;for(var n=0;n<r.length;n++){var l=r[n];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 n="$("+t+"$1)";d[o.cid].push({oldDid:i,newDid:n});for(var a=0;a<o.formulaRepository.length;a++){var r=o.formulaRepository[a];replaceDidInFormula(i,n,r,"formula",true)}}for(var n=e;n<o.columns.length;n++){var c=o.columns[n];var u=St["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(n+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 n="$("+t+"$1)";l[o.cid].push({oldDid:i,newDid:n});for(var a=0;a<o.formulaRepository.length;a++){var r=o.formulaRepository[a];replaceDidInFormula(i,n,r,"formula",true)}}for(var t=o.columns.length-1;t>=e;t--){var i=o.columns[t];if(i.definitionType==="HiCo"){var n=St["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(t+1);if(n!==i.displayId){processContextFormulas(i.displayId,n);i.displayId=n}}}updateRootModels({},l,[],{},{})};this.finalUpdate=function(e,t,i,n,a,r){c=false;updateRootModels(e,t,i,a,r);if((c||n)&&St["b"].$.inArray("Designer",St["b"].DataObjects.RuntimeDO.getUser().permissions)!==-1){var o=St["b"].DataObjects.DocumentDO.getAllExtensions();var l=c?function(e){e.getController().dispatch("updateRootModel",{extension:e})}:function(e){e.getController().dispatch("createContextState",{extension:e,saveQVF:true})};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 n=e.charts[i].model;n.instanceOf==="TableModel"&&synchronizeKeyColumnsNames(n)}}}var e=St["b"].DataObjects.DocumentDO.getAllExtensions();for(var t=0;t<e.length;t++){var i=e[t].getController().getRootModel();var n=i.rootContainerModel.children[0];if(n.children&&n.children.length>0){processContainer(n.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(),n=i.getDimensions(t),a=i.getExpressions(t);var r=new he["a"](this.createContextId(e,t));r.cid=t;r.name="globalContext";d=r;r.rows=n.map(function(e){return createNewDimension(e)});r.columns=a.map(function(e,t){return createNewExpression(t,e)});r.dataContext=Object(me["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 n=e.input.keyColumns[i];for(var a=0;a<t.rows.length;a++){if(n.id===t.rows[a].id){n.name=t.rows[a].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,n,a,r){var o=e.contextId,l=it["a"].getContextByCid(o);if(!l){return}var s=t[o]||[];var d=i[o]||[];var c=n[o]||[];for(var u=e.expressions.length-1;u>=0;u--){var p=e.expressions[u];var g=p.id.split(".");var m=g.pop();var h=parseInt(m.replace("expr",""));var f=getIdSteps(h,c);if(f>0){p.id=g.join(".")+".expr"+(h-f).toString(10);if(e.instanceOf==="TableModel"){for(var v=0;v<e.columnDefinitions.length;v++){if(e.columnDefinitions[v].exprId===m){e.columnDefinitions[v].exprId="expr"+(h-f).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 E=e.dimensionLabelModel.emptySpaceRepository;for(var u=0;u<E.length;u++){var x=E[u];for(var T=0;T<s.length;T++){deleteDidFromFormula(s[T],x,"appliesFormula",false)}replaceDidsInFormulaByList(d,x,"appliesFormula",false)}}if(e.dimensionLabelModel&&e.dimensionLabelModel.dimensionFormulaRepository&&l){var C=e.dimensionLabelModel.dimensionFormulaRepository;if(l.rows.length<C.length){C=e.dimensionLabelModel.dimensionFormulaRepository=e.dimensionLabelModel.dimensionFormulaRepository.slice(0,l.rows.length)}for(var u=0;u<C.length;u++){var y=C[u];for(var T=0;T<s.length;T++){deleteDidFromFormula(s[T],y.appliesFormula,"formula",false);deleteDidFromFormula(s[T],y.conditionFormula,"formula",false)}replaceDidsInFormulaByList(d,y.appliesFormula,"formula",false);replaceDidsInFormulaByList(d,y.conditionFormula,"formula",false)}for(var v=C.length;v<l.rows.length;v++){var M=new fe["a"].DimensionFormulaModel;M.id=l.rows[v].id;M.dimAutoLength=true;M.dimension_mmpt=0;M.appliesFormula={formula:"true",compiledFormula:null};M.conditionFormula={formula:"true",compiledFormula:null};e.dimensionLabelModel.dimensionFormulaRepository.push(M)}}if(e.instanceOf==="TableModel"){if(r[e.contextId]){var S=r[e.contextId],O=e.input.keyColumns;for(var L=O.length-1;L>=0;L--){S.indexOf(O[L].id)>=0&&O.splice(L,1)}}if(a[e.contextId]){var S=a[e.contextId],O=e.input.keyColumns;for(var L=O.length-1;L>=0;L--){S.indexOf(O[L].id)>=0&&O.splice(L,1)}for(var L=0;L<S.length;L++){var A=S[L],_;for(var u=0;u<l.rows.length;u++){_=l.rows[u];if(_.id===A){break}}O.push({id:_.id,name:_.nameInternal?_.nameInternal:_.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 n=it["a"].getContextByCid(p.contextId);if(p.dimensions.length>=n.rows.length){p.dimensions=p.dimensions.slice(0,n.rows.length-1);if(p.dimensions.length>0){p.dimensions[p.dimensions.length-1].categoryOrientation="Cell"}}for(var a=0;a<p.cases.length;a++){var r=p.cases[a];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 a=0;a<p.cases.length;a++){var r=p.cases[a];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 n=t[i].nodes;for(var a=0;a<n.length;a++){var r=n[a].nodes;for(var o=0;o<r.length;o++){updateSingleChart(r[o].model,l,s,d,c,u)}}}}updateElements("time");updateElements("structure")}function updateRootModels(n,a,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,n,a,r,o,l)}else if(e.charts){for(var i=0;i<e.charts.length;i++){updateSingleChart(e.charts[i].model,n,a,r,o,l)}}}var e=St["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,n,a){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[n];e[n]=r.replace(t,i);if(e.compiledFormula){replacer(e.compiledFormula.topNode)}if(e[n]!==r){if(a){s=true}else{c=true}}}function replaceDidInContextFormulas(e,t){var i=new RegExp("\\$\\("+e+"(,[A-Z]+)?\\)","g");var n="$("+t+"$1)";for(var a=0;a<d.formulaRepository.length;a++){var r=d.formulaRepository[a];replaceDidInFormula(i,n,r,"formula",true)}St["b"].DataObjects.DocumentDO.addDidToRenameList(d.cid,i,n)}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 n=0;n<r.length;n++){var a=r[n];e.variable=e.variable.replace(a.oldDid,a.newDid);if(e.variable!==i){t=true;break}}}return t}if(e.compiledFormula==null){e.compiledFormula=R["a"].compile(e[t])}var n=e.compiledFormula;if(replaceInNode(n.topNode)){e[t]=reconstructFormulaFromNode(n.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)}St["b"].DataObjects.DocumentDO.addDidListToRenameList(d.cid,e)}function reconstructFormulaFromNode(e){var t;if(e.instanceOf==="CompiledFormulaNode"){var i=reconstructFormulaFromNode(e.operand1);var n=reconstructFormulaFromNode(e.operand2);var a=U["a"].getOperator(e.operator);if(i.precedence>a.precedence){i.value="("+i.value+")"}if(n.precedence>a.precedence){n.value="("+n.value+")"}if(a.op==="§"){t={precedence:a.precedence,value:"-"+n.value}}else if(a.op==="#"){t={precedence:a.precedence,value:"+"+n.value}}else{t={precedence:a.precedence,value:i.value+" "+e.operator+" "+n.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 ve["c"];i.value=0;i.type="number";return i}else if(e==="#"||e==="§"){return null}else{return t}}function deleteDidFromFormula(e,t,i,n){var a="$("+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 n=e.variable.substr(0,a.length);if(n===a||n===r){t=null;o=true}}return t}if(t.compiledFormula==null){t.compiledFormula=R["a"].compile(t[i])}var l=t.compiledFormula;l.topNode=removeFromNode(l.topNode);if(l.topNode===null){l.topNode=new ve["c"];l.topNode.type="number";l.topNode.value=0}if(o){t[i]=reconstructFormulaFromNode(l.topNode).value;if(n){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)}St["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){St["b"].DataObjects.DocumentDO.addDimensionToRemoveList(d.cid,i.id);removeDimension(t,true,true);t--}}}function removeDimension(e,t,i){var n=d.rows[e];function removeFormula(e){if(e!==undefined&&e!==-1){St["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,e)}}if(n.dimensionType==="std"){removeFormula(n.sortingCondFormula);if(i){removeDidFromContextFormulas(n.displayId)}}else if(n.dimensionType==="drill"||n.dimensionType==="cyclic"){for(var a=0;a<n.groupMembers.length;a++){removeFormula(n.groupMembers[a].sortingCondFormula);removeDidFromContextFormulas(n.groupMembers[a].displayId)}}else if(n.dimensionType==="dynamic"){for(var a=0;a<n.dynamicNames.length;a++){removeFormula(n.dynamicNames[a].formulaId);removeDidFromContextFormulas(n.dynamicNames[a].displayId)}if(i){removeDidFromContextFormulas(n.displayId)}}if(t){d.rows.splice(e,1)}}function createNewDrilldownElement(e,t){var i=new be["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;St["b"].Models.Actions.ModelActions.DrillDownElementModel.initDimensionSorting(i,d);St["b"].Models.Actions.ModelActions.DrillDownElementModel.initDimensionAdditions(i);return i}function createNewDynamicElement(e,t){var i=new Te["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 Ee["a"](d.id+"."+e.id);i.nameBi=i.name=e.name;i.dimensionType=e.dimensionType;i.groupActualLevel=e.groupActualLevel;i.displayId=t?t:St["b"].Models.Actions.ModelActions.ContextModel.getNextDimensionId(d);var n=i.displayId.substr(0,3);St["b"].Models.Actions.ModelActions.DimensionModel.initDimensionSorting(i,d);St["b"].Models.Actions.ModelActions.DimensionModel.initDimensionAdditions(i);i.groupMembers=new Array(e.groupMembers.length);for(var a=0;a<e.groupMembers.length;a++){var r=n+St["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(i);i.groupMembers[a]=createNewDrilldownElement(r,e.groupMembers[a])}i.dynamicNames=new Array(e.dynamicNames.length);for(var a=0;a<e.dynamicNames.length;a++){var r=n+St["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(i);i.dynamicNames[a]=createNewDynamicElement(r,e.dynamicNames[a])}return i}function adjustContextDimensions(){var e=new Array(r.length);for(var t=0;t<r.length;t++){var i=r[t];var n=d.rows[t];if(n===undefined){e[t]=createNewDimension(i);St["b"].DataObjects.DocumentDO.addDimensionToAddList(d.cid,e[t].id)}else if(i.dimensionType!==n.dimensionType){e[t]=createNewDimension(i,n.displayId);removeDimension(t,false,false)}else{adjustSingleDimension(n,i);e[t]=n}}for(var a=d.rows.length-1;a>=r.length;a--){St["b"].DataObjects.DocumentDO.addDimensionToRemoveList(d.cid,d.rows[a].id);removeDimension(a,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){St["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 n=0;n<t.groupMembers.length;n++){var a=e.groupMembers[n];var r=t.groupMembers[n];if(a===undefined){var o=i+St["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(e);e.groupMembers[n]=createNewDrilldownElement(o,r)}else{a.qvName=r.qvName;a.useQvName&&(a.name=a.nameInternal=r.name)}}for(var n=e.groupMembers.length-1;n>=t.groupMembers.length;n--){var a=e.groupMembers[n];St["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,a.sortingCondFormula);removeDidFromContextFormulas(a.displayId);e.groupMembers.splice(n,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 n=0;n<e.dynamicNames.length;n++){var a=e.dynamicNames[n];if(a.instanceOf==="DynamicElementDO"){var r=parseInt(a.id.replace("dynd",""));if(r>i){var o="dynd"+(r-1);replaceDidInContextFormulas(a.id,o);a.id=o}}}}function updateDynamicDimension(e,t){removeMarkedDynamicElements(e);var i=e.displayId.substr(0,3);for(var n=0;n<t.dynamicNames.length;n++){var a=t.dynamicNames[n];var r=null;for(var o=0;o<e.dynamicNames.length;o++){if(a.id===e.dynamicNames[o].id){r=e.dynamicNames[o];break}}if(r!==null){r.qvName=a.qvName;if(r.updateNameFromQV){r.internalName=r.name=a.qvName}}else{var l=i+St["b"].Models.Actions.ModelActions.DimensionModel.getNextSubDimensionId(e);e.dynamicNames.push(createNewDynamicElement(l,a))}}var s=parseInt(t.dynamicNames[t.dynamicNames.length-1].id.substr(4));for(var n=0;n<e.dynamicNames.length;n++){var r=e.dynamicNames[n];if(r.instanceOf==="DynamicElementDO"&&parseInt(r.id.substr(4))>s){removeDidFromContextFormulas(r.displayId);removeDidFromContextFormulas(r.id);e.dynamicNames.splice(n,1);n--}}}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 n=new St["b"].DataObjects.ExpressionPartDO;n.appliesFormula=St["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"PartCond&FID","true",false);if("HiCo"===i.definitionType&&-1!==i.definition&&""!==i.definition){var a=St["b"].Models.Actions.ModelActions.ContextModel.getFormulaById(d,i.definition).formula;St["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,i.definition);i.definition=-1;n.partFormula=St["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"PartFormula&FID",a,false)}else if(i.definitionType==="QV"){n.partFormula=-1}n.id=0;n.name="New 0";i.definitionPartArray=[n]}var r=new St["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){St["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 n=function(e){if(e!==undefined&&e!==-1){St["b"].Models.Actions.ModelActions.ContextModel.removeFormulaFromRepository(d,e)}};var a=i.ruleRepository;for(var r=0;r<a.length;r++){var o=a[r];n(o.conditionFormula);n(o.appliesFormula)}var l=i.definitionPartArray;for(var r=0;r<l.length;r++){var s=l[r];n(s.appliesFormula)}removeDidFromContextFormulas(i.displayId);removeDidFromContextFormulas(i.id);if(t){d.columns.splice(e,1)}}function createNewExpression(e,t){var i=new xe["a"](d.id+"."+t.id,t.biColumnId);i.nameBi=i.name=t.name;i.definition=t.id;i.definitionType="QV";i.displayId=St["b"].Utils.Update.ContextUpdater.generateExpressionDisplayId(e+1);i.definitionPartArray=[];var n=new Ce["a"];n.id=0;n.name="New 0";n.appliesFormula=St["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"Formula&FID","true",true);n.partFormula=-1;i.definitionPartArray.push(n);var a=new ye["a"];a.conditionFormula=St["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"RuleCond&FID","true",true);a.appliesFormula=St["b"].Models.Actions.ModelActions.ContextModel.addFormulaToRepository(d,"RuleApplies&FID","true",true);a.id=0;a.name="New 0";i.ruleRepository.push(a);return i}function adjustContextExpressions(){St["b"].Connector.ConnectorHelper.ContextUpdater_adjustContextExpressions(n,createNewExpression.bind(this),d,removeExpression.bind(this),replaceDidsInContextFormulasByList.bind(this))}};St["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=St["b"].DataObjects.CommentRepo.getAllSelectedExtensionComments(t);for(var n=0;n<i.length;n++){var a=i[n];if(e.id===a.rootModel){if(c===null){c=[];u=[];collectIds(e)}updateComment(a,e,t)}}delete e.freshTransport;if(p){t.getController().dispatch("updateRootModelState",{extension:t,parameters:{saveQVF:true}})}else if(g){for(var n=0;n<i.length;n++){var a=i[n];if(e.id===a.rootModel){t.getController().dispatch("createOrUpdateCommentAction",{extension:t,comment:a,lastModified:null})}}St["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 n=parseInt(e.grid.substr(5));if(u.indexOf(n)===-1){St["b"].DataObjects.CommentRepo.removeCommentById(e.id,i);g=true;return}for(var a=0;a<e.comments.length;a++){for(var r=0;r<e.comments[a].grid.length;r++){var o=e.comments[a].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"+St["b"].Models.Actions.ModelActions.RootModel.getNextId(t);!s.originalLastModified&&(s.originalLastModified=s.lastModified);g=true;p=true}c.push(d)}}}}};var _e=r(478);var Ie=r(164);var De=r(581);var Re=r(588);var Ne=r(580);var Pe=r(590);function CellDialog(u){var $=this;var D=u.extension;var R=D.getController();var N=R.getRootModel();var p=D.getCanvasDO().getDOMElement();var M=St["b"].DataObjects.ContextRepo;var b=St["b"].DataObjects.DocumentDO.getAllExtensions();var P=rt["a"].transport;var e=st["a"].deepCopy(R.getLayoutDefinition(),true);var W=null;var z=null;var g=null;var m=null;var h=null;var t=null;var w=u.containerModel;var U=w.name?w.name:"";var F=w?w.extendedModel:null;var B=null;var j=null;var H=null;var k=null;var G=w&&w.id.indexOf("chart")!==-1?parseInt(w.id.substr(5)):0;var l=false,s=false;var V=null;function findNonEmptyContext(e){if(!e){return null}for(var t=0;t<e.length;t++){var i=e[t];if(it["a"].isValidContext(i)){return i}}return null}var f=findNonEmptyContext(D.getContexts());var X=false;if(!f){if(F&&F.contextId){f=M.getContextByCid(F.contextId)}if(!f||f.rows.length===0||f.columns.length===0||!f.dataModel){for(var i=0;i<b.length;i++){f=findNonEmptyContext(b[i].getContexts());if(f){break}}}if(!f||f.rows.length===0||f.columns.length===0||!f.dataModel){f=D.getContexts()[0]}}if(f.rows.length!==0&&f.columns.length!==0&&f.dataModel){X=true}var Y=new St["b"].Utils.Calculator(f);var v=null;var K=null;var d=0;var n=null;var S="",O=0,L=0,A=0;var T=0;var c=0;if(F&&F.instanceOf==="MultipleContainerModel"){s=true}else if(!F||F.instanceOf==="ChartModel"||F.instanceOf==="TimeChartModel"||F.instanceOf==="TableModel"||F.instanceOf==="PlaceHolderModel"){l=true}var a=M.getAllContexts().slice(0);var Z=[];var Q=[];for(var i=0;i<a.length;i++){if(a[i].rows.length!==0&&a[i].columns.length!==0&&a[i].dataModel){var r=M.getExtensionByContextCid(a[i].cid).getTitle()+" - "+a[i].name;Z.push(r);Q.push(a[i].cid)}}var q=b.map(function(e){return e.getContexts()[0].cid});var J=St["b"].Utils.Constants.ParameterSets.multiButtonActions;var E=St["b"].Utils.Constants.ParameterSets.multiButtonActionsTL;var _=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignments;var I=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignmentsTL;var ee=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignments;var te=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignmentsTL;var ie=["title","subtitle","comment"];var C=[Ot["a"].getTranslation("TITLE"),Ot["a"].getTranslation("SUBTITLE"),Ot["a"].getTranslation("COMMENT")];var y=St["b"].DataObjects.DocumentDO.getBIVariables().map(function(e){return e.name.replace(/\n/g," ")});y.sort();var ne=["Auto","Fix"];var ae=[Ot["a"].getTranslation("AUTO"),Ot["a"].getTranslation("FIX")];var re=[1,.5,.33];var oe=["1","0.5","0.33"];var le=[{value:"Cell",activeIcon:"cell_cell.png",inactiveIcon:"cell_cell_grey.png",tooltip:Ot["a"].getTranslation("CELL")}];var se=[{value:"Auto",activeIcon:"cell_cell.png",inactiveIcon:"cell_cell_grey.png",tooltip:Ot["a"].getTranslation("AUTO")},{value:"Left",activeIcon:"cell_left.png",inactiveIcon:"cell_left_grey.png",tooltip:Ot["a"].getTranslation("LEFT")},{value:"Top",activeIcon:"cell_top.png",inactiveIcon:"cell_top_grey.png",tooltip:Ot["a"].getTranslation("TOP")}];var de=[{value:"Left",activeIcon:"text_align_left.png",inactiveIcon:"text_align_left_grey.png",tooltip:Ot["a"].getTranslation("LEFT")},{value:"Mid",activeIcon:"text_align_center.png",inactiveIcon:"text_align_center_grey.png",tooltip:Ot["a"].getTranslation("MID")},{value:"Right",activeIcon:"text_align_right.png",inactiveIcon:"text_align_right_grey.png",tooltip:Ot["a"].getTranslation("RIGHT")}];var ce=[{value:"None",activeIcon:"totals_position_none.png",inactiveIcon:"totals_position_none_grey.png",tooltip:Ot["a"].getTranslation("NONE")},{value:"Cell",activeIcon:"totals_position_cell.png",inactiveIcon:"totals_position_cell_grey.png",tooltip:Ot["a"].getTranslation("CELL")},{value:"CategoryStart",activeIcon:"totals_position_left.png",inactiveIcon:"totals_position_left_grey.png",tooltip:Ot["a"].getTranslation("DIMENSION_START")},{value:"CategoryEnd",activeIcon:"totals_position_right.png",inactiveIcon:"totals_position_right_grey.png",tooltip:Ot["a"].getTranslation("DIMENSION_END")}];var ue="Auto";var pe=Ot["a"].getTranslation("NOTATION");var ge=4;var me=1;var he="12px";var x="880";var fe="390";var ve="0px";var be=19;var Te=25;var Ee;var xe=[{id:"cell-tabs-container",text:Ot["a"].getTranslation("TYPE"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE"),buildUp:createContainerTab},{id:"cell-tabs-navigation",text:"CLICK_BEHAVIOUR",tooltip:"HELP_CELL_CLICK_BEHAVIOUR",buildUp:createNavigationTab,hidden:true},{id:"cell-tabs-multiple-cases",text:Ot["a"].getTranslation("MULTIPLE_CASES_BORDERS"),tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES"),buildUp:createMultipleCasesTab},{id:"cell-tabs-multiple-elements",text:Ot["a"].getTranslation("SUBCASES"),tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_ELEMENTS"),buildUp:createMultipleElementsTab},{id:"cell-tabs-dimensions",text:Ot["a"].getTranslation("DIMENSIONS"),tooltip:Ot["a"].getTranslation("HELP_CELL_DIMENSIONS"),buildUp:createDimensionsTab},{id:"cell-tabs-dim-keyfigures",text:Ot["a"].getTranslation("MEASURES"),tooltip:Ot["a"].getTranslation("HELP_CELL_MEASURES"),buildUp:createKeyfiguresTab}];var Ce=3;var ye=[{id:"ctabs-element",text:Ot["a"].getTranslation("SINGLE"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_SINGLE"),buildUp:createContainerElementTab},{id:"ctabs-multiples",text:Ot["a"].getTranslation("MULTIPLE"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE"),buildUp:createContainerMultiplesTab},{id:"ctabs-text",text:Ot["a"].getTranslation("TEXT"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_TITLE"),buildUp:createContainerTextTab},{id:"ctabs-empty",text:Ot["a"].getTranslation("EMPTY"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_EMPTY"),buildUp:createContainerEmptyTab},{id:"ctabs-button",text:Ot["a"].getTranslation("BUTTON"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_BUTTON"),buildUp:createContainerButtonTab},{id:"ctabs-url",text:Ot["a"].getTranslation("URL"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL"),buildUp:createContainerUrlTab}];if(St["b"].Connector.ConnectorHelper.Support.ButtonPlus){Ce=5;ye.splice(5,0,{id:"ctabs-buttonplus",text:Ot["a"].getTranslation("BUTTON_PLUS"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_BUTTON_PLUS"),buildUp:createContainerButtonPlusTab})}$.open=function(){createDummyContainer();selectCurrentlyActiveElement();updateActiveChart();var e=St["b"].$(p).offset();var t=[{text:Ot["a"].getTranslation("OKAY"),id:"cellOkayButton",title:Ot["a"].getTranslation("HELP_CELL_OKAY"),click:$.okClose},{text:Ot["a"].getTranslation("CANCEL"),id:"cellCloseButton",title:Ot["a"].getTranslation("HELP_CELL_CANCEL"),click:$.cancel},{text:Ot["a"].getTranslation("APPLY"),id:"cellApplyButton",title:Ot["a"].getTranslation("HELP_CELL_ASSUME"),click:$.apply}];var i=new St["b"].UI.HiCoDialogDefinition("cellDialog",Ot["a"].getTranslation("CELL"),t);i.setPosition([e.left,e.right]);i.setWidth(x);i.setHeight(fe);he=i.getFontSize();i.setParentDomElement(p.parentNode);i.setTooltip(Ot["a"].getTranslation("HELP_CELL"));z=new St["b"].UI.HiCoDialog(i);z.setEscapeBeforeHandler(escapeBeforeHandler);z.setEscapeAfterHandler(escapeAfterHandler);W=z.getDialogDiv();z.setEvent("dialogresize",function(e,t){updateSizeForElements()});z.setCSS("overflow","hidden");var n={show:function(e,t){T=t.index;z.decorateTabs(t.index,xe);updateSizeForElements();if(t.index===1){g&&g.tabActivated()}}};var a=z.buildTabs("cellTabDiv",xe,W,"100%",{top:"0px",left:"0px"},n,true);St["b"].$(a).height("100%");z.setCSS();St["b"].$(".contextTabTable").width("100%");var r=document.getElementById("cellContainerTab");z.manipulateCssForLeftTabs(r,"70px",false);z.decorateTabs(0,xe);z.decorateTabs(0,ye);var o=u.landingTab&&xe.some(function(e){return e.id===u.landingTab});St["b"].$("#cellTabDiv",St["b"].$(W).parent()).tabs("select",o?u.landingTab:xe[0].id);var l=document.getElementById("cellContainerTabDiv");if(F){if(F.instanceOf==="ChartModel"||F.instanceOf==="TimeChartModel"||F.instanceOf==="TableModel"||F.instanceOf==="PlaceHolderModel"){St["b"].$(a).tabs("option","disabled",[2,3])}else if(F.instanceOf==="MultipleContainerModel"){St["b"].$(l).tabs("option","selected",1)}else if(F.instanceOf==="EmptyModel"){St["b"].$(l).tabs("option","selected",3)}else if(F.instanceOf==="UrlContainerModel"){St["b"].$(l).tabs("option","selected",St["b"].Connector.ConnectorHelper.Settings.CellDialog_UrlTabIndex)}else if(F.instanceOf==="ButtonModel"){St["b"].$(l).tabs("option","selected",4);updateButtonTab()}else if(F.instanceOf==="ButtonPlusModel"){St["b"].$(l).tabs("option","selected",5);updateButtonPlusTab(undefined,F)}else if(F.instanceOf==="ContainerCommentGridModel"){St["b"].$(l).tabs("option","selected",2)}}if(!X){if(!F||F.instanceOf==="PlaceHolderModel"){St["b"].$(l).tabs("option","selected",Ce)}St["b"].$(l).tabs("option","disabled",[0,1])}if(St["b"].$(l).tabs("option","selected")===0){z.getDialog().dialog("option","title",Ot["a"].getTranslation("SINGLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+(v!==null?" - "+v.name:""))}updateNavigationTab();updateKeyfiguresTab();updateDimensionsTab();St["b"].$(".ui-tabs-panel",St["b"].$(W).parent()).css("overflow-y","auto");var s=St["b"].$(W).height()-St["b"].$("#cellTabDiv > .ui-tabs-nav").height();St["b"].$(".ui-tabs-panel",St["b"].$(W).parent()).height(s-be);St["b"].$(".ui-tabs-panel","#cellContainerTab").height(s-Te);if(m){m.updateTableDivHeightFromOutside(St["b"].$(W).parent().height(),parseFloat(W.parentNode.style.width))}if(h){h.updateTableDivHeightFromOutside(St["b"].$(W).parent().height())}Ee=St["b"].$("#cellTabDiv > .ui-tabs-nav").height();var d=parseInt(z.highest());var c=parseInt(z.getDialog().offsetParent().css("z-index"));if(d>c){d+=1;z.getDialog().offsetParent().css("z-index",d)}};$.expressionsChangedCallback=function(){h.updateActiveKeyfigures(m.getActiveExpressions())};function createCommentIconsElements(e){var t=document.createElement("div");t.setAttribute("id","commentIconsContainer");t.style.marginTop="20px";t.style.display=e?"block":"none";var i=document.createElement("table");St["b"].Utils.DOM.setStyle(i,{borderCollapse:"separate",borderSpacing:"5px 0"});var n={borderBottom:"1px solid black"};z.buildTableRow(i,[{type:"text",value:Ot["a"].getTranslation("ALLOW_TOP"),tdStyle:n,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_COMMENT_ALLOW_TOP")},{type:"text",value:Ot["a"].getTranslation("ALLOW_RIGHT"),tdStyle:n,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_COMMENT_ALLOW_RIGHT")},{type:"text",value:Ot["a"].getTranslation("ALLOW_BOTTOM"),tdStyle:n,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_COMMENT_ALLOW_BOTTOM")},{type:"text",value:Ot["a"].getTranslation("ALLOW_LEFT"),tdStyle:n,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_COMMENT_ALLOW_LEFT")},{type:"text",value:Ot["a"].getTranslation("ALLOW_NUMBER"),tdStyle:n,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_COMMENT_ALLOW_NUMBER")}]);var a=document.createElement("tr");var r=["Yes","No","---"].concat(y);var o=["Top","Right","Bottom","Left","Number"];for(var l=0;l<o.length;l++){var s=o[l]==="Bottom"||o[l]==="Number"?"Yes":"No";if(w.extendedModel.instanceOf==="ContainerCommentGridModel"){var d=w.extendedModel["allow"+o[l]];if(r.indexOf(d)>=0){s=d}}var c=document.createElement("td");var u=St["b"].Utils.DOM.createSelectBox(c,"selectedAddCommentAllow_"+o[l].toLowerCase(),r,r,s,he);u.style.width="120px";St["b"].$(u).change(function(e){if(this.selectedIndex===2){this.selectedIndex=1}});a.appendChild(c)}i.appendChild(a);t.appendChild(i);return t}function updateSizeForElements(){var e=parseFloat(W.parentNode.style.height)-70;var t=parseFloat(W.parentNode.style.width);W.style.height=e;document.getElementById(xe[T].id).style.height=e-Ee-be+"px";if(T===0){document.getElementById(ye[c].id).style.height=e-Ee-Te+"px"}else if(T===4){if(h){h.updateTableDivHeightFromOutside(e+70)}}else if(T===5){if(m){m.updateTableDivHeightFromOutside(e+70,t)}}}function createNavigationTab(){var e=document.createElement("div");e.setAttribute("id","cellNavigationTab");return e}function updateNavigationTab(){var e=document.getElementById("cellNavigationTab");St["b"].$(e).empty();var t=null;if(l){t=n}else if(s){t=j.extendedModel}else{var i=ye[c].id;if(i==="ctabs-text"||i==="ctabs-empty"||i==="ctabs-button"||i==="ctabs-buttonplus"){t=V}}g=new St["b"].UI.NavigationMenu({extension:D,extendedModel:t});if(g.embed){g=g.embed(z,e)}else{g=null}}function updateButtonTab(){var e=document.getElementById("ButtonActionTable");St["b"].$(e).empty();var t=document.getElementById("button_Name");t.value=F.info.name;z.buildTableRow(e,[{type:"empty"},{type:"empty"},{type:"empty"},{type:"text",value:Ot["a"].getTranslation("EXTENSION"),tooltip:Ot["a"].getTranslation("")},{type:"text",value:Ot["a"].getTranslation("FUNCTION"),tooltip:Ot["a"].getTranslation("")}]);for(var i=0;i<F.info.actions.length;i++){var n=F.info.extensions[i];var a=F.info.actions[i];var r=[];if(F.info.edxArray){r=F.info.edxArray}addButtonRow(e,n,a,i,r,F.info.partialArray?F.info.partialArray:[])}}function saveNavigationSettings(){if(g){g.changeSelection()}}function createDimensionsTab(){var e=document.createElement("div");e.setAttribute("id","cellDimensionsTab");e.style.height="100%";return e}function updateDimensionsTab(e){var t=h?h.getActiveTab():null;var i=document.getElementById("cellDimensionsTab");St["b"].$(i).empty();if(!X){return i}h=null;var e=e!==undefined?e:chartElementSelected();if(n&&e&&m){h=new St["b"].UI.DimensionMenu({extension:D,model:{extendedModel:n},containerModel:w,activeKeyfigures:m.getActiveExpressions()});if(h.embed){h=h.embed(z,i,he,$.dimensionsChangedCallback);if(t!==null){h.setActiveTab(t)}}else{h=null}z.manipulateCssForLeftTabs(document.getElementById("cellContainerTab"),"70px",false)}}function saveDimensionsSettings(){if(h){h.changeSelection(true)}}function freeDimensionsResources(){if(h){h.freeResources()}}function createKeyfiguresTab(){var e=document.createElement("div");e.setAttribute("id","cellKeyfiguresTab");e.style.height="100%";return e}function updateKeyfiguresTab(e){var t=m?m.getActiveTab():null;var i=document.getElementById("cellKeyfiguresTab");St["b"].$(i).empty();m=null;var e=e!==undefined?e:chartElementSelected();if(n&&e){m=new St["b"].UI.VisualizationMenu({extension:D,chartModel:n});if(m.embed){m=m.embed(z,i,he,$.expressionsChangedCallback);if(t!==null){m.setActiveTab(t)}if(m.getSize()>x){St["b"].$(W).parent().width(m.getSize());St["b"].$(W).width(m.getSize());x=m.getSize()}else if(m.getSize()<x){x=m.getSize()}}else{m=null}z.manipulateCssForLeftTabs(document.getElementById("cellContainerTab"),"70px",false)}}function saveKeyfiguresSettings(){if(m){m.changeSelection(true)}}function freeKeyfiguresResources(){if(m){m.freeResources()}}function createMultipleCasesTab(){var e=document.createElement("div");e.setAttribute("id","cellMultipleCasesTab");e.style.height="100%";updateMultipleCasesTab(e);return e}function updateMultipleCasesTab(e){var e=e||document.getElementById("cellMultipleCasesTab");St["b"].$(e).empty();if(!X){return e}var t=j.extendedModel;var i=t.cases;var n=St["b"].$(W).parent().offset();var a={width:"80px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var r={width:"50px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var o={width:"50px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};var l={width:"100px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var s={borderBottom:"1px solid black"};var d={height:"10px",width:"10px",backgroundColor:"rgb(150,150,150)"};var c=document.createElement("table");St["b"].Utils.DOM.setStyle(c,{borderCollapse:"separate",borderSpacing:"5px 0"});function getTextStyle(e){return e==null?o:r}var u=Ot["a"].getTranslation("BORDER")+" mm/10pt ("+Ot["a"].getTranslation("CASE_SEQUENCE_PRIORITY")+")";z.buildTableRow(c,[{type:"empty",colSpan:"6"},{type:"text",value:u,colSpan:"8",tdStyle:s},{type:"text",value:Ot["a"].getTranslation("TITLE"),tooltip:Ot["a"].getTranslation("CELL_TITLE_BOLD")}]);z.buildTableRow(c,[{type:"empty",tdStyle:s},{type:"empty",tdStyle:s},{type:"empty",tdStyle:s},{type:"text",value:Ot["a"].getTranslation("NAME"),tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_NAME")},{type:"text",value:Ot["a"].getTranslation("APPLIES_TO"),tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_APPLIES")},{type:"text",value:Ot["a"].getTranslation("CONDITION"),tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_CONDITION")},{type:"text",value:Ot["a"].getTranslation("TOP"),colSpan:"2",tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_TOP")},{type:"text",value:Ot["a"].getTranslation("RIGHT"),colSpan:"2",tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_RIGHT")},{type:"text",value:Ot["a"].getTranslation("BOTTOM"),colSpan:"2",tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_BOTTOM")},{type:"text",value:Ot["a"].getTranslation("LEFT"),colSpan:"2",tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_LEFT")},{type:"text",value:Ot["a"].getTranslation("BOLD"),tdStyle:s,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_BOLD")}]);var p=document.createElement("tbody");for(var g=0;g<i.length;g++){var m=i[g];var h=i.length===1?"delete_small_grey.png":"delete_small.png";var f=i.length===1?null:removeMultipleCaseEventHandler;var v=m.borders.top.width==null?pe:(m.borders.top.width*10).toFixed(ge);var b=m.borders.right.width==null?pe:(m.borders.right.width*10).toFixed(ge);var T=m.borders.bottom.width==null?pe:(m.borders.bottom.width*10).toFixed(ge);var E=m.borders.left.width==null?pe:(m.borders.left.width*10).toFixed(ge);var x=[{type:"div",id:"cellMultipleCaseDragger##"+g,style:d,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_DRAGGER")},{type:"iconbutton",id:"cellMultipleAddCase##"+g,iconName:"add_small.png",click:addMultipleCaseEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_ADD_CASE")},{type:"iconbutton",id:"cellMultipleRemoveCase##"+g,iconName:h,click:f,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_REMOVE_CASE")},{type:"textinput",id:"cellMultipleCaseName##"+g,value:m.name,length:20,maxLength:20,style:a,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_NAME"),focusOut:changeMultipleCaseNameEventHandler},{type:"formulainput",id:"cellMultipleCaseApplies##"+g,buttonId:"cellMultipleCaseAppliesButton##"+g,formulaEditorId:"multiple.Case.Applies."+g,formulaObject:m.appliesFormula,calculator:Y,context:K,callerObject:$,callerDivOffset:n,formulaEditorType:rt["a"].formulaEdit.APPLIES_TO,formulaTitle:Ot["a"].getTranslation("FORMULA"),style:l,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_APPLIES")},{type:"formulainput",id:"cellMultipleCaseCondition##"+g,buttonId:"cellMultipleCaseConditionButton##"+g,formulaEditorId:"multiple.Case.Condition."+g,formulaObject:m.conditionFormula,calculator:Y,context:K,callerObject:$,callerDivOffset:n,formulaEditorType:rt["a"].formulaEdit.CONDITION,formulaTitle:Ot["a"].getTranslation("FORMULA"),style:l,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_CONDITION")},{type:"textinput",id:"cellMultipleCaseTopWidth##"+g,value:v,length:10,style:getTextStyle(m.borders.top.width),focusIn:notationFocusIn,focusOut:notationFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_MULT_CASES_TOP")},{type:"rgbdiv",id:"cellMultipleCaseTopColor##"+g,color:m.borders.top.color,withNotationCheckbox:true,notationColor:m.borders.top.notationColor},{type:"textinput",id:"cellMultipleCaseRightWidth##"+g,value:b,length:10,style:getTextStyle(m.borders.right.width),focusIn:notationFocusIn,focusOut:notationFocusOut},{type:"rgbdiv",id:"cellMultipleCaseRightColor##"+g,color:m.borders.right.color,withNotationCheckbox:true,notationColor:m.borders.right.notationColor},{type:"textinput",id:"cellMultipleCaseBottomWidth##"+g,value:T,length:10,style:getTextStyle(m.borders.bottom.width),focusIn:notationFocusIn,focusOut:notationFocusOut},{type:"rgbdiv",id:"cellMultipleCaseBottomColor##"+g,color:m.borders.bottom.color,withNotationCheckbox:true,notationColor:m.borders.bottom.notationColor},{type:"textinput",id:"cellMultipleCaseLeftWidth##"+g,value:E,length:10,style:getTextStyle(m.borders.left.width),focusIn:notationFocusIn,focusOut:notationFocusOut},{type:"rgbdiv",id:"cellMultipleCaseLeftColor##"+g,color:m.borders.left.color,withNotationCheckbox:true,notationColor:m.borders.left.notationColor},{type:"checkbox",id:"cellMultipleCaseTitleBold##"+g,checked:m.titleBold,tooltip:Ot["a"].getTranslation("CELL_TITLE_BOLD"),tdStyle:{textAlign:"center"}}];z.buildTableRow(p,x)}c.appendChild(p);if(i.length>1){St["b"].$(p).sortable({axis:"y",containment:p,cursor:"crosshair",distance:3,tolerance:"pointer",stop:sortMultipleCasesEventHandler})}e.appendChild(c);return e}function addMultipleCaseEventHandler(e){applyMultipleSettings();var t=j.extendedModel.cases[parseInt(this.id.split("##").pop())];St["b"].Models.Actions.ExtendedModelActions.MultipleContainerModel.addNewCase(j.extendedModel,t);updateMultipleCasesTab();updateMultipleElementsTab()}function removeMultipleCaseEventHandler(e){applyMultipleSettings();var t=parseInt(this.id.split("##").pop());St["b"].Models.Actions.ExtendedModelActions.MultipleContainerModel.deleteCase(j.extendedModel,t);updateMultipleCasesTab();updateMultipleElementsTab()}function changeMultipleCaseNameEventHandler(e){var t=j.extendedModel;var i=parseInt(this.id.split("##")[1]);var n=this.value;for(var a=0;a<t.cases.length;a++){var r=t.cases[a];if(a!==i&&r.name===n){this.value=t.cases[i].name;break}}t.cases[i].name=n;applyMultipleSettings();updateMultipleElementsTab()}function sortMultipleCasesEventHandler(e,t){var i=e.target.childNodes;var n=j.extendedModel;var a=[];var r=[],o=[],l=[];var s=false;var d=0;for(var c=0;c<i.length;c++){var u=i[c].childNodes[0].childNodes[0];var p=parseInt(u.id.split("##").pop());a.push(n.cases[p]);r.push(n.timeElements[p]);o.push(n.structureElements[p]);l.push(n.tableElements[p]);if(p===O){d=c}if(c!==p){s=true}}if(s){applyMultipleSettings();O=d;n.cases=a;n.timeElements=r;n.structureElements=o;n.tableElements=l;updateMultipleCasesTab();updateMultipleElementsTab()}}function notationFocusIn(e){this.style.color="";if(this.value===pe){this.value=""}}function notationFocusOut(e){if(this.value===""){this.value=pe;this.style.color="rgb(150,150,150)"}}function createMultipleElementsTab(){var e=document.createElement("div");e.setAttribute("id","cellMultipleElementsTab");e.style.height="100%";updateMultipleElementsTab(e);return e}function updateMultipleElementsTab(e){var e=e||document.getElementById("cellMultipleElementsTab");St["b"].$(e).empty();if(!X){return e}var T=j.extendedModel;var E=St["b"].$(W).parent().offset();var t={borderBottom:"1px solid black"};var x={width:"10px",height:"10px",background:"rgb(0, 176, 240)"};var C={width:"10px",height:"10px",background:"rgb(150, 150, 150)"};var y=document.createElement("table");St["b"].Utils.DOM.setStyle(y,{borderCollapse:"separate",borderSpacing:"5px 0"});z.buildTableRow(y,[{type:"text",value:Ot["a"].getTranslation("CASE"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_NAME")},{type:"text",value:Ot["a"].getTranslation("GRID_CELL"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_GRID_CELL"),colSpan:"3",tdStyle:t},{type:"empty"},{type:"empty"},{type:"empty"},{type:"text",value:Ot["a"].getTranslation("CONDITION"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_CONDITION")},{type:"text",value:Ot["a"].getTranslation("CONTEXT"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_CONTEXT")},{type:"text",value:Ot["a"].getTranslation("ALIGNMENT"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_ALIGNMENT"),colSpan:"2",tdStyle:t},{type:"text",value:Ot["a"].getTranslation("AXIS"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_AXIS_LINKING")}]);z.buildTableRow(y,[{type:"empty",tdStyle:t},{type:"text",value:Ot["a"].getTranslation("ROW"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_ROW"),tdStyle:t},{type:"text",value:Ot["a"].getTranslation("COLUMN"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_COLUMN"),tdStyle:t},{type:"empty",tdStyle:t},{type:"empty",tdStyle:t},{type:"empty",tdStyle:t},{type:"empty",tdStyle:t},{type:"empty",tdStyle:t},{type:"text",value:Ot["a"].getTranslation("OVERWRITES_MULTIPLE_CONTEXT"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_OVERWRITES_MULTIPLE_CONTEXT"),tdStyle:t},{type:"text",value:Ot["a"].getTranslation("DIMENSIONS"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_DIMENSIONS"),tdStyle:t},{type:"text",value:Ot["a"].getTranslation("ELEMENTS"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_ELEMENTS"),tdStyle:t},{type:"text",value:Ot["a"].getTranslation("LINKING"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_AXIS_LINKING"),tdStyle:t}]);var d=false,c=null;function switchClickHandler(e){var t=this.id.split("##");t[2]=parseInt(t[2]);t[3]=parseInt(t[3]);t[4]=parseInt(t[4]);if(d){if(t[1]===c[1]&&t[2]===c[2]&&t[3]===c[3]&&t[4]===c[4]){c=null;d=false;for(var i=0;i<y.childNodes.length;i++){var n=y.childNodes[i];if(n.tagName.toUpperCase()!=="TBODY"){continue}var a=n.childNodes[0].childNodes[3].childNodes[0];var r=a.id.split("##");if(r[1]===t[1]){a.setAttribute("src",Se["a"].imgPath+"refresh_small.png");a.setAttribute("title",Ot["a"].getTranslation("HELP_CELL_SUBCASES_SWITCH_POSITIONS1"))}}}else if(t[1]===c[1]){applyMultipleSettings();saveKeyfiguresSettings();saveDimensionsSettings();var o=j.extendedModel[t[1]+"Elements"];var l=o[t[2]].nodes[t[3]];o[t[2]].nodes[t[3]]=o[c[2]].nodes[c[3]];o[c[2]].nodes[c[3]]=l;var s=false;if(t[1]===S&&t[2]===O&&t[3]===L){O=c[2];L=c[3];s=true}else if(c[1]===S&&c[2]===O&&c[3]===L){O=t[2];L=t[3];s=true}if(s){updateActiveChart();updateKeyfiguresTab();updateDimensionsTab();z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+" - "+v.name)}updateMultipleElementsTab()}}else{for(var i=0;i<y.childNodes.length;i++){var n=y.childNodes[i];if(n.tagName.toUpperCase()!=="TBODY"){continue}var a=n.childNodes[0].childNodes[3].childNodes[0];var r=a.id.split("##");if(r[1]!==t[1]){continue}if(t[2]!==parseInt(r[2])||t[3]!==parseInt(r[3])||t[4]!==parseInt(r[4])){a.setAttribute("src",Se["a"].imgPath+"chevron_left_small.png");a.setAttribute("title",Ot["a"].getTranslation("HELP_CELL_SUBCASES_SWITCH_POSITIONS2"))}else{a.setAttribute("title",Ot["a"].getTranslation("HELP_CELL_SUBCASES_SWITCH_POSITIONS3"))}}c=t;d=true}}function buildRowsForType(e,t,i,n){z.buildTableRow(y,[{type:"text",value:i,colSpan:"12",style:{fontWeight:"bold"}}]);for(var a=0;a<e.length;a++){var r=e[a].nodes;for(var o=0;o<r.length;o++){var l=r[o].nodes;var s=document.createElement("tbody");for(var d=0;d<l.length;d++){var c=l[d];var u=new Array(11);var p=t+"##"+a+"##"+o+"##"+d;if(d===0&&o===0){if(a!==0){z.buildTableRow(y,[{type:"separator",colSpan:"12"}])}u[0]={type:"text",value:T.cases[a].name};var g=Math.floor(o/n)+1;var m=o%n+1;u[1]={type:"text",value:g.toString(10),id:"cellMultipleSwitchRow##"+p,tdStyle:{textAlign:"right"},click:switchClickHandler};u[2]={type:"text",value:m.toString(10),id:"cellMultipleSwitchCol##"+p,tdStyle:{textAlign:"right"},click:switchClickHandler};u[3]={type:"iconbutton",id:"cellMultipleSwitch##"+p,iconName:"refresh_small.png",click:switchClickHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_SWITCH_POSITIONS1")}}else if(d===0){var g=Math.floor(o/n)+1;var m=o%n+1;if(m>1){z.buildTableRow(y,[{type:"empty"},{type:"empty"},{type:"separator",colSpan:"10"}])}else{z.buildTableRow(y,[{type:"empty"},{type:"separator",colSpan:"11"}])}u[0]={type:"empty"};u[1]=m>1?{type:"empty"}:{type:"text",value:g.toString(10),id:"cellMultipleSwitchRow##"+p,tdStyle:{textAlign:"right"},click:switchClickHandler};u[2]={type:"text",value:m.toString(10),id:"cellMultipleSwitchCol##"+p,tdStyle:{textAlign:"right"},click:switchClickHandler};u[3]={type:"iconbutton",id:"cellMultipleSwitch##"+p,iconName:"refresh_small.png",click:switchClickHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_SWITCH_POSITIONS1")}}else{u[0]={type:"empty"};u[1]={type:"empty"};u[2]={type:"empty"};u[3]={type:"empty"}}u[4]={type:"iconbutton",id:"cellMultipleAddElement##"+p,iconName:"add_small.png",click:addMultipleElementEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_ADD")};var h=l.length===1?"delete_small_grey.png":"delete_small.png";var f=l.length===1?null:removeMultipleElementEventHandler;u[5]={type:"iconbutton",id:"cellMultipleRemoveElement##"+p,iconName:h,click:f,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_REMOVE")};var v=S===t&&O===a&&L===o&&A===d?x:C;u[6]={type:"div",id:"cellMultipleElementDragger##"+p,style:v,click:selectActiveMultipleChart,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_DRAGGER")};var b=M.getContextByCid(c.model.contextId);u[7]={type:"formulainput",id:"cellMultipleElementCondition##"+p,buttonId:"cellMultipleElementConditionButton##"+p,formulaEditorId:"multiple.Element.Condition."+t+"."+a+"."+o+"."+d,formulaObject:c,calculator:Y,context:b,callerObject:$,callerDivOffset:E,formulaEditorType:rt["a"].formulaEdit.QV_CONDITION,formulaTitle:Ot["a"].getTranslation("FORMULA"),tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_FORMULA")};u[8]={type:"selectbox",id:"cellMultipleElementContext##"+p,value:c.model.contextId,values:Q,translations:Z,change:changeMultipleElementContextEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_OVERWRITES_MULTIPLE_CONTEXT"),width:"200px"};u[9]={type:"selectbox",id:"cellMultipleElementAlignmentCategory##"+p,value:c.model.axisAlignmentCategory,values:_,translations:I,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_DIMENSIONS")};u[10]={type:"selectbox",id:"cellMultipleElementAlignmentElement##"+p,value:c.model.axisAlignmentElement,values:ee,translations:te,tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_ELEMENTS")};u[11]={type:"checkbox",id:"cellMultipleElementAxisLinking##"+p,checked:c.model.axisLinking==true,tdStyle:{textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_SUBCASES_AXIS_LINKING")};z.buildTableRow(s,u)}y.appendChild(s);if(l.length>1){St["b"].$(s).sortable({axis:"y",containment:s,cursor:"crosshair",distance:3,tolerance:"pointer",stop:sortMultipleElementsEventHandler})}}}}if(T.timeActive){buildRowsForType(T.timeElements,"time",Ot["a"].getTranslation("TIME"),T.timeCellCategoryCount)}if(T.structureActive){buildRowsForType(T.structureElements,"structure",Ot["a"].getTranslation("STRUCTURE"),T.structureCellValueCount)}if(T.tableActive){buildRowsForType(T.tableElements,"table",Ot["a"].getTranslation("TABLE"),T.tableCellValueCount)}e.appendChild(y);return e}function addMultipleElementEventHandler(e){applyMultipleSettings();var t=this.id.split("##");var i=j.extendedModel;var n=t[1],a=parseInt(t[2]),r=parseInt(t[3]),o=parseInt(t[4]);var l=i[n+"Elements"][a].nodes[r].nodes;var s=JSON.parse(JSON.stringify(l[o]));l.push(s);updateMultipleElementsTab()}function removeMultipleElementEventHandler(e){applyMultipleSettings();saveKeyfiguresSettings();saveDimensionsSettings();var t=this.id.split("##");var i=j.extendedModel;var n=t[1],a=parseInt(t[2]),r=parseInt(t[3]),o=parseInt(t[4]);var l=i[n+"Elements"][a].nodes[r].nodes;if(l.length>1){l.splice(o,1);if(n===S&&a===O&&r===L&&o<=A){if(A===l.length||o<A){A--}updateActiveChart();updateKeyfiguresTab();updateDimensionsTab();z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+" - "+v.name)}updateMultipleElementsTab()}}function selectActiveMultipleChart(e){saveKeyfiguresSettings();saveDimensionsSettings();var t=this.id.split("##");S=t[1];O=parseInt(t[2]);L=parseInt(t[3]);A=parseInt(t[4]);updateActiveChart();z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+" - "+v.name);updateKeyfiguresTab();updateDimensionsTab();St["b"].Utils.DOM.setStyle(this,{background:"rgb(0, 176, 240)"});function updateDraggerColors(e,t){for(var i=0;i<e.length;i++){var n=e[i].nodes;for(var a=0;a<n.length;a++){var r=n[a].nodes;for(var o=0;o<r.length;o++){if(S!==t||O!==i||L!==a||A!==o){var l=document.getElementById("cellMultipleElementDragger##"+t+"##"+i+"##"+a+"##"+o);St["b"].Utils.DOM.setStyle(l,{background:"rgb(150, 150, 150)"})}}}}}var i=j.extendedModel;if(i.timeActive){updateDraggerColors(i.timeElements,"time")}if(i.structureActive){updateDraggerColors(i.structureElements,"structure")}}function changeMultipleElementContextEventHandler(e){var t=j.extendedModel;var i=this.id.split("##");var n=i[1],a=parseInt(i[2]),r=parseInt(i[3]),o=parseInt(i[4]);var l=t[n+"Elements"][a].nodes[r].nodes[o].model;l.contextId=Q[this.selectedIndex];if(sameContextAndTypeOfMultipleElement(n,a,r,o)){var s=w.extendedModel[n+"Elements"][a].nodes[r].nodes[o];l.expressions=s.model.expressions;l.compares=s.model.compares;l.highlights=s.model.highlights;if(l.stackMode){l.stackMode=s.model.stackMode}else if(l.rowDefinitions){l.rowDefinitions=s.model.rowDefinitions;l.columnDefinitions=s.model.columnDefinitions}}else{l.expressions=[];l.compares=[];l.highlights=[];l.dimensionLabelModel.dimensionFormulaRepository=[];if(l.stackMode){l.stackMode=false}else if(l.rowDefinitions){l.rowDefinitions=[];l.columnDefinitions=[]}}if(S===n&&O===a&&L===r&&A===o){updateActiveContext();z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+" - "+v.name);updateKeyfiguresTab();updateDimensionsTab()}}function sortMultipleElementsEventHandler(e,t){var i=e.target.childNodes;var n=j.extendedModel;var a=i[0].childNodes[5].childNodes[0];var r=a.id.split("##");var o=r[1];var l=parseInt(r[2]);var s=parseInt(r[3]);var d=n[o+"Elements"][l].nodes[s].nodes;var c=[];var u=false;var p=0;for(var g=0;g<i.length;g++){var a=i[g].childNodes[5].childNodes[0];var r=a.id.split("##");var m=parseInt(r[4]);c.push(d[m]);if(m===A){p=g}if(g!==m){u=true}}if(u){if(S===o&&O===l&&L===s){applyMultipleSettings();saveKeyfiguresSettings();saveDimensionsSettings()}n[o+"Elements"][l].nodes[s].nodes=c;if(S===o&&O===l&&L===s){A=p;updateActiveChart();updateKeyfiguresTab();updateDimensionsTab()}updateMultipleElementsTab()}}function createContainerTab(){var e=document.createElement("div");e.setAttribute("id","cellContainerTab");e.style.height="100%";var t={select:function(e,t){z.decorateTabs(t.index,ye);var i=document.getElementById("cellTabDiv");c=t.index;if(s){applyMultipleSettings();saveKeyfiguresSettings();saveDimensionsSettings()}else if(l){saveKeyfiguresSettings();saveDimensionsSettings()}saveNavigationSettings();switch(t.index){case 0:St["b"].$(i).tabs("option","disabled",[2,3]);z.enableButton("cellApplyButton");z.enableButton("cellOkayButton");l=true;s=false;break;case 1:if(j.extendedModel.dimensions.length>0){St["b"].$(i).tabs("option","disabled",[]);z.enableButton("cellApplyButton");z.enableButton("cellOkayButton")}else{St["b"].$(i).tabs("option","disabled",[1,2,3,4,5]);z.disableButton("cellApplyButton");z.disableButton("cellOkayButton")}l=false;s=true;break;case 2:case 3:case 4:case 5:case 6:var n=t.index===5||t.index===6?[1,2,3,4,5]:[2,3,4,5];St["b"].$(i).tabs("option","disabled",n);z.enableButton("cellApplyButton");z.enableButton("cellOkayButton");l=false;s=false;break}var a=l||s;if(a){updateActiveChart()}var r=U?U:w.id;switch(t.index){case 0:z.getDialog().dialog("option","title",Ot["a"].getTranslation("SINGLE")+" "+Ot["a"].getTranslation("CELL")+" - "+r+(v?" - "+v.name:""));break;case 1:z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+r+(v?" - "+v.name:""));break;case 2:z.getDialog().dialog("option","title",Ot["a"].getTranslation("TEXT")+" "+Ot["a"].getTranslation("CELL")+" - "+r);break;case 3:z.getDialog().dialog("option","title",Ot["a"].getTranslation("EMPTY")+" "+Ot["a"].getTranslation("CELL")+" - "+r);break;case 4:case 5:case 6:var o=t.index===St["b"].Connector.ConnectorHelper.Settings.CellDialog_UrlTabIndex?Ot["a"].getTranslation("URL"):Ot["a"].getTranslation("BUTTON");z.getDialog().dialog("option","title",o+" "+Ot["a"].getTranslation("CELL")+" - "+r)}updateNavigationTab();updateKeyfiguresTab(a);updateDimensionsTab(a);document.getElementById(ye[c].id).style.height=parseFloat(W.parentNode.style.height)-70-Ee-Te+"px"}};z.buildTabs("cellContainerTabDiv",ye,e,"100%",{top:"0px",left:"85px"},t,true);return e}function createContainerElementTab(){return document.createElement("div")}$.setValuesFromFormulaEditorCFM=function(e,t){var i=t.split(".");if(i[0]==="buttonplus"){var n=document.getElementById(t);n.value=Y.invertNames(Y.decode(e.formula));H.states[i[2]].condition.formula=e.formula;H.states[i[2]].condition.compiledFormula=e.compiledFormula}else if(i[0]==="url"){var n=document.getElementById("cellUrlExpression");n.value=Y.invertNames(Y.decode(e.formula));k.urlFormula.formula=e.formula;k.urlFormula.compiledFormula=e.compiledFormula}else if(i[0]==="multiple"){switch(i[1]){case"Case":var a=parseInt(i[3]);var r=j.extendedModel.cases[a];var n,o;if(r){if(i[2]==="Applies"){o=r.appliesFormula;n=document.getElementById("cellMultipleCaseApplies##"+i[3])}else if(i[2]==="Condition"){o=r.conditionFormula;n=document.getElementById("cellMultipleCaseCondition##"+i[3])}}if(n!==null&&n!==undefined){o.formula=e.formula;o.compiledFormula=e.compiledFormula;n.value=Y.invertNames(Y.decode(e.formula))}break;case"Element":if(i[2]==="Condition"){var l=i[3],a=parseInt(i[4]),s=parseInt(i[5]),d=parseInt(i[6]);try{var c=j.extendedModel[l+"Elements"][a].nodes[s].nodes[d];c.formula=e.formula;c.compiledFormula=e.compiledFormula;var n=document.getElementById("cellMultipleElementCondition##"+l+"##"+a+"##"+s+"##"+d);n.value=Y.invertNames(Y.decode(e.formula))}catch(e){}}break;case"ChartTypeActive":var u,n;if(i[2]==="time"){u=j.extendedModel.timeFormula;n=document.getElementById("selectedMultipleTimeFormula")}else if(i[2]==="structure"){u=j.extendedModel.structureFormula;n=document.getElementById("selectedMultipleStructureFormula")}else{u=j.extendedModel.tableFormula;n=document.getElementById("selectedMultipleTableFormula")}if(n!==null){u.formula=e.formula;u.compiledFormula=e.compiledFormula;n.value=Y.invertNames(Y.decode(e.formula))}break}}else{var p=parseInt(i[2]);if(p>=0&&p<B.charts.length){B.charts[p].formula=e.formula;B.charts[p].compiledFormula=e.compiledFormula;var g=document.getElementById("selectedFormulaElement."+p);g.value=Y.invertNames(Y.decode(e.formula))}}};function createContainerMultiplesTab(){var e=document.createElement("div");e.setAttribute("id","cellContainerMultipleTab");e.style.padding=ve;updateContainerMultiplesTab(e);return e}function updateContainerMultiplesTab(e){var e=e||document.getElementById("cellContainerMultipleTab");St["b"].$(e).empty();if(!X){return e}var t=j.extendedModel;var i=document.createElement("table");St["b"].Utils.DOM.setStyle(i,{borderSpacing:"0"});var n=document.createElement("tr");var a=document.createElement("tr");var r=document.createElement("tr");var o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,{verticalAlign:"top"});var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{verticalAlign:"top"});var s=document.createElement("td");St["b"].Utils.DOM.setStyle(s,{verticalAlign:"top"});var d={width:"55px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var c={width:"55px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};var u={width:"100%",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var p={width:"100%",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};var g={width:"100px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var m={borderBottom:"1px solid black"};var h={borderBottom:"1px solid black",textAlign:"right"};var f={borderBottom:"1px solid black",textAlign:"center"};var v={textAlign:"center"};var b=document.createElement("table");St["b"].Utils.DOM.setStyle(b,{borderCollapse:"separate",borderSpacing:"5px 0",width:"100%"});z.buildTableRow(b,[{type:"text",value:Ot["a"].getTranslation("DIMENSIONS_OF_CONTEXT"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_CONTEXT")},{type:"text",value:Ot["a"].getTranslation("FONT"),colSpan:"4",tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT")},{type:"text",value:Ot["a"].getTranslation("OPTIMIZE_CELL"),colSpan:"2",tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_OPTIMIZE_CELL")},{type:"text",value:Ot["a"].getTranslation("VALUE"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_VALUE_LINKING")},{type:"text",value:Ot["a"].getTranslation("EXPAND"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_EXPAND_DIMENSIONS")}]);z.buildTableRow(b,[{type:"text",value:"",tdStyle:m},{type:"text",value:Ot["a"].getTranslation("TITLE_SIZE"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_TITLE_SIZE")},{type:"text",value:Ot["a"].getTranslation("CHART_SIZE"),colSpan:"2",tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_CHART_SIZE")},{type:"text",value:Ot["a"].getTranslation("CHART_STEP"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_CHART_STEP")},{type:"text",value:Ot["a"].getTranslation("ORDER"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_OPTIMIZE_CELL_ORDER")},{type:"text",value:Ot["a"].getTranslation("STRUCTURE_SIZE"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_OPTIMIZE_CELL_STRUCTURE_SIZE")},{type:"text",value:Ot["a"].getTranslation("LINKING"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_VALUE_LINKING")},{type:"text",value:Ot["a"].getTranslation("DIMENSIONS"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_EXPAND_DIMENSIONS")}]);var T=t.inputFontSize==null?pe:t.inputFontSize.toString(10);var E=t.inputFontSize==null?c:d;var x=t.titleFontSize==null?St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART"):t.titleFontSize.toString(10);var C=[{type:"selectbox",id:"selectedMultipleContext",value:t.contextId,values:Q,width:"200px",translations:Z,change:changeMultipleContextEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_CONTEXT")},{type:"textinput",id:"selectedMultipleFontSizeTitle",value:x,length:2,maxLength:2,style:d,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT")},{type:"textinput",id:"selectedMultipleFontSize",value:T,length:2,maxLength:2,style:E,focusIn:notationFocusIn,focusOut:notationFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_CHART_SIZE")},{type:"selectbox",id:"selectedMultipleFontSizeType",value:t.fontSizeType,values:ne,translations:ae,style:{marginLeft:"auto",display:"block"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_CHART_STEP_DROPDOWN")},{type:"selectbox",id:"selectedMultipleFontStep",value:t.fontStep,values:re,translations:oe,style:{marginLeft:"auto",display:"block"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FONT_CHART_STEP")},{type:"checkbox",id:"selectedMultipleOptimizeCellOrder",group:"selectedMultipleOptimizeCellOrderG",value:"",checked:t.optimizeCellOrder,tdStyle:v,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_OPTIMIZE_CELL_ORDER")},{type:"checkbox",id:"selectedMultipleOptimizeCellStructureSize",group:"selectedMultipleOptimizeCellStructureSizeG",value:"",checked:t.optimizeCellStructureSize,tdStyle:v,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_OPTIMIZE_CELL_STRUCTURE_SIZE")},{type:"checkbox",id:"selectedMultipleValueLinking",group:"selectedMultipleValueLinkingG",value:"",tdStyle:v,checked:t.valueLinking,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_VALUE_LINKING")},{type:"checkbox",id:"selectedMultipleExpandCategories",group:"selectedMultipleExpandCategoriesG",value:"",checked:t.expandCategories,tdStyle:v,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_EXPAND_DIMENSIONS")}];z.buildTableRow(b,C);o.appendChild(b);var b=document.createElement("table");St["b"].Utils.DOM.setStyle(b,{borderCollapse:"separate",borderSpacing:"5px 0",width:"100%"});z.buildTableRow(b,[{type:"empty",colSpan:"10",tdStyle:m}]);z.buildTableRow(b,[{type:"text",value:Ot["a"].getTranslation("TYPE"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_TYPE")},{type:"text",value:Ot["a"].getTranslation("FORMULA"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FORMULA")},{type:"text",value:Ot["a"].getTranslation("STRUCTURE_IN_N"),colSpan:"2",tdStyle:m},{type:"text",value:Ot["a"].getTranslation("CELL_SIZE_IN_MMPT"),colSpan:"2",tdStyle:m},{type:"text",value:Ot["a"].getTranslation("CELL_STRUCTURE_IN_N"),colSpan:"3",tdStyle:m}]);z.buildTableRow(b,[{type:"text",value:"",tdStyle:m},{type:"text",value:"",tdStyle:m},{type:"text",value:Ot["a"].getTranslation("DIMENSIONS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_DIMENSION")},{type:"text",value:Ot["a"].getTranslation("ELEMENTS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_ELEMENT")},{type:"text",value:Ot["a"].getTranslation("DIMENSIONS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_DIMENSION")},{type:"text",value:Ot["a"].getTranslation("ELEMENTS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_ELEMENT")},{type:"text",value:Ot["a"].getTranslation("DIMENSIONS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_DIMENSION")},{type:"text",value:Ot["a"].getTranslation("ELEMENTS"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_ELEMENT")},{type:"text",value:Ot["a"].getTranslation("SIZE"),tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_PLUS")}]);function getTextStyle(e){return e==null?c:d}var y=St["b"].$(W).parent().offset();var M=t.timeMultipleValueCount==null?ue:t.timeMultipleValueCount.toString(10);var S=t.timeMultipleCategoryCount==null?ue:t.timeMultipleCategoryCount.toString(10);var O=t.timeCellValueSize==null?ue:(t.timeCellValueSize*10).toFixed(me);var L=t.timeCellCategorySize==null?ue:(t.timeCellCategorySize*10).toFixed(me);var C=[{type:"iconbutton",id:"selectedMultipleTimeActive",group:"selectedMultipleTimeActiveG",iconName:"time.png",click:changeMultipleActiveChartTypes,tdStyle:{width:"12px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_ACTIVE"),style:{width:"16px"},active:t.timeActive},{type:"formulainput",id:"selectedMultipleTimeFormula",buttonId:"selectedMultipleTimeFormulaButton",formulaEditorId:"multiple.ChartTypeActive.time",formulaObject:t.timeFormula,calculator:Y,context:K,callerObject:$,callerDivOffset:y,formulaEditorType:rt["a"].formulaEdit.QV_CONDITION,formulaTitle:Ot["a"].getTranslation("FORMULA"),style:g,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FORMULA")},{type:"textinput",id:"selectedMultipleTimeMultipleCategoryCount",value:S,length:2,maxLength:2,tdStyle:v,style:getTextStyle(t.timeMultipleCategoryCount),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_DIMENSION")},{type:"textinput",id:"selectedMultipleTimeMultipleValueCount",value:M,length:2,maxLength:2,tdStyle:v,style:getTextStyle(t.timeMultipleValueCount),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_ELEMENT")},{type:"textinput",id:"selectedMultipleTimeCellCategorySize",value:L,length:7,maxLength:10,tdStyle:v,style:getTextStyle(t.timeCellCategorySize),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_DIMENSION")},{type:"textinput",id:"selectedMultipleTimeCellValueSize",value:O,length:7,maxLength:10,tdStyle:v,style:getTextStyle(t.timeCellValueSize),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_ELEMENT")},{type:"textinput",id:"selectedMultipleTimeCellCategoryCount",value:t.timeCellCategoryCount.toString(10),length:2,maxLength:2,style:d,tdStyle:v,focusOut:changedMultipleCellGridStructureEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_DIMENSION")},{type:"textinput",id:"selectedMultipleTimeCellValueCount",value:t.timeCellValueCount.toString(10),length:2,maxLength:2,style:d,tdStyle:v,focusOut:changedMultipleCellGridStructureEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_ELEMENT")},{type:"iconbutton",id:"selectedMultipleTimeCellGridSizes",iconName:"add_small.png",click:editMultipleCellGridSizes,tdStyle:{width:"20px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_PLUS")}];z.buildTableRow(b,C);var M=t.structureMultipleValueCount==null?ue:t.structureMultipleValueCount.toString(10);var S=t.structureMultipleCategoryCount==null?ue:t.structureMultipleCategoryCount.toString(10);var O=t.structureCellValueSize==null?ue:(t.structureCellValueSize*10).toFixed(me);var L=t.structureCellCategorySize==null?ue:(t.structureCellCategorySize*10).toFixed(me);var C=[{type:"iconbutton",id:"selectedMultipleStructureActive",group:"selectedMultipleStructureActiveG",iconName:"structure.png",click:changeMultipleActiveChartTypes,tdStyle:{width:"12px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_ACTIVE"),style:{width:"16px"},active:t.structureActive},{type:"formulainput",id:"selectedMultipleStructureFormula",buttonId:"selectedMultipleStructureFormulaButton",formulaEditorId:"multiple.ChartTypeActive.structure",formulaObject:t.structureFormula,calculator:Y,context:K,callerObject:$,callerDivOffset:y,formulaEditorType:rt["a"].formulaEdit.QV_CONDITION,formulaTitle:Ot["a"].getTranslation("FORMULA"),style:g,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_FORMULA")},{type:"textinput",id:"selectedMultipleStructureMultipleCategoryCount",value:S,length:2,maxLength:2,tdStyle:v,style:getTextStyle(t.structureMultipleCategoryCount),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_DIMENSION")},{type:"textinput",id:"selectedMultipleStructureMultipleValueCount",value:M,length:2,maxLength:2,tdStyle:v,style:getTextStyle(t.structureMultipleValueCount),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_STRUCTURE_ELEMENT")},{type:"textinput",id:"selectedMultipleStructureCellCategorySize",value:L,length:7,maxLength:10,tdStyle:v,style:getTextStyle(t.structureCellCategorySize),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_DIMENSION")},{type:"textinput",id:"selectedMultipleStructureCellValueSize",value:O,length:7,maxLength:10,tdStyle:v,style:getTextStyle(t.structureCellValueSize),focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELL_ELEMENT")},{type:"textinput",id:"selectedMultipleStructureCellCategoryCount",value:t.structureCellCategoryCount.toString(10),length:2,maxLength:2,style:d,tdStyle:v,focusOut:changedMultipleCellGridStructureEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_DIMENSION")},{type:"textinput",id:"selectedMultipleStructureCellValueCount",value:t.structureCellValueCount.toString(10),length:2,maxLength:2,style:d,tdStyle:v,focusOut:changedMultipleCellGridStructureEventHandler,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_CELLSTRUCTURE_ELEMENT")},{type:"iconbutton",id:"selectedMultipleStructureCellGridSizes",iconName:"add_small.png",click:editMultipleCellGridSizes,tdStyle:{width:"20px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_PLUS")}];z.buildTableRow(b,C);l.appendChild(b);var b=document.createElement("table");St["b"].Utils.DOM.setStyle(b,{borderCollapse:"separate",borderSpacing:"5px 0",width:"100%"});z.buildTableRow(b,[{type:"empty",colSpan:"7",tdStyle:m}]);z.buildTableRow(b,[{type:"iconbutton",id:"selectedMultipleAddDimension",iconName:"add_small.png",click:addMultipleDimensionEventHandler,tdStyle:{borderBottom:"1px solid black",width:"20px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_ADD")},{type:"text",value:Ot["a"].getTranslation("DIMENSION"),tdStyle:m,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_DIMENSION")},{type:"text",value:Ot["a"].getTranslation("ORIENTATION"),tdStyle:f,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_ORIENTATION")},{type:"text",value:Ot["a"].getTranslation("ALIGNMENT"),tdStyle:f,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_ALIGNMENT")},{type:"text",value:Ot["a"].getTranslation("BREAK_TEXT"),tdStyle:f,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_BREAKTEXT")},{type:"text",value:Ot["a"].getTranslation("SIZE")+" mm/10pt",tdStyle:h,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_SIZE")},{type:"text",value:Ot["a"].getTranslation("TOTALS"),tdStyle:f,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_TOTALS")}]);var A=document.createElement("div");A.setAttribute("id","hiddenDivCell");St["b"].Utils.DOM.setStyle(A,{position:"absolute",visibility:"hidden",height:"auto",width:"auto"});A.style.fontSize=he;W.appendChild(A);var _=200;var I=[],D=[];for(var R=0;R<K.rows.length-1;R++){var N=K.rows[R].name;A.innerHTML=N;while(A.offsetWidth>=_){N=N.substr(0,N.length-1);A.innerHTML=N+"..."}I.push(K.rows[R].name===N?N:N+"...");D.push(K.rows[R].name)}St["b"].$(A).remove();for(var P=0;P<t.dimensions.length;P++){var w=t.dimensions[P];var U=P===t.dimensions.length-1?"delete_small.png":"delete_small_grey.png";var F=P===t.dimensions.length-1?removeMultipleDimensionEventHandler:null;var B=P===t.dimensions.length-1?le:se;for(var H=0;H<B.length;H++){B[H].id="selectedMultipleDimensionOrientation##"+P+"##"+B[H].value}for(var H=0;H<de.length;H++){de[H].id="selectedMultipleDimensionAlignment##"+P+"##"+de[H].value}var k=w.categorySize==null?ue:(w.categorySize*10).toFixed(me);var G=w.categorySize==null?p:u;for(var H=0;H<ce.length;H++){ce[H].id="selectedMultipleDimensionTotalsPosition##"+P+"##"+ce[H].value}var V=[{type:"iconbutton",id:"selectedMultipleRemoveDimension##"+P,iconName:U,click:F,tdStyle:{width:"20px",textAlign:"center"},tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_REMOVE")},{type:"text",id:"selectedMultipleDimensionName##"+P,value:I[P],tdStyle:{width:_+"px",tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_DIMENSION")}},{type:"iconselector",value:w.categoryOrientation,values:B,tdStyle:v,click:P===t.dimensions.length-1?null:generateChangeDimensionEventHandler("categoryOrientation",B),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_ORIENTATION")},{type:"iconselector",value:w.categoryAlignment,values:de,tdStyle:v,click:generateChangeDimensionEventHandler("categoryAlignment",de),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_ALIGNMENT")},{type:"checkbox",id:"selectedMultipleDimensionTextAction##"+P,group:"selectedMultipleDimensionTextActionG##"+P,value:"",checked:w.categoryTextBreak,tdStyle:v,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_BREAKTEXT")},{type:"textinput",id:"selectedMultipleDimensionSize##"+P,value:k,length:10,maxLength:10,style:G,tdStyle:v,focusIn:autoFocusIn,focusOut:autoFocusOut,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_SIZE")},{type:"iconselector",value:w.totalsPosition,values:ce,tdStyle:v,click:generateChangeDimensionEventHandler("totalsPosition",ce),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_MULTIPLE_DIMENSION_TOTALS")}];z.buildTableRow(b,V)}s.appendChild(b);n.appendChild(o);a.appendChild(l);r.appendChild(s);i.appendChild(n);z.buildTableRow(i,[{type:"empty",color:"rgb(170,170,170)",tdStyle:{height:"15px"}}]);i.appendChild(a);z.buildTableRow(i,[{type:"empty",color:"rgb(170,170,170)",tdStyle:{height:"15px"}}]);i.appendChild(r);e.appendChild(i);return e}function applyMultipleSettings(){var e=j.extendedModel;var t=document.getElementById("selectedMultipleFontSize");if(t!==null){var i=parseInt(t.value);e.inputFontSize=isNaN(i)?null:i;t=document.getElementById("selectedMultipleFontSizeType");e.fontSizeType=ne[t.selectedIndex];t=document.getElementById("selectedMultipleFontStep");e.fontStep=re[t.selectedIndex];t=document.getElementById("selectedMultipleFontSizeTitle");i=parseInt(t.value);e.titleFontSize=isNaN(i)?parseInt(St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART")):i;t=document.getElementById("selectedMultipleTimeMultipleValueCount");i=parseInt(t.value);e.timeMultipleValueCount=isNaN(i)?null:i;t=document.getElementById("selectedMultipleTimeMultipleCategoryCount");i=parseInt(t.value);e.timeMultipleCategoryCount=isNaN(i)?null:i;t=document.getElementById("selectedMultipleTimeCellValueSize");i=parseFloat(t.value);e.timeCellValueSize=isNaN(i)?null:i/10;t=document.getElementById("selectedMultipleTimeCellCategorySize");i=parseFloat(t.value);e.timeCellCategorySize=isNaN(i)?null:i/10;t=document.getElementById("selectedMultipleStructureMultipleValueCount");i=parseInt(t.value);e.structureMultipleValueCount=isNaN(i)?null:i;t=document.getElementById("selectedMultipleStructureMultipleCategoryCount");i=parseInt(t.value);e.structureMultipleCategoryCount=isNaN(i)?null:i;t=document.getElementById("selectedMultipleStructureCellValueSize");i=parseFloat(t.value);e.structureCellValueSize=isNaN(i)?null:i/10;t=document.getElementById("selectedMultipleStructureCellCategorySize");i=parseFloat(t.value);e.structureCellCategorySize=isNaN(i)?null:i/10;t=document.getElementById("selectedMultipleOptimizeCellOrder");e.optimizeCellOrder=t.checked;t=document.getElementById("selectedMultipleOptimizeCellStructureSize");e.optimizeCellStructureSize=t.checked;t=document.getElementById("selectedMultipleValueLinking");e.valueLinking=t.checked;t=document.getElementById("selectedMultipleExpandCategories");e.expandCategories=t.checked;for(var n=0;n<e.dimensions.length;n++){var a=e.dimensions[n];t=document.getElementById("selectedMultipleDimensionTextAction##"+n);a.categoryTextBreak=t.checked;t=document.getElementById("selectedMultipleDimensionSize##"+n);i=parseFloat(t.value);a.categorySize=isNaN(i)?null:i/10}var r=[{name:"top",id:"Top"},{name:"right",id:"Right"},{name:"bottom",id:"Bottom"},{name:"left",id:"Left"}];for(var n=0;n<e.cases.length;n++){var o=e.cases[n];for(var l=0;l<r.length;l++){var s=r[l];t=document.getElementById("cellMultipleCase"+s.id+"Width##"+n);i=parseFloat(t.value);o.borders[s.name].width=isNaN(i)?null:i/10;t=document.getElementById("cellMultipleCase"+s.id+"Color##"+n);o.borders[s.name].color=t.style.backgroundColor;o.borders[s.name].notationColor=t.style.backgroundImage!=="none"}o.titleBold=document.getElementById("cellMultipleCaseTitleBold##"+n).checked}if(e.timeActive){applyElementsSettings(e.timeElements,"time")}if(e.structureActive){applyElementsSettings(e.structureElements,"structure")}}function applyElementsSettings(e,t){for(var i=0;i<e.length;i++){var n=e[i].nodes;for(var a=0;a<n.length;a++){var r=n[a].nodes;for(var o=0;o<r.length;o++){var l=r[o];var s=t+"##"+i+"##"+a+"##"+o;var d=document.getElementById("cellMultipleElementAlignmentCategory##"+s);l.model.axisAlignmentCategory=_[d.selectedIndex];var c=document.getElementById("cellMultipleElementAlignmentElement##"+s);l.model.axisAlignmentElement=ee[c.selectedIndex];l.model.axisLinking=document.getElementById("cellMultipleElementAxisLinking##"+s).checked}}}}}function changeMultipleContextEventHandler(e){var t=j.extendedModel;t.contextId=Q[this.selectedIndex];var i=M.getContextByCid(t.contextId);K=i;while(t.dimensions.length!==0&&i.rows.length<=t.dimensions.length){t.dimensions.pop()}for(var n=0;n<t.dimensions.length;n++){t.dimensions[n].name=i.rows[n].name}if(t.dimensions.length===0){St["b"].$("#cellTabDiv").tabs("option","disabled",[1,2,3,4,5]);z.disableButton("cellApplyButton");z.disableButton("cellOkayButton")}else{t.dimensions[t.dimensions.length-1].categoryOrientation="Cell"}applyMultipleSettings();updateContainerMultiplesTab();updateMultipleCasesTab()}function changeMultipleActiveChartTypes(e){var t;if(St["b"].$(this).hasClass("cellOpClass")){St["b"].$(this).removeClass("cellOpClass");t=true}else{St["b"].$(this).addClass("cellOpClass");t=false}var i=j.extendedModel;var n=t&&S==="";var a=false;if(this.id==="selectedMultipleTimeActive"){if(!t&&S==="time"){n=true;a=true}i.timeActive=t}else if(this.id==="selectedMultipleStructureActive"){if(!t&&S==="structure"){n=true;a=true}i.structureActive=t}if(n){if(a){saveKeyfiguresSettings();saveDimensionsSettings();S="";O=0;L=0;A=0}updateActiveChart();z.getDialog().dialog("option","title",Ot["a"].getTranslation("MULTIPLE")+" "+Ot["a"].getTranslation("CELL")+" - "+(U?U:w.id)+(v?" - "+v.name:""));updateKeyfiguresTab();updateDimensionsTab()}updateMultipleElementsTab();if(i.timeActive||i.structureActive||i.tableActive){St["b"].$("#cellTabDiv").tabs("option","disabled",[])}else{St["b"].$("#cellTabDiv").tabs("option","disabled",[1,2,3,4,5])}}function editMultipleCellGridSizes(e){var t={model:j.extendedModel,extension:D};if(this.id==="selectedMultipleTimeCellGridSizes"){t.type="time"}else if(this.id==="selectedMultipleStructureCellGridSizes"){t.type="structure"}else{t.type="table"}var i=new St["b"].UI.MultipleGridEditor(t);i.open()}function addMultipleDimensionEventHandler(e){applyMultipleSettings();var t=j.extendedModel.dimensions;var i=M.getContextByCid(j.extendedModel.contextId);if(t.length>=i.rows.length-1){return}if(t.length>0){t[t.length-1].categoryOrientation="Auto"}var n=i.rows[t.length].name;t.push(new _e["a"](n));updateContainerMultiplesTab();if(t.length===1){St["b"].$("#cellTabDiv").tabs("option","disabled",[]);z.enableButton("cellApplyButton");z.enableButton("cellOkayButton")}}function removeMultipleDimensionEventHandler(e){var t=j.extendedModel.dimensions;var i=parseInt(e.target.id.split("##").pop());t.splice(i,1);if(t.length>0){t[t.length-1].categoryOrientation="Cell"}if(t.length===0){St["b"].$("#cellTabDiv").tabs("option","disabled",[1,2,3,4,5]);z.disableButton("cellApplyButton");z.disableButton("cellOkayButton")}applyMultipleSettings();updateContainerMultiplesTab()}function generateChangeDimensionEventHandler(s,d){return function(e){var t=this.id.split("##");var i=t[t.length-2];var n=j.extendedModel.dimensions[parseInt(i)];var a=t[t.length-1];n[s]=a;for(var r=0;r<d.length;r++){var o=d[r];var l=document.getElementById(t[0]+"##"+i+"##"+o.value);l.src=Se["a"].imgPath+(a===o.value?o.activeIcon:o.inactiveIcon)}}}function changedMultipleCellGridStructureEventHandler(e){var t=parseInt(this.value);if(isNaN(t)||t<1){t=1;this.value="1"}var i=j.extendedModel;var n,a,r,o,l;if(this.id.indexOf("Time")!==-1){if(this.id.indexOf("Value")!==-1){i.timeCellValueCount=t;l="rows"}else{i.timeCellCategoryCount=t;l="columns"}n=i.timeElements;a=i.timeCellCategoryCount*i.timeCellValueCount;r="time";o=i.timeCellGridSizes}else if(this.id.indexOf("Structure")!==-1){if(this.id.indexOf("Value")!==-1){i.structureCellValueCount=t;l="columns"}else{i.structureCellCategoryCount=t;l="rows"}n=i.structureElements;a=i.structureCellCategoryCount*i.structureCellValueCount;r="structure";o=i.structureCellGridSizes}else{if(this.id.indexOf("Value")!==-1){i.tableCellValueCount=t;l="columns"}else{i.tableCellCategoryCount=t;l="rows"}n=i.tableElements;a=i.tableCellCategoryCount*i.tableCellValueCount;r="table";o=i.tableCellGridSizes}var s=o[l];var d=n[0].nodes.length;applyMultipleSettings();for(var c=0;c<n.length;c++){if(d>a){n[c].nodes=n[c].nodes.slice(0,a)}else if(d<a){for(var u=d;u<a;u++){var p=St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.createChartEntry(r,0,i.contextId);p.model.axisLinking=true;var g=new Ie["a"]([p]);n[c].nodes.push(g)}}}if(s.length<t){var m=t-s.length;var h=m/t;var f=1-h;for(var c=0;c<s.length;c++){var v=s[c]*(1-h);s[c]=c===s.length-1?f:v;f-=v}var f=h;var b=1/t;for(var c=t-s.length;c>0;c--){s.push(c===1?f:b);o[l+"Fixed"].push(false);f-=b}}else if(s.length>t){var T=1;for(var c=s.length-t;c>0;c--){T-=s[s.length-1];s.pop();o[l+"Fixed"].pop()}var f=1;for(var c=0;c<s.length;c++){var b=c===s.length-1?f:s[c]/T;s[c]=b;f-=b}}if(d!==a){updateMultipleElementsTab()}}function createContainerEmptyTab(){var e=document.createElement("div");e.style.padding=ve;St["b"].Utils.DOM.createSpan(e,Ot["a"].getTranslation("NO_CONTENT"));return e}function createContainerUrlTab(){var e=document.createElement("div");e.setAttribute("id","containerUrlTab");e.style.padding=ve;updateContainerUrlTab(e);return e}function updateContainerUrlTab(e){e=e||document.getElementById("containerUrlTab");St["b"].$(e).empty();var t={borderBottom:"1px solid black"};var i=document.createElement("table");var n=[{type:"text",value:"URL "+Ot["a"].getTranslation("FORMULA"),tdStyle:t,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_CONDITION")}];z.buildTableRow(i,n);var a=v||f||St["b"].DataObjects.ContextRepo.getAllContexts()[0];n[0]={type:"formulainput",id:"cellUrlExpression",buttonId:"cellUrlExpressionButton",formulaEditorId:"url.Expression",formulaObject:k.urlFormula,calculator:Y,context:a,callerObject:$,formulaEditorType:rt["a"].formulaEdit.CONDITION,formulaTitle:"URL "+Ot["a"].getTranslation("FORMULA"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_CONDITION"),style:{width:"500px"},callerDivOffset:St["b"].$(W).parent().offset()};z.buildTableRow(i,n);e.appendChild(i);t={borderBottom:"1px solid black",width:"50px"};var r={width:"50px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"};var o={width:"50px",textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};i=document.createElement("table");n=[{type:"text",value:Ot["a"].getTranslation("HEIGHT"),tdStyle:t,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_DIMENSION")},{type:"text",value:Ot["a"].getTranslation("WIDTH"),tdStyle:t,tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_DIMENSION")}];z.buildTableRow(i,n);var l,s,d,c;if(k.dimension.height===null){l=ue;d=o}else{l=k.dimension.height;d=r}if(k.dimension.width===null){s=ue;c=o}else{s=k.dimension.width;c=r}n=[{type:"textinput",id:"cellUrlDimensionHeight",value:l,length:5,maxLength:5,style:d,focusIn:autoFocusIn,focusOut:getChangeHandler("height"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_DIMENSION")},{type:"textinput",id:"cellUrlDimensionWidth",value:s,length:5,maxLength:5,style:c,focusIn:autoFocusIn,focusOut:getChangeHandler("width"),tooltip:Ot["a"].getTranslation("HELP_CELL_TYPE_URL_DIMENSION")}];z.buildTableRow(i,n);e.appendChild(i);return e;function getChangeHandler(t){return function(){var e=parseInt(this.value);if(isNaN(e)){k.dimension[t]=null;this.value=""}else{k.dimension[t]=e;this.value=e.toString(10)}autoFocusOut.call(this)}}}function createContainerButtonTab(){var e=document.createElement("div");e.setAttribute("id","containerButtonTab");e.style.padding=ve;var t=document.createElement("table");z.buildTableRow(t,[{type:"text",value:Ot["a"].getTranslation("NAME"),tooltip:Ot["a"].getTranslation("BUTTON_NAME")}]);St["b"].Utils.DOM.createTextInput(t,"button_Name",U?U:"",35,he,undefined,30);e.appendChild(t);var t=document.createElement("table");t.setAttribute("id","ButtonActionTable");St["b"].Utils.DOM.setStyle(t,{borderCollapse:"separate",borderSpacing:"5px 0"});St["b"].$(t).sortable({axis:"y",cursor:"crosshair",distance:3,tolerance:"pointer"});z.buildTableRow(t,[{type:"empty"},{type:"empty"},{type:"empty"},{type:"text",value:Ot["a"].getTranslation("EXTENSION"),tooltip:Ot["a"].getTranslation("EXTENSION")},{type:"text",value:Ot["a"].getTranslation("FUNCTION"),tooltip:Ot["a"].getTranslation("FUNCTION")}]);addButtonRow(t);e.appendChild(t);return e}function addButtonRow(e,t,i,n,a){var r=document.createElement("tr");r.setAttribute("id","buttonTableRow");var o=document.createElement("td");var l=document.createElement("div");l.setAttribute("id","draggerButtonElement");St["b"].Utils.DOM.setStyle(l,{width:"10px",height:"10px",background:"rgb(150, 150, 150)"});l.setAttribute("title",Ot["a"].getTranslation("HELP_CELL_TYPE_SINGLE_DRAGGER"));o.appendChild(l);r.appendChild(o);var o=document.createElement("td"),s=Se["a"].imgPath+"add_small.png",d=St["b"].Utils.DOM.createIconButton(o,null,"","",he,s,Ot["a"].getTranslation("HELP_CELL_TYPE_SINGLE_ADD"));St["b"].$(d).on("click",function(){addButtonRow(e)});r.appendChild(o);var o=document.createElement("td"),s=Se["a"].imgPath+"delete_small.png",d=St["b"].Utils.DOM.createIconButton(o,null,"","",he,s,Ot["a"].getTranslation("HELP_CELL_TYPE_SINGLE_REMOVE"));St["b"].$(d).on("click",function(){if(this.parentNode.parentNode.parentNode.children.length>2){St["b"].$(this.parentNode.parentNode).remove()}});r.appendChild(o);var c=document.createElement("td");var u=false;var p=t;if(p){for(var g=0;g<q.length;g++){if(p.substr(0,p.length-5)==q[g].substr(0,q[g].length-5)){u=true;break}}if(!u){for(var g=0;g<b.length;g++){if(t==b[g].getAdapter().getServerId().split("\\")[1]){p=b[g].getContexts()[0].cid;break}}}}var m=b.map(function(e){return e.getTitle()});var h=St["b"].Utils.DOM.createSelectBox(c,"button_Extension",q,m,p,he,"200px");h.disabled=["Reload","Toggle_Show_Edit_Mode"].indexOf(i||J[0])>=0;r.appendChild(c);e.appendChild(r);var f=document.createElement("td");var v=St["b"].Utils.DOM.createSelectBox(f,"button_Action",J,E,i,he);r.appendChild(f);function changeAction(e){var t=J[this.selectedIndex];if(this.parentNode.parentNode.children.length>5){for(var i=0;this.parentNode.parentNode.children.length>5;i++){St["b"].$(this.parentNode.parentNode.lastChild).remove()}}h.disabled=["Reload","Toggle_Show_Edit_Mode"].indexOf(t)>=0}if(i==="Toggle_Show_Edit_Mode"){h.disabled=true}else if(i==="Reload"){}St["b"].$(v).change(changeAction);e.appendChild(r)}function createContainerButtonPlusTab(){var e,t;t=document.createElement("div");t.setAttribute("id","containerButtonPlusTab");e=document.createElement("form");e.setAttribute("id","containerButtonPlusForm");t.appendChild(e);updateButtonPlusTab(e);e.onsubmit=function(){return false};return t}function updateButtonPlusTab(e){var t,i,n,a;a=St["b"].Utils.Translations.getTranslation;n={borderBottom:"1px solid black"};i=e||document.getElementById("containerButtonPlusForm");i.style.padding=ve;St["b"].$(i).empty();t=document.createElement("table");t.setAttribute("id","buttonplus-table");St["b"].Utils.DOM.setStyle(t,{borderCollapse:"separate",borderSpacing:"5px 0"});z.buildTableRow(t,[{type:"text",value:a("EDIT"),tooltip:a("HELP_BUTTON_OPEN_EDITOR"),tdStyle:n}]);H.states.forEach(function(e){addButtonPlusRow(i,t,e)});i.appendChild(t)}function addButtonPlusRow(e,t,i){var n=St["b"].Utils.Translations.getTranslation;var a=z.buildTableRow(t,[{type:"iconbutton",name:"editState",iconName:"edit.png",value:"text",tooltip:n("HELP_BUTTON_OPEN_EDITOR"),style:{width:"16px",height:"16px"}}]);a.id="state."+H.states.indexOf(i);a.querySelector('input[name="editState"]').onclick=function(t){return function(){var e=z.getDialog().offsetParent().css("z-index");z.getDialog().offsetParent().css("z-index",1e3);St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("getButtonEditorAction",{state:t,extension:D,onClose:function(){z.getDialog().offsetParent().css("z-index",e)},goOldWay:true})}}(i)}function createContainerTextTab(){var e=document.createElement("div");e.setAttribute("id","containerTextTab");e.style.padding=ve;function hideList(e){var t=St["b"].$(e);if(t.is(":visible")){t.hide()}}var t=document.createElement("table");St["b"].Utils.DOM.setStyle(t,{borderCollapse:"separate",borderSpacing:"5px 0"});var i={borderBottom:"1px solid black"};var n=document.createElement("col");St["b"].Utils.DOM.setStyle(n,{width:"60px"});t.appendChild(n);var n=document.createElement("col");St["b"].Utils.DOM.setStyle(n,{width:"60px"});t.appendChild(n);var n=document.createElement("col");St["b"].Utils.DOM.setStyle(n,{width:"auto"});t.appendChild(n);var a=F&&F.instanceOf==="ContainerCommentGridModel",r=a?F.textType:"title",o=Ot["a"].getTranslation(St["b"].Connector.ConnectorHelper.Settings.translations.transportSettingsTooltip),l=[{type:"text",value:Ot["a"].getTranslation("TYPE"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_TYPE")},{type:"text",value:Ot["a"].getTranslation("VARIABLE_DEPENDENCY"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_VAIABLE")},{type:"text",value:Ot["a"].getTranslation("SHOW_CONDITION"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_SHOW")},{type:"text",value:Ot["a"].getTranslation("EDIT_CONDITION"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_EDIT")},{type:"text",value:Ot["a"].getTranslation("LOG"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_LOG")},{type:"text",value:Ot["a"].getTranslation("DEFAULT"),tdStyle:i,tooltip:Ot["a"].getTranslation("HELP_CELL_TEXT_DEFAULT")},{type:"text",value:Ot["a"].getTranslation("AUTO_SAVE"),tdStyle:i,tooltip:""},{type:"text",value:Ot["a"].getTranslation("TRANSPORT"),tdStyle:i,tooltip:o}];z.buildTableRow(t,l);var s=document.createElement("tr");var d=document.createElement("td");d.style.verticalAlign="top";var c=St["b"].Utils.DOM.createSelectBox(d,"selectedCaption_type",ie,C,r,he);function changeType(){var e=document.getElementById("commentIconsContainer"),t=document.getElementById("selectedCaption_type").selectedIndex===2;e.style.display=t?"block":"none";if(!a){St["b"].Connector.ConnectorHelper.CallDialog_createContainerTextTab(t,changeTransportIcons)}}St["b"].$(c).change(changeType);s.appendChild(d);var u=document.createElement("td");function variableSelectHandler(){var e=document.getElementById("selectedTextVariable_text");e.value=St["b"].$(this).html();hideList("#selectedTextVariable_list")}St["b"].Utils.DOM.createComboBox(u,"selectedTextVariable",15,"150px","120px",y,w.extendedModel.condition?w.extendedModel.condition:"",he,null,variableSelectHandler,null);s.appendChild(u);var p=document.createElement("td");function showConditionSelectHandler(){var e=document.getElementById("selectedTextShowCondition_text");e.value=St["b"].$(this).html();hideList("#selectedTextShowCondition_list")}var g=["Yes","No","---"].concat(y);St["b"].Utils.DOM.createComboBox(p,"selectedTextShowCondition",15,"150px","120px",g,F.showCondition||"",he,null,showConditionSelectHandler,null);s.appendChild(p);function editConditionSelectHandler(){var e=document.getElementById("selectedTextEditCondition_text");e.value=St["b"].$(this).html();hideList("#selectedTextEditCondition_list")}var m=document.createElement("td");St["b"].Utils.DOM.createComboBox(m,"selectedTextEditCondition",15,"150px","120px",g,F.editCondition||"",he,null,editConditionSelectHandler,null);s.appendChild(m);var h=document.createElement("td");h.style.textAlign="center";St["b"].Utils.DOM.createCheckBox(h,"selectedTextLoggable",F.loggable);s.appendChild(h);var f=document.createElement("td");f.style.textAlign="center";St["b"].Utils.DOM.createCheckBox(f,"selectedTextDefault",a?F.showDefaultText:true);s.appendChild(f);var v=document.createElement("td");v.style.textAlign="center";St["b"].Utils.DOM.createCheckBox(v,"selectedAutoSave",a?F.autoSave:true);s.appendChild(v);var b;if(F.transport){b=F.transport}else{b=St["b"].Connector.ConnectorHelper.Settings.defaultTransportType}var T=document.createElement("td");T.style.verticalAlign="bottom";St["b"].$(T).css("textAlign","center");var E=document.createElement("input");E.setAttribute("type","image");E.setAttribute("id","selectedTransportActive");E.setAttribute("title",o);E.src=Se["a"].imgPath+"on.png";if(b!=P.ACTIVE){St["b"].$(E).addClass("cellOpClass")}St["b"].$(E).click(changeTransportIcons);T.appendChild(E);var x=document.createElement("input");x.setAttribute("type","image");x.setAttribute("id","selectedTransportBackend");x.setAttribute("title",o);x.src=Se["a"].imgPath+St["b"].Connector.ConnectorHelper.getTransportIconByValue(P.BACKEND,"backend.png");if(b!==P.BACKEND&&b!==P.INACTIVE){St["b"].$(x).addClass("cellOpClass")}St["b"].$(x).click(changeTransportIcons);T.appendChild(x);s.appendChild(T);t.appendChild(s);e.appendChild(t);e.appendChild(createCommentIconsElements(r==="comment"));return e}function changeTransportIcons(){var e=document.getElementById("selectedTransportActive");var t=document.getElementById("selectedTransportInactive");var i=document.getElementById("selectedTransportBackend");St["b"].$(e).addClass("cellOpClass");St["b"].$(t).addClass("cellOpClass");St["b"].$(i).addClass("cellOpClass");switch(this.id){case"selectedTransportActive":St["b"].$(e).removeClass("cellOpClass");break;case"selectedTransportInactive":St["b"].$(t).removeClass("cellOpClass");break;case"selectedTransportBackend":St["b"].$(i).removeClass("cellOpClass");break;default:St["b"].$(t).removeClass("cellOpClass");break}}$.close=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(t!==null){t.close()}}z.close();if(D.ignoreShowCondition){D.ignoreShowCondition=D.getMode()===Le["a"].EDIT_GRID;St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}};$.cancel=function(){freeDimensionsResources();freeKeyfiguresResources();$.close();R.setLayoutDefinition(e);D.paint()};$.okClose=function(){freeDimensionsResources();freeKeyfiguresResources();$.apply().then(function(){return $.close()})};$.apply=function(){return Me["b"](this,void 0,void 0,function(){var t,i,n,a,r,o,l,s,d,c,u,p,g,m,h,f,v,b,T,E,x,C,y,M,S,O,L,A,_,I;return Me["e"](this,function(e){switch(e.label){case 0:t=St["b"].$("#cellContainerTabDiv").tabs("option","selected");i=ye[t].id;n=document.getElementById("button_Name").value;a=document.getElementById("selectedCaption_type");r=null;if(i==="ctabs-text"||i==="ctabs-empty"||i==="ctabs-button"||i==="ctabs-buttonplus"){saveNavigationSettings();r=V.navigationVariable}else if(i==="ctabs-element"){saveKeyfiguresSettings();saveDimensionsSettings();saveNavigationSettings()}else if(i==="ctabs-multiples"){saveKeyfiguresSettings();saveDimensionsSettings();applyMultipleSettings();saveNavigationSettings()}if(!((!F||N.firstObjectGrid===null)&&i==="ctabs-element"))return[3,1];St["b"].DataObjects.RuntimeDO.setUpdateScalingGroups(true);R.dispatch("createBaseExtension",{extension:D,charts:B.charts});w=St["b"].Factories.ModelFactory.getModelById(N,N.firstObjectGrid.children[0].id);F=w.extendedModel;G=parseInt(w.id.substr(5));return[3,3];case 1:if(F===null||N.firstObjectGrid===null){R.dispatch("createBaseLayout",{extension:D,dontPaint:true});w=St["b"].Factories.ModelFactory.getModelById(N,N.firstObjectGrid.children[0].id);F=w.extendedModel;G=parseInt(w.id.substr(5))}w.name=U;o=i;l=null;s=false;switch(i){case"ctabs-element":o="chart";l=null;s=s||(!w.charts||w.charts.length===0);break;case"ctabs-multiples":o="multiple";l=null;s=s||(!F||F.instanceOf!=="MultipleContainerModel");break;case"ctabs-button":o="button";d=[],c=[],u=[],p=[],g=document.getElementById("ButtonActionTable");for(m=1;m<g.children.length;m++){c.push(q[g.children[m].children[3].children[0].selectedIndex]);h=J[g.children[m].children[4].children[0].selectedIndex];d.push(h);if(h==="Reload"){f=false;p.push({actionNr:m-1,partial:f})}}l={name:n,actions:d,extensions:c,edxArray:u,partialArray:p};s=true;break;case"ctabs-buttonplus":v=[];o="buttonplus";l={button:St["b"].Utils.GlobalFunctions.deepCopy(H),newData:v};s=F.instanceOf!=="ButtonPlusModel";break;case"ctabs-empty":o="empty";l="empty";s=true;break;case"ctabs-url":o="url";l=JSON.parse(JSON.stringify(k));s=true;break;case"ctabs-text":l={};b=F&&F.instanceOf==="ContainerCommentGridModel";T=document.getElementById("selectedTextVariable_text").value;E=St["b"].DataObjects.DocumentDO.getVariable(T);l.condition=E?T:"";l.conditionValue=E?E.value:"";x=document.getElementById("selectedTextShowCondition_text").value;C=document.getElementById("selectedTextEditCondition_text").value;l.showCondition=x==="---"?"":x;l.editCondition=C==="---"?"":C;l.loggable=document.getElementById("selectedTextLoggable").checked;l.showDefaultText=document.getElementById("selectedTextDefault").checked;l.autoSave=document.getElementById("selectedAutoSave").checked;l.allowTop=document.getElementById("selectedAddCommentAllow_top").value;l.allowRight=document.getElementById("selectedAddCommentAllow_right").value;l.allowBottom=document.getElementById("selectedAddCommentAllow_bottom").value;l.allowLeft=document.getElementById("selectedAddCommentAllow_left").value;l.allowNumber=document.getElementById("selectedAddCommentAllow_number").value;y=!document.getElementById("selectedTransportActive").classList.contains("cellOpClass")&&P.ACTIVE;M=!document.getElementById("selectedTransportBackend").classList.contains("cellOpClass")&&P.BACKEND;l.transport=y||M||P.INACTIVE;o="comment";S=ie[a.selectedIndex];s=!b;if(b){O=F.textType;if(S==="comment"&&O!=="comment"||S!=="comment"&&O==="comment"){s=true}}l.rows=b?F.gridRows.length:1;l.cols=b?F.gridColumns.length:1;l.titleLabelType=S;l.insertNewCellOnBuild=s;l.row=0;l.col=0;l.exists_in_db=false;l.chartId=null;l.gridId=w.id;l.rootModelId=N.id;break}if(F.instanceOf==="PlaceHolderModel"){s=true}return[4,R.dispatch("updateGridContent",{extension:D,charts:B.charts,chartContainerModel:w,multipleModel:j.extendedModel,navigationVariable:r,insertType:o,insertSubType:l,insertNewObject:s})];case 2:e.sent();if(s){L=w.id;w=St["b"].Factories.ModelFactory.getModelById(N,L)}F=w.extendedModel;e.label=3;case 3:if(D.getMode()===St["b"].Utils.Enums.EMode.SET_CONTEXT){D.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}createDummyContainer();if(i==="ctabs-element"||i==="ctabs-multiples"){if(i==="ctabs-multiples"){updateContainerMultiplesTab();updateMultipleCasesTab()}updateActiveChart();updateKeyfiguresTab();updateDimensionsTab()}else if(i==="ctabs-buttonplus"){updateButtonPlusTab()}updateNavigationTab();A=document.getElementById("cellContainerTabDiv");if(w.extendedModel.instanceOf==="ContainerCommentGridModel"){if(o!=="comment"){St["b"].$(A).tabs("option","selected",2);_=w.children[0].children[1];I=document.getElementById("selectedCaption_type");I.selectedIndex=ie.indexOf(_.titleLabelType)}}if(w.extendedModel.input&&w.extendedModel.input.autoSave){D.getController().dispatch("updateInlineCommentsOnAutoSave",{extension:D,containerModel:w})}R.updateLayoutDefinition();return[2,true]}})})};function escapeBeforeHandler(){var e=false;return e}function escapeAfterHandler(){freeDimensionsResources();freeKeyfiguresResources();var e=document.getElementById("formulaEditor");if(e!==null){if(t!==null){t.close()}}}function updateActiveChart(){if(X){if(S===""){if(j.extendedModel.timeActive){S="time"}else if(j.extendedModel.structureActive){S="structure"}else{}}}if(s){try{n=j.extendedModel[S+"Elements"][O].nodes[L].nodes[A].model}catch(e){n=null}}else if(l){if(d>=0&&d<B.charts.length){n=B.charts[d].model}else{n=null}B.extendedModel=n}updateActiveContext()}function updateActiveContext(){if(n){v=M.getContextByCid(n.contextId);if(v===null){v=M.getAllContexts()[0];n.contextId=v.cid}}else{v=null}}function chartElementSelected(){return l||s}function reuseChartSettings(){return w&&w.charts}function isOriginalContainerMultiple(){return w&&F&&F.instanceOf==="MultipleContainerModel"}function sameContextAndTypeOfMultipleElement(e,t,i,n){if(!isOriginalContainerMultiple()){return false}var a=document.getElementById("cellMultipleElementContext##"+e+"##"+t+"##"+i+"##"+n);var r=Q[a.selectedIndex];var o;try{o=F[e+"Elements"][t].nodes[i].nodes[n].model}catch(e){o=null}return o&&r===o.contextId}function createNewChartEntry(e,t){var t=t!=undefined?t:f.cid;return St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.createChartEntry(e,G,t)}function createDummyContainer(){var e;if(reuseChartSettings()){e=w.charts}else{e=[createNewChartEntry("structure")];d=0}B=new Oe["a"];B.id="chart"+G;B.charts=e;j=new Oe["a"];j.id="chart"+G;if(X){if(isOriginalContainerMultiple()){j.extendedModel=w.extendedModel;K=M.getContextByCid(j.extendedModel.contextId)}else{j.extendedModel=new De["a"];j.extendedModel.id=j.id.replace("chart","chartdata");K=f;St["b"].Models.Actions.ExtendedModelActions.MultipleContainerModel.init(j,K.cid)}}if(w&&w.extendedModel&&w.extendedModel.navigationVariable&&(w.extendedModel.instanceOf==="ButtonModel"||w.extendedModel.instanceOf==="ButtonPlusModel"||w.extendedModel.instanceOf==="EmptyModel"||w.extendedModel.instanceOf==="ContainerCommentGridModel")){V={navigationVariable:JSON.parse(JSON.stringify(w.extendedModel.navigationVariable))}}else{V={navigationVariable:{variable:"",auto:true,value:"",useQVNav:true}}}if(F.instanceOf!=="ButtonPlusModel"){H=new Re["a"];St["b"].Models.Actions.ExtendedModelActions.ButtonPlusModel.addState(H,new Ne["a"])}else{H=St["b"].Utils.GlobalFunctions.deepCopy(F)}k=F.instanceOf!=="UrlContainerModel"?new Pe["a"]:JSON.parse(JSON.stringify(F))}function selectCurrentlyActiveElement(){if(!w||!w.extendedModel){return}var e=w.extendedModel;var t=e.instanceOf;if(t==="MultipleContainerModel"){if(e.activeElementType){S=e.activeElementType;var i=u.multipleSubcell;if(i!==null){var n=i.extendedModel.instanceOf==="ContainerGridModel"?i.children[0].multiplePath:i.multiplePath;var a;for(var r=0;r<e.cells.length;r++){var o=e.cells[r];if(o.path===n){O=o.caseIdx;a=w.children[o.childIndex];break}}if(i.extendedModel.instanceOf!=="ContainerGridModel"){for(var r=0;r<a.children.length;r++){if(a.children[r].id===i.id){L=r;break}}var l=e[S+"Elements"][O].nodes[L].nodes;A=St["b"].Models.Actions.ViewModelActions.ContainerModel.getActiveChartIndex({charts:l});if(A===-1){A=0}}}}}else if(t==="ChartModel"||t==="TimeChartModel"||t==="TableModel"){d=St["b"].Models.Actions.ViewModelActions.ContainerModel.getActiveChartIndex(w);if(d===-1){d=0}}}function autoFocusIn(e){this.style.color="";if(this.value===ue){this.value=""}}function autoFocusOut(e){if(this.value===""){this.value=ue;this.style.color="rgb(150,150,150)"}}}St["b"].UI=St["b"].UI||{};St["b"].UI.ColorPicker=St["b"].UI.ColorPicker||{createColorPicker:function(e,t,i,n,a){if(n===true||n===undefined){var r=new St["b"].UI.ColorPickerDialog(i);r.open(e,a);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 n=t(i.style["background-color"]);St["b"].$(i).CanvasColorPicker({width:400,height:200,showRGB:true,showHSB:false,showColor:false,color:{r:n.r,g:n.g,b:n.b},onColorChange:function(e,t){o(r,e)},onOK:function(e,t){o(r,e);var i=r.replace("_colorPicker","_field");var n=document.getElementById(i);var a=e.r+","+e.g+","+e.b;n.value=a;return true}})}}}};St["b"].UI.ColorPickerDialog=function(r){var s=this;var u=St["b"].DataObjects.RuntimeDO;var d=u.getTranslation("COLOR_PICKER");var p=null;var n="rgb(50,50,50)";var a="rgb(140, 180, 0)";var o="rgb(255, 0, 0)";var c,g;s.open=function(e,t){St["b"].$(document.body).bind("mousedown",closedFromEvent);var i=document.getElementById("colorPickerDialog");if(i===null){var n="colorPickerDialog";var a=[{text:u.getTranslation("OKAY"),id:"colorDialogOkayButton",click:s.okay},{text:u.getTranslation("CANCEL"),id:"colorDialogCancelButton",click:s.cancel}];var r=new St["b"].UI.HiCoDialogDefinition(n,d,a);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 St["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));St["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(n,e){var t=document.createElement("table");var i=document.getElementById(n);if(e){var a=document.createElement("tr");var r=document.createElement("td");St["b"].$(r).html(u.getTranslation("NOTATION"));a.appendChild(r);r=document.createElement("td");var o=St["b"].Utils.DOM.createCheckBoxWithLabel(r,n+"_notation",null,"","");if(i.style.backgroundImage!==""&&i.style.backgroundImage!=="none"&&i.style.backgroundImage!=undefined){o.checkBox.setAttribute("checked","checked")}St["b"].$(o.checkBox).change(function(e){checkBoxHandler(e)});a.appendChild(r);t.appendChild(a)}var a=document.createElement("tr");var r=document.createElement("td");var l=u.getTranslation("RGB");St["b"].$(r).html(l);a.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",n+"_field");r.style.width=80+"px";St["b"].$(r).focusout(function(){var e=$(this).val();e=createRGB(e);var t=document.getElementById(n+"_colorPicker");t.style.backgroundColor=e;t=document.getElementById(n+"_field");e=createInputRGB(e);t.value=e});St["b"].$(r).keypress(function(e){if(e.which==13){var t=$(this).val();t=createRGB(t);var i=document.getElementById(n+"_colorPicker");i.style.backgroundColor=t;i=document.getElementById(n+"_field");t=createInputRGB(t);i.value=t}});if(o){if(o.checkBox.checked){r.setAttribute("disabled","disabled")}}a.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 n=0;n<3;n++){if(t[n]===undefined||t[n]===""){t[n]="0"}var a=false;var r=t[n].split("");var o=r.length;for(var l=0;l<o;l++){if(isNumber(r[l])!=true){delete r[l];a=true}}r=r.join("");o=r.length;if(o>3){r=r.slice(0,3);a=true}if(a===true){t[n]=r}}for(var n=0;n<i;n++){if(isNumber(t[n])!==true){t[n]="0"}if(t[n]>255){t[n]="255"}if(t[n]<0){t[n]="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=n+"_colorPicker";d.setAttribute("id",p);St["b"].Utils.DOM.setStyle(d,getStyle(i.style.backgroundColor,true));if(o){if(o.checkBox.checked){d.className="opClass"}}r.appendChild(d);a.appendChild(r);if(e){var c={border:"1px solid #aaaaaa"};t.className="ui-corner-bottom";St["b"].Utils.DOM.setStyle(t,c)}t.appendChild(a);return t}function checkBoxHandler(e){var t=e.target;var i=t.id.replace("_notation","");var n=document.getElementById(i+"_field");var a=document.getElementById(i+"_colorPicker");if(t.checked){a.className="opClass";n.disabled=true}else{a.className="noOpClass";n.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 n=e.replace("_colorPicker","");if(r){r(n,i)}var a=document.getElementById(n+"_notation");if(a){if(!a.checked){setSymbolOrDiv(n,i)}else{setSymbolOrDiv(n,null,r)}}else{setDataRulesColor(n,i)}s.cancel()};function setSymbolOrDiv(e,t,i){var n=document.getElementById(e);var a="none";var r="none";var o="12px";var l="12px";var s="1px solid #aaaaaa";var d=t;if(t===undefined||t===null){a="url('"+Se["a"].imgPath+"notation.png')";if(i){a="url('"+Se["a"].imgPath+"notation_grey.png')"}r=St["b"].DataObjects.RuntimeDO.getTranslation("NOTATION");o="16px";l="16px";s="none";d=n.style.backgroundColor}var c={backgroundColor:d,backgroundImage:a,title:r,width:o,minWidth:o,height:l,minHeight:l,border:s,display:"block",margin:"auto",textAlign:"left"};St["b"].Utils.DOM.setStyle(n,c)}function setDataRulesColor(e,t){var i=document.getElementById(e);i.style.backgroundColor=t}function closedFromEvent(){var e=St["b"].$(".canvas-color-picker").filter(function(e,t){return t.style.visibility!=="hidden"}),t=St["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(){St["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=n;i=document.getElementById(t);i.value=n}else{if(e.indexOf("2")===-1){i=document.getElementById(e);i.style.backgroundColor=a;i=document.getElementById(t);i.value=a}else{i=document.getElementById(e);i.style.backgroundColor=o;i=document.getElementById(t);i.value=o}}}};St["b"].UI=St["b"].UI||{};St["b"].UI.CommonTableDialog=function(e){var l=this;var c=St["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,m=null,n="",a="",h=null,r=null,f=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 E='<span style="margin: 0px;"><hr style="margin: 0px 0px 1px 0px; background-color: #bfbfbf"></span>';var x="34%";var C="66%";var y=20;var M=40;var S="rgb(150, 150, 150)";var O="rgb(0, 0, 0)";var L="commonTableKey";var A="commonTableDescription";var _="commonTableSearch";var I="Key (20 digits)";var D="Description (40 digits)";var R="Search key or description";var N="Enter password";var P=null;var w={background:"rgb(240, 240, 240)",border:"none",color:S};var U=JSON.parse(JSON.stringify(St["b"].DataObjects.CommonTableRepo.getCommonTableRepo()));var F={key:"",description:"",additionInformation:""};var B={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 n=new St["b"].UI.HiCoDialogDefinition(t,u,i);n.setWidth(s+"px");n.setHeight(d);n.setPosition("center");n.setResizable(true);m=new St["b"].UI.HiCoDialog(n);g=m.getDialogDiv();m.setCSS("overflow","hidden");m.getDialog().dialog("option","minWidth",s);m.setCSS();g.appendChild(fillContent());var a=parseInt(m.highest());var r=parseInt(m.getDialog().offsetParent().css("z-index"));if(a>r){a+=1;m.getDialog().offsetParent().css("z-index",a)}m.getDialog().dialog("open");if(P){var o=document.getElementById(P);if(o){setRowHighlight(o)}}}else{e.parentNode.remove(e);l.open()}};l.okay=function(){if(P&&P!=="new"){var e=St["b"].DataObjects.CommonTableRepo.checkPassword({hash:P,password:n});if(e){St["b"].DataObjects.CommonTableRepo.updateCommonTable(U[P]);t.setCommonTable({parentId:i,hash:P});l.close()}else{St["b"].UI.HiCoNotification(c.getTranslation("PASSWORD_WRONG"))}}else if(P==="new"){if(checkRepeatPassword()){F.password=n;if(F.key&&F.key!==""){F.hash=K["a"].createSHA1Hash(F.key);var e=St["b"].DataObjects.CommonTableRepo.addCommonTable(F);if(e){t.setCommonTable({parentId:i,hash:F.hash,key:F.key});l.close()}else{St["b"].UI.HiCoNotification(c.getTranslation("KEY_EXISTS"))}}else{St["b"].UI.HiCoNotification(c.getTranslation("KEY_EMPTY"))}}else{St["b"].UI.HiCoNotification(c.getTranslation("PASSWORD_WRONG"))}}else if(P==null){t.setCommonTable({parentId:i,hash:P});l.close()}};l.close=function(){m.close()};l.clear=function(){t.setCommonTable({parentId:i,hash:null});l.close()};function fillContent(){var e=document.createElement("div");e.setAttribute("id","commonTableDialogDiv");St["b"].$(e).addClass("ui-corner-bottom");St["b"].$(e).css(B);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);St["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=E;return e}function createHeader(e){var t=e.appendChild(document.createElement("tr"));var i=e.appendChild(document.createElement("tr"));for(var n=0;n<p.length;n++){var a=t.appendChild(document.createElement("td"));a.innerHTML=p[n];var r=i.appendChild(document.createElement("td"));r.innerHTML=b;if(n===0){a.style.width=x}else{a.style.width=C}}}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 n=i.appendChild(document.createElement("input"));n.setAttribute("type","text");if(t===0){n.setAttribute("value",I);n.setAttribute("id",L);n.maxLength=y;n.style.width="100%"}else{n.setAttribute("value",D);n.setAttribute("id",A);n.maxLength=M;n.style.width="100%"}St["b"].$(n).css(w);St["b"].$(n).focus(focusFieldAction);St["b"].$(n).lostFocus(focusoutFieldAction)}}function createMidBody(e){var t=e.appendChild(document.createElement("tr"));for(var i=0;i<p.length;i++){var n=t.appendChild(document.createElement("td"));if(i===0){n.innerHTML=c.getTranslation("COMMON_TABLE_EXISTS");n.style.width=x}else{var a=n.appendChild(document.createElement("input"));a.setAttribute("type","text");a.setAttribute("value",R);a.setAttribute("id",_);a.maxLength=M;a.style.width="100%";St["b"].$(a).css(w);St["b"].$(a).focus(focusFieldAction);St["b"].$(a).keyup(searchForRow);St["b"].$(a).lostFocus(focusoutFieldAction);n.style.width=C}}}function createBottomBody(e){for(var t in U){var i=e.appendChild(document.createElement("tr"));i.setAttribute("id",t);for(var n=0;n<p.length;n++){var a=i.appendChild(document.createElement("td"));if(n===0){a.style.borderBottom=T;if(!isNaN(U[t].key)){a.style.textAlign="right"}a.innerHTML=U[t].key;a.style.width=x}else{var r=a.appendChild(document.createElement("input"));r.setAttribute("type","text");r.setAttribute("id",t+"##"+A);r.maxLength=M;r.style.width="100%";St["b"].$(r).css(w);if(U[t].description===""){r.setAttribute("value",D)}else{r.setAttribute("value",U[t].description);r.style.color=O}St["b"].$(r).focus(focusFieldAction);St["b"].$(r).lostFocus(focusoutFieldAction);a.style.width=C}}if(t===o.commonTable){P=t}}}function createPasswordBody(e){var t=[c.getTranslation("PASSWORD"),c.getTranslation("PASSWORD_REPEAT")];var i=["password","repeatPassword"];for(var n=0;n<t.length;n++){var a=e.appendChild(document.createElement("tr"));var r=a.appendChild(document.createElement("td"));var o=a.appendChild(document.createElement("td"));o=o.appendChild(document.createElement("input"));o.setAttribute("id",i[n]);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 n="";for(var a=0;a<t.length;a++){n+="*"}this.value=n}};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[n];r.style.width=x;o.setAttribute("type","text");o.setAttribute("value",N);St["b"].$(o).css(w);o.style.width="100%";o.maxLength=M;St["b"].$(o).focus(focusPasswordAction);St["b"].$(o).lostFocus(focusoutPasswordAction);if(n==1){h=a}}}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%";f=e.appendChild(document.createElement("textarea"));f.setAttribute("id","additionInformation");f.style.width="100%";f.style.height="100%";f.style.resize="none";f.setAttribute("rows",1);St["b"].$(f).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 n=t.rows[i];if(e==undefined||n.id!==e.id){St["b"].$(n).removeClass("rowHighlight")}}}}function focusFieldAction(){if(this.id===L||this.id===A){if(this.value.toUpperCase()===I.toUpperCase()||this.value.toUpperCase()===D.toUpperCase()){this.value="";this.style.color=O}St["b"].$(v).addClass("rowHighlight");P="new";resetRowHighlights();getAdditionInformation();St["b"].$(h).show();St["b"].$(f).prop("disabled",false)}else if(this.id.indexOf(A)>-1){P=this.id.split("##")[0];if(this.value.toUpperCase()===D.toUpperCase()){this.value="";this.style.color=O}St["b"].$(v).removeClass("rowHighlight");resetRowHighlights();St["b"].$(this.parentElement.parentElement).addClass("rowHighlight");getAdditionInformation();St["b"].$(h).hide();St["b"].$(f).prop("disabled",false)}else if(this.value.toUpperCase()===R.toUpperCase()){this.value="";this.style.color=O;St["b"].$(v).removeClass("rowHighlight");P=null;resetRowHighlights();St["b"].$(h).hide();St["b"].$(f).prop("disabled",true)}}function focusoutFieldAction(){if(this.value===""){this.style.color=S;if(this.id===L){this.value=I;F.key=""}else if(this.id===A){this.value=D;F.description=""}else if(this.id===_){this.value=R}else if(this.id.indexOf(A)>-1&&P!=null&&P!=="new"){this.value=D;U[P].description=""}}else{if(this.id===L){F.key=this.value}else if(this.id===A){F.description=this.value}else if(this.id.indexOf(A)>-1&&P!=null&&P!=="new"){U[P].description=this.value}}}function focusPasswordAction(){if(this.value.toUpperCase()===N.toUpperCase()){this.value="";this.style.color=O}}function focusoutPasswordAction(){if(this.value===""){this.value=N;this.style.color=S;if(this.id==="password"){n=""}else{a=""}}else{var e=this.getAttribute("real-value");if(this.id==="password"){n=K["a"].encrypt(e,St["b"].Utils.Constants.ParameterSets.LDAP)}else{a=K["a"].encrypt(e,St["b"].Utils.Constants.ParameterSets.LDAP)}}}function searchForRow(e){St["b"].$(v).removeClass("rowHighlight");resetRowHighlights();if(e.keyCode!=13){var a=this.value.toUpperCase();var t=r;var i=St["b"].$(t).find("tr");if(a===""){i.show();return}i.hide();i.filter(function(e,t){var i=St["b"].$(this).children();for(var e=0;e<i.length;e++){var n=St["b"].$(i[e]).text().toUpperCase();if(n.indexOf(a)>-1){return true}}return false}).show()}}function checkRepeatPassword(){if(n!==""&&n===a){return true}else{return false}}function setAdditionInformation(){var e=U[P];if(e){e.additionInformation=f.value}else if(P==="new"){F.additionInformation=f.value}}function getAdditionInformation(){if(P){var e=U[P];if(e){f.value=e.additionInformation}else if(P==="new"){f.value=F.additionInformation}}else{f.value=""}}function setRowHighlight(e){St["b"].$(f).prop("disabled",false);var t=St["b"].$(e);if(t.hasClass("rowHighlight")){t.removeClass("rowHighlight");P=null;getAdditionInformation()}else{t.addClass("rowHighlight");P=e.id;St["b"].$(h).hide();getAdditionInformation()}resetRowHighlights(e);St["b"].$(v).removeClass("rowHighlight")}};St["b"].UI=St["b"].UI||{};St["b"].UI.CompareProperties=function(r){var m=this;var _=JSON.parse(JSON.stringify(r.currComp));var e=r.dialogObj?r.dialogObj:null;var I=St["b"].DataObjects.RuntimeDO;var D=r.extension;var h=D.getCanvasDO().getDOMElement();var p=r.containerModel;var o=p?p.extendedModel:null;var t=St["b"].DataObjects.ContextRepo.getContextByCid(o.contextId);var g=pe["a"];var S=new St["b"].Utils.Calculator(t);var R;var f=St["b"].DataObjects.DocumentDO.getDocSettings().docLanguage.value==="en_US"?"450":"480";var v="190";var N=St["b"].Utils.Constants.TypeValues.indicator;var P=r.availCompares;var b=I.getTranslation("PROPERTIES")+" ("+(_.name!=undefined?_.name:_.id)+")";var T;var E;var x=null;var C=e?e.getDialogDiv():null;var w=null;var y=[{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 M=["type","posField","category","keyfigure","start"];var n=["HELP_COMPAREPROPERTIES_FROM_TYPE","HELP_COMPAREPROPERTIES_FROM_POSITION","HELP_COMPAREPROPERTIES_FROM_DIMENSION","HELP_COMPAREPROPERTIES_FROM_MEASURE","HELP_COMPAREPROPERTIES_FROM_START"];var a=["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 L=[0,0,0,0,0];var u=[N.ABSOLUTE,N.PERCENT,N.LABEL];var A=[I.getTranslation("ABSOLUTE"),I.getTranslation("PERCENT"),I.getTranslation("LABEL")];var U=["HELP_COMPAREPROPERTIES_DESCRIPTION_ABSOLUTE","HELP_COMPAREPROPERTIES_DESCRIPTION_PERCENT","HELP_COMPAREPROPERTIES_DESCRIPTION_LABEL"];var F=[0,0,0];var B=null;var H=null;var k=null;var G="Notation";var V=I.getTranslation("ENTER_HERE");var $={backgroundColor:"rgb(240, 240, 240)",border:"0px none",textAlign:"right",verticalAlign:"middle"};var W={verticalAlign:"middle"};var z=["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 X=["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 Y=[0,0,0,0,0,0];var K=null;var Z=[N.FROM,N.TO,N.START,N.END];var Q=[I.getTranslation("COMPARE_FROM"),I.getTranslation("TO"),I.getTranslation("LEGEND_START"),I.getTranslation("LEGEND_END")];if(_.type==="table"){Z=[N.FROM,N.TO,N.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=[N.START,N.END];var te=[I.getTranslation("BEGIN"),I.getTranslation("END")];var ie=[N.POSITION,N.LABEL];var ne=[I.getTranslation("POSITION"),I.getTranslation("LABEL")];var ae=[];var re=[];for(var i=0;i<t.columns.length;i++){ae[i]=t.columns[i].name;re[i]=t.columns[i].id.split(".").pop()}var oe=[N.AXIS,N.KEYFIGURE];var le=[I.getTranslation("ZERO"),I.getTranslation("MEASURE")];var se=18;var de=4;var ce=null;var ue=null;m.open=function(e){x=e;var t=document.getElementById("compareProperties");if(t===null||t===undefined){var i="compareProperties";var n=C?St["b"].$(St["b"].$(C).parent()).offset():null;var a=C?St["b"].$(St["b"].$(C).parent()).width():null;var r=7;var o=[{text:I.getTranslation("OKAY"),id:"comparePropertiesDialogOkayButton",click:m.okay},{text:I.getTranslation("CANCEL"),id:"comparePropertiesDialogCancelButton",click:m.cancel}];var l=new St["b"].UI.HiCoDialogDefinition(i,b,o);R=l.getFontSize();var s=n&&a?[n.left+a+r,n.top]:"center";l.setPosition(s);l.setWidth(f+"px");l.setHeight(v);l.setResizable(true);l.setParentDomElement(h.parentNode);l.setTooltip(I.getTranslation("HELP_COMPAREPROPERTIES"));E=new St["b"].UI.HiCoDialog(l);T=E.getDialogDiv();var d={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var c=document.createElement("div");c.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(c,d);c.style.fontSize=R;T.appendChild(c);calculateLength();var u=E.buildTabs("comparePropertiesTabDiv",y,null,"auto",{top:"0px",left:"0px"},null,true);E.decorateTabs(0,y);St["b"].$(u).height("100%");E.setEvent("dialogresize",function(e,t){var i=St["b"].$(T).parent().height()-70;St["b"].$(T).height(i);St["b"].$(".ui-tabs-panel",St["b"].$(T).parent()).height(i-St["b"].$("#comparePropertiesTabDiv > .ui-tabs-nav").height()-se);i-=200;St["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesFromTableDiv"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesToTableDiv"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesContentTableDiv"),{height:i+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("comparePropertiesRestTableDiv"),{height:i+"px"})});T.setAttribute("class","compareProperties");E.setCSS();var p=parseInt(E.highest());var g=parseInt(E.getDialog().offsetParent().css("z-index"));if(p>g){p+=1;E.getDialog().offsetParent().css("z-index",p)}E.getDialog().dialog("open")}else{t.parentNode.remove(t);m.open(e)}};m.okay=function(){var e=_;e.compareFromPos=ie[document.getElementById("select##"+e.id+"##compareFromPosition").selectedIndex];if(e.compareFromPos===N.LABEL){e.from=S.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===N.LABEL){e.to=S.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=B;e.percent.legend=H;var n=document.getElementById("select##"+e.id+"##text").value;if(n.indexOf("$")>-1){n=S.encode(n)}e.text.text=n===V?"":n;e.text.legend=k;if(e.text.originalText){delete e.text.originalText}var a=document.getElementById("select##"+e.id+"##rgb").style;if(a.backgroundImage!=="none"&&a.backgroundImage!==""&&a.backgroundImage!=undefined){e.notation=N.NOTATION}else{e.notation=N.INDIVIDUAL;e.individualColor=a.backgroundColor}e.ellipse=document.getElementById("select##"+e.id+"##ellipse").checked;e.compareStyle=K;e.compareLegend=Z[document.getElementById("select##"+e.id+"##offsetPoint").selectedIndex];e.displayOffset=document.getElementById("select##"+e.id+"##compareOffset").value;if(e.compareToPos===N.POSITION&&e.compareFromPos===N.POSITION){e.linkType=1}else{e.linkType=0}e.displacePriority=q[document.getElementById("select##"+e.id+"##displacePriority").selectedIndex];e.isStackCompare=!!o.stackMode;x.setCompare(e,r);m.cancel()};m.cancel=function(){if(w&&w.cancel){w.cancel()}E.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=S.encodeInputField(document.getElementById("select##"+e.id+"##position"+t+"Input").value);var n="compare"+t+"Pos";var a=t==="To"?"to":"from";if(e[n]===N.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={};S.addQvVariables(s,false);r[o]=g.resolveVariables(S,r[o],s,null,null,false)}}i=r.join("@")}else{if(i[0]==="$"&&i[1]==="("&&i[i.length-1]===")"){var s={};S.addQvVariables(s,false);i=g.resolveVariables(S,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[n]===N.POSITION&&d.absolutePosition&&(d.absolutePosition.groupIndex+1).toString()===i){var c=e[a].split("#")[1];var r=e[a].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[a]=u?d.dataId_dim:e[a];e[a]=e[a]+"#"+c;break}else if(t==="From"&&e.compareFromPos===N.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===N.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=St["b"].$("#comparePropertiesRestTableDiv").find(".connectorSymbol");for(var n=0;n<i.length;n++){switch(i[n].id.split("##").pop()){case"conArrow":i[n].src=Se["a"].imgPath+(i[n].id===t.id?"arrow_up_active.png":"arrow_up.png");if(i[n].id===t.id){K=N.ARROW}break;case"conPin":i[n].src=Se["a"].imgPath+(i[n].id===t.id?"pin_active.png":"pin.png");if(i[n].id===t.id){K=N.PIN}break;case"conNotation":i[n].src=Se["a"].imgPath+(i[n].id===t.id?"notation.png":"notation_inactive.png");if(i[n].id===t.id){K=N.NOTATION}break}}}function changeLegendPosition(e){var t=e.target.id.split("##").pop();var i=e.target.className.split(/\s+/);var n=null;var a=null;for(var r=0;r<i.length;r++){if(i[r].indexOf("absolute")>-1){n=N.ABSOLUTE;a=B;break}else if(i[r].indexOf("percent")>-1){n=N.PERCENT;a=H;break}else if(i[r].indexOf("text")>-1){n=N.TEXT;a=k;break}}switch(t){case"auto":a=a===N.AUTO?N.NONE:N.AUTO;break;case"legendTop":a=a===N.START?N.NONE:N.START;break;case"legendMid":a=a===N.MID?N.NONE:N.MID;break;case"legendBot":a=a===N.END?N.NONE:N.END;break}switch(n){case N.ABSOLUTE:B=a;break;case N.PERCENT:H=a;break;case N.TEXT:k=a;break}refreshImages(e,n,a)}function refreshImages(e,t,i){if(t!==null){var n=St["b"].$("#comparePropertiesContentTableDiv").find("."+t);for(var a=0;a<n.length;a++){St["b"].$(n[a]).removeClass("opClass");switch(n[a].id.split("##").pop()){case"auto":n[a].src=Se["a"].imgPath+(i===N.AUTO?"order_auto_HI.png":"order_auto_N.png");i===N.NONE&&St["b"].$(n[a]).addClass("opClass");break;case"legendTop":n[a].src=Se["a"].imgPath+(i===N.START?"order_top_HI.png":"order_top_N.png");(i===N.AUTO||i===N.NONE)&&St["b"].$(n[a]).addClass("opClass");break;case"legendMid":n[a].src=Se["a"].imgPath+(i===N.MID?"order_sort_HI.png":"order_sort_N.png");(i===N.AUTO||i===N.NONE)&&St["b"].$(n[a]).addClass("opClass");break;case"legendBot":n[a].src=Se["a"].imgPath+(i===N.END?"order_bottom_HI.png":"order_bottom_N.png");(i===N.AUTO||i===N.NONE)&&St["b"].$(n[a]).addClass("opClass");break}}}}function checkFormulas(e){var t=e.target.id.split("##");var i=e.target.value;var n=0;if(t[2]==="positionFromInput"){n=document.getElementById("select##"+t[1]+"##compareFromPosition").selectedIndex}else if(t[2]==="positionToInput"){n=document.getElementById("select##"+t[1]+"##compareToPosition").selectedIndex}n=ie[n];if(n===N.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 a=i.slice(1,i.length-1);if(validateVariable(a)){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={};S.addQvVariables(t,true);return g.resolveVariables(S,S.encode(e),t,null,null,false)}}function calculateLength(){var e=document.getElementById("hiddenDiv");for(var t=0;t<M.length;t++){St["b"].$(e).html(O[t]);L[t]=e.clientWidth+1}for(var t=0;t<ie.length;t++){St["b"].$(e).html(ne[t]);var i=e.clientWidth+30;if(L[0]<i){L[0]=i}}L[1]=Math.max(L[1],100);for(var t=0;t<oe.length;t++){St["b"].$(e).html(le[t]);var i=e.clientWidth+30;if(L[2]<i){L[2]=i}}for(var t=0;t<re.length;t++){St["b"].$(e).html(ae[t]);var i=e.clientWidth+30;if(L[3]<i){L[3]=i}}for(var t=0;t<ee.length;t++){St["b"].$(e).html(te[t]);var i=e.clientWidth+30;if(L[4]<i){L[4]=i}}for(var t=0;t<u.length;t++){St["b"].$(e).html(A[t]);F[t]=e.clientWidth+1}F[0]=Math.max(F[0],70);F[1]=Math.max(F[1],70);F[2]=Math.max(F[2],281);for(var t=0;t<z.length;t++){St["b"].$(e).html(j[t]);Y[t]=e.clientWidth+1}Y[2]=Math.max(Y[2],53);for(var t=0;t<Z.length;t++){St["b"].$(e).html(Q[t]);var i=e.clientWidth+35;if(Y[3]<i){Y[3]=i}}}function createFromTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareFromPropDiv");var t=createCompareFromToHeader(n);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"};St["b"].Utils.DOM.setStyle(t,i);var n=document.createElement("table");var a=document.createElement("tr");var r=document.createElement("tr");for(var o=0;o<M.length;o++){var l=document.createElement("td");var s=document.createElement("td");var d=L[o];var c={width:d+"px",minWidth:d+"px",whiteSpace:"nowrap",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,c);St["b"].Utils.DOM.setStyle(s,c);St["b"].$(l).html(O[o]);l.setAttribute("title",I.getTranslation(e[o]));var u=document.createElement("span");u.style.margin="0px";St["b"].$(u).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');s.appendChild(u);r.appendChild(s);a.appendChild(l)}n.appendChild(a);n.appendChild(r);t.appendChild(n);return t}function createCompareFromTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesFromTableDiv");var t={height:25+"px",width:"100%"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=_;if(a!==null&&a!==undefined){var n=document.createElement("tr");var r={width:L[0]+"px",minWidth:L[0]+"px",textAlign:"center"};var o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.compareFromPos;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareFromPosition",ie,ne,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_TYPE"));St["b"].$(o).on("change",function(e){var t=e.target;var i=t.id.split("##")[1];var n=ie[t.selectedIndex];updateCompareFromAndTo(a,"From");if(n===N.POSITION){ce=a.positionFromInput.toString();document.getElementById("select##"+i+"##positionFromInput").value=ce}else{ce=S.decodeInputField(a.from,true);document.getElementById("select##"+i+"##positionFromInput").value=ce}});n.appendChild(o);r={width:L[1]+"px",minWidth:L[1]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var d;if(a.compareFromPos===N.POSITION){d=S.decode(a.positionFromInput.toString());ce=a.positionFromInput.toString()}else{d=S.decodeInputField(a.from,true);ce=d}var c=St["b"].Utils.DOM.createTextInputNoMax(o,"select##"+a.id+"##positionFromInput",d,0,R);c.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_POSITION"));St["b"].$(c).css({width:"95px"});St["b"].Utils.DOM.setStyle(c,$);St["b"].$(c).on("focusout",function(e){checkFormulas(e)});St["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e)}});n.appendChild(o);r={width:L[2]+"px",minWidth:L[2]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var u=a.compareFromCat;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareFromCat",oe,le,u,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_DIMENSION"));St["b"].$(o).on("change",function(e){var t=e.target.id.split("##")[1];if(oe[e.target.selectedIndex]===N.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}});n.appendChild(o);r={width:L[3]+"px",minWidth:L[3]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.from.split("#").pop();var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareFromKeyfigure",re,ae,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_MEASURE"));if(u==="axis"){s.disabled=true}n.appendChild(o);r={width:L[4]+"px",minWidth:L[4]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.compareFromStart;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareFromStart",ee,te,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_FROM_START"));if(u==="axis"){s.disabled=true}n.appendChild(o);i.appendChild(n)}e.appendChild(i);return e}function createToTab(){var e=document.createElement("div");e.setAttribute("id","tabCompareToPropDiv");var t=createCompareFromToHeader(a);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%"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var a=_;if(a!==null&&a!==undefined){var n=document.createElement("tr");var r={width:L[0]+"px",minWidth:L[0]+"px",textAlign:"center"};var o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.compareToPos;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareToPosition",ie,ne,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_TYPE"));St["b"].$(s).on("change",function(e){var t=e.target;var i=ie[t.selectedIndex];var n=t.id.split("##")[1];updateCompareFromAndTo(a,"To");if(i===N.POSITION){ue=a.positionToInput.toString();document.getElementById("select##"+n+"##positionToInput").value=ue}else{ue=S.decodeInputField(a.to,true);document.getElementById("select##"+n+"##positionToInput").value=ue}});n.appendChild(o);r={width:L[1]+"px",minWidth:L[1]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var d;if(a.compareToPos===N.POSITION){d=S.decode(a.positionToInput.toString());ue=a.positionToInput.toString()}else{d=S.decodeInputField(a.to,true);ue=d}var c=St["b"].Utils.DOM.createTextInputNoMax(o,"select##"+a.id+"##positionToInput",d,0,R);c.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_POSITION"));St["b"].$(c).css({width:"95px"});St["b"].Utils.DOM.setStyle(c,$);St["b"].$(c).on("focusout",function(e){checkFormulas(e)});St["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e)}});n.appendChild(o);r={width:L[2]+"px",minWidth:L[2]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var u=a.compareToCat;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareToCat",oe,le,u,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_DIMENSION"));St["b"].$(s).on("change",function(e){var t=e.target.id.split("##")[1];if(oe[e.target.selectedIndex]===N.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}});n.appendChild(o);r={width:L[3]+"px",minWidth:L[3]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.to.split("#").pop();var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareToKeyfigure",re,ae,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_MEASURE"));if(u==="axis"){s.disabled=true}n.appendChild(o);r={width:L[4]+"px",minWidth:L[4]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=a.compareToStart;var s=St["b"].Utils.DOM.createSelectBox(o,"select##"+a.id+"##compareToStart",ee,te,l,R);s.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_TO_START"));if(u==="axis"){s.disabled=true}n.appendChild(o);i.appendChild(n)}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"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");for(var a=0;a<u.length;a++){var r=document.createElement("td");var o=F[a];if(u[a]===N.TEXT){o=F[F.length-1]}r.colSpan=3;var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap",textAlign:"center"};St["b"].Utils.DOM.setStyle(r,l);St["b"].$(r).html(A[a]);r.setAttribute("title",I.getTranslation(U[a]));n.appendChild(r)}i.appendChild(n);var s=document.createElement("tr");for(var a=0;a<u.length;a++){var d=document.createElement("td");d.colSpan=3;var o=F[a];if(u[a]===N.TEXT){o=F[F.length-1]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap",textAlign:"center"};St["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";St["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%"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=_;if(n!==null&&n!==undefined){var a=document.createElement("tr");var r,o,l,s;var d={width:F[0]+"px",minWidth:F[0]+"px",textAlign:"center"};var c=document.createElement("td");St["b"].Utils.DOM.setStyle(c,d);B=n.absolute.legend;s=Se["a"].imgPath+(B===N.AUTO?"order_auto_HI.png":"order_auto_N.png");var u=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##auto","","",R,s,St["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));u.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));u.className=N.ABSOLUTE;St["b"].Utils.DOM.setStyle(u,W);St["b"].$(u).on("click",function(e){changeLegendPosition(e)});r=Se["a"].imgPath+(B===N.START?"order_top_HI.png":"order_top_N.png");var p=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendTop","","",R,r,St["b"].DataObjects.RuntimeDO.getTranslation("START"));p.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));p.className=N.ABSOLUTE;St["b"].Utils.DOM.setStyle(p,W);St["b"].$(p).on("click",function(e){changeLegendPosition(e)});if(B===N.MID){o=Se["a"].imgPath+"order_sort_HI.png"}else{o=Se["a"].imgPath+"order_sort_N.png"}var g=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendMid","","",R,o,St["b"].DataObjects.RuntimeDO.getTranslation("MID"));g.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));g.className=N.ABSOLUTE;St["b"].Utils.DOM.setStyle(g,W);St["b"].$(g).on("click",function(e){changeLegendPosition(e)});l=Se["a"].imgPath+(B===N.END?"order_bottom_HI.png":"order_bottom_N.png");var m=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendBot","","",R,l,St["b"].DataObjects.RuntimeDO.getTranslation("END"));m.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));m.className=N.ABSOLUTE;St["b"].Utils.DOM.setStyle(m,W);St["b"].$(m).on("click",function(e){changeLegendPosition(e)});if(B===N.AUTO){St["b"].$(p).addClass("opClass");St["b"].$(g).addClass("opClass");St["b"].$(m).addClass("opClass")}else if(B===N.NONE){St["b"].$(u).addClass("opClass");St["b"].$(p).addClass("opClass");St["b"].$(g).addClass("opClass");St["b"].$(m).addClass("opClass")}a.appendChild(c);d={width:F[1]+"px",minWidth:F[1]+"px",textAlign:"center"};H=n.percent.legend;c=document.createElement("td");St["b"].Utils.DOM.setStyle(c,d);s=Se["a"].imgPath+(H===N.AUTO?"order_auto_HI.png":"order_auto_N.png");var h=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##auto","","",R,s,St["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));h.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));h.className=N.PERCENT;St["b"].Utils.DOM.setStyle(h,W);St["b"].$(h).on("click",function(e){changeLegendPosition(e)});r=Se["a"].imgPath+(H===N.START?"order_top_HI.png":"order_top_N.png");var f=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendTop","","",R,r,St["b"].DataObjects.RuntimeDO.getTranslation("START"));f.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));f.className=N.PERCENT;St["b"].Utils.DOM.setStyle(f,W);St["b"].$(f).on("click",function(e){changeLegendPosition(e)});o=Se["a"].imgPath+(H===N.MID?"order_sort_HI.png":"order_sort_N.png");var v=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendMid","","",R,o,St["b"].DataObjects.RuntimeDO.getTranslation("MID"));v.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));v.className=N.PERCENT;St["b"].Utils.DOM.setStyle(v,W);St["b"].$(v).on("click",function(e){changeLegendPosition(e)});l=Se["a"].imgPath+(H===N.END?"order_bottom_HI.png":"order_bottom_N.png");var b=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendBot","","",R,l,St["b"].DataObjects.RuntimeDO.getTranslation("END"));b.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));b.className=N.PERCENT;St["b"].Utils.DOM.setStyle(b,W);St["b"].$(b).on("click",function(e){changeLegendPosition(e)});if(H===N.AUTO){St["b"].$(f).addClass("opClass");St["b"].$(v).addClass("opClass");St["b"].$(b).addClass("opClass")}else if(H===N.NONE){St["b"].$(h).addClass("opClass");St["b"].$(f).addClass("opClass");St["b"].$(v).addClass("opClass");St["b"].$(b).addClass("opClass")}a.appendChild(c);d={width:F[2]+"px",minWidth:F[2]+"px",textAlign:"center"};c=document.createElement("td");St["b"].Utils.DOM.setStyle(c,d);k=n.text.legend;s=Se["a"].imgPath+(k===N.AUTO?"order_auto_HI.png":"order_auto_N.png");var T=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##auto","","",R,s,St["b"].DataObjects.RuntimeDO.getTranslation("AUTO"));T.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_AUTO"));T.className=N.TEXT;St["b"].Utils.DOM.setStyle(T,W);St["b"].$(T).on("click",function(e){changeLegendPosition(e)});r=Se["a"].imgPath+(k===N.START?"order_top_HI.png":"order_top_N.png");var E=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendTop","","",R,r,St["b"].DataObjects.RuntimeDO.getTranslation("START"));E.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_TOP"));E.className=N.TEXT;St["b"].Utils.DOM.setStyle(E,W);St["b"].$(E).on("click",function(e){changeLegendPosition(e)});o=Se["a"].imgPath+(k===N.MID?"order_sort_HI.png":"order_sort_N.png");var x=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendMid","","",R,o,St["b"].DataObjects.RuntimeDO.getTranslation("MID"));x.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_MIDDLE"));x.className=N.TEXT;St["b"].Utils.DOM.setStyle(x,W);St["b"].$(x).on("click",function(e){changeLegendPosition(e)});l=Se["a"].imgPath+(k===N.END?"order_bottom_HI.png":"order_bottom_N.png");var C=St["b"].Utils.DOM.createIconButton(c,"select##"+n.id+"##legendBot","","",R,l,St["b"].DataObjects.RuntimeDO.getTranslation("END"));C.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_POS_BOTTOM"));C.className=N.TEXT;St["b"].Utils.DOM.setStyle(C,W);St["b"].$(C).on("click",function(e){changeLegendPosition(e)});if(k===N.AUTO){St["b"].$(E).addClass("opClass");St["b"].$(x).addClass("opClass");St["b"].$(C).addClass("opClass")}else if(k===N.NONE){St["b"].$(T).addClass("opClass");St["b"].$(E).addClass("opClass");St["b"].$(x).addClass("opClass");St["b"].$(C).addClass("opClass")}var y=n.text.originalText||n.text.text;if(y.indexOf("$")>-1){y=S.decode(y)}var M=St["b"].Utils.DOM.createTextInputNoMax(c,"select##"+n.id+"##text",y,0,R);M.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_DESCRIPTION_TEXT"));if(M.value===""){St["b"].$(M).val(V);St["b"].Utils.DOM.setStyle(M,{color:"rgb(150, 150, 150)"})}St["b"].Utils.DOM.setStyle(M,{width:"210px"});St["b"].Utils.DOM.setStyle(M,$);St["b"].$(M).focus(function(e){autoFocusIn(e.target)});St["b"].$(M).on("focusout",function(e){checkFormulas(e);autoFocusOut(e.target)});St["b"].$(M).on("keydown",function(e){if(e.which===13){checkFormulas(e);autoFocusOut(e.target)}});a.appendChild(c);i.appendChild(a)}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"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("tr");for(var r=0;r<z.length;r++){var o=document.createElement("td");var l=document.createElement("td");var s=Y[r];var d={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap",textAlign:"center"};St["b"].Utils.DOM.setStyle(o,d);St["b"].Utils.DOM.setStyle(l,d);St["b"].$(o).html(j[r]);o.setAttribute("title",I.getTranslation(X[r]));var c=document.createElement("span");c.style.margin="0px";St["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(c);a.appendChild(l);n.appendChild(o)}i.appendChild(n);i.appendChild(a);e.appendChild(i);return e}function createRestTable(){var e=document.createElement("div");e.setAttribute("id","comparePropertiesRestTableDiv");var t={height:25+"px",width:"100%"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=_;if(n!==null&&n!==undefined){var a=document.createElement("tr");var r={width:Y[0]+"px",minWidth:Y[0]+"px",textAlign:"center"};var o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var l=document.createElement("div");var s="select##"+n.id+"##rgb";l.setAttribute("id",s);var d=n.individualColor;var c="none";var u="none";var p="12px";var g="12px";var m="1px solid #aaaaaa";if(n.notation===N.NOTATION){d=I.getParameter("COLOR_COMPARE_POSITIVE");c=St["b"].DataObjects.RuntimeDO.getTranslation("NOTATION");u="url('"+Se["a"].imgPath+"notation.png')";p="16px";g="16px";m="none"}r={width:p,minWidth:p,height:g,minHeight:g,border:m,display:"block",margin:"auto",textAlign:"left",backgroundColor:d,backgroundImage:u,title:c};St["b"].Utils.DOM.setStyle(l,r);l.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_COLOR"));St["b"].$(l).hover(function(){this.style.cursor="pointer"},function(){this.style.cursor="auto"});St["b"].$(l).on("click",function(e){w=St["b"].UI.ColorPicker.createColorPicker(s,false,false,true,n)});o.appendChild(l);a.appendChild(o);r={width:Y[1]+"px",minWidth:Y[1]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var h=St["b"].Utils.DOM.createCheckBoxWithLabel(o,"select##"+n.id+"##ellipse","","","");h.checkBox.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_ELLIPSE"));if(n.ellipse===true){h.checkBox.setAttribute("checked","checked")}a.appendChild(o);r={width:Y[2]+"px",minWidth:Y[2]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var f=n.compareStyle;K=f;var v=Se["a"].imgPath+"notation_inactive.png";var b=Se["a"].imgPath+"arrow_up_active.png";var T=Se["a"].imgPath+"pin.png";if(f===N.PIN){b=Se["a"].imgPath+"arrow_up.png";T=Se["a"].imgPath+"pin_active.png";v=Se["a"].imgPath+"notation_inactive.png"}else if(f===N.NOTATION){b=Se["a"].imgPath+"arrow_up.png";T=Se["a"].imgPath+"pin.png";v=Se["a"].imgPath+"notation.png"}var E=St["b"].Utils.DOM.createIconButton(o,"select##"+n.id+"##conNotation","","",R,v,St["b"].DataObjects.RuntimeDO.getTranslation("NOTATION"));E.className="connectorSymbol";St["b"].$(E).on("click",function(e){changeConnectorStyleHandler(e)});var x=St["b"].Utils.DOM.createIconButton(o,"select##"+n.id+"##conArrow","","",R,b,St["b"].DataObjects.RuntimeDO.getTranslation("ARROW"));x.className="connectorSymbol";St["b"].$(x).on("click",function(e){changeConnectorStyleHandler(e)});var C=St["b"].Utils.DOM.createIconButton(o,"select##"+n.id+"##conPin","","",R,T,St["b"].DataObjects.RuntimeDO.getTranslation("PIN"));C.className="connectorSymbol";St["b"].$(C).on("click",function(e){changeConnectorStyleHandler(e)});a.appendChild(o);r={width:Y[3]+"px",minWidth:Y[3]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var f=n.compareLegend;var y=St["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##offsetPoint",Z,Q,f,R);y.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_OFFSET"));a.appendChild(o);r={width:Y[4]+"px",minWidth:Y[4]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var M=n.displayOffset;if(M!==G){M=parseFloat(M).toFixed(de)}var S=St["b"].Utils.DOM.createTextInputNoMax(o,"select##"+n.id+"##compareOffset",M,0,R);S.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_OFFSETMMPT"));St["b"].$(S).css({width:"90px"});St["b"].Utils.DOM.setStyle(S,$);if(M===G){S.style.color="rgb(150,150,150)"}St["b"].$(S).focusout(function(e){autoFocusOut(e.target)});St["b"].$(S).focus(function(e){autoFocusIn(e.target)});St["b"].$(S).on("keydown",function(e){if(e.which===13){autoFocusOut(e.target);e.target.blur()}});St["b"].$(S).css("padding",0);a.appendChild(o);r={width:Y[5]+"px",minWidth:Y[5]+"px",textAlign:"center"};o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,r);var O=St["b"].Utils.DOM.createSelectBox(o,"select##"+n.id+"##displacePriority",q,J,n.displacePriority,R);O.setAttribute("title",I.getTranslation("HELP_COMPAREPROPERTIES_REST_DISPLACE"));for(var L=0;L<P.length;L++){for(var A=0;A<q.length;A++){if(P[L].comp.displacePriority===q[A]&&P[L].comp.id.split(".")[0]===n.id.split(".")[0]&&q[A]!==-1&&q[A]!==n.displacePriority&&P[L].extensionId===D.getId()){O[A].style.backgroundColor="rgb(255, 0, 0)";O[A].disabled=true}}}a.appendChild(o);i.appendChild(a);e.appendChild(i);return e}}};St["b"].UI=St["b"].UI||{};St["b"].UI.CopyDatarulesDialog=function(e){var n=this;var t=e.extension;var i=e.parentDialog;var h=e.level;var f=e.cid;var a=e.title;var l=h==="expression"?e.displayId:null;var r=t.getCanvasDO().getDOMElement();var v=St["b"].DataObjects.RuntimeDO;var b=null;var T=null;var s=null;var E="12px";var o=null;var x=null;n.open=function(){var e="copyDatarulesDialog";var t=[{text:v.getTranslation("OKAY"),id:"copyDatarulesOkayButton",click:n.okay},{text:v.getTranslation("CANCEL"),id:"copyDatarulesCancelButton",click:n.close}];var i=new St["b"].UI.HiCoDialogDefinition(e,a,t);E=i.getFontSize();i.setParentDomElement(r.parentNode);i.setHeight(300);i.setWidth(400);i.setPosition({});i.setResizable(true);i.setModal(true);x=new St["b"].UI.HiCoDialog(i);o=x.getDialogDiv();x.setCSS();o.appendChild(fillContent())};function fillContent(){var e=h==="expression";var t=document.createElement("div");var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("td");var r=St["b"].Utils.DOM.createCheckBoxWithLabel(a,"copyDatarulesAdjustCheck","",v.getTranslation("ADJUST_EXPRESSION_IDS_FORMULAS"),"");r.checkBox.setAttribute("checked","checked");n.appendChild(a);i.appendChild(n);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=St["b"].DataObjects.ContextRepo.getAllContexts().slice(0);if(!e){for(var c=0;c<b.length;c++){if(b[c].cid===f){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=St["b"].DataObjects.ContextRepo.getExtensionByContextCid(b[c].cid).getTitle();p[c]=g+" - "+b[c].name;if(b[c].cid===f){T=b[c]}}var m=St["b"].Utils.DOM.createSelectBox(l,"copyDatarulesContextSelect",u,p,f,E);if(b.length===0){m.setAttribute("disabled","disabled");x.disableButton("copyDatarulesOkayButton")}if(e){St["b"].$(m).change(t,changeContextHandler)}if(e){changeContextHandler({exprCell:d,target:m})}return t}function changeContextHandler(e){T=b[e.target.selectedIndex];var t=e.exprCell||document.getElementById("copyDatarulesExprCell");St["b"].$(document.getElementById("copyDatarulesExpressionSelect")).remove();s=[];var i=[];var n=[];for(var a=0;a<T.columns.length;a++){var r=T.columns[a];if(T.cid!==f||r.displayId!==l){s.push(r);i.push(r.displayId);n.push(r.displayId+": "+r.name)}}var o=St["b"].Utils.DOM.createSelectBox(t,"copyDatarulesExpressionSelect",i,n,null,E);if(s.length===0){o.setAttribute("disabled","disabled");x.disableButton("copyDatarulesOkayButton")}else{x.enableButton("copyDatarulesOkayButton")}}n.okay=function(){var e=document.getElementById("copyDatarulesAdjustCheck");e=e&&e.checked;if(h==="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)}n.close()};n.close=function(){x.close()}};St["b"].UI=St["b"].UI||{};St["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 n=St["b"].DataObjects.DocumentDO.getAllExtensions();var u=[];var a=true;var p=St["b"].DataObjects.RuntimeDO;var g=2;var m=2;for(var r=0;r<n.length;r++){var o=[];var l=n[r];var h=l.getController();var f=h.getRootModel().rootContainerModel;St["b"].Models.Actions.ViewModelActions.General.getAllCharts(f,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(){a=false;St["b"].$('div[id*="emptySpaceCopy_"]').remove();i.show();i.createDimensionsEmptyTable()}function setupGrid(){St["b"].$('div[id*="emptySpaceCopy_"]').remove();var e=0;for(var t=0;t<u.length;t++){var i=u[t].extension;var n=i.getCanvasDO().getDOMElement();for(var a=0;a<u[t].charts.length;a++){var r=u[t].charts[a];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-m+"px";v.left=r.position.x+"px";v.width=r.dimension.width-g+"px";e++;var l=document.createElement("div");n.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"));St["b"].Utils.DOM.setStyle(l,v);St["b"].$(l).click(function(e){applyChanges(e.target.id)});St["b"].$(l).hover(function(){St["b"].$(this).css({cursor:"crosshair","background-color":"rgba(0, 176, 240, 0.2)"})},function(){St["b"].$(this).css({cursor:"auto","background-color":"rgba(217, 217, 217, 0.2)"})})}}else{St["b"].Utils.DOM.setStyle(o,v)}}}if(e==0){St["b"].UI.HiCoNotification(p.getTranslation("NOTHING_TO_COPY"),function(){closeCopy()})}}function applyChanges(t){if(c.length!==0){a=false;St["b"].UI.HiCoConfirm(p.getTranslation("CONFIRM_OVERWRITE"),function(e){a=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 n=i[5];n=St["b"].DataObjects.DocumentDO.getExtension(n);var a=n.getController().getRootModel();var r=St["b"].Factories.ModelFactory.getModelById(a,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 fe["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)}}St["b"].$(document).keyup(function(e){if(e.keyCode==27){if(a){closeCopy()}}})};St["b"].UI=St["b"].UI||{};St["b"].UI.CopyLabelFunctionDialog=function(e){var n=this;var t=e.extension;var i=e.parentDialog;var g=e.cid;var l=e.displayId;var a=e.title;var r=t.getCanvasDO().getDOMElement();var m=St["b"].DataObjects.RuntimeDO;var h="12px";var o=null;var f=null;var v=null;var b=null;var s=null;n.open=function(){var e="copyLabelFunctionDialog";var t=[{text:m.getTranslation("OKAY"),id:"copyLabelFunctionDialogOkayButton",click:n.okay},{text:m.getTranslation("CANCEL"),id:"copyLabelFunctionDialogCancelButton",click:n.close}];var i=new St["b"].UI.HiCoDialogDefinition(e,a,t);h=i.getFontSize();i.setParentDomElement(r.parentNode);i.setHeight(170);i.setWidth(470);i.setPosition({});i.setResizable(true);i.setModal(true);f=new St["b"].UI.HiCoDialog(i);o=f.getDialogDiv();f.setCSS();o.appendChild(fillContent())};function fillContent(){var e=document.createElement("div");var t=document.createElement("table");var i=document.createElement("tr");var n=document.createElement("td");var a=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"copyLabelFunctionDialogAdjustCheck","",m.getTranslation("ADJUST_EXPRESSION_IDS_FORMULAS"),"");a.checkBox.setAttribute("checked","checked");i.appendChild(n);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=St["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=St["b"].Utils.DOM.createSelectBox(o,"copyLabelFunctionDialogContextSelect",d,c,g,h);if(v.length===0){p.setAttribute("disabled","disabled");f.disableButton("copyLabelFunctionDialogOkayButton")}St["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");St["b"].$(document.getElementById("copyLabelFunctionDialogExpressionSelect")).remove();s=[];var i=[];var n=[];for(var a=0;a<b.columns.length;a++){var r=b.columns[a];if(b.cid!==g||r.id!==l){s.push(r);i.push(r.displayId);n.push(r.displayId+": "+r.name)}}var o=St["b"].Utils.DOM.createSelectBox(t,"copyLabelFunctionDialogExpressionSelect",i,n,null,h);if(s.length===0){o.setAttribute("disabled","disabled");f.disableButton("copyLabelFunctionDialogOkayButton")}else{f.enableButton("copyLabelFunctionDialogOkayButton")}}n.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)}n.close()};n.close=function(){f.close()}};St["b"].UI=St["b"].UI||{};St["b"].UI.CycleMenu={createCycleDIV:function(e,t){var i=St["b"].DataObjects.DocumentDO.getPainter().getContainerOutermostDivElement(t,e);var n=St["b"].DataObjects.DocumentDO.getExtension(e);if(n==undefined){return}var a=n.getController().getRootModel();var r=St["b"].Factories.ModelFactory.getModelById(a,t);var o=r.extendedModel.contextId;var l="CYCLEDIV_"+e+"_"+t+"_"+o;var s=document.getElementById(l);if(s===null){var d=St["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";St["b"].$(s).mouseenter(function(e){St["b"].$(this).clearQueue()});St["b"].$(s).mouseleave(function(e){St["b"].$(this).fadeOut(500,function(){St["b"].$("#"+l).remove()})});St["b"].$(s).click(function(e){e.stopPropagation();St["b"].UI.CycleMenu.createCycleGroupsDIV(this.id)});var g=document.createElement("img");g.src=Se["a"].imgPath+"cycle.png";s.appendChild(g);St["b"].$(s).hide();i.appendChild(s);St["b"].$(s).fadeIn(500);St["b"].$(s).delay(2e3).fadeOut(500,function(){St["b"].$(this).remove()})}},createCycleGroupsDIV:function(e){var t=e.split("_");var i=t[1];var n=t[2];var a=t.slice(3).join("_");var r="#F3F3F3";var o="#FFFFFF";var l="#5555FF";var s="#D0D0FF";var d="#A0A0A0";var c=St["b"].DataObjects.DocumentDO.getExtension(i);var u=c.getController().getRootModel();var p=St["b"].Factories.ModelFactory.getModelById(u,n);var g=St["b"].DataObjects.ContextRepo.getContextByCid(a);var m=[];var h=[];var f=[];var v=0;for(var b=0;b<g.rows.length;b++){if(g.rows[b].dimensionType==="cyclic"||g.rows[b].dimensionType==="drill"){m.push(a+"_"+b);f.push(b);v=Math.max(v,g.rows[b].groupMembers.length);h.push(g.rows[b].dimensionType)}}var T="CYCLESELECTDIV_"+i+"_"+n+"_"+a;var E=document.getElementById(T);var x=St["b"].DataObjects.DocumentDO.getConnector().getMainContainer(),C=x.getBoundingClientRect(),y=St["b"].DataObjects.DocumentDO.getPainter().getContainerOutermostDivElement(n,i),M=y.getBoundingClientRect();if(E===undefined||E===null){E=document.createElement("div");E.setAttribute("id",T);E.style.left=M.left+16-C.left+"px";if(p.layoutType==="time"){E.style.top=M.top+p.scrollingData.height-16-C.top+"px";for(var b=0;b<p.children.length;b++){var S=p.children[b];if(S.layoutType==="AxisGrid"){E.style.top=M.top+Math.min(S.position.y,p.scrollingData.height)-C.top+"px";break}}}else{E.style.top=M.top-C.top+"px"}E.style.width="60px";E.style.height=16*(m.length+1)+"px";E.style.position="absolute";St["b"].$(E).mouseenter(function(e){St["b"].$(this).clearQueue()});St["b"].$(E).mouseleave(function(e){St["b"].$(this).fadeOut(500,function(){St["b"].$(this).remove()})});var O=document.createElement("table");O.style.backgroundColor=o;O.style.border="1px solid "+d;var L=document.createElement("tr");var A=document.createElement("td");L.appendChild(A);O.appendChild(L);St["b"].$(O).click(function(e){e.stopPropagation()});var _=document.createElement("table");var I=document.createElement("tr");for(var b=0;b<m.length;b++){var D=document.createElement("td");D.style.backgroundColor=r;var R=document.createElement("input");R.setAttribute("type","button");R.setAttribute("id",m[b]+"_"+h[b]);R.setAttribute("name",m[b]);R.style.fontSize="10px";R.style.border="none";R.style.background="none";R.style.fontWeight="bold";var N=m[b].split("_");var P=parseInt(N[N.length-1]);R.value=P+1+" : "+(h[b]==="drill")?"Drill":"Cycle";St["b"].$(R).click(function(e){e.stopPropagation();var t=this.id.split("_");var i=t[t.length-1];var n=t[0];for(var a=1;a<t.length-2;a++){n+="_"+t[a]}var r=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(n);if(!r){return}if(i==="cyclic"){r.extension.getAdapter().cycle(n,parseInt(t[t.length-2]))}else{r.extension.getAdapter().drillUp(n,parseInt(t[t.length-2]),1)}var o=St["b"].$(e.target).closest("div");if(o!==undefined&&o!==null){o.clearQueue();o.fadeOut(500,function(){St["b"].$(this).remove()})}});St["b"].$(R).mouseenter(function(e){St["b"].$(this).parent().css("background-color",s)});St["b"].$(R).mouseleave(function(e){St["b"].$(this).parent().css("background-color",r)});D.appendChild(R);I.appendChild(D)}_.appendChild(I);for(var w=0;w<v;w++){var U=document.createElement("tr");for(var b=0;b<m.length;b++){var F=document.createElement("td");var P=f[b];if(g.rows[P].groupMembers[w]!==undefined){var R=document.createElement("input");R.setAttribute("type","button");R.setAttribute("id",m[b]+"_"+w+"_"+h[b]);R.setAttribute("name",m[b]+"_"+w);R.style.fontSize="10px";R.style.border="none";R.style.background="none";if(g.rows[P].groupActualLevel===w){R.style.color=l}R.value=g.rows[P].groupMembers[w].nameInternal?g.rows[P].groupMembers[w].nameInternal:g.rows[P].groupMembers[w].name;St["b"].$(R).click(function(e){e.stopPropagation();var t=this.id.split("_");var i=t[t.length-1];var n=parseInt(t[t.length-2]);var a=parseInt(t[t.length-3]);var r=t[0];for(var o=1;o<t.length-3;o++){r+="_"+t[o]}var l=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(r);if(!l){return}if(i==="cyclic"){l.extension.getAdapter().cycle(r,a,n)}else if(l.context.rows[a].groupActualLevel>n){var s=l.context.rows[a].groupActualLevel-n;l.extension.getAdapter().drillUp(r,a,s)}var d=St["b"].$(e.target).closest("div");if(d!==undefined&&d!==null){d.clearQueue();d.fadeOut(500,function(){St["b"].$(this).remove()})}});if(g.rows[P].groupActualLevel!==w&&h[b]==="cyclic"){St["b"].$(R).mouseenter(function(e){St["b"].$(this).parent().css("background-color",s)});St["b"].$(R).mouseleave(function(e){St["b"].$(this).parent().css("background-color",o)})}if(g.rows[P].groupActualLevel>w&&h[b]==="drill"){St["b"].$(R).mouseenter(function(e){St["b"].$(this).parent().css("background-color",s)});St["b"].$(R).mouseleave(function(e){St["b"].$(this).parent().css("background-color",o)})}F.appendChild(R)}U.appendChild(F)}_.appendChild(U)}A.appendChild(_);E.style.zIndex="200";E.appendChild(O);St["b"].$(E).hide();x.appendChild(E);St["b"].$(E).fadeIn(500);St["b"].$(E).delay(5e3).fadeOut(500,function(){St["b"].$(this).remove()})}}};St["b"].UI=St["b"].UI||{};St["b"].UI.DimensionMenu=function(e){var U=this;var F=e.extension;var M=e.model.extendedModel;var B=e.containerModel;var S=e.activeKeyfigures;var O=St["b"].DataObjects.ContextRepo.getContextByCid(M.contextId);if(O===null){return}var H=St["b"].DataObjects.RuntimeDO;var A=null;var f;var v=null;var _=null;var k=null;var g=null;var l=null;var G=[];var V=0;var $="12px";var W=St["b"].Utils.Constants.TypeValues.formulaEdit;var s=null;var z=St["b"].Utils.Constants.ParameterSets.emptySpacePositionTypeIds;var j=St["b"].Utils.Constants.ParameterSets.emptySpacePositionTypeTranslations;var I=St["b"].Utils.Constants.ParameterSets.categoryLabelTypeIds;var D=St["b"].Utils.Constants.ParameterSets.categoryLabelTypeTranslations;var R,N;var P=St["b"].Utils.Constants.ParameterSets.categoriesWithoutValuesTypeIds;var w=St["b"].Utils.Constants.ParameterSets.categoriesWithoutValuesTypeTL;var t=St["b"].Utils.Constants.TypeValues.labelOrientation;var X=St["b"].Utils.Constants.TypeValues.categoryLabel;var Y=St["b"].Utils.Constants.TypeValues.labelHorizontalAlignment;var L=[{id:"sepFromNotation",param:"sepFromNotation"},{id:"sepSubtotalFromNotation",param:"sepSubtotalFromNotation"},{id:"sepTotalFromNotation",param:"sepTotalFromNotation"},{id:"sepTotalWVFromNotation",param:"sepTotalWVFromNotation"}];var K=[{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 h=1;var te=["%","mm/10pt"];var b="Auto";var ie=M?M.dimensionLabelModel:null;var i=false;var ne=false;var ae=false;if(ie.orientation===t.VERTICAL){if(M.instanceOf==="ChartModel"){i=true}else{ae=true}}else{ne=true}var T=170+"px";var re=[];var E=[{id:"subtab-category",text:H.getTranslation("OVERALL"),buildUp:createDimensionsCategoryTab,title:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION")},{id:"subtab-separator",text:H.getTranslation("SEPARATOR"),buildUp:createSeparatorTab,title:H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR")},{id:"subtab-empty",text:H.getTranslation("GAP"),buildUp:createEmptyTab,title:H.getTranslation("HELP_CELL_DIMENSIONS_GAP")}];U.embed=function(e,t,i,n){if(O===null){return null}V=new St["b"].Utils.Calculator(O);G=[];if(ie.emptySpaceRepository===undefined){ie.emptySpaceRepository=[]}var a=ie.emptySpaceRepository;for(var r=0;r<a.length;r++){var o=new fe["a"].EmptySpaceModel;o.id=a[r].id;o.space_mmpt=a[r].space_mmpt;o.position=a[r].position;o.axisSplit=a[r].axisSplit;var l=a[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 fe["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 fe["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)}A=e;v=A.getDialogDiv();var u={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var p=document.createElement("div");p.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(p,u);$=i;p.style.fontSize=$;v.appendChild(p);createDimensionsTab();t.appendChild(f);A.setCSS("overflow","hidden");A.setCSS();A.decorateTabs(0,E);var g=parseInt(A.highest());var m=parseInt(A.getDialog().offsetParent().css("z-index"));if(g>m){g+=1;A.getDialog().offsetParent().css("z-index",g)}if(!ae){for(var r=0;r<re.length;r++){for(var h=0;h<O.rows.length;h++){if(re[r].id===O.rows[h].id.split(".")[0]){U.dimensionLengthAuto(re[r].id,re[r].dimAutoLength)}}}}U.updateTableDivHeightFromOutside(St["b"].$(v).parent().height());return this};U.updateTableDivHeightFromOutside=function(e){if(_==null||k==null){return}St["b"].Utils.DOM.setStyle(f,{height:e-117+"px"});e-=117+30+12;St["b"].Utils.DOM.setStyle(document.getElementById("subtab-category"),{height:e+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("subtab-separator"),{height:e+"px"});St["b"].Utils.DOM.setStyle(document.getElementById("subtab-empty"),{height:e+"px"});St["b"].Utils.DOM.setStyle(_,{height:e+"px"});St["b"].Utils.DOM.setStyle(k,{height:e+"px"});if(l!=null){St["b"].Utils.DOM.setStyle(l,{height:e+"px"})}};function createDimensionsTab(){f=A.buildTabs("dimensionsTabDiv",E,null,"auto",{top:"0px",left:"0px"},null,true)}function createDimensionsCategoryTab(){var e=document.createElement("div");e.setAttribute("id","tabCategoryDiv");var t=U.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 n=document.createElement("td");var a=U.createChangeSeparatorsTable();n.appendChild(a);St["b"].Utils.DOM.setStyle(n,{paddingRight:"10px",verticalAlign:"top"});i.appendChild(n);n=document.createElement("td");var r=U.createTotalSeparatorsTable();n.appendChild(r);St["b"].Utils.DOM.setStyle(n,{verticalAlign:"top"});i.appendChild(n);t.appendChild(i);e.appendChild(t);var o={overflow:"auto"};St["b"].Utils.DOM.setStyle(e,o);return e}function createEmptyTab(){var e=document.createElement("div");e.setAttribute("id","tabEmptyDiv");U.createDimensionsEmptyTable(e);return e}U.createDimensionsCategoryTable=function(){var e=document.createElement("div");_=e;e.setAttribute("id","dimensionCategoryTableDiv");St["b"].$(e).empty();var t=document.createElement("table");t.setAttribute("cellSpacing","3px");t.setAttribute("cellPadding","3px");var i,n;var a=document.createElement("td");var r=document.createElement("td");var o=document.createElement("td");var l=document.createElement("tr");a.style.verticalAlign="top";r.style.verticalAlign="top";R=I.slice(0);N=D.slice(0);if(ae){var s=R.indexOf(X.FREE_AXIS_POS);if(s!=-1){R.splice(s,1);N.splice(s,1)}}i=document.createElement("tr");i.style.verticalAlign="middle";n=document.createElement("td");St["b"].$(n).html(H.getTranslation("SHOW_AT"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_AT"));i.appendChild(n);n=document.createElement("td");var d=document.createElement("select");d.setAttribute("size","1");d.setAttribute("id","displayType");d.style.fontSize=$;d.setAttribute("title",H.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")}St["b"].$(u).html(N[c]);d.appendChild(u)}n.appendChild(d);i.appendChild(n);a.appendChild(i);i=document.createElement("tr");i.style.verticalAlign="middle";n=document.createElement("td");St["b"].$(n).html(H.getTranslation("ALIGNMENT"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));i.appendChild(n);n=document.createElement("td");if(ne){var p=St["b"].Utils.Constants.TypeValues.summingPos.START;var g=ie.categoryEntriesPosition===p?"text_align_left.png":"text_align_left_grey.png";var m=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryEntriesPosition.start",p,"Start",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));St["b"].$(m).click(entriesClickHandlerHorizontal);var p=St["b"].Utils.Constants.TypeValues.summingPos.END;var g=ie.categoryEntriesPosition===p?"text_align_right.png":"text_align_right_grey.png";var h=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryEntriesPosition.end",p,"End",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));St["b"].$(h).click(entriesClickHandlerHorizontal)}else{var p=St["b"].Utils.Constants.TypeValues.summingPos.START;var g=ie.categoryEntriesPosition===p?"text_align_top.png":"text_align_top_grey.png";var m=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryEntriesPosition.start",p,"Start",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));St["b"].$(m).click(entriesClickHandlerVertical);var p=St["b"].Utils.Constants.TypeValues.summingPos.END;var g=ie.categoryEntriesPosition===p?"text_align_bottom.png":"text_align_bottom_grey.png";var h=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryEntriesPosition.end",p,"End",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ENTRIES"));St["b"].$(h).click(entriesClickHandlerVertical)}i.appendChild(n);a.appendChild(i);if(!ne){i=document.createElement("tr");i.style.verticalAlign="middle";n=document.createElement("td");n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));i.appendChild(n);n=document.createElement("td");var p=Y.LEFT;var g=ie.alignment===p?"text_align_left.png":"text_align_left_grey.png";var f=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryAlignment.left",p,"Left",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));St["b"].$(f).click(alignmentClickHandler);var p=Y.MIDDLE;var g=ie.alignment===p?"text_align_center.png":"text_align_center_grey.png";var v=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryAlignment.center",p,"Mid",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));St["b"].$(v).click(alignmentClickHandler);var p=Y.RIGHT;var g=ie.alignment===p?"text_align_right.png":"text_align_right_grey.png";var b=St["b"].Utils.DOM.createIconButton(n,"hicoCellCategoryAlignment.right",p,"Right",$,Se["a"].imgPath+g,H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ALIGNMENT"));St["b"].$(b).click(alignmentClickHandler);i.appendChild(n);a.appendChild(i)}i=document.createElement("tr");i.style.verticalAlign="middle";n=document.createElement("td");St["b"].$(n).html(H.getTranslation("LABELS_WITHOUT_TOTALS"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_LABELS_WITHOUT_TOTALS"));i.appendChild(n);n=document.createElement("td");var T=document.createElement("select");T.setAttribute("size","1");T.setAttribute("id","categoriesWithoutTotals");T.style.fontSize=$;for(var c=0;c<P.length;c++){var u=document.createElement("option");if(P[c]===ie.categoriesWithoutTotals){u.setAttribute("selected","selected")}St["b"].$(u).html(w[c]);T.appendChild(u)}T.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_LABELS_WITHOUT_TOTALS"));n.appendChild(T);i.appendChild(n);r.appendChild(i);if(ae){i=document.createElement("tr");n=document.createElement("td");St["b"].$(n).html(H.getTranslation("SHOW_HEADER"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_HEADER"));i.appendChild(n);n=document.createElement("td");var E=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"showCategoryHeader","","","");if(ie.hideCategoryHeader!==true){E.checkBox.setAttribute("checked","checked")}E.checkBox.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_SHOW_HEADER"));i.appendChild(n);r.appendChild(i);J=ie.repeatNotation;var x=[{value:"notation",id:"repeatNotation##notation",activeIcon:"notation.png",inactiveIcon:"notation_inactive.png",tooltip:H.getTranslation("NOTATION")},{value:"on",id:"repeatNotation##on",activeIcon:"on.png",inactiveIcon:"on_inactive.png",tooltip:H.getTranslation("ON")},{value:"off",id:"repeatNotation##off",activeIcon:"off.png",inactiveIcon:"off_inactive.png",tooltip:H.getTranslation("OFF")}];var C=[{type:"text",value:H.getTranslation("REPEAT_NOTATION"),tdStyle:{tooltip:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_REPEAT_NOTATION")}},{type:"iconselector",value:J,values:x,tdStyle:{textAlign:"left"},click:repeatNotationEventHandler,tooltip:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_REPEAT_NOTATION")}];A.buildTableRow(r,C)}else{i=document.createElement("tr");i.style.verticalAlign="middle";n=document.createElement("td");St["b"].Utils.DOM.createSpan(n,H.getTranslation("ADDITIONAL_WIDTH"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ADDITIONAL_DISTANCE"));i.appendChild(n);n=document.createElement("td");var y=(ie.addCategoryDistance*10).toFixed(ee);var M=St["b"].Utils.DOM.createTextInput(n,"addCategoryDistance",y,10,$);St["b"].Utils.DOM.setStyle(M,{textAlign:"right",width:"60px%"});M.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_ADDITIONAL_DISTANCE"));St["b"].Utils.DOM.createSpan(n,"&nbsp;mm/10pt");i.appendChild(n);r.appendChild(i);i=document.createElement("tr");n=document.createElement("td");St["b"].Utils.DOM.createSpan(n,H.getTranslation("DISTANCE_MULTIPLIER"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_DISTANCE_MULTIPLIER"));i.appendChild(n);n=document.createElement("td");var S=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"hasCategoryDistanceMultiplier","","","");if(ie.hasCategoryDistanceMultiplier===true){S.checkBox.setAttribute("checked","checked")}S.checkBox.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_DISTANCE_MULTIPLIER"));i.appendChild(n);r.appendChild(i)}St["b"].Utils.DOM.setStyle(o,{width:"50px"});l.appendChild(a);l.appendChild(o);l.appendChild(r);t.appendChild(l);l=document.createElement("tr");var O=document.createElement("td");O.setAttribute("colspan","3");var L=document.createElement("span");L.style.margin="0px";St["b"].$(L).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');O.appendChild(L);l.appendChild(O);t.appendChild(l);l=document.createElement("tr");O=document.createElement("td");O.setAttribute("colspan","3");if(!ae){O.appendChild(createDimensionsForTimeStructure())}l.appendChild(O);t.appendChild(l);e.appendChild(t);St["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 n="hicoCellCategoryAlignment."+t[i];if(n===this.id){this.src=Se["a"].imgPath+"text_align_"+t[i]+".png"}else{var a=document.getElementById(n);a.src=Se["a"].imgPath+"text_align_"+t[i]+"_grey.png"}}}function entriesClickHandlerHorizontal(e){if(this.id.indexOf("start")>=0){this.src=Se["a"].imgPath+"text_align_left.png";document.getElementById("hicoCellCategoryEntriesPosition.end").src=Se["a"].imgPath+"text_align_right_grey.png"}else{document.getElementById("hicoCellCategoryEntriesPosition.start").src=Se["a"].imgPath+"text_align_left_grey.png";this.src=Se["a"].imgPath+"text_align_right.png"}}function entriesClickHandlerVertical(e){if(this.id.indexOf("start")>=0){this.src=Se["a"].imgPath+"text_align_top.png";document.getElementById("hicoCellCategoryEntriesPosition.end").src=Se["a"].imgPath+"text_align_bottom_grey.png"}else{document.getElementById("hicoCellCategoryEntriesPosition.start").src=Se["a"].imgPath+"text_align_top_grey.png";this.src=Se["a"].imgPath+"text_align_bottom.png"}}function repeatNotationEventHandler(e){var t=this.id.split("##");J=t[1];for(var i=0;i<x.length;i++){var n=x[i];var a=document.getElementById(n.id);a.src=Se["a"].imgPath+(J===n.value?n.activeIcon:n.inactiveIcon)}}};function createDimensionsForTimeStructure(){var e=["60px","220px","220px","110px"];var t=document.createElement("div");t.setAttribute("id","dimensionCategoryDimensionTableDiv");var i=document.createElement("table");St["b"].Utils.DOM.setStyle(i,{borderCollapse:"separate",borderSpacing:"5px 0",width:"100%",overflow:"hidden"});A.buildTableRow(i,[{type:"empty",tdStyle:{width:e[0],minWidth:e[0]}},{type:"text",value:H.getTranslation("APPLIES_TO"),tooltip:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_APPLIES_TO"),tdStyle:{borderBottom:"1px solid black",width:e[1],minWidth:e[1],whiteSpace:"nowrap"}},{type:"text",value:H.getTranslation("CONDITION"),tooltip:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CONDITION"),tdStyle:{borderBottom:"1px solid black",width:e[2],minWidth:e[2],whiteSpace:"nowrap"}},{type:"text",value:H.getTranslation("CUT_AT"),tooltip:H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CUT_AT"),tdStyle:{borderBottom:"1px solid black",width:e[3],minWidth:e[3],whiteSpace:"nowrap"}}]);var n=O.rows;for(var a=0;a<n.length;a++){var r=n[a];var o=getDimensionFormula(r.id);if(o===-1||o===null||o===undefined){var l=new fe["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)+"..."}St["b"].$(u).html(p);St["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",H.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 m=buildFormulaButton("ruleDimApplies##"+r.id,"ruleDimAppliesEdit##"+r.id,W.APPLIES_TO,H.getTranslation("APPLIES_TO"));u.appendChild(m.childNodes[0]);St["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_APPLIES_TO"));d.appendChild(u);c.width=e[2];c.minWidth=e[2];var h=V.invertNames(V.decode(s.conditionFormula.formula));u=buildTextInput("ruleDimConditionEdit##"+r.id,h,0,null,true);u.childNodes[0].style.width=T;var m=buildFormulaButton("ruleDimCondition##"+r.id,"ruleDimConditionEdit##"+r.id,W.CONDITION,H.getTranslation("CONDITION"));u.appendChild(m.childNodes[0]);St["b"].Utils.DOM.setStyle(u,c);u.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CONDITION"));d.appendChild(u);c.width=e[3];c.minWidth=e[3];var f=buildTextInput("dimCutAtMMPT##"+r.id,(parseFloat(s.dimension_mmpt)*10).toFixed(ee),6,null);var v=St["b"].$(f).find("input").get(0);St["b"].Utils.DOM.setStyle(v,{textAlign:"right",backgroundColor:"rgb(240, 240, 240)",border:"0px"});St["b"].$(v).focus(autoFocusIn);St["b"].$(v).focusout(autoFocusOut);if(s.dimAutoLength){v.value=b;v.style.color="rgb(150,150,150)"}St["b"].Utils.DOM.createSpan(f,"&nbsp;mm/10pt");St["b"].Utils.DOM.setStyle(f,c);f.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_DIMENSION_CUT_AT"));d.appendChild(f);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,a,r,o){var t=document.createElement("td");var i=St["b"].Utils.DOM.createButtonInput(t,e,"","fx",$);St["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}var i=St["b"].$(f).parent().offset();s=new St["b"].UI.FormulaEditor(O,r);var n=document.getElementById(a).value;s.open(V.encode(n),a,[],U,{x:i.left+20,y:i.top+20},o)});return t}U.dimensionLengthAuto=function(e,t){var i=document.getElementById("dimCutAtMMPT##"+e);t===true?i.disabled=true:i.disabled=false};U.createChangeSeparatorsTable=function(){var e=document.createElement("div");e.setAttribute("id","changeSeparatorsTableDiv");if(!ae){var t=document.createElement("table");t.setAttribute("cellSpacing","3px");var i=document.createElement("tr");var n=document.createElement("td");St["b"].$(n).html(H.getTranslation("REFERENCE"));St["b"].Utils.DOM.setStyle(n,{fontWeight:"bold",borderBottom:"1px solid black"});n.setAttribute("colspan","2");n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_REFERENCE"));i.appendChild(n);t.appendChild(i);i=document.createElement("tr");n=document.createElement("td");var a=document.createElement("select");a.setAttribute("size","1");a.setAttribute("id","selectedKeyfigure");a.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_REFERENCE"));a.style.fontSize=$;var r=false;for(var o=0;o<S.length;o++){var l=document.createElement("option");if(S[o].id===ie.selectedKeyfigure){l.setAttribute("selected","selected");r=true}var s=S[o].name.length<=30?S[o].name:S[o].name.substr(0,28)+"...";St["b"].$(l).html(s);a.appendChild(l)}if(r===false&&a.length>0){a.options[0].setAttribute("selected","selected")}n.appendChild(a);n.setAttribute("colspan","2");i.appendChild(n);t.appendChild(i);i=document.createElement("tr");n=document.createElement("td");St["b"].$(n).html(H.getTranslation("CHANGE_OF"));St["b"].Utils.DOM.setStyle(n,{fontWeight:"bold",borderBottom:"1px solid black"});n.setAttribute("colspan","2");n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_CHANGE_OF"));i.appendChild(n);t.appendChild(i);i=document.createElement("tr");n=document.createElement("td");St["b"].$(n).html(H.getTranslation("TIMETYPE"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TIMETYPE"));i.appendChild(n);n=document.createElement("td");var d=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"separatorTimeType","","","");if(r&&ie.separatorTimeType===true){d.checkBox.setAttribute("checked","checked")}d.checkBox.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TIMETYPE"));i.appendChild(n);t.appendChild(i);i=document.createElement("tr");n=document.createElement("td");St["b"].$(n).html(H.getTranslation("SCENARIO"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_SCENARIO"));i.appendChild(n);n=document.createElement("td");var c=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"separatorDataType","","","");if(r&&ie.separatorDataType===true){c.checkBox.setAttribute("checked","checked")}c.checkBox.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_SCENARIO"));i.appendChild(n);t.appendChild(i);i=document.createElement("tr");n=document.createElement("td");St["b"].$(n).html(H.getTranslation("DIMENSION"));n.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_DIMENSION"));i.appendChild(n);n=document.createElement("td");var u=St["b"].Utils.DOM.createCheckBoxWithLabel(n,"separatorCategory","","","");if(r&&ie.separatorCategory===true){u.checkBox.setAttribute("checked","checked")}u.checkBox.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_DIMENSION"));i.appendChild(n);t.appendChild(i);e.appendChild(t)}return e};U.setParameters=function(){if(ie.sepLengthStart_factor===null){if(ne){ie.sepLengthStart_factor=H.getParameter("FACTOR_TIME_SEPARATOR_NEGATIVE_AREA");ie.sepLengthEnd_factor=H.getParameter("FACTOR_TIME_SEPARATOR_DRAWING_AREA");ie.sepSubtotalLengthStart_factor=H.getParameter("FACTOR_TIME_SUBTOTAL_SEPARATOR_NEGATIVE_AREA");ie.sepSubtotalLengthEnd_factor=H.getParameter("FACTOR_TIME_SUBTOTAL_SEPARATOR_LENGTH");ie.sepTotalLengthStart_factor=H.getParameter("FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalLengthEnd_factor=H.getParameter("FACTOR_TIME_TOTAL_WITH_VALUES_SEPARATOR_LENGTH");ie.sepTotalWVLengthStart_factor=H.getParameter("FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalWVLengthEnd_factor=H.getParameter("FACTOR_TIME_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH")}else if(i){ie.sepLengthStart_factor=H.getParameter("FACTOR_STRUCTURE_SEPARATOR_NEGATIVE_AREA");ie.sepLengthEnd_factor=H.getParameter("FACTOR_STRUCTURE_SEPARATOR_DRAWING_AREA");ie.sepSubtotalLengthStart_factor=H.getParameter("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_NEGATIVE_AREA");ie.sepSubtotalLengthEnd_factor=H.getParameter("FACTOR_STRUCTURE_SUBTOTAL_SEPARATOR_LENGTH");ie.sepTotalLengthStart_factor=H.getParameter("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalLengthEnd_factor=H.getParameter("FACTOR_STRUCTURE_TOTAL_WITH_VALUES_SEPARATOR_LENGTH");ie.sepTotalWVLengthStart_factor=H.getParameter("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_NEGATIVE_AREA");ie.sepTotalWVLengthEnd_factor=H.getParameter("FACTOR_STRUCTURE_TOTAL_WITHOUT_VALUES_SEPARATOR_LENGTH")}}};U.createTotalSeparatorsTable=function(){U.setParameters();g=document.createElement("div");g.setAttribute("id","headerSeparatorDiv");if(ae){return g}var e=document.createElement("table");e.setAttribute("cellSpacing","3px");var t=document.createElement("tr");var i=document.createElement("td");St["b"].$(i).html(H.getTranslation("LENGTH"));St["b"].Utils.DOM.setStyle(i,{fontWeight:"bold"});i.setAttribute("colspan","6");i.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_LENGTH"));i.style.borderBottom="1px solid black";t.appendChild(i);e.appendChild(t);var n=[H.getTranslation("TYPE"),H.getTranslation("CHANGE_OF"),H.getTranslation("SUBTOTAL"),H.getTranslation("TOTAL"),H.getTranslation("TOTALS_WITHOUT_VALUES")];var a=[H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE"),H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_CHANGE_OF"),H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_SUBTOTAL"),H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_TOTAL"),H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_TYPE_TOTALS_WO_VALUES")];var t=document.createElement("tr");for(var r=0;r<n.length;r++){var i=document.createElement("td");St["b"].$(i).html(n[r]);if(r===0){i.setAttribute("colspan","2")}i.setAttribute("title",a[r]);i.style.borderBottom="1px solid black";t.appendChild(i)}e.appendChild(t);var o=document.createElement("tr");var l=H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_NOTATION");var i=document.createElement("td");St["b"].$(i).html(H.getTranslation("START"));i.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_START"));o.appendChild(i);i=document.createElement("td");St["b"].$(i).html(H.getTranslation("NOTATION"));i.setAttribute("title",l);o.appendChild(i);for(var r=0;r<L.length;r++){i=document.createElement("td");var s=St["b"].Utils.DOM.createCheckBoxWithLabel(i,L[r].id,"","","");if(ie[L[r].param]){s.checkBox.setAttribute("checked","checked")}St["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=H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_AUTO");var i=document.createElement("td");o.appendChild(i);i=document.createElement("td");St["b"].$(i).html(H.getTranslation("AUTO"));i.setAttribute("title",d);o.appendChild(i);for(var r=0;r<K.length;r++){i=document.createElement("td");var c=St["b"].Utils.DOM.createCheckBoxWithLabel(i,K[r].id,"","","");if(ie[K[r].param]){c.checkBox.setAttribute("checked","checked")}if(ie[L[r].param]){c.checkBox.setAttribute("disabled","disabled")}c.checkBox.setAttribute("title",d);o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var m=H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_MANUAL");var i=document.createElement("td");o.appendChild(i);i=document.createElement("td");St["b"].$(i).html(H.getTranslation("MANUAL"));i.setAttribute("title",m);o.appendChild(i);function createDynamicLengthEntry(e,t,i,n,a,r){var o=(ie[i+"_factor"]*100).toFixed(h);var l=(ie[i+"_mmpt"]*10).toFixed(ee);var s=St["b"].Utils.DOM.createTextInput(e,t+"_factor",o,4,$);s.setAttribute("maxlength","10");s.setAttribute("title",m);var d=St["b"].Utils.DOM.createTextInput(e,t+"_mmpt",l,4,$);d.setAttribute("maxlength","10");d.setAttribute("title",m);var c=document.createElement("select");c.setAttribute("size","1");c.style.fontSize=$;c.setAttribute("id",n);St["b"].$(c).attr("class","_lengthUnits");c.setAttribute("title",m);for(var u=0;u<te.length;u++){var p=document.createElement("option");St["b"].$(p).html(te[u]);c.appendChild(p)}var g=ie[a];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=""}}St["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[L[r].param]);o.appendChild(i)}e.appendChild(o);var o=document.createElement("tr");var i=document.createElement("td");St["b"].$(i).html(H.getTranslation("END"));i.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_SEPARATOR_END"));o.appendChild(i);i=document.createElement("td");St["b"].$(i).html(H.getTranslation("NOTATION"));i.setAttribute("title",l);o.appendChild(i);for(var r=0;r<Q.length;r++){i=document.createElement("td");var p=St["b"].Utils.DOM.createCheckBoxWithLabel(i,Q[r].id,"","","");if(ie[Q[r].param]){p.checkBox.setAttribute("checked","checked")}p.checkBox.setAttribute("title",l);St["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");St["b"].$(i).html(H.getTranslation("MANUAL"));i.setAttribute("title",m);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};U.createDimensionsEmptyTable=function(e){var t=e||document.getElementById("tabEmptyDiv");St["b"].$(t).empty();var i=document.createElement("div");k=i;i.setAttribute("id","emptyTableDiv");var n=document.createElement("table");St["b"].Utils.DOM.setStyle(n,{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 n=0;n<e.length;n++){var a=document.createElement("th");St["b"].Utils.DOM.setStyle(a,r);if(e[n]){St["b"].Utils.DOM.createSpan(a,e[n]);a.setAttribute("title",t[n])}i.appendChild(a)}return i}var a=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_APPLIES_TO");var o=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_MMPT");var l=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_POSITION");var s=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_AXIS_SPLIT");var d=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_DELETE");var c=H.getTranslation("HELP_CELL_DIMENSIONS_GAP_COPY_FROM");var u=[null,H.getTranslation("APPLIES_TO"),null,H.getTranslation("MMPT"),H.getTranslation("POSITION"),H.getTranslation("SPLIT_AXIS")];var p=[null,a,null,o,l,s];var g=buildHeader(u,p);var m=document.createElement("th");St["b"].Utils.DOM.setStyle(m,{borderBottom:"1px solid black",width:"20px",maxWidth:"20px",minWidth:"20px",overflow:"hidden",textAlign:"center"});var h=St["b"].Utils.DOM.createSpan(m,"+","dimensionMenuAddEmptySpace."+x);h.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_GAP_ADD"));St["b"].$(h).click(function(e){U.addEmptySpace(e);U.createDimensionsEmptyTable()});St["b"].$(h).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});g.appendChild(m);var f=document.createElement("tbody");n.appendChild(f);var v=document.createElement("th");var b=St["b"].Utils.DOM.createButtonInput(v,"emptyCopyFromButton","",H.getTranslation("COPY_FROM"),$);b.setAttribute("title",c);St["b"].$(b).click(function(e){var t={extension:F,parentDialog:U,tmpEmptySpaceRepository:G,containerModel:B};var i=new St["b"].UI.CopyEmptySpacesDialog(t);i.open()});g.appendChild(v);n.appendChild(g);var T=["12px","200px","40px","80px","70px","55px","20px","100px"];if(G.length===0){var E=document.createElement("tr");for(var x=0;x<T.length;x++){var C=document.createElement("td");C.style.width=T[x];E.appendChild(C)}n.appendChild(E)}else{for(var x=0;x<G.length;x++){var y=document.createElement("tr");y.setAttribute("id","emptyRow."+x);var M=document.createElement("td");var S=document.createElement("div");S.setAttribute("id","emptyDragger."+x);S.setAttribute("title",H.getTranslation("HELP_CELL_DIMENSIONS_GAP_DRAGGER"));St["b"].Utils.DOM.setStyle(S,{height:"10px",width:"10px",background:"rgb(150,150,150)"});M.appendChild(S);M.style.width=T[0];S.style.marginLeft="1px";y.appendChild(M);var O=G[x].appliesFormula;var L=buildTextInput("emptyApplies."+x,V.invertNames(V.decode(O)),26,null,true);L.style.width=T[1];L.childNodes[0].style.width="98%";L.setAttribute("title",a);y.appendChild(L);var A=buildFormulaButton("emptyAppliesB."+x,"emptyApplies."+x,W.APPLIES_TO,H.getTranslation("APPLIES_TO"));A.style.width=T[2];A.setAttribute("title",a);y.appendChild(A);var _=buildTextInput("emptyMMPT."+x,(parseFloat(G[x].space_mmpt)*10).toFixed(ee),6,null);_.style.width=T[3];_.setAttribute("title",o);y.appendChild(_);var I=z.indexOf(G[x].position);var D=buildListBox("emptyPosition."+x,j,j[I],null);D.style.width=T[4];D.style.textAlign="left";D.setAttribute("title",l);y.appendChild(D);M=document.createElement("td");var R=St["b"].Utils.DOM.createCheckBoxWithLabel(M,"axisSplit."+x,"","","");if(G[x].axisSplit===true){R.checkBox.setAttribute("checked","checked")}M.style.textAlign="center";R.checkBox.setAttribute("title",s);y.appendChild(M);var N=document.createElement("td");St["b"].Utils.DOM.setStyle(N,{width:T[6],maxWidth:T[6],minWidth:T[6],overflow:"hidden",textAlign:"center"});var P=St["b"].Utils.DOM.createSpan(N,"-","dimensionMenuRemoveEmptySpace."+x);P.setAttribute("title",d);St["b"].$(P).click(function(e){U.removeEmptySpace(e);U.createDimensionsEmptyTable()});St["b"].$(P).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});y.appendChild(N);var w=document.createElement("td");w.style.width=T[7];y.appendChild(w);f.appendChild(y)}}if(G.length>1){St["b"].$(f).sortable({axis:"y",containment:f,cursor:"crosshair",distance:3,stop:U.sortEmptySpace,start:U.startEmptySpaceSorting})}i.appendChild(n);t.appendChild(i);return i};U.getActiveTab=function(){return St["b"].$(f).tabs("option","selected")};U.setActiveTab=function(e){return St["b"].$(f).tabs("option","selected",e)};U.updateActiveKeyfigures=function(e){var t=document.getElementById("selectedKeyfigure");var i="";if(t!==null){if(t.selectedIndex>=0&&S[t.selectedIndex]){i=S[t.selectedIndex].id}St["b"].$(t).empty();var n=false;S=e;for(var a=0;a<S.length;a++){var r=document.createElement("option");if(S[a].id===i){r.setAttribute("selected","selected");n=true}St["b"].$(r).html(S[a].name);t.appendChild(r)}if(n===false&&t.length>0){t.options[0].setAttribute("selected","selected")}}};U.changeSelection=function(e){applyEmptySpace(false);if(M==null||ie===null){console.warn("saveDimensionSettings");return}var t=document.getElementById("displayType");var i=R[t.selectedIndex];ie.displayType=i;var n=null;var a=["left","center","right"];for(var r=0;r<a.length;r++){var n=document.getElementById("hicoCellCategoryAlignment."+a[r]);if(n&&n.src.indexOf("grey")===-1){n=n.getAttribute("name");break}}if(n){if(ie.displayType!==X.FREE_AXIS_POS&&i===X.FREE_AXIS_POS){n=Y.RIGHT}if(ie.displayType===X.FREE_AXIS_POS&&i!==X.FREE_AXIS_POS){if(ie.alignment===Y.RIGHT&&n===Y.RIGHT){n=Y.LEFT}}ie.alignment=n}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=P[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=S[u.selectedIndex].id;ie.selectedKeyfigure=p}var g=document.getElementById("separatorDataType");if(g!==null){ie.separatorDataType=g.checked}var m=document.getElementById("separatorCategory");if(m!==null){ie.separatorCategory=m.checked}var h=document.getElementById("separatorTimeType");if(h!==null){ie.separatorTimeType=h.checked}var f=document.getElementById("showCategoryHeader");if(f!==null){ie.hideCategoryHeader=!f.checked}if(ae){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 E=parseFloat(T.value.replace(",","."));re[r].dimAutoLength=isNaN(E);if(!re[r].dimAutoLength){re[r].dimension_mmpt=E/10}}}if(!ae){savingHelper1(L);savingHelper1(K);savingHelper2(Z);savingHelper1(Q);savingHelper2(q)}if(ae===true){M.hideDimensionColumns=[];for(var r=0;r<O.rows.length;r++){var x=O.rows[r];var C=document.getElementById("dimensionHide##"+x.id);if(C!==null){if(C.checked===true){M.hideDimensionColumns.push(x.id)}}}}ie.emptySpaceRepository=[];for(var y=0;y<G.length;y++){ie.emptySpaceRepository.push(G[y])}ie.dimensionFormulaRepository=re;G=[];re=[];if(!e){F.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]}}};U.freeResources=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(s!==null){s.close()}}};function buildTextInput(e,t,i,n,a,r){var o=document.createElement("td");var l=St["b"].Utils.DOM.createTextInputNoMax(o,e,t,i,$);if(n){St["b"].$(l).keyup(n)}if(a){var s=t;var d=St["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;St["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,n,a){var r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,{textAlign:"center"});var o=null;o=St["b"].Utils.DOM.createSelectBox(r,e,t,t,i,$);if(n){St["b"].$(o).change(n)}if(a){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 n=document.getElementById("emptyMMPT."+t);G[t].space_mmpt=parseFloat(n.value.replace(",","."))/10;var a=document.getElementById("emptyPosition."+t);var r=j.indexOf(a.value);G[t].position=z[r];G[t].axisSplit=document.getElementById("axisSplit."+t).checked}return true}U.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 n=re[i];if(n.id===e){t=i;break}}return t}U.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 n=t+1;var a=new fe["a"].EmptySpaceModel;a.appliesFormula="true";a.id=n;G.push(a)};U.hide=function(){A.visibility("hidden")};U.show=function(){A.visibility("visible")};U.removeEmptySpace=function(e){applyEmptySpace(false);var t=parseInt(e.target.id.split(".").pop());if(t>=0&&t<G.length){G.splice(t,1)}};U.startEmptySpaceSorting=function(e,t){var i=t.item.get()[0].id;var n=i.split(".");var a="emptyDragger."+n[1];document.getElementById(a).style.background="rgb(37,157,187)"};U.sortEmptySpace=function(e,t){var i=e.target.childNodes;var n=new Array(G.length);var a=false;var r=0;for(var o=0;o<i.length;o++){var l=parseInt(i[o].id.split(".").pop());if(!isNaN(l)){n[o-r]=G[l]}else{r=1}if(o-r!==l){a=true}}if(a){applyEmptySpace(false);G=n;U.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 n={formula:V.encode(i.value),compiledFormula:null};if(V.checkFormulaCFM(n)===false){i.style.color="#FF0000";e=true}}return e}};St["b"].UI=St["b"].UI||{};St["b"].UI.DocumentSettings=function(){var E=St["b"].Utils.Translations,y=new St["b"].Utils.Calculator(null);St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});var t=this,M=St["b"].DataObjects.DocumentDO.getDocSettings(true),S=St["b"].Utils.Calculator.Converter;var o=[{id:"",translation:"-"},{id:"",translation:"()"}],a=[{id:"",translation:"de_DE"},{id:"",translation:"en_US"}],O=["END","BY_VALUETYPE"],l=[{id:"",translation:E.getTranslation("END")},{id:"",translation:E.getTranslation("BY_VALUETYPE")}],T=[E.getTranslation("AUTO"),"1","2","3"],L=[{id:"",translation:"DD.MM.YYYY"},{id:"",translation:"YYYY.MM.DD"},{id:"",translation:"MM/DD/YYYY"}],A=St["b"].Utils.Constants.ParameterSets.documentModesValue,r=[{id:"",translation:E.getTranslation("DESIGN")},{id:"",translation:E.getTranslation("PRESENTATION")}];var e=St["b"].DataObjects.ContextRepo.getAllContexts(),x={};for(var i=0;i<e.length;i++){for(var n=0;n<e[i].columns.length;n++){x[e[i].columns[n].scalingGroup]=true}}var C=2;var s=[{id:"XXXgeneralOverall",text:E.getTranslation("OVERALL"),tooltip:E.getTranslation("HELP_DOCSETTINGS_OVERALL"),buildUp:createOverall},{id:"XXXgeneralDisplay",text:E.getTranslation("NUMBERS"),tooltip:E.getTranslation("HELP_DOCSETTINGS_NUMBER"),buildUp:createNumber},{id:"XXXgeneralScalingGroups",text:E.getTranslation("SCALING_GROUPS"),tooltip:E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS"),buildUp:createScalingGroups},{id:"XXXgeneralScalingHelper",text:E.getTranslation("SCALING_HELPER"),tooltip:E.getTranslation("HELP_DOCSETTINGS_SCALINGHELPER"),buildUp:createScaling}];var d="numberFormat";var c="440";var u="400",_="260px",p=17,g=50;var m=[E.getTranslation(M.userSpecificScaling.name),"",E.getTranslation("AUTO_SCALING"),"",""],I=["","SCALING_GROUPS","SCALING__PER_CM","",""],D=["",E.getTranslation("SCALING_GROUPS"),E.getTranslation("SCALING__PER_CM"),"",""],R=["","HELP_DOCSETTINGS_SCALINGGROUPS_SCALINGGROUP","HELP_DOCSETTINGS_SCALINGGROUPS_SCALING","",""],N=["","","AUTO","","MANUAL"],P=["","",E.getTranslation("AUTO"),"",E.getTranslation("MANUAL")],w=["","","HELP_DOCSETTINGS_SCALINGGROUPS_AUTO","","HELP_DOCSETTINGS_SCALINGGROUPS_MANUAL"];var h,f,U;var v=[],b=[],F=[],B=[];this.open=function(){var e=E.getTranslation("DOCUMENT");var t=buildButtonBar();var i=new St["b"].UI.HiCoDialogDefinition(d,e,t);i.setWidth(c);i.setHeight(u);i.setPosition({});i.setResizable(true);i.setTooltip(E.getTranslation("HELP_DOCSETTINGS"));U=i.getFontSize();h=new St["b"].UI.HiCoDialog(i);f=h.getDialogDiv();var n={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var a=document.createElement("div");a.setAttribute("id","hiddenDivDocuments");St["b"].Utils.DOM.setStyle(a,n);a.style.fontSize=i.getFontSize();f.appendChild(a);calculateStdLength();h.buildTabs("tabDiv",s,null,_,{top:"0px",left:"0px"},null,true);function adjustSize(){var e=St["b"].$(f).parent().height()-70;St["b"].$(f).height(e);var t=St["b"].$("#tabDiv > .ui-tabs-nav").height();St["b"].$(".ui-tabs-panel",St["b"].$(f).parent()).height(e-t-p);St["b"].$(".ui-tabs-panel","#XXXgeneralOverall").height(e-t-g);St["b"].$("#GENERALDisplayDocument",St["b"].$(f)).height(e-t-p);St["b"].$("#GENERALLanguageDocument",St["b"].$(f)).height(e-t-p);St["b"].$("#GENERALScalingGroupDocument",St["b"].$(f)).height(e-t-p);St["b"].$("#GENERALScalingDocument",St["b"].$(f)).height(e-t-p)}adjustSize();h.setEvent("dialogresize",adjustSize);h.setTabsCss("#generalTab",["generalTab"]);h.setCSS("overflow","hidden");h.setCSS();var r=parseInt(h.highest());var o=parseInt(h.getDialog().offsetParent().css("z-index"));if(r>o){r+=1;h.getDialog().offsetParent().css("z-index",r)}h.decorateTabs(0,s,null)};function buildButtonBar(){var e=[];e.push({text:E.getTranslation("SAVE_CLOSE"),id:"okayButton",click:t.okay});e.push({text:E.getTranslation("CANCEL"),id:"closeButton",click:t.close});e.push({text:E.getTranslation("SAVE"),id:"applyButton",click:t.apply});return e}function createOverall(){var e=document.createElement("table"),t=document.createElement("div");t.setAttribute("id","GENERALLanguageDocument");St["b"].Utils.DOM.setStyle(t,{width:"100%",height:_,overflow:"auto"});var i=M.userSpecific.value,n=E.getTranslation(M.userSpecific.name);h.createTableRow(e,"CHECK_ALLOW_USER_LANG",n,i,"checkBox",E.getTranslation("HELP_DOCSETTINGS_OVERALL_USERSPECIFIC"));i=M.documentMode.value;n=E.getTranslation(M.documentMode.name);h.createTableRow(e,"docPropertyType_documentMode",n,{valueArray:r,selectedValue:i},"dropdown",E.getTranslation("HELP_DOCSETTINGS_OVERALL_MODE"));i=M.showUnlicensed.value;n=E.getTranslation(M.showUnlicensed.name);h.createTableRow(e,"CHECK_SHOW_UNLICENSED",n,i,"checkBox",E.getTranslation("HELP_DOCSETTINGS_OVERALL_UNLICENSED"));i=M.docLanguage.value;n=E.getTranslation(M.docLanguage.name);h.createTableRow(e,"docPropertyType_15",n,{valueArray:a,selectedValue:i,clazz:"_languageAbbr"},"dropdown",E.getTranslation("HELP_DOCSETTINGS_OVERALL_LANGUAGE"));i=M.dateFormat.value;n=E.getTranslation(M.dateFormat.name);h.createTableRow(e,"DD_DATEFORMAT",n,{valueArray:L,selectedValue:i,clazz:"_dateFormats"},"dropdown",E.getTranslation("HELP_DOCSETTINGS_OVERALL_DATEFORMAT"));i=M.paintTimeout.value;n=E.getTranslation(M.paintTimeout.name);h.createTableRow(e,"DD_PAINT_TIMEOUT",n,{text:i,labelText:""},"textInput",E.getTranslation("HELP_DOCSETTINGS_OVERALL_PAINT_TIMEOUT"));St["b"].Connector.ConnectorHelper.DocumentSettings_createOverall(e,U);i=M.pasteWithoutFormat.value;n=E.getTranslation(M.pasteWithoutFormat.name);h.createTableRow(e,"CHECK_PASTE_WITHOUT_FORMAT",n,i,"checkBox",E.getTranslation("HELP_DOCSETTINGS_OVERALL_PASTE_WITHOUT_FORMAT"));t.appendChild(e);return t}function createNumber(){var e=document.createElement("div");e.setAttribute("id","GENERALDisplayDocument");St["b"].Utils.DOM.setStyle(e,{width:"100%",height:_,overflow:"auto"});var t=document.createElement("table");h.createSection(t,E.getTranslation("DECIMAL_SEPARATORS"),E.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP"));var i=M.decimalSep.value;var n=E.getTranslation(M.decimalSep.name);h.createTableRow(t,"docPropertyType_0",n,{text:i,labelText:""},"textInput",E.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP_DECIMAL"));i=M.thousandSep.value;n=E.getTranslation(M.thousandSep.name);h.createTableRow(t,"docPropertyType_1",n,{text:i,labelText:""},"textInput",E.getTranslation("HELP_DOCSETTINGS_NUMBER_DECSEP_THOUSAND"));h.createSection(t,E.getTranslation("UNITS"),E.getTranslation("HELP_DOCSETTINGS_NUMBER_UNITS"));i=M.unitPosition.value;n=E.getTranslation(M.unitPosition.name);var a=0;for(var r=0;r<O.length;r++){if(O[r]===i){a=r;break}}h.createTableRow(t,"docPropertyType_2",n,{valueArray:l,selectedValue:l[a].translation,clazz:"_unitPosition"},"dropdown",E.getTranslation("HELP_DOCSETTINGS_NUMBER_UNITS_POSITION"));h.createSection(t,E.getTranslation("NEGATIVES"),E.getTranslation("HELP_DOCSETTINGS_NUMBER_NEGATIVE"));i=M.negativeStyle.value;n=E.getTranslation(M.negativeStyle.name);h.createTableRow(t,"docPropertyType_5",n,{valueArray:o,selectedValue:i,clazz:"_negativeStyle"},"dropdown",E.getTranslation("HELP_DOCSETTINGS_NUMBER_NEGATIVE_STYLE"));e.appendChild(t);return e}function scalingClickDeleteHandler(e){for(var t in M.scalingGroups.value){if(t===e&&Object.keys(x).indexOf(t)===-1){delete M.scalingGroups.value[t];var i=document.getElementById("GENERALScalingGroupDocumentPart2");St["b"].$(i).empty();i.appendChild(createScalingGroupTablePart2());return}}}function documentHandler(e){var t=e.target.id;var i=M.scalingGroups.value;var n=t.split("##");var a=n[0];var r=n[1];function getFactor(e){return e==null?"":S.zoomFactor2cm(e).toFixed(3).toString(10)}switch(a){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){St["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){St["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");St["b"].$(e).html(m[0]);var t=e.clientWidth+1+C;v[0]=t;var i=document.createElement("td");var n=St["b"].Utils.DOM.createCheckBoxWithLabel(i,"","","","").checkBox;St["b"].$(e).html(n);var t=e.clientWidth+1+C;v[1]=t;St["b"].$(e).html(m[2]);var t=e.clientWidth+1+C;v[2]=t;var i=document.createElement("td");var n=St["b"].Utils.DOM.createCheckBoxWithLabel(i,"","","","").checkBox;St["b"].$(e).html(n);var t=e.clientWidth+1+C;v[3]=t;for(var a=0;a<D.length;a++){St["b"].$(e).html(D[a]);var t=e.clientWidth+1+C;b[a]=t}for(var a=0;a<P.length;a++){St["b"].$(e).html(P[a]);var t=e.clientWidth+1+C;F[a]=t}}function calculateColumnsLength(){var e=document.getElementById("hiddenDivDocuments");for(var t in M.scalingGroups.value){var i=M.scalingGroups.value[t];var n=document.createElement("td");var a=St["b"].Utils.DOM.createIconButton(n,"docPropertyType_columnsMinus##"+t,"","",U,Se["a"].imgPath+"delete_small.png",E.getTranslation("DELETE"));St["b"].$(e).html(a);var r=e.clientWidth+1+C;if(B[0]){B[0]=Math.max(r,b[0],F[0],B[0])}else{B[0]=Math.max(r,b[0],F[0])}St["b"].$(e).html(y.decode(t));var r=e.clientWidth+1+C;if(B[1]){B[1]=Math.max(r,b[1],F[1],B[1])}else{B[1]=Math.max(r,b[1],F[1])}var o=i.scalingFactor==null?"":i.scalingFactor.toFixed(3);St["b"].$(e).html(o);var r=e.clientWidth+1+C;if(r>83){r=83}if(B[2]){B[2]=Math.max(r,b[2],F[2],B[2])}else{B[2]=Math.max(r,b[2],F[2])}St["b"].$(e).html("");var r=e.clientWidth+1+C;if(B[3]){B[3]=Math.max(r,b[3],F[3],B[3])}else{B[3]=Math.max(r,b[3],F[3])}var l=o;if(i.manualFactor!=null){l=i.manualFactor.toFixed(3)}St["b"].$(e).html(l);var r=e.clientWidth+1+C;if(r>83){r=83}if(B[4]){B[4]=Math.max(r,b[4],F[4],B[4])}else{B[4]=Math.max(r,b[4],F[4])}}var s=B[0]+B[1]+B[2];var d=v[0]+v[1]+v[2];var c=d-s;B[1]+=c}function createScalingGroupTablePart1(){var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocumentPart1");St["b"].Utils.DOM.setStyle(e,{width:"100%",height:"auto"});var t=M.scalingGroups.value;var i=true;for(var n in t){if(!t[n].auto){i=false;break}}var a=document.createElement("table");St["b"].Utils.DOM.setStyle(a,{padding:"0",borderSpacing:C+"px"});var r=document.createElement("tr");var o=M.userSpecificScaling;var l=document.createElement("td");l.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_USERSPECIFIC"));St["b"].$(l).html(E.getTranslation(o.name));St["b"].Utils.DOM.setStyle(l,{width:v[0]+"px",padding:"0"});r.appendChild(l);var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:v[1]+"px",padding:0});var s=St["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_userSpecificScaling","","","").checkBox;l.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_USERSPECIFIC"));St["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",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_ALLAUTO"));St["b"].$(l).html(E.getTranslation("AUTO_SCALING"));St["b"].Utils.DOM.setStyle(l,{width:v[2]+"px",padding:0});r.appendChild(l);var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:B[3]+"px",textAlign:"center",padding:0});var s=St["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_AutoScaling","","","").checkBox;l.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_ALLAUTO"));St["b"].Utils.DOM.setStyle(s,{padding:0,margin:0});St["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<B.length;u++){c+=B[u]}l.style.width=c-d+"px";r.appendChild(l);a.appendChild(r);e.appendChild(a);return e}function createScalingGroupTablePart2(){var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocumentPart2");St["b"].Utils.DOM.setStyle(e,{width:"100%",height:"auto"});var t=M.scalingGroups.value;var i=document.createElement("table");St["b"].Utils.DOM.setStyle(i,{padding:"0",borderSpacing:C+"px"});var n={whiteSpace:"nowrap",textAlign:"left",overflow:"hidden",fontWeight:"bold",padding:"0"};var a={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=B[o];var d=1;for(var c=o+1;c<I.length;c++){if(I[c]==""){d++;s+=B[c]}else{break}}if(R[o]!==""){l.setAttribute("title",E.getTranslation(R[o]))}n.width=s+"px";n.minWidth=s+"px";St["b"].Utils.DOM.setStyle(l,n);if(d>1){l.setAttribute("colspan",d)}St["b"].$(l).html(D[o]);if(I[o]==="SCALING"){St["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<N.length;o++){var l=document.createElement("td");var s=B[o];a.width=s+"px";a.minWidth=s+"px";St["b"].Utils.DOM.setStyle(l,a);St["b"].$(l).html(P[o]);if(w[o]!==""){l.setAttribute("title",E.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=S.zoomFactor2cm(p.manualFactor).toFixed(3)}var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:B[0]+"px",padding:"0"});var m=St["b"].Utils.DOM.createIconButton(l,"docPropertyType_columnsMinus##"+u,"","",U,Se["a"].imgPath+"delete_small.png",E.getTranslation("DELETE"));m.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGHELPER_DELETE"));St["b"].Utils.DOM.setStyle(m,{padding:"0",margin:"0"});St["b"].$(m).bind("click",function(e){documentHandler(e)});r.appendChild(l);var l=document.createElement("td");St["b"].$(l).html(y.decode(u));l.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_SCALINGGROUP"));St["b"].Utils.DOM.setStyle(l,{width:B[1]+"px",padding:"0"});r.appendChild(l);var l=document.createElement("td");var h=S.zoomFactor2cm(p.scalingFactor==null?"":p.scalingFactor).toFixed(3);var f=St["b"].Utils.DOM.createSpan(l,h,"docPropertyType_ScalingFactor##"+u);f.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_FACTOR"));var v={width:B[2]+"px",maxWidth:"83px",padding:"0",display:"block",overflow:"hidden",textAlign:"right"};St["b"].Utils.DOM.setStyle(f,v);r.appendChild(l);var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:B[3]+"px",padding:"0",textAlign:"center"});var b=St["b"].Utils.DOM.createCheckBoxWithLabel(l,"docPropertyType_AutoScalingPerSg##"+u,"","","").checkBox;b.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_AUTO"));St["b"].Utils.DOM.setStyle(b,{padding:"0",marginLeft:"0",marginRight:"0"});if(t[u].auto||g===""){b.checked=true}St["b"].$(b).bind("click",function(e){documentHandler(e)});r.appendChild(l);l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:B[4]+"px",padding:"0"});var T=St["b"].Utils.DOM.createTextInputNoMax(l,"docPropertyType_ManualFactor##"+u,g,12,U);T.setAttribute("title",E.getTranslation("HELP_DOCSETTINGS_SCALINGGROUPS_MANUAL"));St["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";f.style.visibility="visible"}else{T.style.visibility="visible";f.style.visibility="hidden"}i.appendChild(r)}e.appendChild(i);return e}function createScalingGroups(){calculateColumnsLength();var e=document.createElement("div");e.setAttribute("id","GENERALScalingGroupDocument");St["b"].Utils.DOM.setStyle(e,{height:_,overflow:"auto"});var t=document.createElement("table");var i=document.createElement("tr");var n=document.createElement("td");n.appendChild(createScalingGroupTablePart1());n.setAttribute("style","border-bottom: 1px solid black;");i.appendChild(n);t.appendChild(i);var i=document.createElement("tr");var n=document.createElement("td");n.appendChild(createScalingGroupTablePart2());i.appendChild(n);t.appendChild(i);e.appendChild(t);return e}function createScaling(t,e){var i;if(e){i=document.getElementById("GENERALScalingDocument");St["b"].$(i).empty()}else{i=document.createElement("div");i.setAttribute("id","GENERALScalingDocument");St["b"].Utils.DOM.setStyle(i,{width:"100%",height:_,overflow:"auto"})}var n=document.createElement("table");var a=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");St["b"].$(o).html(E.getTranslation(l[d]));o.setAttribute("title",E.getTranslation(s[d]));St["b"].Utils.DOM.setStyle(o,{fontWeight:"bold",margin:"0px",padding:"5px 0px 0px"});a.appendChild(o);o=document.createElement("td");var c=document.createElement("span");St["b"].Utils.DOM.setStyle(c,{margin:"0px"});var u=document.createElement("hr");St["b"].Utils.DOM.setStyle(u,{margin:"0px 0px 1px 0px",color:"#eeeeee",backgroundColor:"#eeeeee"});c.appendChild(u);o.appendChild(c);r.appendChild(o)}n.appendChild(a);n.appendChild(r);var p=M.scalingSettings.value;for(var g in p){var m=p[g];a=document.createElement("tr");o=document.createElement("td");St["b"].Utils.DOM.setStyle(o,{padding:"5px 10px 5px 0px"});var h=St["b"].Utils.DOM.createSpan(o,g===""?'""':y.decode(g),"");h.setAttribute("title",E.getTranslation(s[0]));h.style.fontSize=U;o.appendChild(h);a.appendChild(o);o=document.createElement("td");var f=y.decode(m.value);var v=St["b"].Utils.DOM.createTextInput(o,"docPropertyType_value_"+g,f,8,U);v.setAttribute("title",E.getTranslation(s[1]));v.setAttribute("maxlength","100");a.appendChild(o);o=document.createElement("td");var b=St["b"].Utils.DOM.createSelectBox(o,"docPropertyType_number_"+g,T,T,m.number,U);b.setAttribute("title",E.getTranslation(s[2]));a.appendChild(o);o=document.createElement("td");if(x[g]==undefined){var c=St["b"].Utils.DOM.createSpan(o,"-","docPropertyType_delete_"+g);c.setAttribute("title",E.getTranslation(s[3]));St["b"].$(c).hover(function(){St["b"].$(this).css("text-decoration","underline")},function(){St["b"].$(this).css("text-decoration","none")});St["b"].$(c).click(function(){var e=this.id.replace("docPropertyType_delete_","");delete p[e];createScaling(t,true)})}a.appendChild(o);n.appendChild(a)}i.appendChild(n);return i}function getLeastDecimalPosition(e){var t=0;var i,n;var a=1;do{i=e*a;n=Math.floor(i);if(n<i){t++}else{break}a*=10}while(true);return t}this.okay=function(){t.changeSelection();h.close()};this.apply=function(){t.changeSelection()};this.close=function(){h.close()};this.changeSelection=function(){var e=document.getElementById("docPropertyType_0");var t=e.value;e=document.getElementById("docPropertyType_1");var i=e.value;var n=document.getElementById("docPropertyType_2"),a=n.selectedIndex,r=O[a];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=A[e.selectedIndex];e=document.getElementById("docPropertyType_userSpecificScaling");var c=e.checked.toString();for(var u in M.scalingGroups.value){var p=document.getElementById("docPropertyType_AutoScalingPerSg##"+u);if(p!==null){M.scalingGroups.value[u]={auto:p.checked,scalingFactor:null,manualFactor:null};var g=M.scalingGroups.value[u];if(p.checked){}else{var m=document.getElementById("docPropertyType_ManualFactor##"+u).value;var h=parseFloat(m);if(!isNaN(h)){g.manualFactor=S.zoomFactor2cm(h);g.leastDecimalPosition=getLeastDecimalPosition(h)}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 f=e.checked.toString();e=document.getElementById("DD_DATEFORMAT");var v=L[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();M.decimalSep.value=t;M.thousandSep.value=i;M.unitPosition.value=r;M.negativeStyle.value=o;M.docLanguage.value=l;M.userSpecific.value=s;M.showUnlicensed.value=f;M.documentMode.value=d;M.userSpecificScaling.value=c;M.dateFormat.value=v;M.paintTimeout.value=b;M.pasteWithoutFormat.value=T;var E=M.scalingSettings.value;for(var x in E){var C=document.getElementById("docPropertyType_value_"+x);if(C){E[x].value=y.encode(C.value)}C=document.getElementById("docPropertyType_number_"+x);if(C){E[x].number=C.value}}St["b"].Connector.ConnectorHelper.DocumentSettings_changeSelection();St["b"].DataObjects.DocumentDO.setDocSettings(M);St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateDocument",{saveQVF:true});St["b"].DataObjects.RuntimeDO.updateRuntime(function(){var e=St["b"].DataObjects.DocumentDO.getAllExtensions();St["b"].DataObjects.DocumentDO.triggerDelayedRepaint();for(var t=0;t<e.length;t++){var i=e[t];i.getController().dispatch("createMenus",{extension:i})}St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});for(var n in M.scalingGroups.value){var a=M.scalingGroups.value[n];if(a.auto&&a.scalingFactor!=null){var r=S.zoomFactor2cm(parseFloat(a.scalingFactor)).toFixed(3);St["b"].$(document.getElementById("docPropertyType_ScalingFactor##"+n)).html(r)}}})}};var Lt=r(684);St["b"].UI=St["b"].UI||{};St["b"].UI.FormulaEditor=function(a,b,e,t){var T=this;var y=St["b"].DataObjects.RuntimeDO;var E=St["b"].Utils.Constants.TypeValues.formulaEdit;var x=13;var C=null;var M=null;var S="";var O="";var L=null;var A=null;var _="10px";var I=new St["b"].Utils.Calculator(a);var D=["DIMENSION"];for(var i=0;i<a.rows.length;i++){var n=a.rows[i];if(e&&n.dimensionType==="dynamic"){for(var i=0;i<n.dynamicNames.length;i++){var r=n.dynamicNames[i];if(e.id!==r.id){D.push(r.displayId+"; "+I.invertNames(I.decode(r.name.replace(/\n/g," "))))}}}else{if(n.dimensionType==="drill"||n.dimensionType==="cyclic"){D.push(n.displayId);for(var o=0;o<n.groupMembers.length;o++){D.push(n.groupMembers[o].displayId+"; "+I.invertNames(I.decode(n.groupMembers[o].name.replace(/\n/g," "))))}}else{D.push(n.displayId+"; "+I.invertNames(I.decode(n.name.replace(/\n/g," "))))}}}var R=y.getTranslation("MEASURE");var N="-";var l=St["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(a);var P=[];if(b===E.CONDITION){if(t){P.push(y.getTranslation("THIS_COMP"))}for(var i=0;i<l.length;i++){P.push(l[i].displayId+"; "+I.invertNames(I.decode(l[i].name.replace(/\n/g," "))))}}if(b===E.APPLIES_TO){P.push("-");P.push("POSITION");P.push("FST");P.push("RST");P.push("TTL");R=y.getTranslation("TYPE")}var w=["+","-","*","/","**","(",")","%","%O"];var U=["<","<=","==",">=",">","AND","OR","$(OR:)","$(AND:)"];var F=["-","SUM","AVG","MIN","MAX"];var B=St["b"].DataObjects.DocumentDO.getBIVariables().map(function(e){return e.name.replace(/\n/g," ")});B.sort();T.open=function(e,t,i,n,a,r){a=a||null;var o=I.decode(e);e=I.invertNames(o);S=e;O=t;L=i;A=n;var r=r||y.getTranslation("EDIT_FORMULA");L.splice(0,0,"-");L.push("true");L.push("false");var l=[{text:y.getTranslation("OKAY"),title:y.getTranslation("HELP_FORMULA_OKAY"),click:T.okaySelection},{text:y.getTranslation("CANCEL"),title:y.getTranslation("HELP_FORMULA_OKAY"),click:T.cancelSelection}];var s=new St["b"].UI.HiCoDialogDefinition("formulaEditor",r,l);s.setWidth("615");if(a!==null){s.setPosition([a.x,a.y])}s.setResizable(false);s.setTooltip(y.getTranslation("HELP_FORMULA"));x=s.getFontSize();M=new St["b"].UI.HiCoDialog(s);C=M.getDialogDiv();M.setCSS();if(Lt["a"].detectIE()){St["b"].$(C).css("height","200px")}var d=document.createElement("div");St["b"].Utils.DOM.setStyle(d,{marginTop:"15px",height:"auto"});if(b!==E.QV_CONDITION){var c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",marginRight:_,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",y.getTranslation("HELP_FORMULA_DIMENSION"));var u=St["b"].Utils.DOM.createTextInput(c,"dimensionText",y.getTranslation("DIMENSION"),14,x,undefined,500);u.setAttribute("readonly","readonly");St["b"].$(u).css("border","0px solid black");var p=St["b"].Utils.DOM.createIconButton(c,"dimensionTextButton","","",12,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#dimensionList").is(":visible")){St["b"].$("#dimensionList").hide()}else{St["b"].$("#dimensionList").show()}});var g=T.createListBox("dimensionList","dimensionText","120px","120px",D,"formula_insert_dimension");St["b"].$(g).hover(function(){},function(){if(St["b"].$("#dimensionList").is(":visible")){St["b"].$("#dimensionList").hide()}});c.appendChild(g);d.appendChild(c)}if(b===E.CONDITION){var c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"55px",height:"18px",marginRight:_,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",y.getTranslation("HELP_FORMULA_MEASURE_AGGREGATION"));var u=St["b"].Utils.DOM.createTextInput(c,"aggregationText",N,4,x,undefined);u.setAttribute("readonly","readonly");St["b"].$(u).css("border","0px solid black");var p=St["b"].Utils.DOM.createIconButton(c,"aggregationTextButton","","",12,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#aggregationList").is(":visible")){St["b"].$("#aggregationList").hide()}else{St["b"].$("#aggregationList").show()}});var g=T.createListBox("aggregationList","aggregationText","55px","90px",F,"formula_change_aggregation");St["b"].$(g).hover(function(){},function(){if(St["b"].$("#aggregationList").is(":visible")){St["b"].$("#aggregationList").hide()}});c.appendChild(g);d.appendChild(c)}if(b!==E.SORT_CONDITION&&b!==E.QV_CONDITION){var c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",marginRight:_,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",b===E.CONDITION?y.getTranslation("HELP_FORMULA_MEASURE"):y.getTranslation("HELP_FORMULA_DIMENSION_AGGREGATION"));var u=St["b"].Utils.DOM.createTextInput(c,"keyfigureText",R,14,x,undefined,500);u.setAttribute("readonly","readonly");St["b"].$(u).css("border","0px solid black");p=St["b"].Utils.DOM.createIconButton(c,"keyfigureTextButton","","",12,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#keyfigureList").is(":visible")){St["b"].$("#keyfigureList").hide()}else{St["b"].$("#keyfigureList").show()}});var m=b===E.APPLIES_TO?"formula_change_keyfigure":"formula_insert_keyfigure";var g=T.createListBox("keyfigureList","keyfigureText","120px","120px",P,m);St["b"].$(g).hover(function(){},function(){if(St["b"].$("#keyfigureList").is(":visible")){St["b"].$("#keyfigureList").hide()}});c.appendChild(g);if(b===E.CONDITION){d.appendChild(c)}else{d.insertBefore(c,d.childNodes[d.childNodes.length-1])}}var c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"75px",height:"18px",marginRight:_,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",y.getTranslation("HELP_FORMULA_OPERATOR"));var u=St["b"].Utils.DOM.createTextInput(c,"operatorText",y.getTranslation("OPERATOR"),7,x,undefined,500);u.setAttribute("readonly","readonly");St["b"].$(u).css("border","0px solid black");var p=St["b"].Utils.DOM.createIconButton(c,"operatorTextButton","","",12,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#operatorList").is(":visible")){St["b"].$("#operatorList").hide()}else{St["b"].$("#operatorList").show()}});var g=T.createListBox("operatorList","operatorText","75px","120px",w,"formula_insert_operator");St["b"].$(g).hover(function(){},function(){if(St["b"].$("#operatorList").is(":visible")){St["b"].$("#operatorList").hide()}});c.appendChild(g);d.appendChild(c);c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"55px",height:"18px",marginRight:_,border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",y.getTranslation("HELP_FORMULA_BOOLEAN"));u=St["b"].Utils.DOM.createTextInput(c,"boolText",y.getTranslation("BOOL"),4,x);u.setAttribute("readonly","readonly");u.setAttribute("maxlength",500);St["b"].$(u).css("border","0px solid black");p=St["b"].Utils.DOM.createIconButton(c,"boolTextButton","","",12,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#boolList").is(":visible")){St["b"].$("#boolList").hide()}else{St["b"].$("#boolList").show()}});g=T.createListBox("boolList","boolText","55px","120px",U,"formula_insert_bool");St["b"].$(g).hover(function(){},function(){if(St["b"].$("#boolList").is(":visible")){St["b"].$("#boolList").hide()}});c.appendChild(g);d.appendChild(c);c=document.createElement("div");St["b"].Utils.DOM.setStyle(c,{width:"120px",height:"18px",border:"1px solid #808080",cssFloat:"left",position:"relative"});c.setAttribute("title",y.getTranslation("HELP_FORMULA_VARIABLE"));u=St["b"].Utils.DOM.createTextInput(c,"variableText","Variable",12,x,undefined,500);u.setAttribute("readonly","readonly");St["b"].$(u).css("border","0px solid black");p=St["b"].Utils.DOM.createIconButton(c,"variableTextButton","","",5,Se["a"].imgPath+"dropDown.ico");St["b"].$(p).css("background-color","#ffffff");St["b"].$(p).css("border","none");St["b"].$(p).css("padding","0px");St["b"].$(p).css("position","absolute");St["b"].$(p).css("right","0");St["b"].$(p).click(function(e){if(St["b"].$("#variableList").is(":visible")){St["b"].$("#variableList").hide()}else{St["b"].$("#variableList").show()}});var h=T.createListBox("variableList","variableText","120px","120px",B,"formula_insert_variable");St["b"].$(h).hover(function(){},function(){if(St["b"].$("#variableList").is(":visible")){St["b"].$("#variableList").hide()}});c.appendChild(h);d.appendChild(c);C.appendChild(d);var f=document.createElement("span");f.innerHTML='<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">';C.appendChild(f);var v=document.createElement("textarea");v.style.fontSize=x;v.setAttribute("id","selectedFEFormula");St["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",y.getTranslation("HELP_FORMULA_TERM"));St["b"].$(v).keydown(function(e){if(this.value==="edit formula"){this.value=""}});C.appendChild(v)};T.close=function(){M.close()};T.okaySelection=function(){var e=document.getElementById("selectedFEFormula");S=e.value;var t=new St["b"].Utils.Calculator(a);var i=t.encode(S);var n={formula:i,compiledFormula:null};if(t.checkFormulaCFM(n)===false){alert(y.getTranslation("ALERT_CHECK_FORMULA")+t.lastCheckError);return}A.setValuesFromFormulaEditorCFM(n,O);T.close()};T.cancelSelection=function(){T.close()};T.createListBox=function(n,a,e,t,r,o){var i=document.createElement("div");St["b"].$(i).css("position","absolute");St["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:e,height:t});St["b"].$(i).css("border","1px solid #808080");St["b"].$(i).css("background-color","#ffffff");i.setAttribute("id",n);St["b"].$(i).hide();var l=document.createElement("ul");St["b"].$(l).css("list-style-type","none");St["b"].$(l).css("padding","0px");St["b"].$(l).css("margin","0px");for(var s=0;s<r.length;s++){var d=document.createElement("li");St["b"].$(d).html(r[s]);d.setAttribute("arrayIdx",s);St["b"].Utils.DOM.setStyle(d,{width:"100%"});St["b"].$(d).css("clear","left");St["b"].$(d).css("float","left");St["b"].$(d).css("padding","0px");St["b"].$(d).css("margin","0px");St["b"].$(d).click(function(e){var t=parseInt(e.currentTarget.getAttribute("arrayIdx"));var i=r[t];document.getElementById(a).value=i;St["b"].$("#"+n).hide();T.formulaHandlerFE({target:{id:o}})});St["b"].$(d).hover(function(){St["b"].$(this).css("cursor","default");St["b"].$(this).css("background-color","#eeeeee")},function(){St["b"].$(this).css("cursor","auto");St["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 n=document.getElementById("keyfigureText");if(n.value!=="-"){var a=i.childNodes[0];for(var r=0;r<a.children.length;r++){if(a.children[r].textContent.indexOf(";")>-1){var o=a.children[r].textContent.split(";");o=o[0].replace("D","");o=o.split("");o=o[2]+o[3];if(o!=="00"){a.children[r].hidden=true}}}}else{var a=i.childNodes[0];for(var r=0;r<a.children.length;r++){if(a.children[r].textContent.indexOf(";")>-1){a.children[r].hidden=false}}}return}var n=null;n=document.getElementById("selectedFEFormula");var l=0;var s=0;if(Lt["a"].detectIE()!==false){var d=getInputSelection(n);l=d.start;s=d.end}else{l=n.selectionStart;s=n.selectionEnd}var c=n.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===y.getTranslation("EDIT_FORMULA")){u="";p=""}var g="";if(t==="formula_insert_dimension"){var m=document.getElementById("dimensionText").value;if(m==="true"||m==="false"){g=u+m+p}else{var h="";var f=document.getElementById("keyfigureText").value;if(f==="POSITION"||f==="FST"||f==="RST"||f==="TTL"){if(f!=="-"){h=f}var v=m.split("; ");var b=v[1];var T=v[0]}if(h!==""){if(b===undefined){g=u+"$("+T+","+h+")"+p}else{g=u+"$("+T+","+h+"; "+b+")"+p}}else{g=u+"$("+m+")"+p}}}if(t==="formula_insert_keyfigure"){var m=document.getElementById("keyfigureText").value;var v=m.split("; ");var b=v[1];var T=v[0];var E="";var x=document.getElementById("aggregationText").value;if(x!=="-"){E=x}if(m==="true"||m==="false"){g=u+m+p}else{if(E!==""){g=u+"$("+v[0]+","+E+"; "+v[1]+")"+p}else{g=u+"$("+m+")"+p}}}if(t==="formula_insert_operator"){var m=document.getElementById("operatorText").value;g=u+m+p}if(t==="formula_insert_bool"){var m=document.getElementById("boolText").value;g=u+m+p}if(t==="formula_insert_variable"){var m=document.getElementById("variableText").value.split(": ").pop();g=u+"$("+m+")"+p}n.value=g;var C=g.length-p.length;n.selectionStart=C;n.selectionEnd=C;function getInputSelection(e){e.focus();var t=0,i=0,n,a,r,o,l;if(typeof e.selectionStart=="number"&&typeof e.selectionEnd=="number"){t=e.selectionStart;i=e.selectionEnd}else{a=document.selection.createRange();if(a&&a.parentElement()==e){o=e.value.length;n=e.value.replace(/\r\n/g,"\n");r=e.createTextRange();r.moveToBookmark(a.getBookmark());l=e.createTextRange();l.collapse(false);if(r.compareEndPoints("StartToEnd",l)>-1){t=i=o}else{t=-r.moveStart("character",-o);t+=n.slice(0,t).split("\n").length-1;if(r.compareEndPoints("EndToEnd",l)>-1){i=o}else{i=-r.moveEnd("character",-o);i+=n.slice(0,i).split("\n").length-1}}}}return{start:t,end:i}}}};St["b"].UI=St["b"].UI||{};St["b"].UI.HiCoDialog=function(e){var T=this;var t=e.getId();var i=e.getTitle();var C=e.getFontSize();var n=e.getButtonsBar();var r=null;var o=null;var a=e.getParentDomElement();if(a===null){var a=getDomElement()}var l=e.getPosition();if(l===null){l=St["b"].$(a).offset();l=[l.left,l.top]}var E=document.createElement("div");E.setAttribute("id",t);E.setAttribute("title",i);E.style.fontSize=C;a.appendChild(E);var u=null;var s=St["b"].$(E).dialog({buttons:n,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()){St["b"].$(E).parent().children(".ui-dialog-titlebar").attr("title",e.getTooltip())}this.getDialog=function(){return s};this.getDialogDiv=function(){return E};this.getTitle=function(){return E.getAttribute("title")};this.setEscapeBeforeHandler=function(e){r=e};this.setEscapeAfterHandler=function(e){o=e};this.setTitle=function(e){E.setAttribute("title",e)};this.getId=function(){return E.getAttribute("id")};this.setId=function(e){E.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=St["b"].$(s).height();s.dialog("open");St["b"].$(s).height(t)}};this.createTab=function(e,t,i){var n=document.createElement("div");n.setAttribute("id",e);this.buildTabs(t,i,n,"auto",{top:"0px",left:"0px"},{select:function(e,t){T.decorateTabs(t.index,i,null)}},true);return n};this.createSection=function(e,t,i){if(t!==null){var n=document.createElement("tr");var a=document.createElement("td");a.style.fontWeight="bold";St["b"].$(a).css("margin","0px");St["b"].$(a).css("padding","5px 0px 0px 0px");St["b"].$(a).html(t);if(i!==undefined&&i!==null){a.setAttribute("title",i)}n.appendChild(a);e.appendChild(n)}var r=document.createElement("tr");for(var o=0;o<2;o++){var l=document.createElement("span");l.style.margin="0px";St["b"].$(l).html('<hr style="margin:0px 0px 1px 0px; color:#eeeeee; background-color:#eeeeee">');a=document.createElement("td");St["b"].$(a).css("height","1px");a.appendChild(l);St["b"].$(a).css("margin","0px");St["b"].$(a).css("padding","1px 0px 0px 0px");a.setAttribute("valign","top");r.appendChild(a)}e.appendChild(r)};this.buildSingleTab=function(e,t,i,n,a,r){var o=document.getElementById(e);St["b"].$(o).tabs("add","#"+t,i);var l=document.getElementById(t);l.style.fontSize=C;l.style.height=a;l.setAttribute("id",t);l.style.border="none";l.style.marginLeft=r.left;l.style.marginTop=r.top;var s=n;if(s!==null){var d=s(t);l.appendChild(d)}var c=St["b"].$("a[href=#"+t+"]");St["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=St["b"].$(u).parent();p.attr("id","XXX-TAB-"+t)};this.buildTabs=function(e,i,t,n,a,r,o,l){var s=document.createElement("div");s.style.fontSize=C;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 m=p.tooltip?' title="'+p.tooltip.replace(/"/g,"&#34")+'"':"";St["b"].$(g).html('<a id="a-'+p.id+d+'" href="#'+p.id+d+'"'+m+">"+p.text+"</a>");c.appendChild(g)}s.appendChild(c)}for(var h=0;h<i.length;h++){var f=document.createElement("div");f.style.fontSize=C;if(n!=""){f.style.height=n}f.setAttribute("id",i[h].id+d);f.style.border="none";f.style.marginLeft=a.left;f.style.marginTop=a.top;var v=i[h].buildUp;if(v!==null){var b=v(i[h].id+d);f.appendChild(b)}s.appendChild(f)}t=t||E;t.appendChild(s);if(r===null){r={select:function(e,t){T.decorateTabs(t.index,i,l)}}}St["b"].$(s).tabs(r).height("100%");return s};this.dataTypeTabs=function(e,i,t,n,a,r,o,l){if(a===undefined){var a={top:"0px",left:"0px"}}var s=document.createElement("div");s.style.fontSize=C;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=C;if(n!=""){u.style.height=n}u.setAttribute("id",i[c].id+d);u.style.border="none";u.style.marginLeft=a.left;u.style.marginTop=a.top;var p=i[c].buildUp;if(p!==null){var g=p(i[c].id+d);u.appendChild(g)}s.appendChild(g)}t=t||E;t.appendChild(s);if(r===null){r={select:function(e,t){T.decorateTabs(t.index,i,l)}}}St["b"].$(s).tabs(r).height("100%");return s};this.decorateTabs=function(e,t,i){var n="";if(i!==null&&i!==undefined){n="_"+i}for(var a=0;a<t.length;a++){var r=document.getElementById("a-"+t[a].id+n);if(a===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,n,a,r){var o=document.createElement("tr");var l=document.createElement("td");var s=St["b"].Utils.DOM.createSpan(l,i,"");if(r!==undefined&&r!==null){s.setAttribute("title",r)}s.style.fontSize=C;if(n.style){St["b"].Utils.DOM.setStyle(s,n.style)}if(n.textAlign){l.style.textAlign=n.textAlign}St["b"].$(l).css("padding","5px 10px 05px 0px");o.appendChild(l);var d=document.createElement("td");if(n.colSpan){d.colSpan=n.colSpan}if(a==="textInput"){var c=n.text;var u=6;if(n.length!==undefined&&n.length!==null){u=n.length}var p=St["b"].Utils.DOM.createTextInput(d,t,c,u,C);if(n.maxLength!==undefined){p.setAttribute("maxlength",n.maxLength)}else{p.setAttribute("maxlength","100")}if(n.width){p.style.width=n.width+"px"}if(n.style){St["b"].Utils.DOM.setStyle(d,n.style)}if(n.inputStyle){St["b"].Utils.DOM.setStyle(p,n.inputStyle)}p.setAttribute("mmppt",n.labelText);p.style.textAlign="right";var g=document.createElement("label");g.setAttribute("for",t);St["b"].$(g).html(n.labelText);if(n.change!==undefined){St["b"].$(p).on("change",n.change)}if(n.keydown!==undefined){St["b"].$(p).on("keydown",n.keydown)}d.appendChild(g)}else if(a==="rgbDiv"){var p=document.createElement("div");p.setAttribute("id",t);if(St["b"].$.browser.msie&&St["b"].$.browser.version<9){St["b"].Utils.DOM.setStyle(p,{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px",background:n,backgroundColor:n,border:"1px solid #aaaaaa"})}else{St["b"].Utils.DOM.setStyle(p,{height:"12px",width:"12px",minHeight:"12px",minWidth:"12px",backgroundColor:n,border:"1px solid #aaaaaa"})}St["b"].$(p).on("click",function(){St["b"].UI.ColorPicker.createColorPicker(t,false)});d.appendChild(p)}else if(a==="checkBox"){var p=document.createElement("input");p.setAttribute("type","checkbox");St["b"].$(p).css("padding","2px 2px 0px 0px");St["b"].$(p).css("margin","0px 0px 0px 0px");p.setAttribute("id",t);var m=n.value!==undefined?n.value:n;if(m==="true"||m===true){St["b"].$(p).attr("checked",true);p.setAttribute("value","true")}else{St["b"].$(p).attr("checked",false);p.setAttribute("value","false")}d.appendChild(p)}else if(a==="dropdown"){var p=document.createElement("select");p.setAttribute("size","1");p.style.fontSize=C;p.setAttribute("id",t);St["b"].$(p).attr("class",n.clazz);var h=n.valueArray;var f=n.selectedValue;for(var v=0;v<h.length;v++){var b=document.createElement("option");St["b"].$(b).html(h[v].translation);if(h[v].id==="normal"){}else if(h[v].id==="fat"){b.style.fontWeight="bold"}else if(h[v].id==="italic"){b.style.fontStyle="italic"}else if(h[v].id==="fatAndItalic"){b.style.fontStyle="italic";b.style.fontWeight="bold"}if(h[v].translation.toUpperCase()===f.toUpperCase()){b.setAttribute("selected","selected")}p.appendChild(b)}if(n.style){St["b"].Utils.DOM.setStyle(d,n.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,n,a,r,o){if(a===true){var l=document.createElement("div")}else{var l=e}if(n==="textInput"){var s=i.text;var d=i.length;var c=i.fontSize||C;var u=St["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);St["b"].$(p).html(i.labelText)}l.appendChild(p)}else if(n==="rgbDiv"){var u=document.createElement("div");u.setAttribute("id",t);if(St["b"].$.browser.msie&&St["b"].$.browser.version<9){St["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=""}St["b"].Utils.DOM.setStyle(u,g)}St["b"].$(u).on("click",function(){St["b"].UI.ColorPicker.createColorPicker(t,false)});l.appendChild(u)}else if(n==="checkBox"){var u=document.createElement("input");u.setAttribute("type","checkbox");St["b"].$(u).css("padding","2px 2px 0px 0px");St["b"].$(u).css("margin","0px 0px 0px 0px");u.setAttribute("id",t);u.setAttribute("value","north");if(i==="true"||i===true){St["b"].$(u).attr("checked",true)}else{St["b"].$(u).attr("checked",false)}l.appendChild(u)}else if(n==="dropdown"){var u=document.createElement("select");u.setAttribute("size","1");u.style.fontSize=C;u.setAttribute("id",t);St["b"].$(u).attr("class",i.clazz);var m=i.valueArray;var h=i.selectedValue;for(var f=0;f<m.length;f++){var v=document.createElement("option");var b=r?m[f]:m[f].translation;St["b"].$(v).html(b);if(h!==undefined){if(b.toUpperCase()===h.toUpperCase()){v.setAttribute("selected","selected")}}u.appendChild(v)}l.appendChild(u)}else if(n==="icon"){var c=i.fontSize||C;var T=Se["a"].imgPath+i.src;var E=St["b"].Utils.DOM.createIconButton(l,t,"","",c,T,i.tooltip);var g={width:10+"px",height:10+"px",padding:0+"px "+2+"px"};var x="";if(i.selectedValue.indexOf(i.clazz)>-1){x="active"}else{x="opClass"}if(i.style){g=i.style}l.style.textAlign="left";St["b"].Utils.DOM.setStyle(E,g);E.className=i.mainClazz+" "+x;E.setAttribute("subType",i.clazz);if(i.callback){St["b"].$(E).on("click",function(e){i.callback(e)})}}if(a===true){e.appendChild(l)}return l};this.createLabel=function(e,t,i){St["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 n=document.createElement("td");if(e.colSpan!==undefined){n.setAttribute("colspan",e.colSpan)}if(e.visible!==undefined){n.style.display=e.visible?"block":"none"}var a=null;switch(e.type){case"text":a=St["b"].Utils.DOM.createSpan(n,e.value,e.id!==undefined?e.id:null);break;case"selectbox":a=St["b"].Utils.DOM.createSelectBox(n,e.id,e.values,e.translations,e.value,C,e.width);break;case"textinput":a=St["b"].Utils.DOM.createTextInputNoMax(n,e.id,e.value,e.length,C);if(e.maxLength!=undefined){a.setAttribute("maxlength",e.maxLength.toString())}break;case"checkbox":a=St["b"].Utils.DOM.createCheckBox(n,e.id,e.checked,e.value,e.group,e.disabled);break;case"button":a=St["b"].Utils.DOM.createButtonInput(n,e.id,e.name||"",e.value,C,e.style);break;case"iconbutton":n.style.textAlign="center";a=St["b"].Utils.DOM.createIconButton(n,e.id,e.name||"",e.value||"",C,Se["a"].imgPath+e.iconName,e.tooltip||"",e.style);break;case"rgbdiv":a=document.createElement("div");a.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('"+Se["a"].imgPath+"notation.png')"}else{l="none"}}St["b"].Utils.DOM.setStyle(a,{height:r,width:r,minHeight:r,minWidth:r,backgroundColor:e.color,backgroundImage:l,border:o});St["b"].$(a).on("click",function(){St["b"].UI.ColorPicker.createColorPicker(e.id,false,e.callback,undefined,e.withNotationCheckbox)});n.appendChild(a);break;case"div":a=document.createElement("div");a.setAttribute("id",e.id);n.appendChild(a);break;case"formulainput":a=buildFormulaInput(n,e);break;case"iconselector":buildIconSelector(n,e);break;case"separator":a=document.createElement("span");a.style.margin="0px";var s=e.color||"#eeeeee";a.innerHTML='<hr style="margin:0px 0px 1px 0px; color:'+s+"; background-color:"+s+'">';n.appendChild(a);break;case"icon":a=document.createElement("img");a.setAttribute("id",e.id?e.id:"");a.setAttribute("src",Se["a"].imgPath+e.iconName);a.setAttribute("alt",e.value);n.appendChild(a);break;case"append":a=e.element;n.appendChild(a);break;case"radio":a=document.createElement("input");a.setAttribute("type","radio");a.setAttribute("id",e.id);a.setAttribute("name",e.group);if(e.checked){a.setAttribute("checked",true)}n.appendChild(a);break;case"combobox":var d=St["b"].Utils.DOM.createComboBoxNativeFake(n,e.id,e.length,e.width,e.values,e.value,C,null,null,null);a=d.childNodes[0];break;case"empty":default:break}if(a&&e.attributes){for(var c in e.attributes){e.attributes.hasOwnProperty(c)&&a.setAttribute(c,e.attributes[c])}}if(a&&e.style){St["b"].Utils.DOM.setStyle(a,e.style)}if(a&&e.tooltip!=undefined){a.setAttribute("title",e.tooltip)}if(a&&e.active!=undefined&&e.active===false){St["b"].$(a).addClass("cellOpClass")}if(a&&e.disabled){a.setAttribute("disabled","disabled")}if(a&&e.click){St["b"].$(a).click(e.click)}if(a&&e.keydown){St["b"].$(a).keydown(e.keydown)}if(a&&e.change){St["b"].$(a).change(e.change)}if(a&&e.focusIn){St["b"].$(a).focus(e.focusIn)}if(a&&e.focusOut){St["b"].$(a).focusout(e.focusOut)}if(a&&e.hover){St["b"].$(a).hover(e.hover["in"],e.hover["out"])}if(e.tdStyle){St["b"].Utils.DOM.setStyle(n,e.tdStyle)}u.appendChild(n)});e.appendChild(u);return u};function buildFormulaInput(e,n){var a=n.context;var r=n.calculator;var o=n.callerObject;var l=n.callerDivOffset;var s=n.formulaObject;var d=n.formulaEditorType||St["b"].Utils.Constants.TypeValues.formulaEdit.QV_CONDITION;var c=n.formulaTitle;var t=St["b"].Utils.DOM.createTextInputNoMax(e,n.id,r.invertNames(r.decode(s.formula)),20,C);St["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;St["b"].$(this).blur()}}});St["b"].$(t).focus(function(e){this.style.color="#5555FF"});St["b"].$(t).focusout(function(e){this.style.color="#000000";this.value=r.invertNames(r.decode(s.formula))});var i=St["b"].Utils.DOM.createButtonInput(e,n.buttonId,"","fx",C);i.style.marginLeft="3px";St["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}u=new St["b"].UI.FormulaEditor(a,d);var i=r.invertNames(r.decode(s.formula));u.open(i,n.formulaEditorId,[],o,{x:l.left+20,y:l.top+20},c)});return t}function buildIconSelector(e,t){var i=t.values;for(var n=0;n<i.length;n++){var a=i[n];var r=a.inactiveIcon;if(t.value===a.value&&a.activeIcon){r=a.activeIcon}var o=St["b"].Utils.DOM.createIconButton(e,a.id,"","",C,Se["a"].imgPath+r,a.tooltip);St["b"].$(o).click(t.click);if(a.clazz){St["b"].$(o).addClass(a.clazz)}}}this.setCSS=function(){if(arguments.length>0){s.css.apply(s,arguments)}else{St["b"].$("a.ui-dialog-titlebar-close",St["b"].$(E).parent()).remove();St["b"].$(".ui-dialog-buttonpane",St["b"].$(E).parent()).css("text-align","left");St["b"].$(".ui-dialog-buttonset",St["b"].$(E).parent()).css("float","none");St["b"].$(".ui-dialog",St["b"].$(E).parent()).css("background","none");St["b"].$(".ui-widget",St["b"].$(E).parent()).css("background","none");St["b"].$(".ui-tabs",St["b"].$(E).parent()).css("background","none");St["b"].$(".ui-tabs-nav",St["b"].$(E).parent()).css("background","none");St["b"].$("a.ui-tabs-nav",St["b"].$(E).parent()).css("background","none");St["b"].$(".ui-tabs-panel",St["b"].$(E).parent()).css("background","none");St["b"].$(".ui-state-default",St["b"].$(E).parent()).css("background","#ffffff");St["b"].$(".ui-state-active",St["b"].$(E).parent()).css("background","#ffffff");St["b"].$(".ui-tabs-selected",St["b"].$(E).parent()).css("background","#ffffff");St["b"].$(St["b"].$(E).parent()).css("background","#ffffff");St["b"].$(E).css("background","#ffffff");St["b"].$(".ui-dialog",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-widget",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-draggable",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-widget-content",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-widget-header",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-tabs",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-tabs-panel",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-helper-clearfix",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-corner-all",St["b"].$(E).parent()).css("background-color","#ffffff");St["b"].$(".ui-dialog-titlebar",St["b"].$(E).parent()).css("background-color","#f9f9f9");St["b"].$(".ui-widget-header",St["b"].$(E).parent()).css("border","0px solid black");St["b"].$(".ui-tabs-panel",St["b"].$(E).parent()).css("border","1px solid #aaaaaa");St["b"].$(".ui-tabs-nav",St["b"].$(E).parent()).css("border","0px solid black");St["b"].$(".ui-tabs",St["b"].$(E).parent()).css("border","0px solid black");St["b"].$(".ui-dialog-buttonpane",St["b"].$(E).parent()).css("border","0px solid black");St["b"].$(".ui-dialog-titlebar",St["b"].$(E).parent()).css("border","1px solid #aaaaaa");St["b"].$(E,St["b"].$(E).parent()).css("padding","3px 0px 0px 0px");St["b"].$(".ui-dialog",St["b"].$(E).parent()).css("padding","0px");St["b"].$(".ui-dialog-buttonpane",St["b"].$(E).parent()).css("padding"," 0px 3px 0px 3px");St["b"].$(".ui-dialog-titlebar",St["b"].$(E).parent()).css("padding"," 1px 5px 1px 5px");St["b"].$(".ui-tabs",St["b"].$(E).parent()).css("padding","0px");St["b"].$(".ui-tabs-panel",St["b"].$(E).parent()).css("padding","6px");St["b"].$(".ui-tabs-nav",St["b"].$(E).parent()).css("font-size","11px")}};this.manipulateCssForLeftTabs=function(e,t,i){St["b"].$(".ui-tabs-nav",e).css("position","absolute");St["b"].$(".ui-tabs-nav",e).css("left","0px");St["b"].$(".ui-tabs-nav",e).css("top","5px");St["b"].$(".ui-tabs-nav",e).css("bottom","5px");St["b"].$(".ui-tabs-nav",e).css("width",t);St["b"].$(".ui-tabs-nav li",e).css("right","0px");St["b"].$(".ui-tabs-nav li",e).css("width","100%");St["b"].$(".ui-tabs-nav li",e).css("border-right","none");St["b"].$(".ui-tabs-nav li",e).css("border-top","none");St["b"].$(".ui-tabs-nav li",e).css("border-left","none");St["b"].$(".ui-tabs-nav li",e).css("border-bottom","1px solid black");St["b"].$(".ui-tabs-nav li",e).css("border-radius","0px 0px 0px 0px");St["b"].$(".ui-tabs-nav li",e).css("-moz-border-radius","0px 0px 0px 0px");St["b"].$(".ui-tabs-nav li",e).css("-webkit-border-radius","0px 0px 0px 0px");St["b"].$(".ui-tabs-nav li",e).css("overflow","hidden");St["b"].$(".ui-tabs-nav li a",e).css("float","right");St["b"].$(".ui-tabs-nav li a",e).css("width","100%");St["b"].$(".ui-tabs-nav li a",e).css("text-align","right");St["b"].$(".ui-tabs-nav li a",e).css("padding","0px 0px 4px 0px");if(i===false){St["b"].$(".ui-tabs-panel",e).css("border","0px solid black")}};this.manipulateCssResetTabs=function(e){St["b"].$(".ui-tabs-nav",e).css("position","");St["b"].$(".ui-tabs-nav",e).css("left","");St["b"].$(".ui-tabs-nav",e).css("top","");St["b"].$(".ui-tabs-nav",e).css("bottom","");St["b"].$(".ui-tabs-nav",e).css("width","auto");St["b"].$(".ui-tabs-nav li",e).css("right","");St["b"].$(".ui-tabs-nav li",e).css("width","");if(St["b"].$.browser.msie&&St["b"].$.browser.version<"9.0"){St["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{St["b"].$(".ui-tabs-nav li",e).css("border-right","");St["b"].$(".ui-tabs-nav li",e).css("border-top","");St["b"].$(".ui-tabs-nav li",e).css("border-left","");St["b"].$(".ui-tabs-nav li",e).css("border-bottom","")}St["b"].$(".ui-tabs-nav li",e).css("border-radius","");St["b"].$(".ui-tabs-nav li",e).css("-moz-border-radius","");St["b"].$(".ui-tabs-nav li",e).css("-webkit-border-radius","");St["b"].$(".ui-tabs-nav li",e).css("overflow","");St["b"].$(".ui-tabs-nav li a",e).css("float","");St["b"].$(".ui-tabs-nav li a",e).css("width","");St["b"].$(".ui-tabs-nav li a",e).css("text-align","");St["b"].$(".ui-tabs-nav li a",e).css("padding","");St["b"].$(".ui-tabs-panel",St["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(){St["b"].$(this).css("cursor","move")},function(){St["b"].$(this).css("cursor","auto")});s.parent(".ui-dialog-content").hover(function(){St["b"].$(this).css("cursor","move")},function(){St["b"].$(this).css("cursor","auto")});for(var i=0;i<t.length;i++){St["b"].$("#"+t[i]).hover(function(){St["b"].$(this).css("cursor","default")},function(){St["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(St["b"].$(E).dialog("isOpen")===true){St["b"].$(E).dialog("close");St["b"].$(E).dialog("destroy");St["b"].$(E).remove()}t.remove()};this.highest=function(){var e=0;St["b"].$("div.ui-dialog").each(function(){if(St["b"].$(this).css("z-index")>e){e=St["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",St["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 n=r();if(n===true){return}}var a=document.getElementById("formulaEditor");if(a!==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()}}}}}}))};St["b"].UI.HiCoDialogDefinition=function(e,t,i){var n=e;var a=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 m=true;var h=null;var f="12px";this.getId=function(){return n};this.setId=function(e){n=e};this.getTitle=function(){return a};this.setTitle=function(e){a=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 f};this.setFontSize=function(e){f=e};this.getAutoOpen=function(){return m};this.setAutoOpen=function(e){m=e};this.getTooltip=function(){return h};this.setTooltip=function(e){h=e}};St["b"].UI.HiCoConfirm=function(e,t){var i=St["b"].DataObjects.RuntimeDO;var n=[{text:i.getTranslation("OKAY"),id:"HiCoConfirmDialogConfirmOkayButton",click:okay},{text:i.getTranslation("CANCEL"),id:"HiCoConfirmDialogConfirmCancelButton",click:cancel}];var a=new St["b"].UI.HiCoDialogDefinition("HiCoConfirmDialog",i.getTranslation("CONFIRM_SAVE"),n);a.setModal(true);a.setResizable(false);a.setPosition("center");var r=new St["b"].UI.HiCoDialog(a);r.setEscapeBeforeHandler(escapeBeforeHandler);r.setEscapeAfterHandler(escapeAfterHandler);var o=r.getDialogDiv();r.setCSS();var l=document.createElement("div");St["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(){}};St["b"].UI.HiCoNotification=function(e,t){var i=St["b"].DataObjects.RuntimeDO;var n=[{text:i.getTranslation("OKAY"),id:"HiCNotificationDialogConfirmOkayButton",click:okay}];var a=new St["b"].UI.HiCoDialogDefinition("HiCoNotificationDialog",i.getTranslation("NOTIFICATION"),n);a.setModal(true);a.setResizable(false);a.setPosition("center");var r=new St["b"].UI.HiCoDialog(a);var o=r.getDialogDiv();r.setCSS();var l=document.createElement("div");l.style.margin="0px 5px";St["b"].$(l).html(e);o.appendChild(l);r.getDialog().dialog({draggable:false,minHeight:"0px"});r.getDialog().dialog("open");var s=St["b"].$("#HiCNotificationDialogConfirmOkayButton").width();St["b"].$("#HiCNotificationDialogConfirmOkayButton").parent().css({width:s+"px",margin:"0 auto"});function okay(){if(t!==undefined&&t!==null){t(false)}r.close()}};St["b"].UI=St["b"].UI||{};St["b"].UI.HighlightProperties=function(i){var g=this;var m=St["b"].DataObjects.RuntimeDO;var h=JSON.parse(JSON.stringify(i.highlight));var e=i.dialogObj?i.dialogObj:null;var t=i.extension;var f=t.getCanvasDO().getDOMElement();var s=i.containerModel;var v=s.extendedModel;var b=St["b"].DataObjects.ContextRepo.getContextByCid(v.contextId);var T;var E;var x=St["b"].DataObjects.DocumentDO.getDocSettings().docLanguage.value==="en_US"?"475":"540";var C="150";var y;var M;var S=null;var O=e?e.getDialogDiv():null;var L=St["b"].Utils.Constants.TypeValues.highlightType;var A=St["b"].Utils.Constants.TypeValues.indicator;var d=pe["a"];var _=m.getTranslation("PROPERTIES")+" ("+(h.name!=undefined?h.name:h.id)+")";var n=fillHeader(h.type);var u=n.header;var p=n.headerTL;var I=n.headerTooltips;var D=n.width;var R=[L.CATEGORY_LABEL,L.COMPARE,L.LEGEND,L.VALUE];var N=[m.getTranslation("DIMENSION_LABEL"),m.getTranslation("COMPARE"),m.getTranslation("LEGEND"),m.getTranslation("VALUE")];var P=n.compName?n.compName:null;var w=n.compId?n.compId:null;var a=n.category?n.category:null;var r=n.categoryTL?n.categoryTL:null;var o=n.keyfigureTypes?n.keyfigureTypes:null;var l=n.keyfigureTypesTL?n.keyfigureTypesTL:null;var U=[];var F=[];fillExpressions();var B={backgroundColor:"rgb(240, 240, 240)",border:"0px none",textAlign:"right"};g.open=function(e){T=new St["b"].Utils.Calculator(b);S=e;var t=document.getElementById("highlightProperties");if(t===null||t===undefined){var i="highlightProperties";var n=O?St["b"].$(St["b"].$(O).parent()).offset():null;var a=O?St["b"].$(St["b"].$(O).parent()).width():null;var r=7;var o=[{text:m.getTranslation("OKAY"),id:"highlightPropertiesDialogOkayButton",click:g.apply},{text:m.getTranslation("CANCEL"),id:"highlightPropertiesDialogCancelButton",click:g.cancel}];var l=new St["b"].UI.HiCoDialogDefinition(i,_,o);E=l.getFontSize();var s=n&&a?[n.left+a+r,n.top]:"center";l.setPosition(s);l.setWidth(x);l.setHeight(C);l.setResizable(true);l.setParentDomElement(f.parentNode);l.setTooltip(m.getTranslation("HELP_HIGHLIGHTPROPERTIES"));M=new St["b"].UI.HiCoDialog(l);y=M.getDialogDiv();var d={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var c=document.createElement("div");c.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(c,d);c.style.fontSize=E;y.appendChild(c);calculateLength();y.setAttribute("class",i);M.setCSS();y.appendChild(fillContent());var u=parseInt(M.highest());var p=parseInt(M.getDialog().offsetParent().css("z-index"));if(u>p){u+=1;M.getDialog().offsetParent().css("z-index",u)}M.getDialog().dialog("open")}else{t.parentNode.remove(t);g.open(e)}};g.apply=function(){applyChanges();g.cancel()};g.cancel=function(){M.close()};function fillExpressions(){U=[];F=[];if(h.value.type===A.STACK&&h.type===L.VALUE){U=[m.getTranslation("POSITIVE"),m.getTranslation("NEGATIVE")];F=["#pos#","#neg#"]}else{for(var e=0;e<b.columns.length;e++){U[e]=b.columns[e].name;F[e]=b.columns[e].id}}}function fillHeader(e){var t=[];var i=[];var n=[];var a=[];var r;var o;var l;var s;var d;var c;if(e===L.VALUE){t=["type","keyfigureType","category","position","keyfigure"];i=[m.getTranslation("TYPE"),m.getTranslation("MEASURE_TYPE"),m.getTranslation("DIMENSION"),m.getTranslation("POSITION"),m.getTranslation("MEASURE")];n=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURETYPE","HELP_HIGHLIGHTPROPERTIES_VALUE_DIMENSION","HELP_HIGHLIGHTPROPERTIES_VALUE_POSITION","HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURE"];a=[0,0,0,0,0];r=[A.LABEL,A.ELEMENT];o=[m.getTranslation("LABEL"),m.getTranslation("ELEMENT")];l=[A.TEXT,A.POSITION];s=[m.getTranslation("TEXT"),m.getTranslation("POSITION")]}else if(e===L.COMPARE){t=["type","compareName","compareElement"];i=[m.getTranslation("TYPE"),m.getTranslation("NAME"),m.getTranslation("ELEMENT")];n=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_COMPARE_NAME","HELP_HIGHLIGHTPROPERTIES_COMPARE_ELEMENT"];a=[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===L.CATEGORY_LABEL){t=["type","category","position","elements"];i=[m.getTranslation("TYPE"),m.getTranslation("DIMENSION"),m.getTranslation("POSITION"),m.getTranslation("ELEMENTS")];n=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_CATLABEL_DIMENSION","HELP_HIGHLIGHTPROPERTIES_CATLABEL_POSITION","HELP_HIGHLIGHTPROPERTIES_CATLABEL_ELEMENTS"];a=[0,0,0,0];l=[A.TEXT,A.POSITION];s=[m.getTranslation("TEXT"),m.getTranslation("POSITION")]}else if(e===L.LEGEND){t=["type","keyfigure"];i=[m.getTranslation("TYPE"),m.getTranslation("MEASURE")];n=["HELP_HIGHLIGHTPROPERTIES_TYPE","HELP_HIGHLIGHTPROPERTIES_LEGEND_MEASURE"];a=[0,0]}return{header:t,headerTL:i,headerTooltips:n,width:a,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++){St["b"].$(e).html(p[t]);var i=e.clientWidth+1;D[t]=i}for(var t=0;t<R.length;t++){St["b"].$(e).html(N[t]);var i=e.clientWidth+30;if(D[0]<i){D[0]=i}}if(h.type===L.VALUE){for(var t=0;t<o.length;t++){St["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<F.length;t++){St["b"].$(e).html(U[t]);var i=e.clientWidth+30;if(D[4]<i){D[4]=i}}}else if(h.type===L.COMPARE){for(var t=0;t<P.length;t++){St["b"].$(e).html(P[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}if(D[2]<60){D[2]=60}}else if(h.type===L.CATEGORY_LABEL){for(var t=0;t<a.length;t++){St["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(h.type===L.LEGEND){for(var t=0;t<F.length;t++){St["b"].$(e).html(U[t]);var i=e.clientWidth+30;if(D[1]<i){D[1]=i}}}}function updateTable(e){h.type=R[e.selectedIndex];St["b"].$("#highlightPropDiv").empty();var t=document.getElementById("highlightPropDiv");n=fillHeader(h.type);u=n.header;p=n.headerTL;I=n.headerTooltips;D=n.width;P=n.compName?n.compName:null;w=n.compId?n.compId:null;a=n.category?n.category:null;r=n.categoryTL?n.categoryTL:null;o=n.keyfigureTypes?n.keyfigureTypes:null;l=n.keyfigureTypesTL?n.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"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");var a=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"};St["b"].Utils.DOM.setStyle(o,d);St["b"].Utils.DOM.setStyle(l,d);St["b"].$(o).html(p[r]);o.setAttribute("title",m.getTranslation(I[r]));var c=document.createElement("span");c.style.margin="0px";St["b"].$(c).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(c);a.appendChild(l);n.appendChild(o)}i.appendChild(n);i.appendChild(a);e.appendChild(i);return e}function createTable(){var e=document.createElement("div");e.setAttribute("id","highlightPropertiesTableDiv");var t={height:50+"px",width:"100%"};St["b"].Utils.DOM.setStyle(e,t);if(h){var i=document.createElement("table");var n=document.createElement("tr");var a={width:D[0]+"px",minWidth:D[0]+"px",textAlign:"center"};var r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var o=St["b"].Utils.DOM.createSelectBox(r,"select##"+h.id+"##highlightType",R,N,h.type,E);o.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_TYPE"));St["b"].$(o).change(function(e){updateTable(e.target)});n.appendChild(r);if(h.type===L.VALUE){a={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var l=h.value.type===A.LABEL?"highlight_label.png":"highlight_label_grey.png";var s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightKeyfigureTypeLabel","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("LABEL"));s.style.marginRight="3px";s.style.marginLeft="3px";St["b"].$(s).click(function(e){changeValueTypeToLabel(e)});l=h.value.type===A.ELEMENT?"highlight_element.png":"highlight_element_grey.png";var s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightKeyfigureTypeElement","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("ELEMENT"));s.style.marginRight="3px";s.style.marginLeft="3px";St["b"].$(s).click(function(e){changeValueTypeToElement(e)});if(v.stackMode){fillExpressions();l=h.value.type===A.STACK?"stack.png":"stack_grey.png";var s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightKeyfigureTypeStack","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("STACK"));s.style.marginRight="3px";s.style.marginLeft="3px";St["b"].$(s).click(function(e){changeValueTypeToStack(e)})}n.appendChild(r);a={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);l=h.value.category===A.TEXT?"highlight_text.png":"highlight_text_grey.png";s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCategoryText","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));St["b"].$(s).click(function(e){updateHighlight(h.value);changeInput(h.value)});l=h.value.category===A.TEXT?"highlight_position_grey.png":"highlight_position.png";s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCategoryPosition","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("POSITION"));St["b"].$(s).click(function(e){updateHighlight(h.value);changeInput(h.value)});n.appendChild(r);a={width:D[3]+"px",minWidth:D[3]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);if(h.value.category===A.TEXT){var d=T.decodeInputField(h.value.path,true)}else{var d=T.decodeInputField(h.value.position)}var c=St["b"].Utils.DOM.createTextInputNoMax(r,"select##"+h.id+"##highlightPosition",d,0,E);c.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_VALUE_POSITION"));St["b"].$(c).css({width:"95px"});St["b"].Utils.DOM.setStyle(c,B);St["b"].$(c).on("focusout",function(e){checkFormulas(e,h.value.category)});St["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e,h.value.category)}});var u=St["b"].DataObjects.RuntimeDO.getTranslation("HIGHLIGHT_HELP");u=u.replace(/&quot;/g,'"');s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##helpIcon","","",E,Se["a"].imgPath+"help.png",u);St["b"].Utils.DOM.setStyle(s,{verticalAlign:"top"});n.appendChild(r);a={width:D[4]+"px",minWidth:D[4]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var o=St["b"].Utils.DOM.createSelectBox(r,"select##"+h.id+"##highlightKeyfigure",F,U,h.value.keyfigure,E);o.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_VALUE_MEASURE"));St["b"].$(o).change(function(e){h.value.keyfigure=F[e.target.selectedIndex]});n.appendChild(r)}else if(h.type===L.COMPARE){a={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var o=St["b"].Utils.DOM.createSelectBox(r,"select##"+h.id+"##highlightCompareName",w,P,h.compare.id,E);o.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_COMPARE_NAME"));n.appendChild(r);a={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var p=h.compare.element.absolute?Se["a"].imgPath+"absolute_active.png":Se["a"].imgPath+"absolute_inactive.png";var s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCompareElementAbsolute","","",E,p,St["b"].DataObjects.RuntimeDO.getTranslation("ABSOLUTE"));St["b"].$(s).click(function(e){h.compare.element.absolute=!h.compare.element.absolute;e.target.src=h.compare.element.absolute===true?Se["a"].imgPath+"absolute_active.png":Se["a"].imgPath+"absolute_inactive.png"});p=h.compare.element.percent?Se["a"].imgPath+"percent_active.png":Se["a"].imgPath+"percent_inactive.png";s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCompareElementPercent","","",E,p,St["b"].DataObjects.RuntimeDO.getTranslation("PERCENT"));St["b"].$(s).click(function(e){h.compare.element.percent=!h.compare.element.percent;e.target.src=h.compare.element.percent===true?Se["a"].imgPath+"percent_active.png":Se["a"].imgPath+"percent_inactive.png"});p=h.compare.element.text?Se["a"].imgPath+"text_active.png":Se["a"].imgPath+"text_inactive.png";s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCompareElementText","","",E,p,St["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));St["b"].$(s).click(function(e){h.compare.element.text=h.compare.element.text!==true;e.target.src=h.compare.element.text?Se["a"].imgPath+"text_active.png":Se["a"].imgPath+"text_inactive.png"});n.appendChild(r)}else if(h.type===L.CATEGORY_LABEL){a={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var l=h.categoryLabel.category===A.TEXT?"highlight_text.png":"highlight_text_grey.png";var s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCategoryText","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("TEXT"));St["b"].$(s).click(function(e){updateHighlight(h.categoryLabel);changeInput(h.categoryLabel)});l=h.categoryLabel.category===A.TEXT?"highlight_position_grey.png":"highlight_position.png";s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##highlightCategoryPosition","","",E,Se["a"].imgPath+l,St["b"].DataObjects.RuntimeDO.getTranslation("POSITION"));St["b"].$(s).click(function(e){updateHighlight(h.categoryLabel);changeInput(h.categoryLabel)});n.appendChild(r);a={width:D[2]+"px",minWidth:D[2]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var d=h.categoryLabel.category===A.TEXT?T.decodeInputField(h.categoryLabel.path,true):T.decodeInputField(h.categoryLabel.position);var c=St["b"].Utils.DOM.createTextInputNoMax(r,"select##"+h.id+"##highlightPosition",d,0,E);c.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_CATLABEL_POSITION"));St["b"].$(c).css({width:"95px"});St["b"].Utils.DOM.setStyle(c,B);St["b"].$(c).on("focusout",function(e){checkFormulas(e,h.categoryLabel.category)});St["b"].$(c).on("keydown",function(e){if(e.which===13){checkFormulas(e,h.categoryLabel.category)}});var u=St["b"].DataObjects.RuntimeDO.getTranslation("HIGHLIGHT_HELP");u=u.replace(/&quot;/g,'"');s=St["b"].Utils.DOM.createIconButton(r,"select##"+h.id+"##helpIcon","","",E,Se["a"].imgPath+"help.png",u);St["b"].Utils.DOM.setStyle(s,{verticalAlign:"top"});n.appendChild(r);a={width:D[3]+"px",minWidth:D[3]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var d=T.decodeInputField(h.categoryLabel.elements,true);var c=St["b"].Utils.DOM.createTextInputNoMax(r,"select##"+h.id+"##highlightElements",d,0,E);c.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_CATLABEL_ELEMENTS"));St["b"].$(c).css({width:"95px"});St["b"].Utils.DOM.setStyle(c,B);n.appendChild(r)}else if(h.type===L.LEGEND){fillExpressions();a={width:D[1]+"px",minWidth:D[1]+"px",textAlign:"center"};r=document.createElement("td");St["b"].Utils.DOM.setStyle(r,a);var o=St["b"].Utils.DOM.createSelectBox(r,"select##"+h.id+"##highlightKeyfigure",F,U,h.legend.keyfigure,E);o.setAttribute("title",m.getTranslation("HELP_HIGHLIGHTPROPERTIES_LEGEND_MEASURE"));St["b"].$(o).change(function(e){h.legend.keyfigure=F[e.target.selectedIndex]});n.appendChild(r)}i.appendChild(n)}e.appendChild(i);return e}function applyChanges(){var e=JSON.parse(JSON.stringify(h));if(e.type===L.VALUE){if(e.value.category===A.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===A.STACK){e.value.inGroup=F[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}else{e.value.inGroup=document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex}}e.value.keyfigure=F[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}else if(e.type===L.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===L.CATEGORY_LABEL){if(e.categoryLabel.category===A.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===L.LEGEND){e.legend.keyfigure=F[document.getElementById("select##"+e.id+"##highlightKeyfigure").selectedIndex]}if(e.type!==L.COMPARE){resetOldCompareHighlight()}S.setHighlight(e,i)}function updateHighlight(e){var t=T.encodeInputField(document.getElementById("select##"+h.id+"##highlightPosition").value);if(e.category===A.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 n=t.split("@");for(var a=0;a<n.length;a++){var r=n[a];if(r[0]==="$"&&r[1]==="("&&r[r.length-1]===")"){var i={};T.addQvVariables(i,false);n[a]=d.resolveVariables(T,n[a],i,null,null,false)}}t=n.join("@")}for(var a=0;a<s.children.length;a++){var o=s.children[a];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===A.POSITION&&o.absolutePosition&&(o.absolutePosition.groupIndex+1).toString()===t){var n=e.path.split("@");var l=true;for(var a=0;a<n.length;a++){var r=n[a];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===A.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===A.POSITION){e.category=A.TEXT;var t=document.getElementById("select##"+h.id+"##highlightCategoryText");t.src=Se["a"].imgPath+"highlight_text.png";t=document.getElementById("select##"+h.id+"##highlightPosition");t.value=T.decodeInputField(e.path,true);t=document.getElementById("select##"+h.id+"##highlightCategoryPosition");t.src=Se["a"].imgPath+"highlight_position_grey.png"}else{e.category=A.POSITION;var t=document.getElementById("select##"+h.id+"##highlightCategoryPosition");t.src=Se["a"].imgPath+"highlight_position.png";t=document.getElementById("select##"+h.id+"##highlightPosition");t.value=T.decodeInputField(e.position);t=document.getElementById("select##"+h.id+"##highlightCategoryText");t.src=Se["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=S.getAvailCompares();for(var t=0;t<e.length;t++){if(e[t].comp.id===h.compare.id){e[t].comp.absolute.isHighlighted=false;e[t].comp.percent.isHighlighted=false;e[t].comp.text.isHighlighted=false;break}}}function changeValueTypeToLabel(e){h.value.type=A.LABEL;e.target.src=Se["a"].imgPath+"highlight_label.png";var t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeElement");t.src=Se["a"].imgPath+"highlight_element_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeStack");if(t){t.src=Se["a"].imgPath+"stack_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<F.length;i++){var n=document.createElement("option");var a=U[i];St["b"].$(n).html(a);t.appendChild(n)}}}function changeValueTypeToElement(e){h.value.type=A.ELEMENT;e.target.src=Se["a"].imgPath+"highlight_element.png";var t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeLabel");t.src=Se["a"].imgPath+"highlight_label_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeStack");if(t){t.src=Se["a"].imgPath+"stack_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<F.length;i++){var n=document.createElement("option");var a=U[i];St["b"].$(n).html(a);t.appendChild(n)}}}function changeValueTypeToStack(e){h.value.type=A.STACK;e.target.src=Se["a"].imgPath+"stack.png";var t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeLabel");t.src=Se["a"].imgPath+"highlight_label_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigureTypeElement");t.src=Se["a"].imgPath+"highlight_element_grey.png";t=document.getElementById("select##"+h.id+"##highlightKeyfigure");t.options.length=0;fillExpressions();for(var i=0;i<F.length;i++){var n=document.createElement("option");var a=U[i];St["b"].$(n).html(a);t.appendChild(n)}}function validateVariable(e,t){var i=e.split(",");var n=true;for(var a=0;a<i.length;a++){var r=i[a];if(t===A.TEXT){if(r[0]!=='"'||r[r.length-1]!=='"'){n=false}else{r=r.slice(1,r.length-1)}}else if(t===A.POSITION){if(r[0]==='"'&&r[r.length-1]==='"'){n=false}}if(n){if(r[0]==="$"&&r[1]==="("&&r[r.length-1]===")"){var o={};T.addQvVariables(o,true);n=d.resolveVariables(T,T.encode(r),o,null,null,false)}}else{return n}}return n}};St["b"].UI=St["b"].UI||{};St["b"].UI.KeyDialog=function(e){var o=this;var t=e.chartModel;var a=JSON.parse(JSON.stringify(t.input));var i=e.parent;var l=St["b"].DataObjects.RuntimeDO;var r=St["b"].DataObjects.ContextRepo.getContextByCid(t.contextId);var s=450;var d=300;var c=l.getTranslation("KEYDIALOG");var n,u,p,g,m,h;var f=[];var v=[];var b,T;var E={border:"1px solid rgb(170, 170, 170)",height:190+"px",padding:6+"px",overflow:"auto"};var x={width:150+"px",height:170+"px",border:"1px solid rgb(170, 170, 170)",overflow:"auto"};var C=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 n=new St["b"].UI.HiCoDialogDefinition(t,c,i);g=n.getFontSize();n.setWidth(s+"px");n.setHeight(d);n.setPosition("center");b=new St["b"].UI.HiCoDialog(n);T=b.getDialogDiv();b.setEvent("dialogresize",resizeDialog);b.setCSS("overflow","hidden");b.getDialog().dialog("option","minWidth",s);b.setCSS();T.appendChild(fillContent());var a=parseInt(b.highest());var r=parseInt(b.getDialog().offsetParent().css("z-index"));if(a>r){a+=1;b.getDialog().offsetParent().css("z-index",a)}b.getDialog().dialog("open")}else{e.parentNode.remove(e);o.open()}};o.okay=function(){if(f.length>0){a.keyColumns=f;i.setKeyColumns(a);o.close()}else{St["b"].UI.HiCoNotification(l.getTranslation("SELECT_ONE"))}};o.close=function(){b.close()};function fillContent(){var e=document.createElement("div");e.setAttribute("id","keyDialogDiv");St["b"].$(e).addClass("ui-corner-bottom");St["b"].$(e).css(E);createLeftTable();e.appendChild(n);createMidTable();e.appendChild(u);createRightTable();e.appendChild(p);return e}function createHeader(e){var t=document.createElement("div");var i=document.createElement("tr");var n=document.createElement("td");n.innerHTML=e;i.appendChild(n);t.appendChild(i);return t}function createLeftTable(){n=document.createElement("div");n.setAttribute("id","leftDiv");St["b"].$(n).addClass("floatingDiv");n.appendChild(createHeader(l.getTranslation("AVAILABLE")));n.setAttribute("title",l.getTranslation("HELP_CELL_INPUT_AVAILABLE"));var e=document.createElement("div");m=document.createElement("ul");m.setAttribute("id","leftList");St["b"].$(m).addClass("listSelectable");e.appendChild(m);fillLeftTable();St["b"].$(e).css(x);n.appendChild(e)}function createMidTable(){u=document.createElement("div");u.setAttribute("id","midDiv");St["b"].$(u).addClass("floatingDiv");var e=document.createElement("div");St["b"].$(e).css({margin:"20px 10px 0px"});var t=document.createElement("table");St["b"].$(t).addClass("floatingDivTable");for(var i=0,n=C.length;i<n;i++){var a=document.createElement("tr");if(C[i].entries){for(var r=0,o=C[i].entries.length;r<o;r++){var l=document.createElement("td");l.setAttribute("id",C[i].entries[r].id);if(C[i].entries[r].type==="iconbutton"){St["b"].Utils.DOM.createIconButton(l,C[i].entries[r].id,"","",g,Se["a"].imgPath+C[i].entries[r].src,C[i].entries[r].tooltip);St["b"].$(l).click(sortUpAndDown)}else if(C[i].entries[r].type==="text"){l.colSpan=C[i].entries[r].colSpan;l.setAttribute("title",C[i].entries[r].tooltip);St["b"].Utils.DOM.createSpan(l,C[i].entries[r].value,C[i].entries[r].id);St["b"].$(l).click(addRemoveElement)}else if(C[i].entries[r].type==="empty"){St["b"].$(l).css({border:0+"px"})}a.appendChild(l)}}else{var l=document.createElement("td");l.colSpan=2;St["b"].$(l).css({height:15+"px",border:"0px"});a.appendChild(l)}t.appendChild(a)}e.appendChild(t);u.appendChild(e)}function createRightTable(){p=document.createElement("div");p.setAttribute("id","rightDiv");St["b"].$(p).addClass("floatingDiv");p.appendChild(createHeader(l.getTranslation("KEY")));p.setAttribute("title",l.getTranslation("HELP_CELL_INPUT_KEY"));var e=document.createElement("div");h=document.createElement("ul");h.setAttribute("id","rightList");St["b"].$(h).addClass("listSelectable");fillRightTable();e.appendChild(h);St["b"].$(e).css(x);p.appendChild(e)}function resizeDialog(){var e=St["b"].$(T).parent().height()-70;St["b"].$(T).height(e);St["b"].$("#keyDialogDiv").height(e-15)}function selectElement(){St["b"].$(this).toggleClass("listSelected").siblings().removeClass("listSelected");if(this.parentNode.id==="leftList"){St["b"].$(h).children().removeClass("listSelected")}else if(this.parentNode.id==="rightList"){St["b"].$(m).children().removeClass("listSelected")}}function addRemoveElement(){if(this.id==="addOne"){var e=St["b"].$(".listSelected")[0];if(e){St["b"].$(e).removeClass("listSelected");h.appendChild(e);addOneToRightList(e.id)}}else if(this.id==="addAll"){var t=St["b"].$(m).children();if(t){addAllToRightList();for(var i=0,n=t.length;i<n;i++){St["b"].$(t[i]).removeClass("listSelected");h.appendChild(t[i])}}}else if(this.id==="removeOne"){var e=St["b"].$(".listSelected")[0];if(e){St["b"].$(e).removeClass("listSelected");m.appendChild(e);removeOneFromRightList(e.id)}}else if(this.id==="removeAll"){var t=St["b"].$(h).children();if(t){removeAllFromRightList();for(var i=0,n=t.length;i<n;i++){St["b"].$(t[i]).removeClass("listSelected");m.appendChild(t[i])}}}}function addOneToRightList(e){for(var t=0,i=v.length;t<i;t++){if(v[t].id===e){var n=v.splice(t,1);f.push(n[0]);break}}}function addAllToRightList(){var e=v.splice(0,v.length);f=f.concat(e)}function removeOneFromRightList(e){for(var t=0,i=f.length;t<i;t++){if(f[t].id===e){var n=f.splice(t,1);v.push(n[0]);break}}}function removeAllFromRightList(){var e=f.splice(0,f.length);v=v.concat(e)}function sortUpAndDown(){if(this.id==="sortUp"){var e=St["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=St["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 n=getIndex(t,e);var a=getIndex(i,e);if(n&&a){var r=e[n];e[n]=e[a];e[a]=r}}function getIndex(e,t){for(var i=0,n=t.length;i<n;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;St["b"].$(i).click(selectElement);m.appendChild(i)}}function fillRightTable(){for(var e=0,t=f.length;e<t;e++){var i=document.createElement("li");i.setAttribute("id",f[e].id);i.innerHTML=f[e].nameInternal?f[e].nameInternal:f[e].name;St["b"].$(i).click(selectElement);h.appendChild(i)}}function getLists(){for(var e=0,t=a.keyColumns.length;e<t;e++){var i={name:a.keyColumns[e].name};for(var n=0;n<r.rows.length;n++){if(r.rows[n].id===a.keyColumns[e].id){i=r.rows[n];break}}f.push({id:a.keyColumns[e].id,name:i.nameInternal?i.nameInternal:i.name,hide:a.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=f.length;while(t--){if(f[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 we=r(304);St["b"].UI=St["b"].UI||{};St["b"].UI.LinkDialog=function(e){var h=this;var a;var r;var d=e;var u=d.getCanvasDO().getDOMElement();var f=d.RootModel;var p=null;var v=St["b"].DataObjects.RuntimeDO;var o=St["b"].Utils.Constants.TypeValues.element;deleteXYFromLink();var g=St["b"].Models.Actions.ViewModelActions.General.getAllSingleChartsByType(f.firstObjectGrid,"TimeChartModel");var m=St["b"].Models.Actions.ViewModelActions.General.getAllSingleChartsByType(f.firstObjectGrid,"ChartModel");var c=g.concat(m);var b=["Left","Mid","Right"];var i=["Start","Mid","End"];var T=[v.getTranslation("LEFT"),v.getTranslation("MID"),v.getTranslation("RIGHT")];var E=["Top","Mid","Bottom"];var x=[v.getTranslation("TOP"),v.getTranslation("MID"),v.getTranslation("BOTTOM")];var C=["-"];var y=["-"];var M={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 S="340";var O="140";this.createLinkDiv=function(){var e=new St["b"].UI.HiCoDialogDefinition(s,v.getTranslation("LINKING"),[{text:v.getTranslation("OKAY"),click:this.closeDialog}]);e.setParentDomElement(u.parentNode);e.setWidth(S);e.setPosition({});a=new St["b"].UI.HiCoDialog(e);r=a.getDialogDiv();a.setEscapeAfterHandler(this.closeDialog);var t={select:function(e,t){St["b"].$('div[id*="linkGroup_"]').remove();a.decorateTabs(t.index,l,null);h.showExistingLinks()}};a.buildTabs("tabDiv",l,null,"auto",{top:"0px",left:"0px"},t,true);a.setEvent("dialogresize",function(e,t){h.updateDivHeight()});a.setTabsCss("#generalTab",["generalTab"]);a.setCSS();a.decorateTabs(0,l,null);h.showExistingLinks();var i=parseInt(a.highest());var n=parseInt(a.getDialog().offsetParent().css("z-index"));if(i>n){i+=1;a.getDialog().offsetParent().css("z-index",i)}};this.closeDialog=function(){a.close();St["b"].$('div[id*="linkGroup_"]').remove();deleteXYFromLink();d.LayoutDefinition.link=we["a"].convertCellLinks(f)};this.updateDivHeight=function(){var e=parseFloat(r.style.height);var t=44;var i=e-t;St["b"].$("#XXXAxisLinking").css("height",i);St["b"].$("#XXXValueLinking").css("height",i);St["b"].$("#XXXLegendLinking").css("height",i);St["b"].$("#XXXLinkingSettings").css("height",i);i=e-t-2;St["b"].$("#AxisLinking").css("height",i);St["b"].$("#ValueLinking").css("height",i);St["b"].$("#LegendLinking").css("height",i);St["b"].$("#LinkingSettings").css("height",i)};this.addLinkGroup=function(e){var t=0;while(f.linkGroups[t]!==undefined){t++}f.linkGroups[t]={linkedType:"-",linkedCharts:[],axisOrientation:"Start",legendOrientation:"Left",type:e};h.showExistingLinks(t)};this.showExistingLinks=function(e){if(St["b"].$("#axisLinkingTableBody")){St["b"].$("#axisLinkingTableBody").remove()}if(St["b"].$("#valueLinkingTableBody")){St["b"].$("#valueLinkingTableBody").remove()}if(St["b"].$("#legendLinkingTableBody")){St["b"].$("#legendLinkingTableBody").remove()}var t=1;var i=1;var n=1;var a=document.createElement("tbody");a.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 f.linkGroups){var s=f.linkGroups[l];if(s.type==="axis"){var d=h.createTbody_axis(s,l,t);a.appendChild(d);St["b"].$("#axisLinkingTable").append(a);t++}else if(s.type==="value"){var d=h.createTbody_value(s,l,i);r.appendChild(d);St["b"].$("#valueLinkingTable").append(r);i++}else if(s.type==="legend"){var d=h.createTbody_legend(s,l,n);o.appendChild(d);St["b"].$("#legendLinkingTable").append(o);n++}}if(f.linkGroups[e]!=undefined){h.activeLinkSelection({id:"linkGroup_"+e,type:f.linkGroups[e].type})}};this.createTbody_axis=function(e,t,i){var n=document.createElement("tr");n.setAttribute("ID","linkGroup_"+t);var a=h.buildDragger();a.setAttribute("ID","linkGroup_"+t+"_dragger");a.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_DRAGGER"));St["b"].$(a).click(function(){h.activeLinkSelection({id:"linkGroup_"+t,type:"axis"})});var r=document.createElement("td");St["b"].$(r).html(i);r.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_LINK"));r.style.textAlign="right";var o=document.createElement("td");St["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"));St["b"].$(l).html(e.linkedCharts.length);l.style.textAlign="right";var s=document.createElement("td");s.setAttribute("ID","linkGroup_"+t);St["b"].$(s).css("cursor","pointer");St["b"].$(s).html("-");s.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_MINUS"));s.style.textAlign="center";St["b"].$(s).click(function(){!f.linkSettings.automaticLinking&&h.removeLinkGroup(this.id,"axis")});var d=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignments;var c=St["b"].Utils.Constants.ParameterSets.axisCategoryAlignmentsTL;if(d.indexOf(f.linkGroups[t].axisOrientation)===-1){f.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=St["b"].Utils.DOM.createSelectBox(u,"orientationLinkGroup_"+t,d,c,f.linkGroups[t].axisOrientation,13,"100%");St["b"].$(p).change(function(){h.changeAxisOrientation(this)});if(f.linkSettings.automaticLinking){p.setAttribute("disabled","disabled")}else{p.removeAttribute("disabled")}n.appendChild(a);n.appendChild(r);n.appendChild(o);n.appendChild(l);n.appendChild(u);n.appendChild(s);return n};this.createTbody_value=function(e,t,i){var n=document.createElement("tr");n.setAttribute("ID","linkGroup_"+t);var a=h.buildDragger();a.setAttribute("ID","linkGroup_"+t+"_dragger");a.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_DRAGGER"));St["b"].$(a).click(function(){h.activeLinkSelection({id:"linkGroup_"+t,type:"value"})});var r=document.createElement("td");St["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"));St["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"));St["b"].$(l).html(e.linkedCharts.length);l.style.textAlign="right";var s=document.createElement("td");s.setAttribute("ID","linkGroup_"+t);St["b"].$(s).css("cursor","pointer");St["b"].$(s).html("-");s.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_MINUS"));s.style.textAlign="center";St["b"].$(s).click(function(){!f.linkSettings.automaticLinking&&h.removeLinkGroup(this.id,"value")});n.appendChild(a);n.appendChild(r);n.appendChild(o);n.appendChild(l);n.appendChild(s);return n};this.createTbody_legend=function(e,t,i){var n=document.createElement("tr");n.setAttribute("ID","linkGroup_"+t);var a=h.buildDragger();a.setAttribute("ID","linkGroup_"+t+"_dragger");a.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_DRAGGER"));St["b"].$(a).click(function(){h.activeLinkSelection({id:"linkGroup_"+t,type:"legend"})});var r=document.createElement("td");St["b"].$(r).html(i);r.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_LINK"));r.style.textAlign="right";var o=document.createElement("td");St["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"));St["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=E;var d=x}else{var s=C;var d=y}if(s.indexOf(f.linkGroups[t].legendOrientation)===-1){f.linkGroups[t].legendOrientation=s[0]}var c=document.createElement("td");c.setAttribute("ID","orientationLinkGroup_"+t);var u=St["b"].Utils.DOM.createSelectBox(c,"orientationLinkGroup_"+t,s,d,f.linkGroups[t].legendOrientation,13,"100%");u.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_ORIENTATION"));St["b"].$(u).change(function(){h.changeLegendOrientation(this)});if(f.linkSettings.automaticLinking){u.setAttribute("disabled","disabled")}else{u.removeAttribute("disabled")}var p=document.createElement("td");p.setAttribute("ID","linkGroup_"+t);St["b"].$(p).css("cursor","pointer");St["b"].$(p).html("-");p.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_MINUS"));p.style.textAlign="center";St["b"].$(p).click(function(){!f.linkSettings.automaticLinking&&h.removeLinkGroup(this.id,"legend")});n.appendChild(a);n.appendChild(r);n.appendChild(o);n.appendChild(l);n.appendChild(c);n.appendChild(p);return n};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){St["b"].$('div[id*="linkGroup_"]').remove();h.showExistingLinks();St["b"].$("#"+e.id+"_dragger").children().css("background","rgb(0, 176, 240)");p=e.id.split("_").pop();var t=St["b"].$("#"+e.id)[0].childNodes[2].innerHTML;if(t==="-"){h.highlightLinkContainers("Structure",true,e);h.highlightLinkContainers("Time",true,e)}else{h.highlightLinkContainers(t,false,e)}};this.changeAxisOrientation=function(e){var t=f.linkGroups[e.id.split("_").pop()];if(t.linkedType==="Time"||t.linkedType==="Structure"){t.axisOrientation=i[e.selectedIndex]}else{t.axisOrientation=C[e.selectedIndex]}d.paint()};this.changeLegendOrientation=function(e){var t=f.linkGroups[e.id.split("_").pop()];if(t.linkedType==="Time"){t.legendOrientation=b[e.selectedIndex]}else if(t.linkedType==="Structure"){t.legendOrientation=E[e.selectedIndex]}else{t.legendOrientation=C[e.selectedIndex]}d.paint()};this.updateLink=function(e,t){var i=St["b"].Factories.ModelFactory.getModelById(f,e.id.split("_").pop());var n=f.extensionHash+"."+i.id;var a=f.linkGroups[p].linkedCharts.indexOf(n);if(a>=0){f.linkGroups[p].linkedCharts.splice(a,1);if(i.extendedModel.linkGroup){delete i.extendedModel.linkGroup}d.paint();St["b"].$("#linkGroupLength_"+p).html(f.linkGroups[p].linkedCharts.length);e.style.backgroundColor="rgba(217, 217, 217, 0.2)";h.showExistingLinks(p)}else{if(i.layoutType==="structure"||i.layoutType===o.STRUCTURE){f.linkGroups[p].linkedType="Structure"}else if(i.layoutType==="time"||i.layoutType===o.TIME){f.linkGroups[p].linkedType="Time"}f.linkGroups[p].linkedCharts.push(n);d.paint();St["b"].$("#linkGroupLength_"+p).html(f.linkGroups[p].linkedCharts.length);e.style.backgroundColor="rgba(37, 157, 187, 0.2)";h.activeLinkSelection({id:"linkGroup_"+p,type:f.linkGroups[p].type});h.showExistingLinks(p)}};this.removeLinkGroup=function(e,t){var i=e.split("_").pop();var n=f.linkGroups;var a=n[i];for(var r=0;r<a.linkedCharts.length;r++){var o=null;var l=a.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 n[i];d.paint();if(p==i){h.highlightLinkContainers("",false)}h.showExistingLinks()};this.highlightLinkContainers=function(n,e,t){function getLinked(e){var t=f.extensionHash+"."+e.id;var i=f.linkGroups[p];return i.linkedType===n&&i.linkedCharts.indexOf(t)>=0}if(!e){St["b"].$('div[id*="linkGroup_"]').remove()}var i=[];if(n==="Time"){i=g}else if(n==="Structure"){i=m}var a=null;for(var r=0;i.length>r;r++){if(getLinked(i[r])){a=St["b"].Factories.ModelFactory.getParentContainer(f.firstObjectGrid,i[r])[0];break}}for(var o=0;o<i.length;o++){for(var l=0;i.length>l;l++){var s=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePosition(i[l],f);M.top=s.y+"px";M.height=i[l].dimension.height+"px";M.left=s.x+"px";M.width=i[l].dimension.width+"px";if(getLinked(i[l])){M.backgroundColor="rgba(37, 157, 187, 0.2)";if(n==="Time"){if(t.type==="value"){if(f.linkGroups[p].x==undefined){f.linkGroups[p].x=s.x}}}else if(n==="Structure"){if(t.type==="value"){if(f.linkGroups[p].y==undefined){f.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);St["b"].Utils.DOM.setStyle(c,M);c.style.visibility="visible";St["b"].$(c).click(function(){h.updateLink(this,t)})}else{M.visibility="visible";St["b"].Utils.DOM.setStyle(d,M)}}else{if(a===null){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){M.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);St["b"].Utils.DOM.setStyle(c,M);c.style.visibility="visible";St["b"].$(c).click(function(){h.updateLink(this,t)})}else{M.backgroundColor="rgba(217, 217, 217, 0.2)";M.visibility="visible";St["b"].Utils.DOM.setStyle(d,M)}}else{if(t.type==="axis"||t.type==="legend"||St["b"].Factories.ModelFactory.getParentContainer(f.firstObjectGrid,i[l])[0].id===a.id){if(n==="Time"&&t.type==="value"){if(s.x<=f.linkGroups[p].x+2&&s.x>=f.linkGroups[p].x-2){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){M.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);St["b"].Utils.DOM.setStyle(c,M);c.style.visibility="visible";St["b"].$(c).click(function(){h.updateLink(this,t)})}else{M.backgroundColor="rgba(217, 217, 217, 0.2)";M.visibility="visible";St["b"].Utils.DOM.setStyle(d,M)}}}else if(n==="Structure"&&t.type==="value"){if(s.y<=f.linkGroups[p].y+2&&s.y>=f.linkGroups[p].y-2){var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){M.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);St["b"].Utils.DOM.setStyle(c,M);c.style.visibility="visible";St["b"].$(c).click(function(){h.updateLink(this,t)})}else{M.backgroundColor="rgba(217, 217, 217, 0.2)";M.visibility="visible";St["b"].Utils.DOM.setStyle(d,M)}}}else{var d=document.getElementById("linkGroup_"+l+"_cId_"+i[l].id);if(!d){M.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);St["b"].Utils.DOM.setStyle(c,M);c.style.visibility="visible";St["b"].$(c).click(function(){h.updateLink(this,t)})}else{M.backgroundColor="rgba(217, 217, 217, 0.2)";M.visibility="visible";St["b"].Utils.DOM.setStyle(d,M)}}}}}}}};function createAxisLinking(){var e={"vertical-align":"top",borderBottom:"1px solid black"};var t={textAlign:"right"};var i=document.createElement("div");i.setAttribute("id","AxisLinking");St["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var n=document.createElement("table");n.setAttribute("cellSpacing","5px");n.setAttribute("ID","axisLinkingTable");var a=document.createElement("div");a.style.padding="0px 1px";St["b"].$(a).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"};St["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");St["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");St["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_LINK"));St["b"].Utils.DOM.setStyle(c,e);St["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");St["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_TYPE"));St["b"].Utils.DOM.setStyle(u,e);St["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");St["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_CELLS"));St["b"].Utils.DOM.setStyle(p,e);St["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");St["b"].$(g).html(v.getTranslation("ORIENTATION"));g.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_ORIENTATION"));St["b"].Utils.DOM.setStyle(g,e);St["b"].Utils.DOM.setStyle(g,t);g.setAttribute("width","81px");g.style.textAlign="center";s.appendChild(g);var m=document.createElement("td");St["b"].$(m).html("+");m.setAttribute("title",v.getTranslation("HELP_LINK_AXIS_PLUS"));St["b"].$(m).css("cursor","pointer");St["b"].$(m).click(function(){!f.linkSettings.automaticLinking&&h.addLinkGroup("axis")});St["b"].Utils.DOM.setStyle(m,e);s.appendChild(m);n.appendChild(s);i.appendChild(n);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");St["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var n=document.createElement("table");n.setAttribute("cellSpacing","5px");n.setAttribute("ID","valueLinkingTable");var a=document.createElement("div");a.style.padding="0px 1px";St["b"].$(a).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"};St["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");St["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");St["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_LINK"));St["b"].Utils.DOM.setStyle(c,e);St["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");St["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_TYPE"));St["b"].Utils.DOM.setStyle(u,e);St["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");St["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_CELLS"));St["b"].Utils.DOM.setStyle(p,e);St["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");St["b"].$(g).html("+");g.setAttribute("title",v.getTranslation("HELP_LINK_VALUE_PLUS"));St["b"].$(g).click(function(){!f.linkSettings.automaticLinking&&h.addLinkGroup("value")});St["b"].Utils.DOM.setStyle(g,e);s.appendChild(g);n.appendChild(s);i.appendChild(n);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");St["b"].Utils.DOM.setStyle(i,{overflow:"auto",width:"100%",height:O+"px"});var n=document.createElement("table");n.setAttribute("cellSpacing","5px");n.setAttribute("ID","legendLinkingTable");var a=document.createElement("div");a.style.padding="0px 1px";St["b"].$(a).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"};St["b"].Utils.DOM.setStyle(o,l);r.appendChild(o);var s=document.createElement("tr");var d=document.createElement("td");St["b"].Utils.DOM.setStyle(d,e);d.setAttribute("width","10px");s.appendChild(d);var c=document.createElement("td");St["b"].$(c).html(v.getTranslation("LINK"));c.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_LINK"));St["b"].Utils.DOM.setStyle(c,e);St["b"].Utils.DOM.setStyle(c,t);s.appendChild(c);var u=document.createElement("td");St["b"].$(u).html(v.getTranslation("TYPE"));u.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_TYPE"));St["b"].Utils.DOM.setStyle(u,e);St["b"].Utils.DOM.setStyle(u,t);s.appendChild(u);var p=document.createElement("td");St["b"].$(p).html(v.getTranslation("CELLS"));p.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_CELLS"));St["b"].Utils.DOM.setStyle(p,e);St["b"].Utils.DOM.setStyle(p,t);s.appendChild(p);var g=document.createElement("td");St["b"].$(g).html(v.getTranslation("ORIENTATION"));g.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_ORIENTATION"));St["b"].Utils.DOM.setStyle(g,e);St["b"].Utils.DOM.setStyle(g,t);g.setAttribute("width","81px");g.style.textAlign="center";s.appendChild(g);var m=document.createElement("td");St["b"].$(m).html("+");m.setAttribute("title",v.getTranslation("HELP_LINK_LEGEND_PLUS"));St["b"].$(m).click(function(){!f.linkSettings.automaticLinking&&h.addLinkGroup("legend")});St["b"].Utils.DOM.setStyle(m,e);s.appendChild(m);n.appendChild(s);i.appendChild(n);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=f.linkSettings;a.buildTableRow(t,[{type:"text",value:v.getTranslation("AUTO_LINKING")},{type:"checkbox",change:autoLinkingHandle,id:"automaticLinkingCheck",checked:e.automaticLinking}]);a.buildTableRow(t,[{type:"separator"},{type:"separator"}]);a.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")]}]);a.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:E,translations:[v.getTranslation("TOP"),v.getTranslation("MID"),v.getTranslation("BOTTOM")]}]);a.buildTableRow(t,[{type:"separator"},{type:"separator"}]);a.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")]}]);a.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){f.linkSettings.automaticLinking=e.currentTarget.checked;while(t.hasChildNodes()){t.removeChild(t.firstChild)}updateLinkingSettingsTable(t);h.showExistingLinks();St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}function onChangeDropdown(e){f.linkSettings[e.currentTarget.id]=we["a"].translateValue(e.currentTarget.value);while(t.hasChildNodes()){t.removeChild(t.firstChild)}updateLinkingSettingsTable(t);St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}}function deleteXYFromLink(){for(var e in f.linkGroups){var t=f.linkGroups[e];delete t.x;delete t.y}}};St["b"].UI=St["b"].UI||{};St["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=St["b"].DataObjects.RuntimeDO;var u=new St["b"].Utils.Calculator(t);var p=490;var g=300;var m=6;var h=c.getTranslation("INPUT_LIST_DEFINITIONS");var f,v,b,T,E;var a=[c.getTranslation("LINE"),"",c.getTranslation("DESCRIPTION"),c.getTranslation("KEY"),c.getTranslation("DEFAULT")];var r={backgroundColor:"rgb(240, 240, 240)",border:"0px"};var x={backgroundColor:"rgb(240, 240, 240)",border:"0px",color:"rgb(150,150,150)"};var C="Auto",y=c.getTranslation("NEW_ENTRY");var M=3;var S=2;var O=[0,16,175,175,0];var L="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 n=new St["b"].UI.HiCoDialogDefinition(t,h,i);f=n.getFontSize();n.setWidth(p+"px");n.setHeight(g);n.setPosition("center");v=new St["b"].UI.HiCoDialog(n);b=v.getDialogDiv();var a={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var r=document.createElement("div");r.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(r,a);r.style.fontSize=f;b.appendChild(r);v.setEvent("dialogresize",function(e,t){var i=St["b"].$(b).parent().height()-70;var n=St["b"].$(b).parent().width();St["b"].$(b).height(i);St["b"].$(E).height(i-39);St["b"].$(T).width(n-m-m);St["b"].$(E).width(n-m-m)});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");St["b"].$(E.children[0]).sortable()}else{e.parentNode.remove(e);s.open()}};s.okay=function(){if(checkForNonDuplicates()){if(saveInput()){s.close()}else{St["b"].Factories.DialogFactory.createMissingFieldDialog()}}else{St["b"].Factories.DialogFactory.createDuplicateEntriesDialog()}};s.close=function(){v.close()};function calculateLengths(){var e=document.getElementById("hiddenDiv");for(var t=0,i=a.length;t<i;t++){St["b"].$(e).html(a[t]);var n=e.clientWidth+1;if(O[t]<n){O[t]=n}}}function linkScrollBar(){T.scrollLeft=E.scrollLeft}function saveInput(){d.listContent=[];d.listContent.push({description:c.getTranslation("CHOOSE"),key:"choose",originalDescription:c.getTranslation("CHOOSE")});var e,t,i,n,a="choose";var r=St["b"].$(E).find("tr");for(e=0,t=r.length;e<t;e++){if(!St["b"].$(r[e]).hasClass("dummyRow")){i=u.encode(r[e].cells[M].children[0].value);n=r[e].cells[S].children[0].value;d.listContent.push({description:i,key:u.encode(n),originalDescription:i});if(i==undefined||i===""||i===y){return false}if(n==undefined||n===""||n===C){return false}if(r[e].cells[4].children[0].checked){a=u.encode(n)}}}d.listContentDefault=a;o.setListKeyDialog(d,l);return true}function fillContent(){var e=document.createElement("div");e.setAttribute("id","keyDialogDiv");St["b"].$(e).addClass("ui-corner-bottom");St["b"].$(e).css({border:"1px solid rgb(170, 170, 170)"});createHeader();e.appendChild(T);createTable();e.appendChild(E);return e}function createHeader(){T=document.createElement("div");T.setAttribute("id","keyDialogHeaderDiv");St["b"].$(T).css({height:"20px",width:p-m-m+"px",overflow:"hidden",padding:"0 6px"});var e=document.createElement("table");var t=[{type:"text",value:a[0],tdStyle:{padding:L,width:O[0]+"px",minWidth:O[0]+"px"}},{type:"text",value:a[1],tdStyle:{padding:L,width:O[1]+"px",minWidth:O[1]+"px"}},{type:"text",value:a[3],tdStyle:{padding:L,width:O[S]+"px",minWidth:O[S]+"px"}},{type:"text",value:a[2],tdStyle:{padding:L,width:O[M]+"px",minWidth:O[M]+"px",marginRight:"20px"}},{type:"text",value:a[4],tdStyle:{padding:L,width:O[4]+"px",minWidth:O[4]+"px",marginRight:"20px"}}];v.buildTableRow(e,t);t=[{type:"separator",color:"lightGray",tdStyle:{padding:L,width:O[0]+"px",minWidth:O[0]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:L,width:O[1]+"px",minWidth:O[1]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:L,width:O[2]+"px",minWidth:O[2]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:L,width:O[3]+"px",minWidth:O[3]+"px"}},{type:"separator",color:"lightGray",tdStyle:{padding:L,width:O[4]+"px",minWidth:O[4]+"px",marginRight:"20px"}}];v.buildTableRow(e,t);T.appendChild(e)}function createTable(){E=document.createElement("div");E.setAttribute("id","keyDialogTableDiv");St["b"].$(E).css({height:"165px",width:p-m-m+"px",overflow:"auto",padding:"6px"});var e=document.createElement("table");St["b"].$(E).scroll(function(){linkScrollBar()});var t=d.listContent?d.listContent:[];var i=d.listContentDefault?d.listContentDefault:"choose";for(var n=1,a=t.length;n<a;n++){var r=t[n];var o=i===t[n].key;var l=r.key?r.key:C;var s=createRows(n,l,r.originalDescription,o);v.buildTableRow(e,s)}addNewDummyRow(e);E.appendChild(e)}function createRows(e,t,i,n){var a=[{type:"iconbutton",id:e+"##delete",iconName:"delete_small.png",click:deleteRow,tooltip:c.getTranslation("HELP_TABLE_LISTKEYDIALOG_DELETE"),tdStyle:{padding:L,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:L,width:O[1]+"px",minWidth:O[1]+"px",textAlign:"center"}},{type:"textinput",id:e+"##key",value:u.decode(t),length:25,style:t===C?x:r,focusIn:autoFocusIn,focusOut:checkDescription,tdStyle:{padding:L,width:O[S]+"px",minWidth:O[S]+"px",textAlign:"center"}},{type:"textinput",id:e+"##description",value:u.decode(i),length:25,style:i===y?x:r,focusIn:entryFocusIn,focusOut:autoFocusOut,tdStyle:{padding:L,width:O[M]+"px",minWidth:O[M]+"px",textAlign:"center"}},{type:"checkbox",id:e+"##default",checked:n,click:handleDefault,group:"entryDefaultGroup",tooltip:c.getTranslation("HELP_TABLE_LISTKEYDIALOG_DEFAULT"),tdStyle:{padding:L,textAlign:"center",width:O[4]+"px",minWidth:O[4]+"px"}}];return a}function handleDefault(){var e=St["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=St["b"].$(E).find("tr");var t={},i,n;for(i=0,n=e.length;i<n;i++){if(t[e[i].children[S].children[0].value]){return false}t[e[i].children[S].children[0].value]=true}return true}function autoFocusIn(){this.style.color="";if(this.value===C){this.value=""}}function entryFocusIn(){this.style.color="";if(this.value===y){this.value=""}}function autoFocusOut(){if(this.value===""){this.value=y;this.style.color="rgb(150,150,150)"}if(this.value===""){this.value=y;this.style.color="rgb(150,150,150)";if(St["b"].$(this).closest("tr")[0].children[S].children[0].value===C){St["b"].$(this).closest("tr").addClass("dummyRow");removeDummyRow()}}else if(St["b"].$(this).closest("tr").hasClass("dummyRow")){St["b"].$(this).closest("tr").removeClass("dummyRow");St["b"].$(this).closest("tr").find('input[id*="##default"]').show();St["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;St["b"].$(this).closest("tr").remove();if(t){var i=St["b"].$(E).find("tr");for(var n=0,a=i.length;n<a;n++){if(!St["b"].$(i[n]).hasClass("dummyRow")){i[n].children[4].children[0].checked=true;break}}}if(checkForNonDuplicates()){updateRowColorsNoDuplicates()}}function updateRowColorsNoDuplicates(){var e=St["b"].$(E).find("tr");for(var t=0,i=e.length;t<i;t++){if(!St["b"].$(e[t]).hasClass("dummyRow")){e[t].children[S].children[0].style.color=""}}}function getNewIdx(e){var t=0;for(var i=0,n=e.length;i<n;i++){var a=parseInt(e[i].children[0].children[0].id.split("##")[0]);if(t<=a){t=a+1}}return t}function checkDescription(){if(checkValue(this)){this.style.color="rgb(255, 0, 0)"}if(this.value===""){this.value=C;this.style.color="rgb(150,150,150)";if(St["b"].$(this).closest("tr")[0].children[M].children[0].value===y){St["b"].$(this).closest("tr").addClass("dummyRow");removeDummyRow()}}else if(St["b"].$(this).closest("tr").hasClass("dummyRow")){St["b"].$(this).closest("tr").removeClass("dummyRow");St["b"].$(this).closest("tr").find('input[id*="##default"]').show();St["b"].$(this).closest("tr").find('input[id*="##delete"]').show();addNewDummyRow()}}function checkValue(e){var t=St["b"].$(E).find("tr");for(var i=0,n=t.length;i<n;i++){if(e.id!==t[i].children[S].children[0].id&&t[i].children[S].children[0].value===e.value){return true}}return false}function removeDummyRow(){var e=St["b"].$(E).find(".dummyRow");if(e.length>1){for(var t=1,i=e.length;t<i;t++){var n=e[t];St["b"].$(n).remove()}}St["b"].$(e[0]).find('input[id*="##default"]')[0].disabled=true}function addNewDummyRow(e){var t=e;if(!t){t=E.children[0]}var i=getNewIdx(t.children);var n=createRows(i,C,y,false);v.buildTableRow(t,n);var a=t.children[t.children.length-1];St["b"].$(a).addClass("dummyRow");St["b"].$(a).find('input[id*="##default"]').hide();St["b"].$(a).find('input[id*="##delete"]').hide()}};St["b"].UI=St["b"].UI||{};St["b"].UI.IndicationDialog=function(){var u=this;var y=St["b"].DataObjects.RuntimeDO;var s;var M;var c=y.getTranslation("INDICATIONS");var p;var g;var m=18;var a=false;var h;var S=St["b"].Utils.Constants.TypeValues.highlightType;var f=St["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 n=["","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:y.getTranslation("COMPARES"),tooltip:y.getTranslation("HELP_INDICATIONS_COMPARE"),buildUp:createCompareTab},{id:"comp-tabs-highlight",text:y.getTranslation("HIGHLIGHTS"),tooltip:y.getTranslation("HELP_INDICATIONS_HIGHLIGHT"),buildUp:createHighlightTab}];var b=["function","active","condition","name","context","chart"];var T=["",y.getTranslation("ACTIVE"),y.getTranslation("CONDITION"),y.getTranslation("NAME"),y.getTranslation("EXTENSION"),y.getTranslation("CHART")];var O=[0,0,0,0,0,0];var L;var E;var x;var A;var _;update();u.open=function(e){var t="indicationDialog";var i=St["b"].$(e).offset();var n=[{text:y.getTranslation("OKAY"),id:"indicationDialogOkayButton",click:okay},{text:y.getTranslation("CANCEL"),id:"indicationDialogCancelButton",click:cancel},{text:y.getTranslation("APPLY"),id:"indicationDialogApplyButton",click:assume}];var a=new St["b"].UI.HiCoDialogDefinition(t,c,n);M=a.getFontSize();a.setPosition([i.left,i.top]);a.setWidth(710);a.setHeight(350);a.setResizable(true);a.setParentDomElement(e.parentNode);a.setTooltip(y.getTranslation("HELP_INDICATIONS"));g=new St["b"].UI.HiCoDialog(a);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");St["b"].Utils.DOM.setStyle(o,r);o.style.fontSize=M;p.appendChild(o);calculateLength();h=g.buildTabs("compCompareTabDiv",v,p,"auto",{top:"0px",left:"0px"},null,true);g.decorateTabs(0,v);St["b"].$(h).height("100%");g.setEvent("dialogresize",function(e,t){var i=St["b"].$(p).parent().height()-70;St["b"].$(p).height(i);St["b"].$(".ui-tabs-panel",St["b"].$(p).parent()).height(i-St["b"].$("#compCompareTabDiv > .ui-tabs-nav").height()-m)});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");St["b"].$(".ui-tabs-panel",St["b"].$(p).parent()).css("overflow-y","auto");var d=St["b"].$(p).height()-St["b"].$("#compCompareTabDiv > .ui-tabs-nav").height();St["b"].$(".ui-tabs-panel",St["b"].$(p).parent()).height(d-m)};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<L.length;t++){var i=St["b"].DataObjects.DocumentDO.getExtension(L[t].extensionId);var n=L[t].comp.id.split(".")[0];n=n.replace("tableContainer","chart").replace("containerModel","");var a=St["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),n);var r=checkChart(L[t],a,t);e[i.getId()]=i;for(var o=0;o<r.extendedModel.compares.length;o++){if(r.extendedModel.compares[o].id===L[t].comp.id){r.extendedModel.compares[o]=clone(L[t].comp);break}}}for(var t=0;t<E.length;t++){var i=St["b"].DataObjects.DocumentDO.getExtension(E[t].extensionId);var a=St["b"].Factories.ModelFactory.getModelById(i.getController().getRootModel(),E[t].highlight.id.split(".")[0]);var r=checkContextAndChart(E[t],a,t);e[i.getId()]=i;for(var o=0;o<r.extendedModel.highlights.length;o++){if(r.extendedModel.highlights[o].id===E[t].highlight.id){r.extendedModel.highlights[o]=clone(E[t].highlight);break}}}for(var l in e){if(e.hasOwnProperty(l)){e[l].getController().updateLayoutDefinition()}}}function cancel(){St["b"].$("#highlightProperties").remove();St["b"].$("#compareProperties").remove();L=[];E=[];x=[];A=[];_=[];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)}L=[];E=[];x=[];A=[];_=[];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 n=t.containerModel;L[i].comp=e;checkForPlausability(L[i],n,i)};u.setHighlight=function(e,t){var i=t.idx;var n=t.containerModel;E[i].highlight=clone(e);checkHighlightPlausability(E[i],n,i)};u.getDialog=function(){return g};u.getAvailCompares=function(){return L};u.setActiveTab=function(e){return St["b"].$(h).tabs("option","selected",e)};u.getAvailHighlights=function(){return E};u.update=function(){update();rebuildTabs()};St["b"].UI.IndicationDialog.iconAction=function(e,t,i){var n=e.target;var a=n.id.split("##");switch(a[1]){case"descIcon":i.count=St["b"].$(n).hasClass("active")?1:0;break;case"ascIcon":i.count=St["b"].$(n).hasClass("active")?1:2;break}};St["b"].UI.IndicationDialog.changeIconFromOutside=function(e){var t=e.config.sortList;var i=St["b"].$(e).find(".sortIcon").removeClass("active");for(var n=0;n<i.length;n++){i[n].src=i[n].id.split("##")[1]==="descIcon"?Se["a"].imgPath+"descending.png":Se["a"].imgPath+"ascending.png";for(var a=0;a<t.length;a++){if(t[a][0]!==parseInt(i[n].id.split("##")[2])){continue}if(t[a][1]===1||t[a][1]==="d"){if(i[n].id.split("##")[1]==="descIcon"){i[n].src=Se["a"].imgPath+"descending_active.png";St["b"].$(i[n]).addClass("active")}}else if(t[a][1]===0||t[a][1]==="a"){if(i[n].id.split("##")[1]==="ascIcon"){i[n].src=Se["a"].imgPath+"ascending_active.png";St["b"].$(i[n]).addClass("active")}}}}};St["b"].UI.IndicationDialog.getDialog=function(){return u};function update(){s=St["b"].DataObjects.DocumentDO.getAllExtensions();getAvailCompares();getAvailHighlights();x=St["b"].DataObjects.DocumentDO.getAllExtensions().filter(function(e){return e.getController().getRootModel().firstObjectGrid!==null});A=[];_=[];for(var e=0;e<x.length;e++){A.push(x[e].getId());_.push(x[e].getTitle())}}function checkContextAndChart(e,t,i){var n=e.highlight;var a=n.id+"."+i;var r=x[document.getElementById("select##"+a+"##highlightContext").selectedIndex];var o=r.getController().getRootModel();var l=[];if(o.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(o.firstObjectGrid,l)}var s=document.getElementById("select##"+a+"##highlightChart").selectedIndex;var d=l[s];if(d&&(r.getId()!==e.extensionId||d.id!==n.id.split(".")[0])){var c=clone(n);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=St["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(d.extendedModel.highlights);c.id=d.id+".highlight."+g;c.name=c.id;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(d.extendedModel,c);St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(t.extendedModel,n.id);n.id=c.id;n.name=c.name;n.value.keyfigure=c.value.keyfigure;n.legend.keyfigure=c.legend.keyfigure;e.extensionId=r.getId();return d}return t}function checkChart(e,t,i){var n=e.comp;var a=n.id+"."+i;var r=x[document.getElementById("select##"+a+"##context").selectedIndex];var o=r.getController().getRootModel();var l=[];if(o.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(o.firstObjectGrid,l)}var s=document.getElementById("select##"+a+"##chart").selectedIndex;var d=l[s];var c=n.id.split(".")[0];c=c.replace("tableContainer","chart").replace("containerModel","");if(d&&(r.getId()!==e.extensionId||d.id!==c)){var u=clone(n);var p=St["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=St["b"].DataObjects.DocumentDO.getExtension(e.extensionId);var a=n.id.split(".")[0];var m="COMP:"+g.getId()+"#ctx1#"+a+"#"+n.id.split(".").pop();var h=St["b"].DataObjects.DocumentDO.getVariableByDefinition(m);if(h){h.definition="COMP:"+r.getId()+"#ctx1#"+u.id.split(".")[0]+"#"+u.id.split(".").pop()}St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(d.extendedModel,u);St["b"].DataObjects.CommentRepo.updateCompareReference(g.getId(),r.getId(),n.id,u);St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeCompare(t.extendedModel,n.id);n.id=u.id;e.extensionId=r.getId();n.name=u.name;var f=St["b"].DataObjects.ContextRepo.getContextByCid(d.extendedModel.contextId);for(var v=0;v<f.columns.length;v++){if(f.columns[v].id.split(".").pop()===n.from.split("#").pop()){n.fromAbsolutePosition.positionInGroup=v}if(f.columns[v].id.split(".").pop()===n.to.split("#").pop()){n.toAbsolutePosition.positionInGroup=v}}return d}return t}function rebuildTabs(){if(St["b"].$(p).dialog("isOpen")===true){calculateLength();var e=St["b"].$("#compareTable")[0].config.sortList;St["b"].$("#comp-tabs-compares").html(createCompareTab());St["b"].$("#compareTable").trigger("sorton",[e]);e=St["b"].$("#highlightTable")[0].config.sortList;St["b"].$("#comp-tabs-highlight").html(createHighlightTab());St["b"].$("#highlightTable").trigger("sorton",[e])}}function clone(e){return JSON.parse(JSON.stringify(e))}function checkForPlausability(e,t,i){var n=e.comp.from;var a=e.comp.to;var r=n.split("#");var o=a.split("#");n=r[0].split("@");a=o[0].split("@");var l=n.length;var s=St["b"].DataObjects.ContextRepo.getContextByCid(t.extendedModel.contextId);if(!s||l!==s.rows.length){if(e.comp.compareFromPos!==f.POSITION&&e.comp.compareToPos!==f.POSITION){markElement(e.comp,i);return}}var d=false;var c=false;if(n[0]===f.AXIS){d=true}if(a[0]===f.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 n=St["b"].DataObjects.ContextRepo.getContextByCid(t.extendedModel.contextId);if(e.type===S.VALUE){if(e.value.category!==f.POSITION){var a=e.value.path.split("@");if(!n||a.length!==n.rows.length){markElement(e,i);return}}if(e.value.type!==f.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===S.CATEGORY_LABEL){var a=e.categoryLabel.path.split("@");if(!n||a.length!==n.rows.length){markElement(e,i);return}}else if(e.type===S.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(){E=[];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 n=[];St["b"].Models.Actions.ViewModelActions.General.getAllCharts(i.firstObjectGrid,n);for(var a=0;a<n.length;a++){var r=n[a].extendedModel;for(var o=0;o<r.highlights.length;o++){var l=clone(r.highlights[o]);E.push({extensionId:t.getId(),highlight:l})}}}}}function getAvailCompares(){L=[];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 n=[];St["b"].Models.Actions.ViewModelActions.General.getAllCharts(i.firstObjectGrid,n);for(var a=0;a<n.length;a++){var r=n[a].extendedModel;for(var o=0;o<r.compares.length;o++){var l=clone(r.compares[o]);L.push({comp:l,extensionId:t.getId()})}}}}}function setCharts(e){var t=[];var i=[];for(var n=0;n<e.length;n++){var a=e[n].name?e[n].name:e[n].id;i.push(a);t.push(e[n].id)}return{names:i,ids:t}}function closeInput(e){if(a){return}a=true;var t=e.parentNode;var i=e.value;St["b"].$(e).remove();t.innerHTML=i;var n=t.id.split("##");if(n[1].indexOf("compare")!==-1){L[n[1].split(".").pop()].comp.name=i}else if(n[1].indexOf("highlight")!==-1){E[n[1].split(".").pop()].highlight.name=i}}function addInput(e){if(e.getElementsByTagName("input").length>0){return}a=false;var t=e.innerHTML;e.innerHTML="";var i=15;var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("size",i.toString());n.setAttribute("maxlength",i.toString());n.setAttribute("value",t);n.style.fontSize=2;n.style.fontWeight=12;St["b"].$(n).on("focusout",function(e){closeInput(e.target)});St["b"].$(n).on("keydown",function(e){if(e.which===13){closeInput(e.target)}});e.appendChild(n);n.focus()}u.openCompareProperties=function(e,t){var i=t.getController().getRootModel();var n=e.id.split(".")[0].replace("tableContainer","chart").replace("containerModel","");var a=St["b"].Factories.ModelFactory.getModelById(i,n);if(!a){console.warn("IndicationDialog.openCompareProperties: could not locate chart");return}var r=-1,o=null;for(var l=0;l<L.length;l++){if(L[l].comp.id===e.id&&L[l].extensionId===t.getId()){r=l;o=L[l].comp;break}}if(!o){console.warn("IndicationDialog.openCompareProperties: could not locate compare");return}var s={extension:t,containerModel:a,idx:r,currComp:o,dialogObj:g,availCompares:L};var d=new St["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 n=x[i];var a=n.getController().getRootModel();var r=[];if(a.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(a.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=L[l];if(s){var d={extension:n,containerModel:o,idx:l,currComp:s.comp,dialogObj:g,availCompares:L};var c=new St["b"].UI.CompareProperties(d);c.open(u)}}}u.openHighlightProperties=function(e,t,i){var n=-1,a=null;for(var r=0;r<E.length;r++){var o=E[r];if(o.highlight.id===e.id&&o.extensionId===i.getId()){n=r;a=o.highlight;break}}if(!a){console.warn("IndicationDialog.openHighlightProperties: could not locate highlight");return}var l={extension:i,idx:n,highlight:a,dialogObj:g,containerModel:t};var s=new St["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 n=x[i];var a=n.getController().getRootModel();var r=[];if(a.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(a.firstObjectGrid,r)}var i=document.getElementById("select##"+t+"##highlightChart").selectedIndex;var o=r[i];if(o){var l=t.split(".").pop();var s=E[l];var d={extension:n,idx:l,highlight:s.highlight,dialogObj:g,containerModel:o};var c=new St["b"].UI.HighlightProperties(d);c.open(u)}}function openFormulaEditor(e,t){var i=e.target.id.split("##")[1];var n,a,r,o,l,s,d;if(t===S.COMPARE){n=L[i.split(".").pop()];a=n.comp.name?n.comp.name:n.comp.id;s=n.comp.id;d=n.comp}else if(t===S.HIGHLIGHT){n=E[i.split(".").pop()];a=n.highlight.name?n.highlight.name:n.highlight.id;s=n.highlight.id;d=n.highlight}r=St["b"].DataObjects.DocumentDO.getExtension(n.extensionId);o=St["b"].Factories.ModelFactory.getModelById(r.getController().getRootModel(),i.split(".")[0]);l={extension:r,cid:o.extendedModel.contextId,parentDialog:u,title:a,expressionObject:d,functionTarget:s,type:t};var c=new St["b"].UI.ValueLabelShowFormulaDialog(l);c.open(e.target)}function copyCompare(e){var t=e.target.id.split("##");var i=L[t[1].split(".").pop()];if(i){var n=clone(i.comp);var a=St["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var r=St["b"].Factories.ModelFactory.getModelById(a.getController().getRootModel(),t[1].split(".")[0]);var o=St["b"].Models.Actions.ViewModelActions.CompareModel.getNewId(r.extendedModel.compares);n.id=r.id+".compare"+o;n.name=n.id;n.isUserLayouted=false;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(r.extendedModel,n);a.getController().updateLayoutDefinition();u.update()}}function removeCompare(o){St["b"].UI.HiCoConfirm(y.getTranslation("CONFIRM_REMOVE_COMPARE"),function(e){if(e===true){var t=o.target.id.split("##");var i=L[t[1].split(".").pop()];if(i){var n=St["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var a=n.getController();var r={model:i.comp,extension:n};a.dispatch("deleteCompareAction",r)}}})}function copyHighlight(e){var t=e.target.id.split("##")[1];var i=E[t.split(".").pop()];if(i){var n=clone(i.highlight);var a=St["b"].DataObjects.DocumentDO.getExtension(i.extensionId);var r=St["b"].Factories.ModelFactory.getModelById(a.getController().getRootModel(),t.split(".")[0]);var o=St["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(r.extendedModel.highlights);n.id=r.id+".highlight."+o;n.name=n.id;n.active=false;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(r.extendedModel,n);u.update()}}function removeHighlight(e){var e=e.split("##")[1];var t=e.split(".")[0];var i=e.split(".").pop();var n=E[i];E.splice(i,1);var a=St["b"].DataObjects.DocumentDO.getExtension(n.extensionId);var r=St["b"].Factories.ModelFactory.getModelById(a.getController().getRootModel(),t);St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(r.extendedModel,n.highlight.id);a.getController().updateLayoutDefinition();a.paint()}function chartChangeHandler(e,t){var i=e.target;var n=e.target.id.split("##");var a=t===S.COMPARE?"##context":"##highlightContext";var r=document.getElementById("select##"+n[1]+a).selectedIndex;var o=x[r];var l=o.getController().getRootModel();var s=[];if(l.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(l.firstObjectGrid,s)}var d=s[i.selectedIndex];if(t===S.COMPARE){var c=L[n[1].split(".").pop()];if(c){checkForPlausability(c,d,n[1].split(".").pop())}}else if(t===S.HIGHLIGHT){var u=E[n[1].split(".").pop()];if(u){checkHighlightPlausability(u,d,n[1].split(".").pop())}}}function contextChangeHandler(e,t){var i=e.target;var n=i.id.split("##");var a=x[i.selectedIndex];var r=a.getController().getRootModel();var o=[];if(r.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(r.firstObjectGrid,o)}var l=t===S.COMPARE?"##chart":"##highlightChart";var s=document.getElementById("select##"+n[1]+l);var d=o[s.selectedIndex];s.options.length=0;if(o.length===0){var c=document.createElement("option");St["b"].$(c).html(y.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;St["b"].$(c).html(p);s.appendChild(c)}if(d){if(t===S.COMPARE){var g=L[n[1].split(".").pop()];if(g){checkForPlausability(g,d,n[1].split(".").pop())}}else if(t===S.HIGHLIGHT){var m=E[n[1].split(".").pop()];if(m){checkHighlightPlausability(m,d,n[1].split(".").pop())}}}}function calculateLength(){var e=document.getElementById("hiddenDiv");for(var t=0;t<b.length;t++){St["b"].$(e).html(T[t]);O[t]=e.clientWidth+1}for(var t=0;t<L.length;t++){St["b"].$(e).html(L[t].comp.id);var i=e.clientWidth+35;if(i>O[3]){O[3]=i}}for(var t=0;t<E.length;t++){St["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);St["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}}});St["b"].UI.IndicationDialog.changeIconFromOutside(t);return e}function createHeader(e,t){e.setAttribute("class","tablesorter");var i=e.createTHead();var n=document.createElement("tr");var a=document.createElement("tr");a.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"};St["b"].Utils.DOM.setStyle(o,d);St["b"].Utils.DOM.setStyle(l,d);St["b"].$(o).html(T[r]);if(r!==0){o.setAttribute("title",y.getTranslation(t[r]))}if(r===1||r===3){var c=document.createElement("td");var u=St["b"].Utils.DOM.createIconButton(c,b[r]+"##ascIcon##"+r,"","",M,Se["a"].imgPath+"ascending.png",y.getTranslation("SORT_ORDER_ASC"));u.className="sortIcon";St["b"].$(u).css({"padding-left":"3px"});o.appendChild(c);c=document.createElement("td");var p=St["b"].Utils.DOM.createIconButton(c,b[r]+"##descIcon##"+r,"","",M,Se["a"].imgPath+"descending.png",y.getTranslation("SORT_ORDER_DESC"));p.className="sortIcon";o.appendChild(c)}var g=document.createElement("span");g.style.margin="0px";St["b"].$(g).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(g);a.appendChild(l);n.appendChild(o)}i.appendChild(n);i.appendChild(a);return e}function createCompareTable(e){var t=document.createElement("tbody");for(var i=0;i<L.length;i++){var n=L[i].comp;var a=n.id+"."+i;var r=document.createElement("tr");r.setAttribute("id",a+"##general");var o={width:O[0]+"px",minWidth:O[0]+"px",textAlign:"center"};var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,o);var s=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##edit","","",M,Se["a"].imgPath+"pencil.png",y.getTranslation("EDIT"));s.className="icon";s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_EDIT"));St["b"].$(s).click(function(e){openCompareProperties(e)});var d=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##copy","","",M,Se["a"].imgPath+"page_white_copy.png",y.getTranslation("COPY"));d.className="icon";d.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_COPY"));St["b"].$(d).click(function(e){copyCompare(e)});var c=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##delete","","",M,Se["a"].imgPath+"delete.png",y.getTranslation("REMOVE"));c.className="icon";c.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_DELETE"));St["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");St["b"].Utils.DOM.setStyle(l,o);var u=n.active?"tick.png":"cross.png";var p=n.active?y.getTranslation("ACTIVE"):y.getTranslation("INACTIVE");var g=St["b"].Utils.DOM.createStateImg(l,"select##"+a+"##state",u,p,M);g.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_ACTIVE"));r.appendChild(l);l=document.createElement("td");o={width:O[2]+"px",minWidth:O[2]+"px",textAlign:"center"};var m=St["b"].Utils.DOM.createButtonInput(l,"select##"+a+"##condition","","fx",M);St["b"].Utils.DOM.setStyle(l,o);m.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_CONDITION"));St["b"].$(m).click(function(e){openFormulaEditor(e,S.COMPARE)});r.appendChild(l);l=document.createElement("td");l.setAttribute("id","select##"+a+"##name");l.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_NAME"));o={width:O[3]+"px",minWidth:O[3]+"px",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,o);St["b"].$(l).on("click",function(e){addInput(e.target)});St["b"].$(l).hover(function(){this.style.cursor="pointer";this.style.textDecoration="underline"},function(){this.style.cursor="auto";this.style.textDecoration="none"});n.name?St["b"].$(l).html(n.name):St["b"].$(l).html(n.id);l.style.whiteSpace="nowrap";r.appendChild(l);l=document.createElement("td");o={width:O[4]+"px",minWidth:O[4]+"px",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,o);var h=St["b"].Utils.DOM.createSelectBox(l,"select##"+a+"##context",A,_,L[i].extensionId,M,"250px");h.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_CONTEXT"));St["b"].$(h).on("change",function(e){contextChangeHandler(e,S.COMPARE)});r.appendChild(l);l=document.createElement("td");o={width:O[5]+"px",minWidth:O[5]+"px",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,o);var f=St["b"].DataObjects.DocumentDO.getExtension(L[i].extensionId);var v=f.getController().getRootModel();var b=[];if(v.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(v.firstObjectGrid,b)}var T=setCharts(b);var E=T.names;var x=T.ids;var C=a.split(".")[0];C=C.replace("tableContainer","chart").replace("containerModel","");var h=St["b"].Utils.DOM.createSelectBox(l,"select##"+a+"##chart",x,E,C,M,"100px");h.setAttribute("title",y.getTranslation("HELP_INDICATIONS_COMPARE_CHART"));St["b"].$(h).on("change",function(e){chartChangeHandler(e,S.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,n);t=createHighlightTable(t);e.appendChild(t);St["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}}});St["b"].UI.IndicationDialog.changeIconFromOutside(t);return e}function createHighlightTable(e){var t=document.createElement("tbody");for(var i=0;i<E.length;i++){var n=E[i].highlight;var a=n.id+"."+i;var r=document.createElement("tr");r.setAttribute("id",a+"##general");var o={width:O[0]+"px",minWidth:O[0]+"px",textAlign:"center"};var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,o);var s=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##edit","","",M,Se["a"].imgPath+"pencil.png",y.getTranslation("EDIT"));s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_EDIT"));s.className="icon";St["b"].$(s).click(function(e){openHighlightProperties(e)});s=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##copy","","",M,Se["a"].imgPath+"page_white_copy.png",y.getTranslation("COPY"));s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_COPY"));s.className="icon";St["b"].$(s).click(function(e){copyHighlight(e)});s=St["b"].Utils.DOM.createIconButton(l,"select##"+a+"##delete","","",M,Se["a"].imgPath+"delete.png",y.getTranslation("REMOVE"));s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_DELETE"));s.className="icon";St["b"].$(s).click(function(t){St["b"].UI.HiCoConfirm(y.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");St["b"].Utils.DOM.setStyle(l,o);var d=n.active?"tick.png":"cross.png";var c=n.active?y.getTranslation("ACTIVE"):y.getTranslation("INACTIVE");s=St["b"].Utils.DOM.createStateImg(l,"select##"+a+"##highlightState",d,c,M);s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_ACTIVE"));r.appendChild(l);o={width:O[2]+"px",minWidth:O[2]+"px",textAlign:"center"};l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,o);s=St["b"].Utils.DOM.createButtonInput(l,"select##"+a+"##highlightCondition","","fx",M);s.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CONDITION"));St["b"].$(s).click(function(e){openFormulaEditor(e,S.HIGHLIGHT)});r.appendChild(l);o={width:O[3]+"px",minWidth:O[3]+"px",textAlign:"center",whiteSpace:"nowrap"};l=document.createElement("td");l.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_NAME"));l.setAttribute("id","select##"+a+"##name");St["b"].Utils.DOM.setStyle(l,o);St["b"].$(l).click(function(e){addInput(e.target)});St["b"].$(l).hover(function(){this.style.cursor="pointer";this.style.textDecoration="underline"},function(){this.style.cursor="auto";this.style.textDecoration="none"});n.name?St["b"].$(l).html(n.name):St["b"].$(l).html(n.id);r.appendChild(l);l=document.createElement("td");o={width:O[4]+"px",minWidth:O[4]+"px",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,o);var u=St["b"].Utils.DOM.createSelectBox(l,"select##"+a+"##highlightContext",A,_,E[i].extensionId,M,"250px");u.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CONTEXT"));St["b"].$(u).on("change",function(e){contextChangeHandler(e,S.HIGHLIGHT)});r.appendChild(l);l=document.createElement("td");o={width:O[5]+"px",minWidth:O[5]+"px",textAlign:"center"};St["b"].Utils.DOM.setStyle(l,o);var p=St["b"].DataObjects.DocumentDO.getExtension(E[i].extensionId);var g=p.getController().getRootModel();var m=[];if(g.firstObjectGrid){St["b"].Models.Actions.ViewModelActions.General.getAllCharts(g.firstObjectGrid,m)}var h=setCharts(m);var f=h.names;var v=h.ids;var b=n.id.split(".")[0];var u=St["b"].Utils.DOM.createSelectBox(l,"select##"+a+"##highlightChart",v,f,b,M,"100px");u.setAttribute("title",y.getTranslation("HELP_INDICATIONS_HIGHLIGHT_CHART"));St["b"].$(u).on("change",function(e){chartChangeHandler(e,S.HIGHLIGHT)});r.appendChild(l);t.appendChild(r)}e.appendChild(t);return e}};St["b"].UI.IndicationDialog.isOpen=function(){return document.getElementById("indicationDialog")?true:false};St["b"].UI=St["b"].UI||{};St["b"].UI.MultipleGridEditor=function(e){var i=this;var t=e.model;var n=e.type;var a=e.extension;var r=a.getCanvasDO().getDOMElement();var d=St["b"].DataObjects.RuntimeDO;var g,m,c;if(n==="time"){g=t.timeCellValueCount;m=t.timeCellCategoryCount;c=t.timeCellGridSizes}else{g=t[n+"CellCategoryCount"];m=t[n+"CellValueCount"];c=t[n+"CellGridSizes"]}var h=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 St["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 St["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 n={borderBottom:"1px solid grey",textAlign:"right"};var a=document.createElement("div");var r=document.createElement("table");St["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,m);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:n};o[1]={type:"textinput",id:"multipleGridEditorRowInput."+s.toString(10),value:(c.rows[s]*100).toFixed(1),length:4,maxLength:4,tdStyle:n,style:e,change:changeValueHandler};if(g===s+1){o[1].disabled=true}}else{o[0]={type:"empty"};o[1]={type:"empty"}}if(m>s){o[2]={type:"text",id:"multipleGridEditorColN."+s.toString(10),value:(s+1).toString(10),tdStyle:n};o[3]={type:"textinput",id:"multipleGridEditorColInput."+s.toString(10),value:(c.columns[s]*100).toFixed(1),length:4,maxLength:4,tdStyle:n,style:e,change:changeValueHandler};if(m===s+1){o[3].disabled=true}}else{o[2]={type:"empty"};o[3]={type:"empty"}}u.buildTableRow(r,o)}a.appendChild(r);return a}function changeValueHandler(e){var t=this.id.split(".");var i=parseInt(t[1]);var n=(this.id.indexOf("Row")===-1?m:g)-1;var a=this.id.indexOf("Row")===-1?"columns":"rows";var r=parseFloat(this.value)/100;if(isNaN(r)||r<0||r>1){this.value=(h[a][i]*100).toFixed(1);return}var o=0;for(var l=0;l<i;l++){o+=h[a][l]}if(o+r>1){this.value=(h[a][i]*100).toFixed(1);return}h[a][i]=r;var s=1-o-r;var d=0;for(var l=i+1;l<=n;l++){d+=h[a][l]}var c=d-s;for(var l=i+1;l<n;l++){var u=h[a][l]/d*c;c-=u;h[a][l]-=u;var p=document.getElementById(t[0]+"."+l.toString(10));p.value=(h[a][l]*100).toFixed(1)}h[a][l]-=c;var p=document.getElementById(t[0]+"."+n.toString(10));p.value=(h[a][n]*100).toFixed(1)}this.okay=function(){for(var e=0;e<g;e++){c.rows[e]=h.rows[e]}for(var e=0;e<m;e++){c.columns[e]=h.columns[e]}i.close()};this.close=function(){u.close()}};var Ue=r(662);St["b"].UI=St["b"].UI||{};St["b"].UI.NavigationMenu=function(i){var e=this;var g=i.extendedModel;if(!g){return}var m=new St["b"].Utils.Calculator(null),t=i.extension.getScope().getActionBlacklist(),n=t.indexOf("customClickBehaviour")===-1&&t.indexOf("*")===-1,h="Auto",a={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)"},f=[""].concat(St["b"].DataObjects.DocumentDO.getBIVariables().map(function(e){return e.name}).sort()),s=[{id:"default",text:St["b"].Utils.Translations.getTranslation("DEFAULT"),tooltip:"",buildUp:createClickBehaviorDefault}],d={check:[]};if(n){s.push({id:"custom",text:St["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");St["b"].Utils.DOM.setStyle(i,{borderCollapse:"separate",borderSpacing:"5px 0"});var n={borderBottom:"1px solid black"},a={borderBottom:"1px solid black",width:"100px"},r={borderBottom:"1px solid black",width:"160px"};e.buildTableRow(i,[{type:"text",value:St["b"].Utils.Translations.getTranslation("SET_THIS_VARIABLE"),tdStyle:r,tooltip:St["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_VARIABLE")},{type:"text",value:St["b"].Utils.Translations.getTranslation("DOTS_WITH"),tdStyle:a,tooltip:St["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_WITH")},{type:"text",value:St["b"].Utils.Translations.getTranslation("BI_SELECTION"),tdStyle:n,tooltip:St["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_QV_SELECTION")}]);var o=f.indexOf(g.navigationVariable.variable)>=0?g.navigationVariable.variable:"",l={marginLeft:"auto",display:"block",width:"100%"},s=g.navigationVariable.auto?"":m.decode(g.navigationVariable.value),d={textAlign:"center",verticalAlign:"middle"},c=s===""||s==="auto"?h:s;var u=e.buildTableRow(i,[{type:"selectbox",id:"navigationVariableSelect",value:o,values:f,translations:f,style:l,tooltip:St["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:St["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_SET_WITH")},{type:"checkbox",id:"useQVNav",group:"useQVNavG",value:"",checked:g.navigationVariable.useQVNav,tdStyle:d,tooltip:St["b"].Utils.Translations.getTranslation("HELP_CELL_CLICK_BEHAVIOUR_QV_SELECTION")}]);t.appendChild(i);if(c===h){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=St["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);Ue["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 n=document.createElement("div");n.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 a=document.createElement("label");a.innerText=e.text;a.title=e.tooltip;a.for=d.check[e.id].id;n.appendChild(d.check[e.id]);n.appendChild(a);i.appendChild(n);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=m.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(n){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===h){this.value=""}}function autoFocusOut(){if(this.value===""){this.value=h;this.style.color="rgb(150,150,150)"}}function getTextStyle(e){return e==null?r:a}};var Fe=r(139);St["b"].UI=St["b"].UI||{};St["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 m=null;var h=St["b"].DataObjects.RuntimeDO;var f={padding:"10px",fontFamily:h.getParameter("FONT_FAMILY"),position:"absolute",top:0+"px",height:"auto !important",left:0+"px",width:"auto !important",border:"1px solid black",backgroundColor:St["b"].Utils.Constants.Parameters.colorBackground,visibility:"hidden",zIndex:"100"};var v="12px";c.createSelectorDiv=function(){if(p.cellSelection.rowLength>0){St["b"].$("#selectorDiv").remove();m=document.createElement("div");St["b"].Utils.DOM.setStyle(m,f);m.setAttribute("id","selectorDiv");m.style.fontSize=v;u.parentNode.appendChild(m);St["b"].$("#selectorDiv").draggable();var e=document.createElement("span");St["b"].$(e).html("<b>Add Row</b><br><br>");m.appendChild(e);var t=document.createElement("table");t.setAttribute("cellSpacing","3px");t.setAttribute("cellPadding","3px");var i=document.createElement("tr");var n=document.createElement("label");n.setAttribute("id","rowTypeLabel");St["b"].$(n).html("&nbsp;&nbsp;Type&nbsp;&nbsp;");n.setAttribute("for","rowTypeSelect");var a=document.createElement("select");a.setAttribute("id","rowTypeSelect");for(var r=0;r<g.length;r++){var o=document.createElement("option");St["b"].$(o).html(g[r]);a.appendChild(o)}n.appendChild(a);i.appendChild(n);t.appendChild(i);m.appendChild(t);var l=document.createElement("span");St["b"].$(l).html("<br>");m.appendChild(l);var s=document.createElement("input");s.setAttribute("type","button");s.setAttribute("value",h.getTranslation("CANCEL"));s.style.fontSize=v;St["b"].$(s).bind("click",function(){c.closeSelector()});var d=document.createElement("input");d.setAttribute("type","button");d.setAttribute("value",h.getTranslation("OK"));d.style.fontSize=v;St["b"].$(d).bind("click",function(){c.changeSelections()});m.appendChild(d);m.appendChild(s);m.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 n=new Fe["a"].SpecialRowContent;n.row=e;n.contentType=i;c.shiftBackwards(e);p.specialRowContent.push(n);if(i==="total"&&e<p.rows){var a=new Fe["a"].SpecialRowContent;a.row=e+1;a.contentType="empty";c.shiftBackwards(e+1);p.specialRowContent.push(a)}}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(){St["b"].$("#tableAddRowSelector").draggable("destroy");St["b"].$(m).remove()}};St["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===St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST){t=(e.listContent.filter(function(e){return e.key===t})[0]||e.listContent[0]).description}t=St["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,n="";if(e.type!==St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG){var a=getTextValue(e);var r=a&&a!==""&&(St["b"].DataObjects.DocumentDO.getPainter().isEllipsis(t,a)||t.clientHeight<t.scrollHeight-1);r&&(n+=a);r&&i&&(n+="<hr>")}if(i){var o=St["b"].DataObjects.RuntimeDO.getParameter("CHECK_COMMENT_MODIFIEDBY")==="true",l=e.lastModified?C["a"].parseFormattedDate(e.lastModified).toLocaleString():"",s=e.lastModifiedBy||"";o&&(n+=St["b"].Utils.Translations.getTranslation("MODIFIEDBY")+": "+s+"<br>");n+=St["b"].Utils.Translations.getTranslation("MODIFIEDAT")+": "+l}if(n.trim()!==""){closeLastTooltip();var d={alignTo:t,content:"<span>"+n+"</span>",dock:["bottom","top","left","right"]};if(t.tagName==="text"){d.dock=["top","left","right"]}c=T["a"].createTooltip(d);c.element.classList.add("lui-bg-default")}}};St["b"].UI=St["b"].UI||{};St["b"].UI.UserSettings=function(){var t=this;var p;var o;var l=50;var y=St["b"].DataObjects.RuntimeDO;var M=new St["b"].Utils.Calculator(null);var S=St["b"].Utils.Calculator.Converter;var O="12px";St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"document"});St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"user"});var g,L;reloadInitialSettings();var s=[{id:"",translation:"-"},{id:"",translation:"()"}];var m=[{id:"",translation:"de_DE"},{id:"",translation:"en_US"}];var h=["END","BY_VALUETYPE"];var d=[{id:"",translation:y.getTranslation("END")},{id:"",translation:y.getTranslation("BY_VALUETYPE")}];var f=St["b"].Utils.Constants.ParameterSets.documentModesValue;var v=[{id:"",translation:y.getTranslation("DESIGN")},{id:"",translation:y.getTranslation("PRESENTATION")}];var b=[{id:"",translation:"DD.MM.YYYY"},{id:"",translation:"YYYY.MM.DD"},{id:"",translation:"MM/DD/YYYY"}];var c=[{id:"XXXgeneralOverallUser",text:y.getTranslation("OVERALL"),tooltip:y.getTranslation("HELP_USERSETTINGS_OVERALL"),buildUp:createOverall},{id:"XXXgeneralDisplayUser",text:y.getTranslation("NUMBERS"),tooltip:y.getTranslation("HELP_USERSETTINGS_NUMBER"),buildUp:createNumber},{id:"XXXgeneralScalingGroupsUser",text:y.getTranslation("SCALING_GROUPS"),tooltip:y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS"),buildUp:createScalingGroups}];var u="userSettingsDialog";var T="360";var E="340";var x="200px";var C=17;var A=2;this.open=function(){var e=y.getTranslation("MY_SETTINGS");var t=buildButtonBar();var i=new St["b"].UI.HiCoDialogDefinition(u,e,t);i.setWidth(T);i.setHeight(E);i.setPosition({});i.setResizable(true);i.setTooltip(y.getTranslation("HELP_USERSETTINGS"));O=i.getFontSize();p=new St["b"].UI.HiCoDialog(i);o=p.getDialogDiv();var n=p.buildTabs("userSettingsTabDiv",c,null,x,{top:"0px",left:"0px"},null,true);St["b"].$(n).height("100%");function adjustSize(){var e=St["b"].$(o).parent().height()-70;St["b"].$(o).height(e);var t=St["b"].$("#userSettingsTabDiv > .ui-tabs-nav").height();St["b"].$(".ui-tabs-panel",St["b"].$(o).parent()).height(e-t-C);St["b"].$(".ui-tabs-panel","#XXXgeneralOverall").height(e-t-l);St["b"].$("#GENERALLanguageSettingsUser",St["b"].$(o)).height(e-t-C);St["b"].$("#GENERALDisplaySettingsUser",St["b"].$(o)).height(e-t-C);St["b"].$("#GENERALScalingGroupSettingsUser",St["b"].$(o)).height(e-t-C)}adjustSize();p.setEvent("dialogresize",adjustSize);p.setTabsCss("#generalTab",["generalTab"]);p.setCSS("overflow","hidden");p.setCSS();p.decorateTabs(0,c,null);var a=parseInt(p.highest());var r=parseInt(p.getDialog().offsetParent().css("z-index"));if(a>r){a+=1;p.getDialog().offsetParent().css("z-index",a)}};function buildButtonBar(){var e=[];e.push({text:y.getTranslation("SAVE_CLOSE"),id:"okayButton",click:t.okay});e.push({text:y.getTranslation("CANCEL"),id:"closeButton",click:t.close});e.push({text:y.getTranslation("SAVE"),id:"applyButton",click:t.apply});return e}function createOverall(){var e=document.createElement("div");e.setAttribute("id","GENERALLanguageSettingsUser");St["b"].Utils.DOM.setStyle(e,{width:"100%",height:x,overflow:"auto"});var t=document.createElement("table");c=L.documentMode.value;u=y.getTranslation(g.documentMode.name);var i=0;for(var n=0;n<f.length;n++){if(f[n]===c){i=n;break}}var a=document.createElement("tr");var r=document.createElement("td");var o=St["b"].Utils.DOM.createSpan(r,u,"");o.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_OVERALL_MODE"));o.style.fontSize=O;St["b"].$(r).css("padding","5px 10px 05px 0px");a.appendChild(r);var l=document.createElement("td");var s=[];for(var n=0;n<v.length;n++){s[n]=v[n].translation}var d=St["b"].Utils.DOM.createSelectBox(l,"userPropertyType_documentMode",s,s,v[i].translation,O);d.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_OVERALL_MODE"));a.appendChild(l);St["b"].$(d).bind("change",function(e){documentHandler(e)});t.appendChild(a);var c=L.docLanguage.value;var u=y.getTranslation(g.docLanguage.name);p.createTableRow(t,"docPropertyType_125",u,{valueArray:m,selectedValue:c,clazz:"_languageAbbr"},"dropdown",y.getTranslation("HELP_USERSETTINGS_OVERALL_LANGUAGE"));c=L.dateFormat.value;u=y.getTranslation(g.dateFormat.name);p.createTableRow(t,"DD_DATEFORMAT",u,{valueArray:b,selectedValue:c,clazz:"_dateFormats"},"dropdown",y.getTranslation("HELP_USERSETTINGS_OVERALL_DATEFORMAT"));e.appendChild(t);return e}function createNumber(){var e=document.createElement("div");e.setAttribute("id","GENERALDisplaySettingsUser");var t={height:x,width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");p.createSection(i,y.getTranslation("DECIMAL_SEPARATORS"),y.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP"));var n=L.decimalSep.value;var a=y.getTranslation(g.decimalSep.name);p.createTableRow(i,"docPropertyType_110",a,{text:n,labelText:""},"textInput",y.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP_DECIMAL"));n=L.thousandSep.value;a=y.getTranslation(g.thousandSep.name);p.createTableRow(i,"docPropertyType_111",a,{text:n,labelText:""},"textInput",y.getTranslation("HELP_USERSETTINGS_NUMBER_DECSEP_THOUSAND"));p.createSection(i,y.getTranslation("UNITS"),y.getTranslation("HELP_USERSETTINGS_NUMBER_UNITS"));var n=L.unitPosition.value;var a=y.getTranslation(g.unitPosition.name);var r=0;for(var o=0;o<h.length;o++){if(h[o]===n){r=o;break}}p.createTableRow(i,"docPropertyType_114",a,{valueArray:d,selectedValue:d[r].translation,clazz:"_unitPosition"},"dropdown",y.getTranslation("HELP_USERSETTINGS_NUMBER_UNITS_POSITION"));p.createSection(i,y.getTranslation("NEGATIVES"),y.getTranslation("HELP_USERSETTINGS_NUMBER_NEGATIVE"));n=L.negativeStyle.value;a=y.getTranslation(g.negativeStyle.name);p.createTableRow(i,"docPropertyType_115",a,{valueArray:s,selectedValue:n,clazz:"_negativeStyle"},"dropdown",y.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:x,width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);document.createElement("table");e.appendChild(createScalingGroupTable());return e}function createScalingGroupTable(){var e=L.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 n=document.createElement("table");St["b"].Utils.DOM.setStyle(n,{padding:"0",borderSpacing:A+"px"});var a=true;for(var r in e){if(!e[r].auto){a=false;break}}var o=document.createElement("tr");var l=document.createElement("td");var s=document.createElement("label");s.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_ALLAUTO"));St["b"].$(s).html(y.getTranslation("AUTO_SCALING"));l.appendChild(s);var d=St["b"].Utils.DOM.createCheckBoxWithLabel(l,"userPropertyType_AutoScaling","","","").checkBox;d.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_ALLAUTO"));St["b"].$(d).bind("click",function(e){documentHandler(e)});if(a===true){d.checked=true}St["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);n.appendChild(o);var o=document.createElement("tr");var l=document.createElement("td");St["b"].$(l).html(y.getTranslation("SCALING_GROUPS"));l.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALINGGROUP"));St["b"].Utils.DOM.setStyle(l,t);o.appendChild(l);var l=document.createElement("td");St["b"].$(l).html(y.getTranslation("SCALING"));l.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALING"));l.setAttribute("colspan",3);St["b"].Utils.DOM.setStyle(l,i);o.appendChild(l);n.appendChild(o);var o=document.createElement("tr");var c=["",y.getTranslation("SCALING_UNIT"),y.getTranslation("AUTO"),y.getTranslation("MANUAL")];var u=["",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_UNIT"),y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_AUTO"),y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_MANUAL")];for(var p=0;p<c.length;p++){var l=document.createElement("td");St["b"].$(l).html(c[p]);l.setAttribute("title",u[p]);St["b"].Utils.DOM.setStyle(l,i);o.appendChild(l)}n.appendChild(o);var g={padding:"0"};var m={width:"83px",maxWidth:"83px",padding:0,display:"block",overflow:"hidden",textAlign:"right"};var h={padding:0,textAlign:"center"};var f={padding:0};for(var r in e){var v=e[r];var b="";if(v.manualFactor!=null){b=S.zoomFactor2cm(v.manualFactor).toFixed(3)}var o=document.createElement("tr");var l=document.createElement("td");St["b"].$(l).html(M.decode(r));l.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_SCALINGGROUP"));St["b"].Utils.DOM.setStyle(l,g);o.appendChild(l);var l=document.createElement("td");var T=v.scalingFactor==null?"":S.zoomFactor2cm(v.scalingFactor).toFixed(3);var E=St["b"].Utils.DOM.createSpan(l,T,"userPropertyType_ScalingFactor##"+r);E.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_FACTOR"));St["b"].Utils.DOM.setStyle(E,m);o.appendChild(l);var l=document.createElement("td");var x=St["b"].Utils.DOM.createCheckBoxWithLabel(l,"userPropertyType_AutoScalingPerSg##"+r,"","","").checkBox;x.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_AUTO"));St["b"].Utils.DOM.setStyle(l,h);if(v.auto||b===""){x.checked=true}St["b"].$(x).bind("click",function(e){documentHandler(e)});o.appendChild(l);var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,f);var C=St["b"].Utils.DOM.createTextInputNoMax(l,"userPropertyType_ManualFactor##"+r,b,12,O);C.setAttribute("title",y.getTranslation("HELP_USERSETTINGS_SCALINGGROUPS_MANUAL"));St["b"].Utils.DOM.setStyle(C,{padding:"0",marginLeft:"0",marginRight:"0",textAlign:"right"});C.setAttribute("maxlength",30);o.appendChild(l);if(x.checked){C.style.visibility="hidden";E.style.visibility="visible"}else{C.style.visibility="visible";E.style.visibility="hidden"}n.appendChild(o)}return n}function documentHandler(e){var t=e.target.id;var i=L.scalingGroups.value;var n=t.split("##");var a=n[0];n.shift();var r=n.join("##");switch(a){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=y.getTranslation("NA")}else{d.value=S.zoomFactor2cm(i[r].scalingFactor)}c.style.visibility="hidden";d.style.visibility="visible"}else{var u=S.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){St["b"].$(d).html(y.getTranslation("NA"))}else{St["b"].$(d).html(S.zoomFactor2cm(i[r].scalingFactor))}c.style.visibility="hidden";d.style.visibility="visible"}else{var u=S.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,n;var a=1;do{i=e*a;n=Math.floor(i);if(n<i){t++}else{break}a*=10}while(true);return t}function reloadInitialSettings(){g=St["b"].DataObjects.DocumentDO.getDocSettings(true);L=St["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=f[e.selectedIndex];var i=St["b"].$("#docPropertyType_110").val();var n=St["b"].$("#docPropertyType_111").val();var a=document.getElementById("docPropertyType_114");var r=h[a.selectedIndex];var o=St["b"].$("#docPropertyType_115").val();var l=St["b"].$("#docPropertyType_125").val();e=document.getElementById("DD_DATEFORMAT");var s=b[e.selectedIndex].translation;var d={};for(var c in L.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=S.cm2zoomFactor(g);d[c].leastDecimalPosition=getLeastDecimalPosition(g)}else{d[c].auto=L.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 m={decimalSep:{name:"Decimal",value:i},thousandSep:{name:"Thousand",value:n},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}};St["b"].DataObjects.RuntimeDO.setUserSettings(m);St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateUserSettings",null);St["b"].DataObjects.RuntimeDO.updateRuntime(function(){var e=St["b"].DataObjects.DocumentDO.getAllExtensions();St["b"].DataObjects.DocumentDO.triggerDelayedRepaint();for(var t=0;t<e.length;t++){var i=e[t];i.getController().dispatch("createMenus",{extension:i})}St["b"].DataObjects.DocumentDO.getDocumentController().dispatch("updateScalingGroups",{type:"user"});reloadInitialSettings();for(var n in L.scalingGroups.value){var a=L.scalingGroups.value[n];if(a.auto&&a.scalingFactor!=null){var r=S.zoomFactor2cm(a.scalingFactor);St["b"].$(document.getElementById("userPropertyType_ScalingFactor##"+n)).html(r.toFixed(3))}}})}};St["b"].UI=St["b"].UI||{};St["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 n=e.expressionObject;var a=e.type;var u=St["b"].DataObjects.ContextRepo.getContextByCid(i);var m=new St["b"].Utils.Calculator(u);var h=St["b"].DataObjects.RuntimeDO;var s=t.getCanvasDO().getDOMElement();var f=St["b"].Utils.Constants.TypeValues.formulaEdit;var d=null;var v=[];var r;if(a==="compare"||a==="highlight"){r=n.formulaRepository}else{r=n.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("",h.getTranslation("APPLIES_TO"),"",h.getTranslation("CONDITION"),"");var T="12px";var E=null;var x=null;l.open=function(e){var t=document.getElementById("valueLabelShowFormulaDialog");if(!t){var i="valueLabelShowFormulaDialog";var n=[{text:h.getTranslation("OKAY"),id:"valueLabelShowFormulaOkayButton",click:l.okay},{text:h.getTranslation("CANCEL"),id:"valueLabelShowFormulaCancelButton",click:l.close}];var a=new St["b"].UI.HiCoDialogDefinition(i,o,n);T=a.getFontSize();a.setParentDomElement(s.parentNode);a.setHeight(200);a.setWidth(510);var r=St["b"].$(e).offset();a.setPosition([r.left,r.top+e.offsetHeight]);a.setResizable(true);a.setModal(false);x=new St["b"].UI.HiCoDialog(a);x.setEscapeBeforeHandler(escapeBeforeHandler);x.setEscapeAfterHandler(escapeAfterHandler);E=x.getDialogDiv();x.setCSS();fillContent();checkEntryFormulas()}else{t.parentNode.remove(t);l.open(e)}};l.okay=function(){if(applyFormulas(true)===true){if(a==="compare"||a==="highlight"){n.formulaRepository=[];for(var e=0;e<v.length;e++){var t=v[e];n.formulaRepository.push({id:t.id,appliesFormula:{formula:t.appliesFormula.formula,compiledFormula:null},conditionFormula:{formula:t.conditionFormula.formula,compiledFormula:null}})}}else{n.valueLabelFormulaArray=[];for(var e=0;e<v.length;e++){var t=v[e];n.valueLabelFormulaArray.push({id:t.id,appliesFormula:{formula:t.appliesFormula.formula,compiledFormula:null},conditionFormula:{formula:t.conditionFormula.formula,compiledFormula:null}})}}}x.close()};l.close=function(){var e=document.getElementById("formulaEditor");if(e!==null){if(d!==null){d.close()}}x.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=m.invertNames(m.decode(e.formula));i.style.color="#000000"}};l.copyValueLabelFunctionFrom=function(e,i,t){var n=St["b"].DataObjects.ContextRepo.getContextByCid(e);if(n===null){return}var a=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentByDid(n,i);if(a===null){return}var r=St["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<a.valueLabelFormulaArray.length;l++){var s=a.valueLabelFormulaArray[l].appliesFormula.formula;var d=a.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);St["b"].$(E).empty();E.appendChild(e)}function createHeader(e){var t=document.createElement("thead");var i=document.createElement("tr");for(var n=0;n<b.length;n++){var a=document.createElement("td");var r=e[n];var o={width:r,minWidth:r,whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(a,o);St["b"].$(a).html(b[n]);St["b"].Utils.DOM.setStyle(a,{textAlign:"left",fontWeight:"bold",textDecoration:"underline"});i.appendChild(a)}var l=document.createElement("td");St["b"].Utils.DOM.setStyle(l,{width:"20px",maxWidth:"30px",minWidth:"20px",overflow:"hidden",textAlign:"center"});var s=St["b"].Utils.DOM.createSpan(l,"+","addvalueLabelFormula");St["b"].$(s).click(function(e){if(applyFormulas(true)===true){addEntry()}fillContent()});St["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"};St["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){St["b"].$(t).sortable({axis:"y",containment:t,cursor:"crosshair",distance:3,stop:sortEntries,start:startEntrySorting})}for(var i=0;i<v.length;i++){var n=v[i];var a=document.createElement("tr");a.setAttribute("id","emptyRow."+i);var r=buildDragger("valueLabelDragger."+i);r.style.width=e[0];r.style.minWidth=e[0];a.appendChild(r);var o=n.appliesFormula.formula;var l=buildTextInput("valueLabelApplies."+i,m.invertNames(m.decode(o)),26,null,true);l.style.width=e[1];l.style.minWidth=e[1];a.appendChild(l);var s=buildFormulaButton("valueLabelAppliesB."+i,"valueLabelApplies."+i,f.APPLIES_TO,h.getTranslation("APPLIES_TO"));s.style.width=e[2];s.style.minWidth=e[2];a.appendChild(s);var d=n.conditionFormula.formula;var c=buildTextInput("valueLabelCondition."+i,m.invertNames(m.decode(d)),26,null,true);c.style.width=e[3];c.style.minWidth=e[3];a.appendChild(c);var u=buildFormulaButton("valueLabelConditionB."+i,"valueLabelCondition."+i,f.CONDITION,h.getTranslation("CONDITION"));u.style.width=e[4];u.style.minWidth=e[4];a.appendChild(u);var p=document.createElement("td");St["b"].Utils.DOM.setStyle(p,{width:e[5],maxWidth:e[5],minWidth:e[5],overflow:"hidden",textAlign:"center"});var g=St["b"].Utils.DOM.createSpan(p,"-","removeValueLabelEntry."+i);St["b"].$(g).click(function(e){if(applyFormulas(true)===true){removeEntry(e)}fillContent()});St["b"].$(g).hover(function(){this.style.textDecoration="underline"},function(){this.style.textDecoration="none"});a.appendChild(p);t.appendChild(a)}return t}function buildFormulaButton(e,a,r,o){var t=document.createElement("td");var i=St["b"].Utils.DOM.createButtonInput(t,e,"","fx",T);St["b"].$(i).click(function(e){var t=document.getElementById("formulaEditor");if(t!==null){return}var i=St["b"].$("div:visible[id*='valueLabelShowFormulaDialog']").parent().offset();d=new St["b"].UI.FormulaEditor(u,r);var n=document.getElementById(a).value;d.open(m.encode(n),a,[],l,{x:i.left+20,y:i.top+20},o)});return t}function buildTextInput(e,t,i){var n=document.createElement("td");var a=St["b"].Utils.DOM.createTextInputNoMax(n,e,t,i,T);var r=t;var o="#000000";var l=St["b"].$(a).keydown(function(e){if(e.which===13){var t;var i={formula:m.encode(this.value),compiledFormula:null};t=m.checkFormulaCFM(i);if(!t){this.style.color="#FF0000";o=this.style.color}else{this.value=m.invertNames(m.decode(this.value));r=this.value;o="#000000";St["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 n}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 n=-1;for(var a=0;a<v.length;a++){var r=v[a];if(r.id===i){n=a;break}}if(n!==-1){v.splice(n,1)}for(var a=0;a<v.length;a++){v[a].id=a}}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=m.encode(i.value);v[t].appliesFormula.compiledFormula=null;var n=document.getElementById("valueLabelCondition."+t);v[t].conditionFormula.formula=m.encode(n.value);v[t].conditionFormula.compiledFormula=null}return true}function sortEntries(e,t){var i=e.target.childNodes;var n=new Array(v.length);var a=false;var r=0;for(var o=0;o<i.length;o++){var l=parseInt(i[o].id.split(".").pop());if(!isNaN(l)){n[o-r]=v[l]}else{r=1}if(o-r!==l){a=true}}if(a){applyFormulas(false);v=n;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 n=i.split(".");var a="valueLabelDragger."+n[1];document.getElementById(a).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 n={formula:m.encode(i.value),compiledFormula:null};if(m.checkFormulaCFM(n)===false){i.style.color="#FF0000";e=true}var a=document.getElementById("valueLabelCondition."+t);var n={formula:m.encode(a.value),compiledFormula:null};if(m.checkFormulaCFM(n)===false){a.style.color="#FF0000";e=true}}return e}};var At=r(477);St["b"].UI=St["b"].UI||{};St["b"].UI.VisualizationMenu=function(e){var x=St["b"].DataObjects.InlineCommentRepo;var F=this;var C=e.extension;var o=C.getCanvasDO().getDOMElement();var le=e.chartModel;var y=St["b"].DataObjects.ContextRepo.getContextByCid(le.contextId);if(y===null){return}var se=Ot["a"];var de=St["b"].Utils.Constants.TypeValues;var ce=de.notation;var c=null;var r=null;var s=null;var B=null;var m=null;var L=null;var h=null;var b=null;var u=null;var M=null;var v=null;var f=null;var T=null;var H=null;var ue=false;var i=0;var k="12px";var E="835";var l="384";var n=getScrollBarWidth();var a=1;var d=Lt["a"].detectIE()?"ie":"firefox";var S="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 A=[0,0,0,0,0,0,0,0,0,0,0,0];var _=[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 N;var pe="Axis";var ge="Zero";var P=createInputBoxArray();var me=St["b"].Utils.Constants.ParameterSets.structurePositionTypeIds;var he=St["b"].Utils.Constants.ParameterSets.structurePositionTypeTranslations;var fe=[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 Ee=St["b"].Utils.Constants.ParameterSets.notationTypeIds;var xe=St["b"].Utils.Constants.ParameterSets.notationTypeTranslations;var Ce=St["b"].Utils.Constants.ParameterSets.conceptTypeIds;var ye=St["b"].Utils.Constants.ParameterSets.conceptTypeTranslations;var Me=St["b"].Utils.Constants.ParameterSets.conceptTypeIds;var Se=St["b"].Utils.Constants.ParameterSets.conceptTypeTranslations;var w=["-","All","MinMax","Function"];var U=["-",se.getTranslation("ALL"),se.getTranslation("MIN_MAX"),se.getTranslation("FUNCTION")];var $=["Automatic","In-Line","Displaced"];var W=[se.getTranslation("AUTOMATIC"),se.getTranslation("IN_LINE"),se.getTranslation("DISPLACED")];var z=["","Left","Right"];var j=["-",se.getTranslation("LEFT"),se.getTranslation("RIGHT")];var X=["-","transparent","inverted"];var Y=["-",se.getTranslation("TRANSPARENT"),se.getTranslation("INVERTED")];var K=St["b"].Utils.Constants.ParameterSets.valueLabelTypes;var Z=St["b"].Utils.Constants.ParameterSets.valueLabelTypesTL;var Q=["value","symbol","-"];var q=[se.getTranslation("VALUE"),se.getTranslation("SYMBOL"),"-"];var J=[">=",">"];var ee=St["b"].Utils.Constants.ParameterSets.outlierStyles;var te=St["b"].Utils.Constants.ParameterSets.outlierStylesTL;var ie=["Keyfigures","Value label","","","","","","","Legend","","",""];var ne=[se.getTranslation("MEASURES"),se.getTranslation("VALUE_LABEL"),"","","","","","",se.getTranslation("LEGEND"),"","",""];var ae=[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 Le=["Keyfigures","Operator","Value","Show as","Symbol","Style"];var Ae=[se.getTranslation("MEASURES"),se.getTranslation("OPERATOR"),se.getTranslation("VALUE"),se.getTranslation("SHOW_AS"),se.getTranslation("SYMBOL"),se.getTranslation("STYLE")];var _e=[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 Ne=St["b"].Utils.Constants.ParameterSets.stackTypes;var Pe=St["b"].Utils.Constants.ParameterSets.stackTypesTL;var we=["-","Start","End"];var Ue=["-","Start","End"];var Fe=["Keyfigures","Maximize","Legend","",""];var Be=[se.getTranslation("MEASURES"),se.getTranslation("MAXIMIZE"),se.getTranslation("LEGEND"),"",""];var He=[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 ke=["","","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 We=["-",se.getTranslation("NOTATION")];var ze=y.columns;var je=["-","Start","End"];var Xe=["-","Start","End"];var Ye=["Always","Vertical","Horizontal"];var Ke=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];var Ze=St["b"].Utils.Constants.ParameterSets.structureBarWaterfallPositionTypeIds;var Qe=St["b"].Utils.Constants.ParameterSets.structureBarWaterfallPositionTypeTranslations;var qe=St["b"].Utils.Constants.ParameterSets.timeBarWaterfallPositionTypeIds;var Je=St["b"].Utils.Constants.ParameterSets.timeBarWaterfallPositionTypeTranslations;var et=new St["b"].Utils.Calculator(y);var tt=[[],J,"",q,[],te];var it={};var nt=[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 at=St["b"].Utils.Constants.TypeValues.transport,rt=St["b"].Connector.ConnectorHelper.Settings.transportIcons;var ot,lt,st,dt,ct,ut,pt,gt,mt,ht,ft,vt,bt;var Tt,Et,xt;if(le.instanceOf==="ChartModel"){z=St["b"].Utils.Constants.ParameterSets.structureLegendTypeIds;j=St["b"].Utils.Constants.ParameterSets.structureLegendTypeTranslations;st=["Always","Vertical","Horizontal"];dt=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];Ee=St["b"].Utils.Constants.ParameterSets.notationTypeIds;xe=St["b"].Utils.Constants.ParameterSets.notationTypeTranslations;me=St["b"].Utils.Constants.ParameterSets.structurePositionTypeIds;he=St["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")];Et=[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")];xt=[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")];mt=St["b"].Utils.Constants.ParameterSets.structureRepresentationTypeIds;ht=St["b"].Utils.Constants.ParameterSets.structureRepresentationTypeTranslations;ft=[ze,ht,[],ze,he,ve,Te,xe,ye];vt=[ze,ht,[],ze,he,ve,Te,xe,ye,Se];bt=[Pe,Qe,W,[],[],U,[],[],Ue]}else if(le.instanceOf==="TableModel"){z=St["b"].Utils.Constants.ParameterSets.tableLegendTypeIds;j=St["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")];Et=[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")];xt=[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")];mt=St["b"].Utils.Constants.ParameterSets.tableRepresentationTypeIds;ht=St["b"].Utils.Constants.ParameterSets.tableRepresentationTypeTranslations;Ee=St["b"].Utils.Constants.ParameterSets.notationTypeIds;xe=St["b"].Utils.Constants.ParameterSets.notationTypeTranslations;ft=[ze,ht,[],[],[],[],[],xe,ye];vt=[ze,ht,[],[],[],[],[],xe,ye,Se];ie=["Keyfigures","Value label","","","","","Legend"];ne=[se.getTranslation("MEASURES"),se.getTranslation("VALUE_LABEL"),"","","","",se.getTranslation("LEGEND")];ae=[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"];Xe=["-","End"];bt=[[],[],[],[],[],[],[],[],[]]}else if(le.instanceOf==="TimeChartModel"){me=St["b"].Utils.Constants.ParameterSets.timePositionTypeIds;he=St["b"].Utils.Constants.ParameterSets.timePositionTypeTranslations;Ee=St["b"].Utils.Constants.ParameterSets.timeNotationTypeIds;xe=St["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")];Et=[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")];xt=[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")];mt=St["b"].Utils.Constants.ParameterSets.timeRepresentationTypeIds;ht=St["b"].Utils.Constants.ParameterSets.timeRepresentationTypeTranslations;ft=[ze,ht,[],ze,he,ve,Te,xe,ye];vt=[ze,ht,[],ze,he,ve,Te,xe,ye,Se];z=St["b"].Utils.Constants.ParameterSets.timeLegendTypeIds;j=St["b"].Utils.Constants.ParameterSets.timeLegendTypeTranslations;st=["Always","Vertical","Horizontal"];dt=["-",se.getTranslation("VERTICAL"),se.getTranslation("HORIZONTAL")];bt=[Pe,Je,W,[],[],U,[],[],Ue]}var Ct=!(le.instanceOf==="TableModel")?[[],U,[],Z,[],[],Y,[],j,dt,We,[]]:[[],U,[],Z,Y,[],j,[],[],[],[],[],[]];var yt=[[],[],Xe,Ke,[]];fillExpressionCollection();var Mt=[{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}];F.open=function(){if(y===null){return}var e=St["b"].$(o).offset();var t=[];t.push({text:se.getTranslation("OKAY"),id:"okayButton",click:F.okay});t.push({text:se.getTranslation("CANCEL"),id:"closeButton",click:F.close});t.push({text:se.getTranslation("APPLY"),id:"applyButton",click:F.apply});var i=new St["b"].UI.HiCoDialogDefinition("visualizationMenu","Keyfigures",t);i.setParentDomElement(o.parentNode);i.setWidth(E);i.setHeight(l);i.setPosition([e.left,e.top]);k=i.getFontSize();c=new St["b"].UI.HiCoDialog(i);s=c.getDialogDiv();var n={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var a=document.createElement("div");a.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(a,n);a.style.fontSize=i.getFontSize();s.appendChild(a);calculateStdLength();createExpressionsTab();c.setEvent("dialogresizestop",function(e,t){F.updateTableDivHeight(B,L,b,M,f)});c.setCSS("overflow","hidden");c.setCSS();c.decorateTabs(0,Mt);F.linkScrollbarGeneralTab();F.linkScrollbarColorsDescriptionsTab();F.linkScrollbarOutlierTab();F.linkScrollbarTotalTab();F.linkScrollbarScalingTab();F.updateAllExpressionCollectionObjects();for(var r=0;r<ze.length;r++){F.setRowHighlightForStartUp(ze[r].id)}};F.embed=function(e,t,i,n){if(y===null){return null}c=e;s=c.getDialogDiv();O=n;var a={position:"absolute",visibility:"hidden",height:"auto",width:"auto"};var r=document.createElement("div");r.setAttribute("id","hiddenDiv");St["b"].Utils.DOM.setStyle(r,a);k=i;r.style.fontSize=k;s.appendChild(r);calculateStdLength();createExpressionsTab();t.appendChild(H);c.setCSS("overflow","hidden");c.setCSS();c.decorateTabs(0,Mt);F.linkScrollbarGeneralTab();F.linkScrollbarColorsDescriptionsTab();F.linkScrollbarOutlierTab();F.linkScrollbarTotalTab();F.linkScrollbarScalingTab();F.updateAllExpressionCollectionObjects();for(var o=0;o<ze.length;o++){F.setRowHighlightForStartUp(ze[o].id)}if(le.instanceOf==="TableModel"){for(var o=0,l=ze.length;o<l;o++){F.setRowHighlightForInputStartUp(ze[o].id)}}F.updateTableDivHeightFromOutside(St["b"].$(s).parent().height(),St["b"].$(s).parent().width());return this};F.getSize=function(){return E};F.getDialogObj=function(){return c};function createExpressionsTab(){F.calculateColumnsLength();var e={show:function(e,t){i=t.index;c.decorateTabs(t.index,Mt);F.updateTableDivHeightFromOutside(St["b"].$(s).parent().height(),parseFloat(s.parentNode.style.width))}};H=c.buildTabs("propertiesExpressionsTabDiv",Mt,null,"auto",{top:"0px",left:"0px"},e,true);if(!le.stackMode){St["b"].$(H).tabs("disable",3)}if(checkExpressionsForInput()){St["b"].$(H).tabs("disable",5)}}function checkExpressionsForInput(){if(le.instanceOf!=="TableModel"){return true}var e=de.tableRepresentation;for(var t=0,i=ze.length;t<i;t++){var n=ze[t];var a=it[n.id];var r=a?a.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=St["b"].$("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=St["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=F.createExpressionsGeneralHeader();e.appendChild(t);var i=F.createExpressionsGeneralTable();e.appendChild(i);return e}F.createExpressionsGeneralHeader=function(){E="835";if(ue===true){return F.createExpressionsGeneralHeaderRef()}var e=document.createElement("div");m=e;e.setAttribute("id","headerDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");for(var a=0;a<ot.length;a++){if(ot[a]===""){continue}var r=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);St["b"].$(r).html(lt[a]);if(ct[a]!=""){r.setAttribute("title",ct[a])}n.appendChild(r)}i.appendChild(n);var s=document.createElement("tr");for(var a=0;a<ot.length;a++){if(ot[a]===""){continue}var d=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";St["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 a=0;a<ot.length;a++){if(ot[a]===""){continue}var r=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);if(ot[a]==="Sum as value"){for(var p=0;p<Tt.length;p++){var g=document.createElement("span");St["b"].$(g).text(Et[p]);St["b"].Utils.DOM.setStyle(g,{marginRight:"4px"});if(xt[p]!=""){g.setAttribute("title",xt[p])}r.appendChild(g)}}u.appendChild(r)}i.appendChild(u);e.appendChild(i);return e};F.createExpressionsGeneralHeaderRef=function(){E="965";var e=document.createElement("div");m=e;e.setAttribute("id","headerDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");for(var a=0;a<pt.length;a++){if(pt[a]===""){continue}var r=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);St["b"].$(r).html(gt[a]);if(ut[a]!=""){r.setAttribute("title",ut[a])}n.appendChild(r)}i.appendChild(n);var s=document.createElement("tr");for(var a=0;a<pt.length;a++){if(pt[a]===""){continue}var d=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";St["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 a=0;a<pt.length;a++){if(pt[a]===""){continue}var r=document.createElement("td");var o=G[a];var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);if(pt[a]==="Sum as value"){for(var p=0;p<Tt.length;p++){var g=document.createElement("span");St["b"].$(g).text(Et[p]);St["b"].Utils.DOM.setStyle(g,{marginRight:"4px"});if(xt[p]!=""){g.setAttribute("title",xt[p])}r.appendChild(g)}}u.appendChild(r)}i.appendChild(u);e.appendChild(i);return e};F.getNotationType=function(e,t){if(t===true){for(var i=0;i<e.length;i++){if(e[i].selected===true){var n=e[i].value;break}}}else{var n=e.currSelected}switch(n){case se.getTranslation("ELEMENT"):n=ce.ELEMENT;break;case se.getTranslation("AXIS"):n=ce.AXIS;break;case se.getTranslation("HEADER"):n=ce.HEADER;break;case se.getTranslation("ELEMENT_HEADER"):n=ce.ELEMENT_HEADER;break;case se.getTranslation("ELEMENT_AXIS"):n=ce.ELEMENT_AXIS;break}return n};F.getRepresentationType=function(e,t){if(t===true){for(var i=0;i<e.length;i++){if(e[i].selected===true){var n=e[i].value;break}}}else{var n=e.currSelected}if(n==="timeRepresentationType.0"||n==="structureRepresentationType.0"||n==="tableRepresentationType.0"||n==="-"){n="-"}else if(n==="timeRepresentationType.1"||n==="structureRepresentationType.1"||n==="tableRepresentationType.2"||n===se.getTranslation("BAR")){n=se.getTranslation("BAR")}else if(n==="timeRepresentationType.2"||n==="structureRepresentationType.2"||n==="tableRepresentationType.3"||n===se.getTranslation("NEEDLE")){n=se.getTranslation("NEEDLE")}else if(n==="timeRepresentationType.3"||n==="structureRepresentationType.3"||n==="tableRepresentationType.4"||n===se.getTranslation("WATERFALL")){n=se.getTranslation("WATERFALL")}else if(n==="timeRepresentationType.4"||n==="structureRepresentationType.4"||n==="tableRepresentationType.5"||n===se.getTranslation("LINE")){n=se.getTranslation("LINE")}else if(n==="timeRepresentationType.5"||n==="structureRepresentationType.5"||n==="tableRepresentationType.6"||n===se.getTranslation("SYMBOL")){n=se.getTranslation("SYMBOL")}else if(n==="timeRepresentationType.6"||n==="structureRepresentationType.6"||n==="tableRepresentationType.7"||n===se.getTranslation("SYMBOL_LINE")){n=se.getTranslation("SYMBOL_LINE")}else if(n==="tableRepresentationType.1"||n==="timeRepresentationType.7"||n==="structureRepresentationType.7"){n=se.getTranslation("VALUE")}return n};F.referenceConceptChange=function(e,t,i,n){var a=F.getNotationType(i,n);var r=F.getRepresentationType(e,n);if(r!="-"){if(a==ce.ELEMENT_AXIS||a==ce.ELEMENT_HEADER){t.disabled=false}else{t.disabled=true}}else{t.disabled=true}};F.typeChange=function(e,t,i){var n=it[t];var a=n.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=F.getAllCurrentDropboxContent(n,e,r,i);if(a===r.NONE){F.disableTabElements(true,t,"subtab-outlier",a,0);F.disableTabElements(true,t,"subtab-scaling",a,0);F.disableTabElements(true,t,"subtab-general",a,0);F.disableTabElements(true,t,"subtab-co-des",a,0);if(checkExpressionsForInput()){St["b"].$(H).tabs("disable",5)}St["b"].$("#tabInputTableDiv").html(F.createExpressionsInputTable())}else if(e.instanceOf==="TableModel"&&(a===r.LIST||a===r.COMMENT||a===r.FLAG)){F.disableTabElements(true,t,"subtab-outlier",a,0);F.disableTabElements(true,t,"subtab-scaling",a,0);F.disableTabElements(false,t,"subtab-general",a,0);F.disableTabElements(true,t,"subtab-co-des",a,0);var l=document.getElementById("select##"+t+"##axisMid");l.setAttribute("disabled","disabled");if(o.notationArray){var s=document.getElementById("select##"+t+"##notation");F.updateDropboxElements(s,o.notationArray,n.notation,n.notation.availNotations,n.notation.availNotationsTL,e)}if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");F.updateDropboxElements(d,o.conceptArray,n.concept,n.concept.availConcepts,n.concept.availConceptsTL,e)}St["b"].$(H).tabs("enable",5);St["b"].$("#tabInputTableDiv").html(F.createExpressionsInputTable())}else{if(i===true){if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");F.updateDropboxElements(d,o.conceptArray,n.concept,n.concept.availConcepts,n.concept.availConceptsTL,e)}}else{if(o.notationArray){var s=document.getElementById("select##"+t+"##notation");F.updateDropboxElements(s,o.notationArray,n.notation,n.notation.availNotations,n.notation.availNotationsTL,e)}if(o.conceptArray){var d=document.getElementById("select##"+t+"##concept");F.updateDropboxElements(d,o.conceptArray,n.concept,n.concept.availConcepts,n.concept.availConceptsTL,e)}if(o.backgroundArray){var c=document.getElementById("select##"+t+"##valueLabelBackground");F.updateDropboxElements(c,o.backgroundArray,n.valueLabelBackground,X,Y,e)}if(o.legendArray){var u=document.getElementById("select##"+t+"##legend");F.updateDropboxElements(u,o.legendArray,n.legend,z,j,e)}if(o.positionArray){var p=document.getElementById("select##"+t+"##position");F.updateDropboxElements(p,o.positionArray,n.positions,n.positions.availPositions,n.positions.availPositionsTL,e)}if(o.valueLabelTypesArray){var g=document.getElementById("select##"+t+"##valueLabelType");F.updateDropboxElements(g,o.valueLabelTypesArray,n.valueLabelType,K,Z,e)}if(a==r.VALUE&&e.instanceOf!=="TableModel"){F.disableTabElements(true,t,"subtab-outlier",a);F.disableTabElements(true,t,"subtab-scaling",a);F.disableTabElements(true,t,"subtab-general",a);F.disableTabElements(false,t,"subtab-co-des",a)}else{F.disableTabElements(false,t,"subtab-outlier",a);F.disableTabElements(false,t,"subtab-scaling",a);F.disableTabElements(false,t,"subtab-general",a);F.disableTabElements(false,t,"subtab-co-des",a)}}}};F.getAllCurrentDropboxContent=function(e,t,i,n){var a=e.representations.currSelected;var r=e.notation.currSelected;var o=undefined;var l=undefined;var s=undefined;var d=undefined;var c=undefined;if(a===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=he}else{c=j}}else if(a===i.BAR||a===i.WATERFALL||a==i.LINE||a===i.COLUMN){s=[se.getTranslation("AREA"),se.getTranslation("COLOR"),se.getTranslation("AREA_COLOR")];l=xe;d=Y;c=j;if(t.instanceOf!=="TableModel"){if(t.instanceOf==="ChartModel"){o=Qe}else{o=Je}}}else if(t.instanceOf==="TableModel"&&a===i.LIST||a===i.COMMENT||a===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=ye}else{s=[se.getTranslation("AREA"),se.getTranslation("COLOR"),se.getTranslation("AREA_COLOR")]}if(n===false){l=xe;d=Y;c=j;if(t.instanceOf!=="TableModel"){o=he}}}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}};F.disableTabElements=function(e,t,i,n,a){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(n===de.tableRepresentation.LIST||n===de.tableRepresentation.COMMENT||n===de.tableRepresentation.FLAG){r.removeAttribute("disabled");continue}}if(o[l]==="##stack"){if(n===de.timeRepresentation.COLUMN||n===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);F.updateDropboxElements(s,d,it[t].valueLabelType,K,Z,le)}}continue}if((n===de.timeRepresentation.VALUE||n===de.structureRepresentation.VALUE||n===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")}}};F.updateDropboxElements=function(e,t,i,n,a,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=n.indexOf(s);var u=a[c];for(var p=0;p<e.length;p++){var g=false;for(var m=0;m<t.length;m++){if(u===t[m]){l=true}if(e[p].text===t[m]){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=n[0]}c=n.indexOf(i.currSelected)}if(e[c].selected===false){e[c].selected=true}};F.createExpressionsGeneralTable=function(){var e=document.createElement("div");B=e;e.setAttribute("id","tableDiv");var t={height:175+"px",width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);St["b"].$(e).scroll(function(){F.linkScrollbarGeneralTab()});var i=document.createElement("table");var p=[];for(var n=0;n<ze.length;n++){var a=ze[n];var r=a.id;var o=a.name;var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##general");var d=ct;var c=xt;if(ue===true){G=V;d=ut}var u=document.createElement("td");var g={width:G[0]+"px",minWidth:G[0]+"px"};St["b"].Utils.DOM.setStyle(u,g);St["b"].$(u).html(o);u.setAttribute("id",r);u.setAttribute("title",d[0]);St["b"].$(u).bind("click",function(e){F.highlightRow(e)});u.style.whiteSpace="nowrap";s.appendChild(u);var m=document.createElement("td");g={width:G[1]+"px",minWidth:G[1]+"px"};St["b"].Utils.DOM.setStyle(m,g);var h=l.representations;var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##representation",h.availRepresentations,h.availRepresentationsTL,h.currSelected,k);f.setAttribute("title",d[1]);f.setAttribute("style","width: "+(G[1]-5)+"px");St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e);if(le.instanceOf!=="TableModel"){F.updateExpressionCollectionReferenceObject()}});s.appendChild(m);g={width:G[2]+"px",minWidth:G[2]+"px"};var m=document.createElement("td");St["b"].Utils.DOM.setStyle(m,g);var v=St["b"].Utils.DOM.createCheckBoxWithLabel(m,"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=St["b"].Utils.DOM.createCheckBoxWithLabel(m,"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=St["b"].Utils.DOM.createCheckBoxWithLabel(m,"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(m);if(le.instanceOf!=="TableModel"){var b=l.stack;var T=b.currSelected;m=document.createElement("td");var E=G[3];var x=l.reference;var g={width:E+"px",minWidth:E+"px"};St["b"].Utils.DOM.setStyle(m,g);var C=x.currSelected;var y=l.stack.currSelected!==false;for(var M=0;M<ze.length;M++){var S=it[ze[M].id];var O=ze[M].id.split(".").pop();if(a.id!==ze[M].id){if(a.scalingGroup===ze[M].scalingGroup&&l.representations.currSelected!==de.timeRepresentation.NONE&&l.representations.currSelected!==de.structureRepresentation.NONE&&S.representations.currSelected!==de.timeRepresentation.VALUE){if(y===false||S.stack.currSelected===false){x.availReferences.push(ze[M].name);x.availReferencesIds.push(O)}}}}if(x.availReferencesIds.indexOf(C)===-1){x.currSelected=ge}var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##reference",x.availReferencesIds,x.availReferences,x.currSelected,k);f.style.minWidth=E-5+"px";f.style.width=E-5+"px";f.setAttribute("title",d[3]);St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(m);var m=document.createElement("td");var g={width:G[4]+"px",minWidth:G[4]+"px"};St["b"].Utils.DOM.setStyle(m,g);var L="top";var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##position",me,he,L,k);f.style.width=G[4]-5+"px";f.style.minWidth=G[4]-5+"px";f.setAttribute("title",d[4]);if(le.stackMode&&T!==false&&T!==undefined){f.disabled=true}St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(m);m=document.createElement("td");var g={width:G[5]+"px",minWidth:G[5]+"px"};St["b"].Utils.DOM.setStyle(m,g);var A=null;for(var _=0;_<le.expressions.length;_++){if(le.expressions[_].id===r){A=_;break}}var I=false;if(A===null||!le.expressions[A]||le.expressions[A].representation!==de.timeRepresentation.COLUMN&&le.expressions[A].representation!==de.structureRepresentation.BAR){b.currSelected=false;I=true}var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##stack",b.availStack,b.availStackTL,b.currSelected,k);f.setAttribute("title",d[6]);p.push(f);f.disabled=I;St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e);var t=this.id.split("##");var i=it[t[1]];var n=i.stack;var a=this.selectedIndex;var r=n.availStack[a];if(this.lastSelectedIndex&&this.lastSelectedIndex!=a){r=n.availStack[this.lastSelectedIndex];for(var o=0;o<p.length;o++){if(p[o]!=this){St["b"].$(p[o]).find("option:eq("+this.lastSelectedIndex+")").css("background","none").removeAttr("disabled")}}r=n.availStack[a]}for(var o=0;o<p.length;o++){if(p[o]!=this&&r!==false){St["b"].$(p[o]).find("option:eq("+a+")").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)}F.updateDropboxElements(d,c,i.valueLabelType,K,Z,le)}if(l>=2){St["b"].$(H).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{St["b"].$(H).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=a}).bind("click, mouseover",function(e){var t=this;var i=[];for(var n=0;n<ze.length;n++){var a=document.getElementById("select##"+ze[n].id+"##stack");var r=a.selectedIndex;if(a!=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(m);m=document.createElement("td");var g={width:G[6]+"px",minWidth:G[6]+"px"};St["b"].Utils.DOM.setStyle(m,g);var D=l.sequence;var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##sequence",D.availSequence,D.availSequenceTL,D.currSelected,k);f.setAttribute("title",d[6]);f.disabled=l.representations.currSelected===de.timeRepresentation.VALUE||l.representations.currSelected===de.structureRepresentation.VALUE;St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(m)}m=document.createElement("td");var E=G[7];var g={width:E+"px",minWidth:E+"px"};St["b"].Utils.DOM.setStyle(m,g);var R=l.notation;var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##notation",R.availNotations,R.availNotationsTL,R.currSelected,k);f.style.width=E-5+"px";f.style.minWidth=E-5+"px";f.setAttribute("title",d[7]);St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e);var t=e.target.id.split("##")[1];var i=document.getElementById("select##"+t+"##notation");var n=document.getElementById("select##"+t+"##representation");var a=document.getElementById("select##"+t+"##referenceConcept");F.typeChange(le,t,true);if(a!==null){F.referenceConceptChange(n,a,i,true)}});s.appendChild(m);m=document.createElement("td");var E=G[8];var g={width:E+"px",minWidth:E+"px"};St["b"].Utils.DOM.setStyle(m,g);var N=l.concept;var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##concept",N.availConcepts,N.availConceptsTL,N.currSelected,k);f.style.width=E-5+"px";f.style.minWidth=E-5+"px";f.setAttribute("title",d[8]);St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(m);if(ue===true){m=document.createElement("td");var E=G[9];var g={width:E+"px",minWidth:E+"px"};St["b"].Utils.DOM.setStyle(m,g);var P=l.referenceConcept;var f=St["b"].Utils.DOM.createSelectBox(m,"select##"+r+"##referenceConcept",P.availConceptsRef,P.availConceptsTLRef,P.currSelected,k);f.style.width=E-5+"px";f.style.minWidth=E-5+"px";f.setAttribute("title",d[9]);St["b"].$(f).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(m);F.referenceConceptChange(l.representations,f,l.notation,false)}if(le.instanceOf==="TableModel"){var w=ue===true?10:9;var g={width:G[w]+"px",minWidth:G[w]+"px"};m=document.createElement("td");St["b"].Utils.DOM.setStyle(m,g);var U=St["b"].Utils.DOM.createCheckBoxWithLabel(m,"select##"+r+"##axisMid","select##"+r+"##axisMid","","").checkBox;if(l.axisMid.currSelected===true){U.setAttribute("checked","checked")}U.setAttribute("title",d[w]);s.appendChild(m)}i.appendChild(s)}e.appendChild(i);return e};function createExpressionsColorsDescriptionsTab(){var e=document.createElement("div");e.setAttribute("id","tabColorsDescriptionsDiv");var t=F.createExpressionsColorsDescriptionsHeader();e.appendChild(t);var i=F.createExpressionsColorsDescriptionsTable();e.appendChild(i);return e}F.createExpressionsColorsDescriptionsHeader=function(){var e=document.createElement("div");h=e;e.setAttribute("id","headerColorsDescriptionsDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("tr");for(var r=0;r<ne.length;r++){if(ne[r]==""){continue}var o=document.createElement("td");var l=document.createElement("td");var s=A[r];var d=1;for(var c=r+1;c<ne.length;c++){if(ne[c]==""){d++;s+=A[c]}else{break}}var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);o.setAttribute("colspan",d);St["b"].$(o).html(ne[r]);o.setAttribute("title",ae[r]);n.appendChild(o);St["b"].Utils.DOM.setStyle(l,u);l.setAttribute("colspan",d);var p=document.createElement("span");p.style.margin="0px";St["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');if(ne[r]!="Keyfigures"){l.appendChild(p)}a.appendChild(l)}i.appendChild(n);i.appendChild(a);var g=document.createElement("tr");for(var r=0;r<re.length;r++){var o=document.createElement("td");var s=A[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);St["b"].$(o).html(oe[r]);if(Oe[r]!=""){o.setAttribute("title",Oe[r])}g.appendChild(o)}i.appendChild(g);var a=document.createElement("tr");for(var r=0;r<re.length;r++){var l=document.createElement("td");var s=A[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);St["b"].Utils.DOM.setStyle(l,u);var p=document.createElement("span");p.style.margin="0px";St["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(p);a.appendChild(l)}i.appendChild(a);e.appendChild(i);return e};F.activateDeactivateButton=function(e){var t=it[e];var i=t.valueLabel.currSelected;i=i.split(".");i=i[0];var n=document.getElementById("select##"+e+"##functionButton");if(i===w[3]){n.disabled=false}else{n.disabled=true;var a=document.getElementById("visualMenuFunctionProp##"+e);if(a!==null){a.parentNode.remove(a)}}};F.activateDeactivateButtonStack=function(e){var t=e.selectedIndex;var i=document.getElementById("select##_##functionButton");if(w[t]==="Function"){i.disabled=false}else{i.disabled=true}};F.createExpressionsColorsDescriptionsTable=function(){var e=document.createElement("div");L=e;e.setAttribute("id","tableColorsDescriptionsDiv");var t={height:175+"px",width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);St["b"].$(e).scroll(function(){F.linkScrollbarColorsDescriptionsTab()});var i=document.createElement("table");for(var n=0;n<ze.length;n++){var a=ze[n];var r=a.id;var o=a.name;var l=it[r];var s=document.createElement("tr");s.setAttribute("id",r+"##colordesc");var d=document.createElement("td");var c={width:A[0]+"px",minWidth:A[0]+"px"};St["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);d.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_MEASURES"));St["b"].$(d).bind("click",function(e){F.highlightRow(e)});St["b"].$(d).html(o);d.style.whiteSpace="nowrap";s.appendChild(d);var u=document.createElement("td");var c={width:A[1]+"px",minWidth:A[1]+"px"};St["b"].Utils.DOM.setStyle(u,c);var p=l.valueLabel;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabel",w,U,p.currSelected&&p.currSelected.split(".").length>1?p.currSelected.split(".")[0]:"All",k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)}).bind("change",function(e){var t=e.target.id.split("##")[1];F.activateDeactivateButton(t)});s.appendChild(u);var m=document.createElement("td");var c={width:A[2]+"px",minWidth:A[2]+"px"};var h=St["b"].Utils.DOM.createButtonInput(m,"select##"+r+"##functionButton","","fx",k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_SHOW"));St["b"].$(h).on("click",function(e){F.openFunctionDialog(e)});St["b"].Utils.DOM.setStyle(m,c);s.appendChild(m);var u=document.createElement("td");var c={width:A[3]+"px",minWidth:A[3]+"px"};St["b"].Utils.DOM.setStyle(u,c);var f=l.valueLabelType;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabelType",K,Z,f.currSelected,k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_TYPE"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(u);if(le.instanceOf!=="TableModel"){var u=document.createElement("td");var c={width:A[4]+"px",minWidth:A[4]+"px"};St["b"].Utils.DOM.setStyle(u,c);var v=St["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:A[5]+"px",minWidth:A[5]+"px"};St["b"].Utils.DOM.setStyle(u,c);var v=St["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:A[6]+"px",minWidth:A[6]+"px"}}else{var c={width:A[4]+"px",minWidth:A[4]+"px"}}St["b"].Utils.DOM.setStyle(u,c);St["b"].Utils.DOM.setStyle(u,c);var b=l.valueLabelBackground;var T=X;var E=Y;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##valueLabelBackground",T,E,b.currSelected,k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_BACKGROUND"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(u);var u=document.createElement("td");if(le.instanceOf!=="TableModel"){var c={width:A[7]+"px",minWidth:A[7]+"px"}}else{var c={width:A[5]+"px",minWidth:A[5]+"px"}}St["b"].Utils.DOM.setStyle(u,c);var x=l.valueLabelUnits;var v=St["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##valueLabelUnitsD","select##"+r+"##valueLabelUnitsG","","").checkBox;v.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_VALUE_UNITS"));if(x.currSelected){v.setAttribute("checked","checked")}s.appendChild(u);u=document.createElement("td");if(le.instanceOf!=="TableModel"){var c={width:A[8]+"px",minWidth:A[8]+"px"}}else{var c={width:A[6]+"px",minWidth:A[6]+"px"}}St["b"].Utils.DOM.setStyle(u,c);var C=l.legend;var y="";var M=C.currSelected?C.currSelected.split(".").pop():"";var S=C.currSelected&&z.some(function(e,t){var i=e===C.currSelected||e&&C.currSelected.indexOf(e)!==-1;if(i){y=z[t];C.currSelected=z[t]}return i});if(!S){if(le.instanceOf==="ChartModel"||le.instanceOf==="TimeChartModel"){y=z[3];C.currSelected=z[3]}else if(le.instanceOf==="TableModel"){if(l.representations.currSelected===mt[1]){y=z[3];C.currSelected=z[3]}else{y=z[2];C.currSelected=z[2]}}}var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##legend",z,j,y,k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_SHOW"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(u);if(le.instanceOf!=="TableModel"){var u=document.createElement("td");var c={width:A[9]+"px",minWidth:A[9]+"px"};St["b"].Utils.DOM.setStyle(u,c);var C=l.legend;var y="Always";if(M){if(M==="Dynamic"){y="Vertical";C.currSelected=C.currSelected.replace("Dynamic","Vertical")}else{y=M}}var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##legendCollision",st,dt,y,k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_DISPLACE"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(u);u=document.createElement("td");var c={width:A[10]+"px",minWidth:A[10]+"px"};St["b"].Utils.DOM.setStyle(u,c);var O=l.connector;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##connector",$e,We,O.currSelected,k);g.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_DESCRIPTION_LEGEND_CONNECTOR"));St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});s.appendChild(u);u=document.createElement("td");var c={width:A[11]+"px",minWidth:A[11]+"px"};St["b"].Utils.DOM.setStyle(u,c);var v=St["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")}St["b"].$(v).bind("change",function(e){F.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=F.createExpressionsOutlierHeader();e.appendChild(t);var i=F.createExpressionsOutlierTable();e.appendChild(i);return e}F.createExpressionsOutlierHeader=function(){var e=document.createElement("div");u=e;e.setAttribute("id","headerOutlierDiv");var t={height:25+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");for(var a=0;a<Le.length;a++){var r=document.createElement("td");if(Le[a]==="Keyfigures"){var o=_[a]}else{var o=_[a]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);St["b"].$(r).html(Ae[a]);if(_e[a]!=""){r.setAttribute("title",_e[a])}n.appendChild(r)}i.appendChild(n);var s=document.createElement("tr");for(var a=0;a<Le.length;a++){var d=document.createElement("td");if(Le[a]==="Keyfigures"){var o=_[a]}else{var o=_[a]}var l={width:o+"px",minWidth:o+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(r,l);St["b"].Utils.DOM.setStyle(d,l);var c=document.createElement("span");c.style.margin="0px";St["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};F.createExpressionsOutlierTable=function(){var e=document.createElement("div");b=e;e.setAttribute("id","tableOutlierDiv");var t={height:200+"px",width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);St["b"].$(e).scroll(function(){F.linkScrollbarOutlierTab()});var i=document.createElement("table");for(var n=0;n<ze.length;n++){var a=ze[n];var r=a.id;var o="";if(a.nameInternal!==null){o=a.nameInternal}else{o=a.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:_[0]+"px",minWidth:_[0]+"px"};St["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);St["b"].$(d).bind("click",function(e){F.highlightRow(e)});St["b"].$(d).html(o);if(_e[0]!=""){d.setAttribute("title",_e[0])}d.style.whiteSpace="nowrap";s.appendChild(d);var u=document.createElement("td");c={width:_[1]+"px",minWidth:_[1]+"px"};St["b"].Utils.DOM.setStyle(u,c);var p=l.outlierOperator;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierOperator",J,J,p,k);g.setAttribute("title",_e[1]);St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});if(_e[1]!=""){d.setAttribute("title",_e[1])}s.appendChild(u);var u=document.createElement("td");c={width:_[2]+"px",minWidth:_[2]+"px"};St["b"].Utils.DOM.setStyle(u,c);var m=l.outlier?l.outlier:"";var h=et.decode(m);m=et.invertNames(h);var f=St["b"].Utils.DOM.createTextInput(u,"select##"+r+"##outlier",m,0,k);f.setAttribute("size","8");St["b"].$(f).css("padding",0);if(_e[2]!=""){u.setAttribute("title",_e[2])}s.appendChild(u);var u=document.createElement("td");c={width:_[3]+"px",minWidth:_[3]+"px"};St["b"].Utils.DOM.setStyle(u,c);var p=l.outlierLabel;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierLabel",Q,q,p,k);St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});if(_e[3]!=""){u.setAttribute("title",_e[3])}s.appendChild(u);var u=document.createElement("td");c={width:_[4]+"px",minWidth:_[4]+"px"};St["b"].Utils.DOM.setStyle(u,c);var v=St["b"].Utils.DOM.createCheckBoxWithLabel(u,"select##"+r+"##outlierSymbols","select##"+r+"##outlierSymbolsName","","").checkBox;if(l.outlierSymbols){v.setAttribute("checked","checked")}if(_e[4]!=""){u.setAttribute("title",_e[4])}s.appendChild(u);var u=document.createElement("td");c={width:_[5]+"px",minWidth:_[5]+"px"};St["b"].Utils.DOM.setStyle(u,c);var p=l.outlierStyle;var g=St["b"].Utils.DOM.createSelectBox(u,"select##"+r+"##outlierStyle",ee,te,p,k);St["b"].$(g).bind("change",function(e){F.temporaryChangeSelection(e)});if(_e[5]!=""){u.setAttribute("title",_e[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=F.createExpressionsTotalHeader();e.appendChild(t);var i=F.createExpressionsTotalTable();e.appendChild(i);return e}F.createExpressionsTotalHeader=function(){var e=document.createElement("div");v=e;e.setAttribute("id","headerTotalDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("td");var r={width:I[0]+"px",minWidth:I[0]+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(a,r);St["b"].$(a).html(se.getTranslation("TYPE"));a.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"};St["b"].Utils.DOM.setStyle(o,r);St["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"};St["b"].Utils.DOM.setStyle(l,r);St["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";St["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"};St["b"].Utils.DOM.setStyle(c,r);St["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";St["b"].$(d).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');c.appendChild(d);n.appendChild(a);n.appendChild(o);n.appendChild(l);n.appendChild(c);i.appendChild(n);var p=document.createElement("tr");for(var u=0;u<Ie.length;u++){var g=document.createElement("td");var m=I[u];var r={width:m+"px",minWidth:m+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(g,r);St["b"].$(g).html(De[u]);g.setAttribute("title",Re[u]);p.appendChild(g)}i.appendChild(p);var h=document.createElement("tr");for(var u=0;u<Ie.length;u++){var f=document.createElement("td");m=I[u];var r={width:m+"px",minWidth:m+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(g,r);St["b"].Utils.DOM.setStyle(f,r);var d=document.createElement("span");d.style.margin="0px";St["b"].$(d).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');f.appendChild(d);h.appendChild(f)}i.appendChild(h);e.appendChild(i);return e};F.createExpressionsTotalTable=function(){var e=document.createElement("div");M=e;e.setAttribute("id","tableTotalDiv");var t={height:175+"px",width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);St["b"].$(e).scroll(function(){F.linkScrollbarTotalTab()});var i=document.createElement("table");var n=document.createElement("tr");var a={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 m={width:I[0]+"px",minWidth:I[0]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var h=St["b"].Utils.DOM.createSelectBox(g,"select##_##stackType",Ne,Pe,a.currSelected,k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_TYPE"));n.appendChild(g);var g=document.createElement("td");var m={width:I[1]+"px",minWidth:I[1]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);if(le.instanceOf==="ChartModel"){var f=Ze;var v=Qe}else{var f=qe;var v=Je}var h=St["b"].Utils.DOM.createSelectBox(g,"select##_##stackPosition",f,v,o.currSelected,k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_POSITION"));n.appendChild(g);var g=document.createElement("td");var m={width:I[2]+"px",minWidth:I[2]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var h=St["b"].Utils.DOM.createSelectBox(g,"select##_##stackLabelAlignment",$,W,d.currSelected?d.currSelected.split(".")[0]:"",k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_ALIGNMENT"));n.appendChild(g);var g=document.createElement("td");var m={width:I[3]+"px",minWidth:I[3]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var b=St["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")}n.appendChild(g);var g=document.createElement("td");var m={width:I[4]+"px",minWidth:I[4]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var b=St["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"));n.appendChild(g);var g=document.createElement("td");var m={width:I[5]+"px",minWidth:I[5]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var h=St["b"].Utils.DOM.createSelectBox(g,"select##_##stackShowLabel",w,U,l.currSelected?l.currSelected.split(".")[0]:"",k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_SHOW"));St["b"].$(h).bind("change",function(e){F.temporaryChangeSelection(e);F.activateDeactivateButtonStack(e.target)});n.appendChild(g);var g=document.createElement("td");var m={width:I[6]+"px",minWidth:I[6]+"px",backgroundColor:"rgb(232,232,232)"};var T=St["b"].Utils.DOM.createButtonInput(g,"select##_##functionButton","","fx",k);var E=l.currSelected?l.currSelected.split(".")[0]:"";if(E!=="Function"){T.disabled=true}St["b"].$(T).on("click",function(e){F.openFunctionDialogStack(e)});St["b"].Utils.DOM.setStyle(g,m);T.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_FORMULA"));n.appendChild(g);var g=document.createElement("td");var m={width:I[7]+"px",minWidth:I[7]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var b=St["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"));n.appendChild(g);var g=document.createElement("td");var m={width:I[8]+"px",minWidth:I[8]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var b=St["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"));n.appendChild(g);var g=document.createElement("td");var m={width:I[9]+"px",minWidth:I[9]+"px",backgroundColor:"rgb(232,232,232)"};St["b"].Utils.DOM.setStyle(g,m);var h=St["b"].Utils.DOM.createSelectBox(g,"select##_##stackLine",we,Ue,p.currSelected,k);h.setAttribute("title",se.getTranslation("HELP_CELL_MEASURES_STACK_100_PERCENT_LINE"));n.appendChild(g);i.appendChild(n);e.appendChild(i);return e};function createExpressionsScalingTab(){var e=document.createElement("div");e.setAttribute("id","tabScalingDiv");var t=F.createExpressionsScalingHeader();e.appendChild(t);var i=F.createExpressionsScalingTable();e.appendChild(i);return e}F.createExpressionsScalingHeader=function(){var e=document.createElement("div");T=e;e.setAttribute("id","headerScalingDiv");var t={height:50+"px",width:"auto",overflow:"hidden"};St["b"].Utils.DOM.setStyle(e,t);var i=document.createElement("table");var n=document.createElement("tr");var a=document.createElement("tr");for(var r=0;r<Be.length;r++){if(Be[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<Be.length;c++){if(Be[c]==""){d++;s+=D[c]}else{break}}var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);o.setAttribute("colspan",d);St["b"].$(o).html(Be[r]);o.setAttribute("title",He[r]);n.appendChild(o);St["b"].Utils.DOM.setStyle(l,u);l.setAttribute("colspan",d);var p=document.createElement("span");p.style.margin="0px";St["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');if(Fe[r]!=="Keyfigures"&&Fe[r]!=="Maximize"){l.appendChild(p)}a.appendChild(l)}i.appendChild(n);i.appendChild(a);var g=document.createElement("tr");for(var r=0;r<ke.length;r++){var o=document.createElement("td");var s=D[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);St["b"].$(o).html(Ge[r]);o.setAttribute("title",Ve[r]);g.appendChild(o)}i.appendChild(g);var a=document.createElement("tr");for(var r=0;r<ke.length;r++){var l=document.createElement("td");var s=D[r];var u={width:s+"px",minWidth:s+"px",whiteSpace:"nowrap"};St["b"].Utils.DOM.setStyle(o,u);St["b"].Utils.DOM.setStyle(l,u);var p=document.createElement("span");p.style.margin="0px";St["b"].$(p).html('<hr style="margin:0px 0px 3px 0px; color:#000000; background-color:#000000">');l.appendChild(p);a.appendChild(l)}i.appendChild(a);e.appendChild(i);return e};F.createExpressionsScalingTable=function(){var e=document.createElement("div");f=e;e.setAttribute("id","tableScalingDiv");var t={height:175+"px",width:"100%",overflow:"auto"};St["b"].Utils.DOM.setStyle(e,t);St["b"].$(e).scroll(function(){F.linkScrollbarScalingTab()});var i=document.createElement("table");for(var n=0;n<ze.length;n++){var a=ze[n];var r=a.id;var o="";if(a.nameInternal!==null){o=a.nameInternal}else{o=a.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"};St["b"].Utils.DOM.setStyle(d,c);d.setAttribute("id",r);St["b"].$(d).bind("click",function(e){F.highlightRow(e)});St["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"};St["b"].Utils.DOM.setStyle(g,c);var u=l.scalingMaximize;var p=St["b"].Utils.DOM.createCheckBoxWithLabel(g,"select##"+r+"##scalingMaximize","select##"+r+"##scalingMaximize","","").checkBox;if(u){p.setAttribute("checked","checked")}St["b"].$(p).bind("change",function(e){F.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"};St["b"].Utils.DOM.setStyle(g,c);var m=St["b"].Utils.DOM.createSelectBox(g,"select##"+r+"##scalingLegendShow",je,Xe,l.scalingLegendShow,k);St["b"].$(m).bind("change",function(e){F.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"};St["b"].Utils.DOM.setStyle(g,c);var m=St["b"].Utils.DOM.createSelectBox(g,"select##"+r+"##scalingLegendDisplace",Ye,Ke,l.scalingLegendDisplace,k);St["b"].$(m).bind("change",function(e){F.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"};St["b"].Utils.DOM.setStyle(g,c);var p=St["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(F.createExpressionsInputHeader());e.appendChild(F.createExpressionsInputTable())}return e}F.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",n="1px solid lightGray",a="pointer";var r=document.createElement("table");if(le.input.keyColumns.length>y.rows.length||le.input.keyColumns.length===0){St["b"].Utils.ExpressionParser.fillKeyColumns(y,le)}var o=le.input.keyColumns.length+" "+se.getTranslation("OF")+" "+y.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:n,cursor:a,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:n,cursor:a,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:n,cursor:a,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}F.createExpressionsInputTable=function(){var e=de.tableRepresentation;var t=document.createElement("div");t.setAttribute("id","tabInputTableDiv");var i=document.createElement("table");var n=getInputSaveNames(y.id);var a=createInputTabHeaderRow();c.buildTableRow(i,a.headers);c.buildTableRow(i,a.separator);a=null;for(var r in it){var o=it[r];if(o.representations.currSelected===e.LIST){a=createInputTabList(o,r,n)}else if(o.representations.currSelected===e.COMMENT){a=createInputTabComment(o,r,n)}else if(o.representations.currSelected===e.FLAG){a=createInputTabFlag(o,r,n)}if(a){c.buildTableRow(i,a);a=null}}t.appendChild(i);return t};function getInputSaveNames(e){var t=[];var i=e.split(".")[0];var n=St["b"].DataObjects.InlineCommentRepo.getInlineCommentRepo()[i];if(n){for(var a=0;a<n.length;a++){if(t.indexOf(n[a].saveName)===-1){t.push(n[a].saveName)}}}return t}F.updateInputTab=function(e){if(checkExpressionsForInput()){St["b"].$(H).tabs("disable",5)}else{St["b"].$(H).tabs("enable",5)}St["b"].$("#tabInputTableDiv").html(F.createExpressionsInputTable())};function createInputBoxArray(){var e=St["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=St["b"].Utils.Calculator.IFrameCalculation;t.setSpanFont("normal "+k+" 'Arial'");t.setSpanHTML("None");var i={names:["None"],ids:["none"],width:[t.getSpanWidth()]};for(var n=0,a=e.length;n<a;n++){i.names.push(e[n].name);i.ids.push(e[n].id);t.setSpanHTML(e[n].name);i.width.push(t.getSpanWidth())}return i}function openKeyDialog(){var e=new St["b"].UI.KeyDialog({chartModel:le,parent:F});e.open()}function openCommonTableDialog(){var e=it[this.id.split("##")[0]];if(e){var t=new St["b"].UI.CommonTableDialog({parent:F,parentId:this.id,expr:e});t.open()}}F.setCommonTable=function(e){var t=e.parentId.split("##");var i=it[t[0]];if(i){var n=document.getElementById(e.parentId);if(e.hash){i.commonTable=e.hash;if(n){n.innerHTML=St["b"].DataObjects.CommonTableRepo.getCommonTable(e.hash).key}St["b"].Connector.ConnectorHelper.VisualizationMenu_setCommonTable_addStyles(t[0])}else{i.commonTable=null;if(n){n.innerHTML=se.getTranslation("SELF")}St["b"].Connector.ConnectorHelper.VisualizationMenu_setCommonTable_removeStyles(t[0],i)}}};function openKeyVariable(){St["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"));St["b"].Utils.DOM.setStyle(i,{listStyleType:"none",padding:"2px 4px",margin:0+"px"});createEntry(i,this);document.body.appendChild(t);var n=8;for(var a=0;a<P.width.length;a++){n=Math.max(n,P.width[a]+8)}var r=i.children[0].clientHeight*7;if(r<i.clientHeight){var o=getScrollBarWidth();n+=o}St["b"].Utils.DOM.setStyle(t,{position:"absolute",backgroundColor:"rgb(240, 240, 240)",fontFamily:"'Arial'",fontSize:k,top:e.top+"px",left:e.left+"px",border:"1px solid lightGray",overflow:"auto",maxHeight:r+"px",width:n+"px",zIndex:9999})}function equalsVariable(e,t){return e==P.ids[t]||e==P.names[t]}function createEntry(e,t){var i="none";for(var n=0;n<P.ids.length;n++){var a=e.appendChild(document.createElement("li"));a.setAttribute("id",t.id+"##"+n);if(P.names[n].toUpperCase()===i.toUpperCase()){St["b"].$(a).css("color","rgb(150, 150, 150)");if(t.id==="inputKeyVariable"){a.innerHTML=se.getTranslation("NONE")}else{a.innerHTML=se.getTranslation("NOT_ALLOWED")}}else{if(t.id==="inputKeyVariable"){if(equalsVariable(le.input.keyVariable,n)){St["b"].$(a).css("font-weight","bold")}}else{if(equalsVariable(le.input.saveVariable,n)){St["b"].$(a).css("font-weight","bold")}}a.innerHTML=P.names[n]}St["b"].$(a).hover(function(){St["b"].$(this).addClass("highlightListElement")},function(){St["b"].$(this).removeClass("highlightListElement")});St["b"].$(a).click(selectListBoxElement)}}function selectListBoxElement(){var e=this.id.split("##");var t=parseInt(e[1]);if(e[0]==="inputKeyVariable"){if(t!==0){le.input.keyVariable=P.names[t]}else{le.input.keyVariable=null}}else{if(t!=0){le.input.saveVariable=P.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 n=document.getElementById(e[0]);n&&(n.textContent=i);St["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<P.names.length;i++){if(P.names[i]===this.value){t=i;break}}if(t!==-1){e.addKeyVariable=P.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=St["b"].$("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=St["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 St["b"].UI.ListKeyDialog({obj:t,parent:F,id:e,context:y});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()!==S.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=S;t.saveName=S;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()===S.toLowerCase())){i.style.color="rgb(0,0,0)"}}}function checkValue(e,t){for(var i in it){var n=it[i];var a;if(document.getElementById(t+"##inputAddKey_text")){a=document.getElementById(t+"##inputAddKey_text").value}if(i!==t&&n.saveName===e&&n.addKeyVariable===a){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()===S.toLowerCase()){this.value=""}this.style.color="rgb(0, 0, 0)"}F.setListKeyDialog=function(e,t){var i=it[t];if(i){i.listContent=JSON.parse(JSON.stringify(e.listContent));i.listContentDefault=e.listContentDefault}var n=document.getElementById(t+"##inputLength");n.innerHTML=i.listContent.length-1};F.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")+" "+y.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]+"##"+at.ACTIVE);var n=document.getElementById(e[0]+"##"+at.INACTIVE);var a=document.getElementById(e[0]+"##"+at.BACKEND);var r=St["b"].Connector.ConnectorHelper.IsActivateTransport(t);switch(e[1]){case"inputNumbers":if(St["b"].$(this).hasClass("cellOpClass")){t.number=true;St["b"].$(this).removeClass("cellOpClass")}else{t.number=false;St["b"].$(this).addClass("cellOpClass")}if(t.isDate){var o=document.getElementById(e[0]+"##inputDate");if(o){St["b"].$(o).addClass("cellOpClass");t.isDate=false}}break;case"inputDate":if(St["b"].$(this).hasClass("cellOpClass")){t.isDate=true;St["b"].$(this).removeClass("cellOpClass")}else{t.isDate=false;St["b"].$(this).addClass("cellOpClass")}if(t.number){var o=document.getElementById(e[0]+"##inputNumbers");if(o){St["b"].$(o).addClass("cellOpClass");t.number=false}}break;case"inputEdit":if(St["b"].$(this).hasClass("cellOpClass")){t.edit=true;St["b"].$(this).removeClass("cellOpClass")}else{t.edit=true;St["b"].$(this).addClass("cellOpClass")}break;case"inputMandatory":if(St["b"].$(this).hasClass("cellOpClass")){t.mandatory=true;St["b"].$(this).removeClass("cellOpClass")}else{t.mandatory=true;St["b"].$(this).addClass("cellOpClass")}break;case at.ACTIVE:r&&St["b"].$(i).removeClass("cellOpClass");St["b"].$(a).addClass("cellOpClass");t.transport=at.ACTIVE;break;case at.INACTIVE:St["b"].$(i).addClass("cellOpClass");St["b"].$(n).removeClass("cellOpClass");St["b"].$(a).addClass("cellOpClass");t.transport=at.INACTIVE;break;case at.BACKEND:St["b"].$(i).addClass("cellOpClass");r&&St["b"].$(a).removeClass("cellOpClass");t.transport=at.BACKEND;break}}}function createInputTabHeaderRow(){var e=de.tableRepresentation;var t=false;for(var i in it){var n=it[i];if(n.representations.currSelected===e.COMMENT){t=true;break}}var a=[{type:"text",value:nt[0],tdStyle:{width:R[0]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_MEASURE")},{type:"text",value:nt[1],tdStyle:{width:R[1]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_TYPE")},{type:"text",value:nt[2],tdStyle:{width:R[2]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_LENGTH")},{type:"text",value:nt[3],tdStyle:{width:R[3]+"px",textAlign:"left"},tooltip:se.getTranslation("HELP_CELL_INPUT_SOURCE")},{type:"text",value:nt[4],tdStyle:{width:R[4]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_SAVE_AS")},{type:"text",value:nt[5],tdStyle:{width:R[5]+"px"},tooltip:se.getTranslation("HELP_CELL_INPUT_ADDITIONAL_KEY")},{type:"text",value:nt[6],tdStyle:{width:R[6]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_EDIT")},{type:"text",value:nt[7],tdStyle:{width:R[7]+"px",textAlign:"center"},tooltip:se.getTranslation("HELP_CELL_INPUT_MANDATORY")},{type:"text",value:nt[8],tdStyle:{width:R[8]+"px",textAlign:"center"},tooltip:se.getTranslation(St["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){a.push({type:"text",value:nt[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:a,separator:r}}function createInputTabList(e,t,i){var n=S;var a="rgb(150, 150, 150)";if(e.saveName){n=e.saveName;a="rgb(0, 0, 0)"}var r=e.commonTable&&St["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=St["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:a},length:21,value:n,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 n=S;var a="rgb(150, 150, 150)";if(e.saveName){n=e.saveName;a="rgb(0, 0, 0)"}var r=e.commonTable&&St["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=St["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:a},length:21,value:n,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<P.names.length;t++){if(P.names[t]!=="None"){e.push(P.names[t])}}return e}function getVariableByKey(e){if(e==null){return""}for(var t=0;t<P.ids.length;t++){if(equalsVariable(e,t)){return P.names[t]}}return""}function createInputTabFlag(e,t,i){var n=S;var a="rgb(150, 150, 150)";if(e.saveName){n=e.saveName;a="rgb(0, 0, 0)"}var r=e.commonTable&&St["b"].DataObjects.CommonTableRepo.getCommonTable(e.commonTable);var o=r?r.key:se.getTranslation("SELF");var l=St["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:a},length:21,value:n,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 n=JSON.parse(JSON.stringify(rt));for(var a=0;a<n.length;a++){n[a].id=e+"##"+n[a].value;if(i||n[a].value!==t&&!castInactiveToBackend(n[a].value)){n[a].clazz="cellOpClass"}}return n;function castInactiveToBackend(e){return St["b"].Connector.ConnectorHelper.VisualizationMenu_castInactiveToBackend(e,t)}}F.updateTableDivHeight=function(e,t,i,n,a){if(e===null||t==null||i===null||n===null||a==null){return}var r=c.getDialog().dialog("option","height");St["b"].$(s).height(r-70);r-=160;St["b"].Utils.DOM.setStyle(e,{height:r-25+"px"});St["b"].Utils.DOM.setStyle(t,{height:r-25+"px"});St["b"].Utils.DOM.setStyle(i,{height:r+"px"});St["b"].Utils.DOM.setStyle(n,{height:r-25+"px"});St["b"].Utils.DOM.setStyle(a,{height:r-25+"px"})};F.updateTableDivHeightFromOutside=function(e,t){if(B==null||L==null||b==null||M==null||f==null||H==null||h==null||m==null||u==null||v==null||T==null){return}H.style.height=e-117+"px";t-=14+14;e-=117+30+12;document.getElementById(Mt[i].id).style.height=e+"px";e-=25;switch(i){case 0:B.style.height=e-25+"px";if(B.clientHeight<B.scrollHeight-a){if(d==="firefox"&&B.clientHeight>33||d==="ie"){t-=n+a}else if(d==="chrome"){t-=n}t=t+"px"}else if(B.clientHeight>=B.scrollHeight-a){t="auto"}m.style.width=t;break;case 1:L.style.height=e-25+"px";if(L.clientHeight<L.scrollHeight-a||d==="ie"){if(d==="firefox"&&L.clientHeight>33){t-=n+a}else if(d==="chrome"){t-=n}t=t+"px"}else if(L.clientHeight>=L.scrollHeight-a){t="auto"}h.style.width=t;break;case 2:b.style.height=e+"px";if(b.clientHeight<b.scrollHeight-a||d==="ie"){if(d==="firefox"&&b.clientHeight>33){t-=n+a}else if(d==="chrome"){t-=n}t=t+"px"}else if(b.clientHeight>=b.scrollHeight-a){t="auto"}u.style.width=t;break;case 3:M.style.height=e-25+"px";if(M.clientHeight<M.scrollHeight-a||d==="ie"){if(d==="firefox"&&M.clientHeight>33){t-=n+a}else if(d==="chrome"){t-=n}t=t+"px"}else if(M.clientHeight>=M.scrollHeight-a){t="auto"}v.style.width=t;break;case 4:f.style.height=e-25+"px";if(f.clientHeight<f.scrollHeight-a||d==="ie"){if(d==="firefox"&&f.clientHeight>33){t-=n+a}else if(d==="chrome"){t-=n}t=t+"px"}else if(f.clientHeight>=f.scrollHeight-a){t="auto"}T.style.width=t;break}};F.linkScrollbarGeneralTab=function(){var e=document.getElementById("headerDiv");var t=document.getElementById("tableDiv");e.scrollLeft=t.scrollLeft};F.linkScrollbarColorsDescriptionsTab=function(){var e=document.getElementById("headerColorsDescriptionsDiv");var t=document.getElementById("tableColorsDescriptionsDiv");e.scrollLeft=t.scrollLeft};F.linkScrollbarOutlierTab=function(){var e=document.getElementById("headerOutlierDiv");var t=document.getElementById("tableOutlierDiv");e.scrollLeft=t.scrollLeft};F.linkScrollbarTotalTab=function(){var e=document.getElementById("headerTotalDiv");var t=document.getElementById("tableTotalDiv");e.scrollLeft=t.scrollLeft};F.linkScrollbarScalingTab=function(){var e=document.getElementById("headerScalingDiv");var t=document.getElementById("tableScalingDiv");e.scrollLeft=t.scrollLeft};F.highlightRow=function(e){var t=e.target.id;var i=it[g];var n=document.getElementById(g+"##general");var a=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"){St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","#ffffff");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","#ffffff");St["b"].$(St["b"].$(r),St["b"].$(r)).css("background-color","#ffffff");St["b"].$(St["b"].$(o),St["b"].$(o)).css("background-color","#ffffff")}else{St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(r),St["b"].$(r)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(o),St["b"].$(o)).css("background-color","rgb(232,232,232)")}}var l=g;g="";if(t!==l){n=document.getElementById(t+"##general");a=document.getElementById(t+"##colordesc");r=document.getElementById(t+"##outlier");o=document.getElementById(t+"##scaling");St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","#999999");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","#999999");St["b"].$(St["b"].$(r),St["b"].$(r)).css("background-color","#999999");St["b"].$(St["b"].$(o),St["b"].$(o)).css("background-color","#999999");g=t}};F.highlightInlineCommentRow=function(e){var t=e.target.id;var i=it[g];var n=document.getElementById(g+"##general");if(i!==undefined){if(i.representations.currSelected.split(".").pop()==="0"){St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","#ffffff")}else{St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","rgb(232,232,232)")}}var a=g;g="";if(t!==a){n=document.getElementById(t+"##general");St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","#999999");g=t}};F.setRowHighlightForStartUp=function(e){var t=it[e];var i=document.getElementById(e+"##general");var n=document.getElementById(e+"##colordesc");var a=document.getElementById(e+"##outlier");var r=document.getElementById(e+"##scaling");if(t.representations.currSelected.split(".").pop()!=="0"){St["b"].$(St["b"].$(i),St["b"].$(i)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(r),St["b"].$(r)).css("background-color","rgb(232,232,232)")}};F.setRowHighlightForInputStartUp=function(e){var t=it[e];var i=document.getElementById(e+"##general");if(t.representations.currSelected.split(".").pop()!=="0"){St["b"].$(St["b"].$(i),St["b"].$(i)).css("background-color","rgb(232,232,232)")}};F.setRowHighlightRepresentation=function(e){var t=it[e];var i=document.getElementById(e+"##general");var n=document.getElementById(e+"##colordesc");var a=document.getElementById(e+"##outlier");var r=document.getElementById(e+"##scaling");if(g===e){return}if(t.representations.currSelected.split(".").pop()==="0"){St["b"].$(St["b"].$(i),St["b"].$(i)).css("background-color","#ffffff");St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","#ffffff");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","#ffffff");St["b"].$(St["b"].$(r),St["b"].$(r)).css("background-color","#ffffff")}else{St["b"].$(St["b"].$(i),St["b"].$(i)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(n),St["b"].$(n)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(a),St["b"].$(a)).css("background-color","rgb(232,232,232)");St["b"].$(St["b"].$(r),St["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;St["b"].$(e).html(lt[t]);var n=e.clientWidth+1;if(t==2){for(var a=0;a<Et.length;a++){St["b"].$(e).html(Et[a]);i+=e.clientWidth+5}}G[t]=Math.max(n,i)}}else{for(var t=0;t<pt.length;t++){var i=0;St["b"].$(e).html(gt[t]);var n=e.clientWidth+1;if(t==2){for(var a=0;a<Et.length;a++){St["b"].$(e).html(Et[a]);i+=e.clientWidth+5}}V[t]=Math.max(n,i)}G=V}for(var t=0;t<ie.length;t++){St["b"].$(e).html(ie[t]);var n=e.clientWidth+1;A[t]=n}for(var t=0;t<re.length;t++){if(re[t]==="Function"){A[t]=35}else{St["b"].$(e).html(oe[t]);var n=e.clientWidth+1;if(n>A[t]){A[t]=n}}}for(var t=0;t<Le.length;t++){St["b"].$(e).html(Ae[t]);var n=e.clientWidth+1;_[t]=n}for(var t=0;t<Ie.length;t++){St["b"].$(e).html(De[t]);var n=e.clientWidth+1;if(Ie[t]==="Function"){n=35}I[t]=n}for(var t=0;t<Fe.length;t++){St["b"].$(e).html(Be[t]);var n=e.clientWidth+1;D[t]=n}for(var t=0;t<ke.length;t++){St["b"].$(e).html(Ge[t]);var n=e.clientWidth+1;if(n>D[t]){D[t]=n}}for(var t=0,r=nt.length;t<r;t++){St["b"].$(e).html(nt[t]);var n=e.clientWidth+1;R[t]=n}}F.calculateColumnsLength=function(){var e=document.getElementById("hiddenDiv");if(ue!==true){for(var t=0;t<ze.length;t++){St["b"].$(e).html(ze[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<ze.length;t++){St["b"].$(e).html(ze[t].name);var i=e.clientWidth+35;if(i>G[0]){G[0]=i}}}for(var n=1;n<ft.length;n++){var a=ft[n];for(var t=0;t<a.length;t++){if(a[t].instanceOf!=="ExpressionDO"||a[t].instanceOf===undefined){if(a[t].translation!==undefined){St["b"].$(e).html(a[t].translation)}else{St["b"].$(e).html(a[t])}var i=e.clientWidth+35;if(i>G[n]){G[n]=i}}else{break}}}}else{for(var t=0;t<ze.length;t++){St["b"].$(e).html(ze[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 n=1;n<vt.length;n++){var a=vt[n];for(var t=0;t<a.length;t++){if(a[t].instanceOf!=="ExpressionDO"||a[t].instanceOf===undefined){if(a[t].translation!==undefined){St["b"].$(e).html(a[t].translation)}else{St["b"].$(e).html(a[t])}var i=e.clientWidth+35;if(i>V[n]){V[n]=i}}else{break}}}G=V}A[0]=G[0];for(var n=1;n<Ct.length;n++){var a=Ct[n];for(var t=0;t<a.length;t++){St["b"].$(e).html(a[t]);var i=e.clientWidth+35;if(i>A[n]){A[n]=i}}}_[0]=G[0];for(var n=1;n<tt.length;n++){var a=tt[n];if(a===""){var r=document.createElement("input");r.type="text";r.setAttribute("size","8");St["b"].$(e).html(r);var i=e.clientWidth;if(i>_[n]){_[n]=i}}else{for(var t=0;t<a.length;t++){St["b"].$(e).html(a[t]);var i=e.clientWidth+35;if(i>_[n]){_[n]=i}}}}for(var n=0;n<bt.length;n++){var a=bt[n];for(var t=0;t<a.length;t++){St["b"].$(e).html(a[t]);var i=e.clientWidth+35;if(i>I[n]){I[n]=i}}}D[0]=G[0];for(var n=1;n<yt.length;n++){var a=yt[n];for(var t=0;t<a.length;t++){St["b"].$(e).html(a[t]);var i=e.clientWidth+35;if(i>D[n]){D[n]=i}}}for(var t=0,o=ze.length;t<o;t++){St["b"].$(e).html(ze[t].nameInternal?ze[t].nameInternal:ze[t].name);var i=e.clientWidth+35;if(R[0]<i){R[0]=i}}St["b"].$(e).html(se.getTranslation("LIST"));var i=e.clientWidth+1;if(R[1]<i){R[1]=i}St["b"].$(e).html(se.getTranslation("COMMENT"));var i=e.clientWidth+1;if(R[1]<i){R[1]=i}St["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<ze.length;e++){it[ze[e].id]=createExpressionObject(ze[e])}}function createExpressionObject(e){var t=null;var i=e;if(le.expressions){for(var n=0;n<le.expressions.length;n++){if(le.expressions[n].id===e.id){t=le.expressions[n];break}}}if(t){i=t;if(!i.addKeyVariable){i.addKeyVariable=e.addKeyVariable}}var a=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:mt,availRepresentationsTL:ht,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:Ce,availConceptsTL:ye,currSelected:i.concept};var u=se.getTranslation("AREA");var p=se.getTranslation("COLOR");var g=se.getTranslation("AREA_COLOR");var m=[];var h=[];for(var n=0;n<Me.length;n++){if(Me[n]==="conceptType.0"||Me[n]==="conceptType.1"||Me[n]==="conceptType.4"){m.push(Me[n])}}for(var n=0;n<Se.length;n++){if(Se[n]===u||Se[n]===p||Se[n]===g){h.push(Se[n])}}if(i.referenceConcept===undefined){i.referenceConcept=i.concept}var f={availConceptsRef:m,availConceptsTLRef:h,currSelected:i.referenceConcept};var v=null;var b=null;var T=null;var E={currSelected:false};if(le.instanceOf!=="TableModel"){v={availPositions:me,availPositionsTL:he,currSelected:l};var x=t?t.stackOrder:false;T={availStack:fe,availStackTL:ve,currSelected:x};b={availSequence:be,availSequenceTL:Te,currSelected:e.sequence}}else{E.currSelected=i.axisMid?i.axisMid:false}var C=false;for(var n=0;n<e.ruleRepository.length;n++){if(e.ruleRepository[n].referenceUsed==true){ue=true;C=true;break}}if(!C){if(le.instanceOf==="TimeChartModel"){var y=Ee.slice(0,2);var M=xe.slice(0,2)}else{var y=Ee.slice(0,3);var M=xe.slice(0,3)}if(le.instanceOf==="TableModel"&&e.representation===de.tableRepresentation.VALUE){y=[y[0],y[2]];M=[M[0],M[2]]}var S={availNotations:y,availNotationsTL:M,currSelected:o}}else{var S={availNotations:Ee,availNotationsTL:xe,currSelected:o}}var O=i.outlier;var L=i.outlierLabel;var A=i.outlierOperator;var _=i.outlierSymbols;var I=t?t.outlierStyle:St["b"].DataObjects.RuntimeDO.getParameter("SELECT_OUTLIER_STYLE");var D={currSelected:i.valueLabelOpt?i.valueLabelOpt:"All.Dynamic"};var R=[];for(var N=0;N<i.valueLabelFormulaArray.length;N++){var P=i.valueLabelFormulaArray[N].id;var w=i.valueLabelFormulaArray[N].appliesFormula.formula;var U=i.valueLabelFormulaArray[N].conditionFormula.formula;var F={id:P,appliesFormula:{formula:w,compiledFormula:null},conditionFormula:{formula:U,compiledFormula:null}};R.push(F)}var B={currSelected:i.units};var H={currSelected:i.valueLabelBackground?i.valueLabelBackground:"transparent"};var k={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 W={currSelected:i.connector};var z=i.scalingMaximize;var j=i.scalingLegendShow;var X=i.scalingLegendDisplace;var Y=i.scalingLegendSign;var K=St["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 ne=i.listContentDefault;var ae=i.transport?i.transport:at.BACKEND;var re=i.commonTable?i.commonTable:null;var oe={name:a,representations:s,positions:v,sequence:b,stack:T,notation:S,concept:c,outlier:O,outlierLabel:L,outlierOperator:A,outlierSymbols:_,outlierStyle:I,valueLabel:D,valueLabelFormulaArray:R,valueLabelUnits:B,legend:V,connector:W,legendInGrid:$,referenceUsed:ue,valueLabelBackground:H,valueLabelType:k,valueLabelOverlapSelf:G,scalingMaximize:z,scalingLegendSign:Y,scalingLegendShow:j,scalingLegendDisplace:X,scalingGroup:K,showRestAsValue:i.showRestAsValue,showSubtotalAsValue:i.showSubtotalAsValue,showTotalAsValue:i.showTotalAsValue,axisMid:E,reference:d,referenceConcept:f,listContent:Z,edit:Q,mandatory:q,maxLength:J,saveName:ee,number:te,isDate:ie,listContentDefault:ne,transport:ae,commonTable:re,addKeyVariable:i.addKeyVariable};return oe}function changeRepresentationTypesForInlineComments(e,t){var i=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(y,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}F.updateAllExpressionCollectionObjects=function(){for(var e in it){F.updateExpressionCollectionObject(e,false)}F.updateExpressionCollectionReferenceObject()};F.updateExpressionCollectionReferenceObject=function(){if(le.instanceOf!=="TableModel"){var e=Ne[document.getElementById("select##_##stackType").selectedIndex]==="%";for(var t=0;t<ze.length;t++){var i=ze[t];var n=it[i.id];var a=n.stack.currSelected!==false?true:false;var r=document.getElementById("select##"+i.id+"##reference");var o=n.reference;for(var l=0;l<ze.length;l++){var s=it[ze[l].id];var d=ze[l].id.split(".").pop();if(i.id===ze[l].id){continue}if(i.scalingGroup===ze[l].scalingGroup&&n.representations.currSelected!==de.timeRepresentation.NONE&&n.representations.currSelected!==de.structureRepresentation.NONE&&s.representations.currSelected!==de.timeRepresentation.VALUE&&(!e||s.stack.currSelected===false&&!a)){if(o.availReferencesIds.indexOf(d)===-1){if(a===false||s.stack.currSelected===false){o.availReferences.push(ze[l].name);o.availReferencesIds.push(d);var c=document.createElement("option");St["b"].$(c).html(ze[l].name);r.appendChild(c)}}else{if(a===true&&s.stack.currSelected!==false){F.removeReferenceEntries(o,l,r)}}}else{F.removeReferenceEntries(o,l,r)}}}F.setReferencesAndDisableEnableElements()}};F.removeReferenceEntries=function(e,t,i){var n=e.availReferencesIds.indexOf(ze[t].id.split(".").pop());if(n!==-1){e.availReferences.splice(n,1);e.availReferencesIds.splice(n,1);if(e.availReferencesIds.indexOf(e.currSelected)===-1){e.currSelected=ge;i.selectedIndex=0}i.options.remove(n)}};F.setReferencesAndDisableEnableElements=function(){var e=999999;var t=undefined;var i=undefined;var n=undefined;for(var a in it){var r=it[a];if(r.stack.currSelected!==false&&r.stack.currSelected<e){e=r.stack.currSelected;t=r.reference.currSelected;i=a;n=r.scalingGroup}}for(var a in it){var o=document.getElementById("select##"+a+"##reference");var l=document.getElementById("select##"+a+"##stack");var r=it[a];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(n!==undefined&&r.scalingGroup!==n){l.selectedIndex=0;l.setAttribute("disabled","disabled");r.stack.currSelected=false;var d=document.getElementById("select##"+a+"##valueLabelType");if(d){var c=Z.slice(0);c.splice(3,1);c.splice(2,1);F.updateDropboxElements(d,c,r.valueLabelType,K,Z,le)}}else{l.removeAttribute("disabled")}}if(a!==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")}}};F.updateExpressionCollectionObject=function(e,t){F.typeChange(le,e,false);var i=document.getElementById("select##"+e+"##notation");var n=document.getElementById("select##"+e+"##representation");var a=document.getElementById("select##"+e+"##referenceConcept");if(a!==null){F.referenceConceptChange(n,a,i,true)}F.activateDeactivateButton(e)};F.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};F.getActiveTab=function(){return St["b"].$(H).tabs("option","selected")};F.setActiveTab=function(e){return St["b"].$(H).tabs("option","selected",e)};F.temporaryChangeSelection=function(e){var t=e.target.id;var i=document.getElementById(t);var n=t.split("##");var a=n[1];var r=n[2];var o=it[a];switch(r){case"representation":var l=o.representations;var s=i.selectedIndex;l.currSelected=l.availRepresentations[s];F.updateExpressionCollectionObject(a,true);F.setRowHighlightRepresentation(a);F.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##"+a+"##reference");d.selectedIndex=0;o.reference.currSelected=o.reference.availReferencesIds[d.selectedIndex]}F.handleStackReferenceExpressions(r,o,a);F.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];F.handleStackReferenceExpressions(r,o,a);F.setReferencesAndDisableEnableElements();F.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##"+a+"##valueLabelCollisionD").checked?".Dynamic":".Always";l.currSelected=w[s]+c}break;case"valueLabelType":var l=o.valueLabelType;var s=i.selectedIndex;l.currSelected=K[s];break;case"valueLabelCollisionD":var l=o.valueLabel;var s=document.getElementById("select##"+a+"##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=X[s];break;case"legend":var l=o.legend;var s=i.selectedIndex;if(st){var c=st[document.getElementById("select##"+a+"##legendCollision").selectedIndex];l.currSelected=z[s]+"."+c}else{l.currSelected=z[s]}break;case"legendCollision":var l=o.legend;var s=document.getElementById("select##"+a+"##legend").selectedIndex;var c=st[i.selectedIndex];l.currSelected=z[s]+"."+c;if(i.selectedIndex!==0){document.getElementById("select##"+a+"##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##"+a+"##legendCollision").selectedIndex=0;var l=o.legend;var s=document.getElementById("select##"+a+"##legend").selectedIndex;var c=st[0];l.currSelected=z[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:}};F.temporaryChangeInlineCommentSelection=function(e){var t=this.id;var i=document.getElementById(t);var n=t.split("##");var a=n[1];var r=it[a];var o=r.representations;var l=i.selectedIndex;o.currSelected=o.availRepresentations[l];r.type=o.currSelected;F.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"){St["b"].$(St["b"].$(t),St["b"].$(t)).css("background-color","#ffffff")}else{St["b"].$(St["b"].$(t),St["b"].$(t)).css("background-color","rgb(232,232,232)")}}F.handleReferenceFromStack=function(e,t,i){var n=9999999;var a=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<n){n=l.stack.currSelected;a=l;var s=document.getElementById("select##"+o+"##reference")}}}if(r!==undefined){if(i.split(".").pop()!==r){if(a!==undefined){if(t.stack.currSelected!==false){a.reference.currSelected=r;s.selectedIndex=a.reference.availReferencesIds.indexOf(a.reference.currSelected)}}}else{alert(se.getTranslation("ALERT_CHECK_REFERENCE_ITSELF"))}}};F.handleReferenceToStack=function(){var e=0;var t=[];var i=[];var n=[];for(var a in it){var r=it[a];if(r.stack.currSelected!==false){e++;t.push(a.split(".").pop())}}for(var a in it){if(it[a].reference.currSelected!==ge){if(t.indexOf(it[a].reference.currSelected)!==-1){i.push(it[a]);n.push(a)}}}var o=e>=2?F.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##"+n[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}}}}};F.handleStackReferenceExpressions=function(e,t,i){F.handleReferenceFromStack(e,t,i);F.handleReferenceToStack()};F.getHighestStackExpr=function(){var e=undefined;var t=undefined;for(var i in it){var n=it[i];if(n.stack.currSelected!==false&&t===undefined){e=n.stack.currSelected;t=i.split(".").pop()}else{if(n.stack.currSelected!==false){if(n.stack.currSelected>e){e=n.stack.currSelected;t=i.split(".").pop()}}}}return t};F.checkReferences=function(e,t){var i=false;var n=false;var a=0;var r=undefined;var o=undefined;while(a<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){a++;i=n=true;r=undefined}if(l.split(".").pop()===r){a++;i=true;var r=it[l].reference.currSelected}}}if(i===false||n===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]}}};F.openFunctionDialogStack=function(e){N=e.target.id;N=N.replace("select##","");N=N.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 n={extension:C,cid:y.cid,parentDialog:F,title:t,expressionObject:le,functionTarget:N,type:"valueLabelStack"};r=new St["b"].UI.ValueLabelShowFormulaDialog(n);r.open(e.target)};F.openFunctionDialog=function(e){N=e.target.id;N=N.replace("select##","");N=N.replace("##functionButton","");var t=it[N];var i=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(y,N.split(".").pop());var n=t.name+" ("+i.displayId+")";var a={extension:C,cid:y.cid,parentDialog:F,title:n,expressionObject:t,functionTarget:N,type:"valueLabel"};r=new St["b"].UI.ValueLabelShowFormulaDialog(a);r.open(e.target)};F.changeSelection=function(e){var t=le.expressions;le.expressions=[];if(le.stackMode){le.stackMode=false}var i=0;for(var n=0;n<ze.length;n++){var a=ze[n];var r=a.id;var o=it[r];if(le.instanceOf==="TimeChartModel"){a.labelPosition=o.positions.currSelected}else if(le.instanceOf==="ChartModel"){a.currPosition=o.positions.currSelected}if(le.instanceOf==="ChartModel"||le.instanceOf==="TimeChartModel"){a.sequence=o.sequence.currSelected}else{a.sequence=1}a.representation=o.representations.currSelected;var l=t.findIndex(function(e){return e.id===a.id});l=t[l];var s=l&&l.saveName&&l.saveName.toLowerCase()!==S.toLowerCase()?l.saveName:r.split(".").pop().replace("expr","");a.saveName=o.saveName&&o.saveName.toLowerCase()===S.toLowerCase()?null:o.saveName;var d=a.saveName&&a.saveName.toLowerCase()!==S.toLowerCase()?a.saveName:r.split(".").pop().replace("expr","");if(le.instanceOf==="TableModel"&&checkValue(d,r)&&s!==d){if(o.commonTable){x.updateSaveNamesCommon(d,s,a.representation,o.commonTable,le,o)}else{x.updateSaveNamesInline(d,s,a.representation,C,le,o)}}if(le.instanceOf==="TableModel"){if(o.commonTable){x.updateCreatedCommonCommentsListContent(d,o.commonTable,o.listContent,a.representation);x.updateCreateCommonCommentsTransport(d,o.commonTable,a.representation,o.transport)}else{var c=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(y.cid).extension;x.updateCreatedInlineCommentsListContent(d,c,o.listContent,a.representation);x.updateCreateInlineCommentsTransport(d,c,a.representation,o.transport)}}a.edit=o.edit;a.listContent=o.listContent;a.maxLength=o.maxLength;a.mandatory=o.mandatory;a.isDate=o.isDate;a.number=o.number;a.listContentDefault=o.listContentDefault;a.transport=o.transport;a.commonTable=o.commonTable;a.addKeyVariable=o.addKeyVariable;a.concept=o.concept.currSelected;a.referenceConcept=o.referenceConcept.currSelected;a.referenceUsed=o.referenceUsed;a.notationTypeId=o.notation.currSelected;a.axisNotation=o.notation.currSelected===ce.AXIS||o.notation.currSelected===ce.ELEMENT_AXIS;a.reference=o.reference.currSelected;var u=w[document.getElementById("select##"+r+"##valueLabel").selectedIndex];if(le.instanceOf==="TableModel"){var p=".Always";a.valueRowLabelPosition=z[document.getElementById("select##"+r+"##legend").selectedIndex]}else{var p=document.getElementById("select##"+r+"##valueLabelCollisionD").checked?".Always":".Dynamic";var g=z[document.getElementById("select##"+r+"##legend").selectedIndex];var m=st[document.getElementById("select##"+r+"##legendCollision").selectedIndex];a.valueRowLabelPosition=g+"."+m;a.legendInGrid=document.getElementById("select##"+r+"##legendInGrid").checked;a.connector=o.connector.currSelected;a.valueLabelOverlapSelf=document.getElementById("select##"+r+"##valueLabelCollisionSelfD").checked}a.valueLabelOpt=u+p;a.valueLabelBackground=o.valueLabelBackground.currSelected;a.units=document.getElementById("select##"+r+"##valueLabelUnitsD").checked;a.valueLabelType=K[document.getElementById("select##"+r+"##valueLabelType").selectedIndex];a.showRestAsValue=document.getElementById("select##"+r+"##showRestAsValue").checked;a.showSubtotalAsValue=document.getElementById("select##"+r+"##showSubtotalAsValue").checked;a.showTotalAsValue=document.getElementById("select##"+r+"##showTotalAsValue").checked;a.valueLabelFormulaArray=[];for(var h=0;h<o.valueLabelFormulaArray.length;h++){a.valueLabelFormulaArray.push(o.valueLabelFormulaArray[h])}var f=et.encode(document.getElementById("select##"+r+"##outlier").value);a.outlier=f;a.outlierLabel=Q[document.getElementById("select##"+r+"##outlierLabel").selectedIndex];a.outlierOperator=J[document.getElementById("select##"+r+"##outlierOperator").selectedIndex];a.outlierStyle=ee[document.getElementById("select##"+r+"##outlierStyle").selectedIndex];a.outlierSymbols=document.getElementById("select##"+r+"##outlierSymbols").checked;a.scalingMaximize=document.getElementById("select##"+r+"##scalingMaximize").checked;a.scalingLegendShow=je[document.getElementById("select##"+r+"##scalingLegendShow").selectedIndex];a.scalingLegendDisplace=Ye[document.getElementById("select##"+r+"##scalingLegendDisplace").selectedIndex];a.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 At["a"];v.id=r;v.biColumnId=a.biColumnId;v.name=a.name;v.representation=a.representation;if(le.instanceOf==="TimeChartModel"){v.labelPosition=a.labelPosition}else if(le.instanceOf==="ChartModel"){v.currPosition=a.currPosition}else if(le.instanceOf==="TableModel"){v.axisMid=document.getElementById("select##"+r+"##axisMid").checked}v.sequence=a.sequence;v.notation=a.notationTypeId;v.axisNotation=a.axisNotation;v.concept=a.concept;v.referenceConcept=a.referenceConcept;v.reference=a.reference;v.referenceUsed=a.referenceUsed;v.valueLabelOpt=a.valueLabelOpt;v.valueLabelBackground=a.valueLabelBackground;v.units=a.units;v.valueLabelType=a.valueLabelType;v.valueLabelFormulaArray=[];for(var h=0;h<a.valueLabelFormulaArray.length;h++){v.valueLabelFormulaArray.push(a.valueLabelFormulaArray[h])}v.valueRowLabelPosition=a.valueRowLabelPosition;if(le.instanceOf!=="TableModel"){v.legendInGrid=a.legendInGrid;v.connector=a.connector;v.valueLabelOverlapSelf=a.valueLabelOverlapSelf}v.outlier=a.outlier=f;v.outlierLabel=a.outlierLabel;v.outlierOperator=a.outlierOperator;v.outlierStyle=a.outlierStyle;v.outlierSymbols=a.outlierSymbols;v.scalingMaximize=a.scalingMaximize;v.scalingLegendShow=a.scalingLegendShow;v.scalingLegendDisplace=a.scalingLegendDisplace;v.scalingLegendSign=a.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=a.saveName;v.edit=a.edit;v.showRestAsValue=a.showRestAsValue;v.showSubtotalAsValue=a.showSubtotalAsValue;v.showTotalAsValue=a.showTotalAsValue;v.maxLength=a.maxLength;v.listContent=a.listContent;v.mandatory=a.mandatory;v.isDate=a.isDate;v.number=a.number;v.type=a.type;v.listContentDefault=a.listContentDefault;v.transport=a.transport;v.commonTable=a.commonTable;v.addKeyVariable=a.addKeyVariable;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addExpression(le,v)}}if(le.stackMode){if(le.instanceOf==="ChartModel"){var b=Ze}else{var b=qe}le.stackType=Ne[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 n=0;n<le.valueLabelFormulaArray.length;n++){var T=0;var E;for(var h=0;h<le.expressions.length;h++){if(le.expressions[h].stackOrder>T){T=le.expressions[h].stackOrder;E=le.expressions[h].id.split(".")[2]}}le.valueLabelFormulaArray[n].id=E}}}if(!e){C.paint()}return true};F.freeResources=function(){var e=document.getElementById("valueLabelShowFormulaDialog");if(e!==null){if(r!==null){r.close()}}St["b"].$(document.getElementById("HiCoKeyVariableSelectBox")).remove()};F.okay=function(){F.changeSelection();F.close()};F.apply=function(){F.changeSelection()};F.close=function(){c.close();C.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}};St["b"].UI=St["b"].UI||{};St["b"].UI.XLSExporterDialog=function(e){var l=this;var s=e;var C=St["b"].DataObjects.RuntimeDO;var n=C.getTranslation("EXPORT_AS_XLS");var a=s.getCanvasDO().getDOMElement();var y=[];var M=St["b"].DataObjects.ContextRepo.getAllContexts();var S="12px";var r=null;var o=null;l.open=function(){var e="xlsExporterDialog";var t=[{text:C.getTranslation("OKAY"),id:"xlsExporterOkayButton",click:l.okay},{text:C.getTranslation("CANCEL"),id:"xlsExporterCancelButton",click:l.close}];var i=new St["b"].UI.HiCoDialogDefinition(e,n,t);S=i.getFontSize();i.setParentDomElement(a.parentNode);i.setHeight(300);i.setWidth(480);i.setPosition({});i.setResizable(true);i.setModal(true);i.setTooltip(C.getTranslation("HELP_EXPORT_EXCEL"));o=new St["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<M.length;i++){var n=M[i];var a=document.getElementById("CHK_SINGLE_"+i);if(a!==undefined&&a!==null){if(a.checked===true){e.push(n);var r=document.getElementById("SELECT_SINGLE_"+i);if(r!==undefined&&r!==null){t.push(y[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 n=document.createElement("td");St["b"].Utils.DOM.createSpan(n,"&nbsp;","space1");var a=St["b"].Utils.DOM.createIconButton(n,"selectAllButton","","",S,Se["a"].imgPath+"selectAll.png",C.getTranslation("SELECT_ALL"));a.setAttribute("title",C.getTranslation("HELP_EXPORT_EXCEL_CHECKALL"));St["b"].$(a).click(function(e){for(var t=0;t<M.length;t++){var i=document.getElementById("CHK_SINGLE_"+t);if(i!==undefined&&i!==null){i.checked=true}}checkOKEnable()});St["b"].Utils.DOM.createSpan(n,"&nbsp;&nbsp;","space2");var r=St["b"].Utils.DOM.createIconButton(n,"deselectAllButton","","",S,Se["a"].imgPath+"deselectAll.png",C.getTranslation("DESELECT_ALL"));r.setAttribute("title",C.getTranslation("HELP_EXPORT_EXCEL_CHECKNONE"));St["b"].$(r).click(function(e){for(var t=0;t<M.length;t++){var i=document.getElementById("CHK_SINGLE_"+t);if(i!==undefined&&i!==null){i.checked=false}}checkOKEnable()});i.appendChild(n);t.appendChild(i);var o=document.createElement("tr");var l=document.createElement("td");St["b"].Utils.DOM.createSpan(l,"Context","CONTEXT_HEADER");o.appendChild(l);var s=document.createElement("td");St["b"].Utils.DOM.createSpan(s,"Extension - Chart","CONTEXT_HEADER");o.appendChild(s);t.appendChild(o);for(var d=0;d<M.length;d++){var c=[];var u=M[d];var p=document.createElement("tr");var g=document.createElement("td");var m=St["b"].Utils.DOM.createCheckBoxWithLabel(g,"CHK_SINGLE_"+d,"CONTEXT_SINGLE",u.name,false);m.checkBox.setAttribute("title",C.getTranslation("HELP_EXPORT_EXCEL_CHECKCONTEXT"));m.label.setAttribute("title",C.getTranslation("HELP_EXPORT_EXCEL_CHECKCONTEXT"));St["b"].$(m.checkBox).click(function(e){checkOKEnable()});p.appendChild(g);var h=document.createElement("td");var f=findAllTablesForContext(u);var v=[];var b=[];for(var T=0;T<f.length;T++){var E=f[T];v.push(E.extensionNameId?E.extensionNameId+" - "+E.chartNameId:E.chartNameId);b.push(E.extensionId+";"+E.chartId);c.push(E.extensionId+";"+E.chartId)}var x=b.length===2?b[1]:b[0];St["b"].Utils.DOM.createSelectBox(h,"SELECT_SINGLE_"+d,b,v,x,S,30);if(b.length===1){h.firstElementChild.disabled="disabled"}p.appendChild(h);t.appendChild(p);y.push(c)}e.appendChild(t);return e}function findAllTablesForContext(e){var t=[],i=St["b"].DataObjects.DocumentDO.getAllExtensions();t.push({extensionId:"",contextId:"none",chartId:"none"});for(var n=0;n<i.length;n++){var a=i[n];var r=[];St["b"].Models.Actions.ViewModelActions.General.getAllCharts(a.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:a.getId(),chartId:l.id,extensionNameId:a.getTitle()||a.getId(),chartNameId:l.name||l.id})}}}return t}function checkOKEnable(){var e=0;for(var t=0;t<M.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){St["b"].$("#xlsExporterOkayButton").removeAttr("disabled");St["b"].$("#xlsExporterOkayButton").css("color","#000000")}else{St["b"].$("#xlsExporterOkayButton").attr("disabled",true);St["b"].$("#xlsExporterOkayButton").css("color","#BBBBBB")}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CheckUsedCommonTablesExistenceAction={valid:function(){return[]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();if(!i.firstObjectGrid||t.getAdapter().isSnapshotItem()){return}var l="";var s=St["b"].DataObjects.CommonTableRepo;processContainer(i.firstObjectGrid);if(l.length>0){var n=St["b"].Connector.ConnectorHelper.IsExtensionTitleEqualsDefault(t);var a="<b>"+t.getTitle()+(n?" ("+t.getAdapter().getServerId()+")":"")+"</b><br><br>"+Ot["a"].getTranslation("ALERT_UNDEFINED_COMMON_TABLE")+":<br><br>"+l;St["b"].UI.HiCoNotification(a,null)}function processContainer(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];var n=i.extendedModel;if(i&&i.charts){for(var a=0;a<i.charts.length;a++){var r=i.charts[a].model;if("TableModel"===r.instanceOf){processTable(r,i)}}}else if(n&&(n.instanceOf==="ContainerGridModel"||n.instanceOf==="MultipleContainerModel")){processContainer(i)}}}function processTable(e,t){var i=e.expressions;var n="";for(var a=0;a<i.length;a++){var r=i[a];if(r.commonTable&&undefined==s.getCommonTable(r.commonTable)){n+=(n.length>0?", ":"")+getDisplayId(e.contextId,r.id)+" - "+r.name}}if(n.length){var o=t.name?t.name:t.id;l+=(l.length>0?"<br>"+o:o)+": "+n}}function getDisplayId(e,t){var i=St["b"].DataObjects.ContextRepo.getContextByCid(e);if(i){for(var n=0;n<i.columns.length;n++){if(i.columns[n].id===t){return i.columns[n].displayId}}}return""}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CopyReferenceAction={valid:function(){return[]},execute:function(e){var t={x:null,y:null};var i=St["b"].DataObjects.CommentRepo.getSelectedCommentReferenceElement();var n=document.getElementById(i);if(n){var a=St["b"].$.data(n);if(a){var r=e.extension.getAdapter().getContainerElementCoordinates();t.x=parseFloat(n.style.left)-r.x+20;t.y=parseFloat(n.style.top)-r.y;a.currCommentCell.reference.push({active:true,elementPath:null,elementType:null,chartId:a.currCommentCell.created_in_chart,extension:a.extension.getId(),refId:C["a"].createGuid(),id:a.currCommentCell.reference[0].id,position:{x:t.x,y:t.y},freshCreate:true});var o=a.currCommentCell.reference.length-1;a.currCommentCell.reference[o].active=true;St["b"].Layout.CommentReference.redrawReference(e.extension,t,a.currComment,o,a.currCommentCell)}}}};var Be={valid:function(){return[]},execute:function(e){var t=e.additionalData;var i="";if(t){if(t.instanceOf==="InlineModel"){i=t.originalText}else if(t.extendedModel.instanceOf==="CommentModel"){i=t.children[0].text}}Be.copyHtmlToClipboard(i)},createCopyAbsoluteDiv:function(){var e=document.createElement("div");e.style.position="fixed";e.style.left="-20000px";e.style.display="block";e.style.userSelect="all";e.className="selectable";return e},copyHtmlToClipboard:function(e){var t=Be.createCopyAbsoluteDiv();t.innerHTML=e;document.body.appendChild(t);t.focus();t.click();window.getSelection().removeAllRanges();window.getSelection().selectAllChildren(t);document.execCommand("copy");document.body.removeChild(t)}};St["b"].Actions.CopyCommentToClipboardAction=Be;St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateAddColumn={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=false;var r=e.parameters!=undefined&&e.parameters.position==="left";var o=null;var l;if(e.parameters&&e.parameters.caller==="commentModel"){l=e.model.id}else{l=n.selectedChart}if(l===""){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}else{var s=St["b"].Factories.ModelFactory.getModelById(n,l);if(s.extendedModel&&s.extendedModel.instanceOf==="ContainerGridModel"){o=s;a=true}else if(s.extendedModel&&s.extendedModel.instanceOf==="ContainerBorderModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDCOL_TO_BORDER"));return}else{var d=St["b"].Factories.ModelFactory.getParentContainer(n.firstObjectGrid,s);if(d.length>0){var c=d[0];var u=d[1];if(c&&c.extendedModel&&c.extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDCOL_IN_MULTIPLE"));return}else if(u&&u.extendedModel&&u.extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDCOL_IN_MULTIPLE"));return}else if(c.extendedModel.instanceOf==="ContainerGridModel"){o=c}else if(c.extendedModel.instanceOf==="ContainerCommentGridModel"){o=c}else{alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}else{alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}}if(o===null){return}if(o.extendedModel.instanceOf==="ContainerGridModel"||o.extendedModel.instanceOf==="ContainerCommentGridModel"){if(o.extendedModel.instanceOf==="ContainerCommentGridModel"){if(o.children[o.children.length-1].instanceOf==="BackGroundModel"){o.children.pop()}}var p=o.extendedModel;var g=p.gridRows.length;var m=p.gridColumns.length;var h=-1;if(a){if(r){h=0}else{h=m}}else{for(var f=0;f<o.children.length;f++){if(l===o.children[f].id){h=f%m;if(!r){h++}break}}if(h===-1){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}var v=Array(g);for(var f=0;f<g;f++){var b=St["b"].Models.Actions.ModelActions.RootModel.getNextId(n);var T;if(o.extendedModel.instanceOf==="ContainerCommentGridModel"){var E={rows:o.extendedModel.gridRows.length,cols:o.extendedModel.gridColumns.length+1,row:f,col:h,condition:o.extendedModel.condition,conditionValue:o.extendedModel.conditionValue,showCondition:o.extendedModel.showCondition,editCondition:o.extendedModel.editCondition,chartId:b,rootModelId:t.getController().getRootModel().id,commentId:o.extendedModel.commentId,insertNewCellOnBuild:true,titleLabelType:St["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT};T=St["b"].Factories.ModelFactory.buildCommentFields(t,E)}else{T=St["b"].Factories.ModelFactory.buildPlaceHolder(b)}v[f]=T}St["b"].Models.Actions.ExtendedModelActions.ContainerGridModel.addColumn(o,v,h);if(!e.doNotPaint){t.paint()}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateAddRow={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=t.getController();var l=i.getRootModel();var n=false;var a=!(e.parameters&&e.parameters.position==="above");var r=null;var o;if(e.parameters&&e.parameters.caller==="commentModel"){o=e.model.id}else{o=l.selectedChart}if(o===""){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}else{var s=St["b"].Factories.ModelFactory.getModelById(l,o);if(s.extendedModel&&s.extendedModel.instanceOf==="ContainerGridModel"){r=s;n=true}else if(s.extendedModel&&s.extendedModel.instanceOf==="ContainerBorderModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDROW_TO_BORDER"));return}else{var d=St["b"].Factories.ModelFactory.getParentContainer(l.firstObjectGrid,s);if(d.length>0){var c=d[0];var u=d[1];if(c&&c.extendedModel&&c.extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDROW_IN_MULTIPLE"));return}else if(u&&u.extendedModel&&u.extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ADD_GRIDROW_IN_MULTIPLE"));return}else if(c.extendedModel.instanceOf==="ContainerGridModel"){r=c}else if(c.extendedModel.instanceOf==="ContainerCommentGridModel"){r=c}else{alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}else{alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}}if(r===null){return}if(r.extendedModel.instanceOf==="ContainerGridModel"||r.extendedModel.instanceOf==="ContainerCommentGridModel"){if(r.extendedModel.instanceOf==="ContainerCommentGridModel"){if(r.children[r.children.length-1].instanceOf==="BackGroundModel"){r.children.pop()}}var p=r.extendedModel;var g=p.gridRows.length;var m=p.gridColumns.length;var h=-1;if(n){if(a){h=g}else{h=0}}else{for(var f=0;f<r.children.length;f++){if(o===r.children[f].id){h=Math.floor(f/m);if(a){h++}break}}if(h===-1){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}var v=Array(m);for(var f=0;f<m;f++){var b=St["b"].Models.Actions.ModelActions.RootModel.getNextId(l);var T;if(r.extendedModel.instanceOf==="ContainerCommentGridModel"){var E={rows:r.extendedModel.gridRows.length+1,cols:r.extendedModel.gridColumns.length,row:h,col:f,condition:r.extendedModel.condition,conditionValue:r.extendedModel.conditionValue,showCondition:r.extendedModel.showCondition,editCondition:r.extendedModel.editCondition,chartId:b,rootModelId:t.getController().getRootModel().id,commentId:r.extendedModel.commentId,isNewRow:true,insertNewCellOnBuild:true,titleLabelType:St["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT};T=St["b"].Factories.ModelFactory.buildCommentFields(t,E)}else{T=St["b"].Factories.ModelFactory.buildPlaceHolder(b)}v[f]=T}var x=St["b"].Utils.Calculator.Converter;var C=Math.max(10,x.pt2pix(St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART")));expandTitleRowContainer(r);St["b"].Models.Actions.ExtendedModelActions.ContainerGridModel.addRow(r,v,h);if(!e.doNotPaint){t.paint()}}function expandTitleRowContainer(e){var t=e.extendedModel;for(var i=0;i<t.gridRows.length;i++){if(!t.gridRowsFixed[i]){return}}var n=St["b"].Factories.ModelFactory.getParentContainer(l.firstObjectGrid,e)[0];if(n===undefined||n===null||n.extendedModel===undefined||n.extendedModel===null){return}var a;for(var r=0;r<n.children.length;r++){if(n.children[r].id===e.id){a=r;break}}var o=Math.floor(a/n.extendedModel.gridColumns.length);if(n.extendedModel.gridRowsFixed[o]){expandTitleRowContainer(n);if(o===n.extendedModel.gridRows.length-1){n.extendedModel.gridRows[o-1]-=C}else{n.extendedModel.gridRows[o]+=C}n.extendedModel.gridRowsFixed[o]=false}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateAddTableRow={valid:function(){return[St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=document.getElementById("tableAddRowSelector");if(t!==null){return}var i=new St["b"].UI.TableAddRowSelector(e);i.createSelectorDiv()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateBaseExtension={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();var n=e.charts;St["b"].Factories.ModelFactory.createInitialChart(i,t.getChartsMap(),n);t.paint();t.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateBaseLayout={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();St["b"].Factories.ModelFactory.createInitialLayout(i,t.getChartsMap());if(e.dontPaint!==true){t.paint()}t.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateCommentReferenceLink={valid:function(){return[]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();var n=e.model;var a=St["b"].Factories.ModelFactory.getParentContainer(i.firstObjectGrid,e.model);var r=a[0];var o=St["b"].DataObjects.CommentRepo.getCommentById(r.extendedModel.commentId,t.getId());var l=o.currContent.grid[n.row][n.column];var s=null;for(var d=0;d<n.children.length;d++){if(n.children[d].id.indexOf("commentReference")!==-1){s=St["b"].Factories.ModelFactory.getModelById(i,n.children[d].id);break}}if(s&&l){s.isCommentReference=true;l.reference.push({refId:C["a"].createGuid(),version:1,active:true,elementPath:null,elementType:null,chartId:l.created_in_chart,extension:t.getId(),position:{x:null,y:null},freshCreate:true});t.paint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateCommonTableAction={valid:function(){return[]},execute:function(e){var t=e&&e.tableHashes;var i={};if(t){for(var n=0;n<t.length;n++){var a=t[n],r=St["b"].DataObjects.CommonTableRepo.getCommonTable(a);r&&(i[a]=r)}}else{i=St["b"].DataObjects.CommonTableRepo.getCommonTableRepo()}var o={};for(var l in i){var r=i[l];o[l]={additionInformation:r.additionInformation,description:r.description,hash:l,key:r.key,password:r.password}}if(Object.keys(i).length){St["b"].Utils.GlobalVariables.hasService&&re["a"].repository("createCommonTable",{},o,false);St["b"].DataObjects.DocumentDO.setDocumentValue("commonTables",o);if(!e||!e.parameters||e.parameters!==false){St["b"].DataObjects.DocumentDO.saveDocument()}}}};var He=St["b"].Actions.CreateContextState={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=St["b"].DataObjects.RuntimeDO.getUser();var n={extensionHash:t.getId(),username:i.name,sessionKey:i.sessionKey};var a=t.getContexts();if(!a){throw new Error("Cannot execute createContextState: Extension has no context.")}var r=[];var o=[];a.forEach(function(e){r.push(e.dataModel);o.push(e.dataModelOriginal);e.dataModel=null;e.dataModelOriginal=null});var l=St["b"].Utils.GlobalFunctions.filterKeys(JSON.parse(JSON.stringify(a)),["compiledFormula"],true);var s=l.map(me["a"]);a.forEach(function(e,t){e.dataModel=r[t];e.dataModelOriginal=o[t]});if(t.getAdapter().storeRemotely()&&St["b"].Utils.GlobalVariables.hasService){re["a"].repository("createContextState",n,s,false)}t.setExtensionValue("dataContexts",s);if(e.saveQVF){t.saveExtension()}t.getController().dispatch("updateDocument",{saveQVF:e.saveQVF})}};var ke=St["a"].API||{};ke.trueChart=ke.trueChart||{};ke.trueChart.getDocLanguage=function(){var e=St["b"].DataObjects.DocumentDO.getSettings().docLanguage.value;switch(e){case"en_US":return"en";case"de_DE":return"de"}};ke.trueChart.getTranslation=function(e){var t=[];for(var i=1;i<arguments.length;i++){t[i-1]=arguments[i]}return Ot["a"].getTranslation.apply(Ot["a"],[e].concat(t))};ke.trueChart.getVariables=function(){return St["b"].DataObjects.DocumentDO.getVariables().slice()};ke.trueChart.paintingPromise=O["b"].getPromise();St["a"].API=St["b"].API=ke;var Ge=function(){function ConverterHelper(){}ConverterHelper.isDocumentEditMode=function(){var e=St["b"].DataObjects.DocumentDO.getDocSettings(true),t=e.userSpecific&&e.userSpecific.value==="true",i=t?St["b"].DataObjects.RuntimeDO.getUser().userSpecific:e,n=St["b"].Utils.Constants.ParameterSets.documentModesValue;return!n.indexOf(i.documentMode.value)};ConverterHelper.setCommentStyle=function(e,n){var a=this;var r=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(a.listTags.indexOf(i.tagName)!==-1){i.style.margin="0px";i.style.padding="0 0 0 "+n}if(i.childNodes){r(i)}}};r(e)};ConverterHelper.getFloatingCommentMarkers=function(e){var t=[],i=e.getBoundingClientRect(),n=St["b"].$("div[id*='DIV_'][id*='_commentReference_']");for(var a=0;a<n.length;a++){var r=n[a],o=r.getBoundingClientRect();if(o.top>=i.top&&o.top<=i.top+i.height&&o.left>=i.left&&o.left<=i.left+i.width){t.push({div:r,left:o.left-i.left,top:o.top-i.top})}}return t};ConverterHelper.convert=function(v,b){var T=this;var E=this.isDocumentEditMode();E&&b.getController().dispatch("updateDocumentMode",{editMode:false});ke.trueChart.paintingPromise.then(function(){var e=b.getCanvasDO().getDOMElement(),t=T.getFloatingCommentMarkers(e),i=St["b"].$(e),n=i.clone(true),a=i.height(),r=i.width();E&&b.getController().dispatch("updateDocumentMode",{editMode:true});for(var o=0;o<t.length;o++){var l=t[o],s=St["b"].$(l.div).clone(true);s.css("top",l.top+"px");s.css("left",l.left+"px");n.append(s)}n.find(".dummyCommentClass").remove();var d=n.find(".HiCoInlineComment");var c="",u="0";if(d.length>0){u=d[0].style.fontSize||"0";c=u+" '"+d[0].style.fontFamily+"'"}for(var o=0;o<d.length;o++){var p=d[o],g=parseInt(p.style.width||"0"),m=parseInt(p.style.height||"0");if(p.classList.contains("HiCoInlineCommentFixedHeight")){p.innerHTML=dt["a"].rewriteHtmlToDimension(p.innerHTML,m,g,c,p.style.lineHeight)}p.style.top=parseInt(p.style.top||"0")+"px";p.style.left=parseInt(p.style.left||"0")+"px";T.setCommentStyle(p,u)}n.find("colgroup").remove();var h='<div height="'+a+'" width="'+r+'" id="'+b.getId()+'">'+n.html()+"</div>";var f=new RegExp("[\\n\\t]","g");h=h.replace(f,"").replace(/>[\\s]+</g,"><").replace(/<br>/g,"<br/>").replace(/&nbsp;/g," ");re["a"].repositoryDownload(v,h)})};ConverterHelper.listTags=["OL","UL","DL"];return ConverterHelper}();St["b"].Actions=St["b"].Actions||{};var Ve=St["b"].Actions.CreateEMFAction={valid:function(){return[Le["a"].DEFAULT,Le["a"].CONTEXTMENU,Le["a"].READ_ONLY]},execute:function(e){Ge.convert("createEMF",e.extension)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateMenusAction={valid:function(){return[]},execute:function(e){var t=e.extension;var i=t.getController();var n=St["b"].DataObjects.RuntimeDO.getUser().sessionKey;if(n===""){i.dispatch("getUnlicensedState",{extension:t})}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateOrUpdateCommentAction={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID]},execute:function(r){var o=r.extension,l=o.getAdapter().storeRemotely()&&St["b"].Utils.GlobalVariables.hasService,s=r.comment&&r.comment.exists_in_db;if(s){save(r.comment,function(){St["b"].DataObjects.CommentRepo.modifyCommentCell(r.comment.currContent,function(e){delete e.originalLastModified})})}else{if(r.caller==="saveDialog"){var e=St["b"].DataObjects.CommentRepo.getLoadedCommentsByExtension(o.getId());if(e.length>0){for(var t=0;t<e.length;t++){if(e[t].cutDelete){St["b"].DataObjects.CommentRepo.removeCommentById(e[t].id,o,false)}}e=St["b"].DataObjects.CommentRepo.getLoadedCommentsByExtension(o.getId());for(var t=0;t<e.length;t++){if(e[t].exists_in_db===false){save(e[t])}}}St["b"].DataObjects.CommentRepo.updateCommentRepository(o)}else{save(r.comment)}}function save(e,t){var i=St["b"].DataObjects.CommentRepo.prepareForSave(e);if(l&&(s&&e.currContent||!s&&e.comments)){var n=void 0,a={extensionHash:o.getId()};if(s){n=St["b"].DataObjects.CommentRepo.prepareForSaveSingleCondition(r.comment);a.lastModified=r.lastModified}else{n=i}re["a"].repository("createOrUpdateSingleComment",a,n,false,t)}else{t&&t()}!s&&St["b"].DataObjects.CommentRepo.updateSelectedCommentID(o,e,e.id,true);o.setExtensionValue("comments",i);s&&r.saveLocally&&o.saveExtension()}}};St["b"].Actions=St["b"].Actions||{};var $e=St["b"].Actions.CreatePDFAction={valid:function(){return[Le["a"].DEFAULT,Le["a"].CONTEXTMENU,Le["a"].READ_ONLY]},execute:function(e){Ge.convert("createPDF",e.extension)}};St["b"].Actions=St["b"].Actions||{};var We=St["b"].Actions.CreatePNGAction={valid:function(){return[Le["a"].DEFAULT,Le["a"].CONTEXTMENU,Le["a"].READ_ONLY]},execute:function(e){Ge.convert("createPNG",e.extension)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateRootModelAction={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension,i=t.getController(),n=i.getLayoutDefinition(),a=i.getRootModel();if(a.confirmBeforeSaveText){if(!confirm(Ot["a"].getTranslation("CONFIRM_FINAL_TEXT_DELETE"))){return}delete a.confirmBeforeSaveText}var r=a.id,o=C["a"].createGuid(),l=St["b"].DataObjects.RuntimeDO.getUser().username,s=K["a"].createSHA1Hash(o+l),d=i.getCurrRootModelIndex(),c=false,u=t.isHidden()?"true":"false";a.id=n.id=s;a.selectedChart="";a.isCompareMode=false;St["b"].DataObjects.CommentRepo.updateCommentAndReferenceState(s,r,t);i.dispatch("createOrUpdateCommentAction",{extension:t,caller:"saveDialog"});var p=n.getPreparedForSave();var g=st["a"].deepCopy(a);var m=St["b"].Models.Actions.ModelActions.RootModel.prepareForSave(g);var h={extensionHash:t.getId(),modelHash:s,saveName:a.saveName,oldRootModelHash:r,hidden:u};if(t.getAdapter().storeRemotely()&&St["b"].Utils.GlobalVariables.hasService){re["a"].repository("createLayoutDefinition",h,p,false,function(){c=true});re["a"].repository("createRootModel",h,g,false,undefined,function(){c=false})}else{c=true}t.setExtensionValue("layoutDefinition",p);t.setExtensionValue("rootModel",g);if(m.usedCommonTables&&m.usedCommonTables.length){i.dispatch("createCommonTable",{tableHashes:m.usedCommonTables})}i.switchRootModel(d);i.dispatch("createContextState",{extension:t,saveQVF:false});var f=St["b"].DataObjects.DocumentDO.getHiCoVariables();function notify(){if(!c||e.parameters&&e.parameters.dontNotifyText){return}t.showExtensionMessage(Ot["a"].getTranslation("MESSAGE_SAVE_SUCCESS"),3e3)}St["b"].DataObjects.CommentRepo.redrawLinkedReferences();var v={documentId:St["b"].DataObjects.DocumentDO.getHash(),version:St["b"].DataObjects.DocumentDO.getConnector().isPublished?St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().version:C["a"].createFormattedDate()};if(St["b"].Utils.GlobalVariables.hasService){re["a"].repository("createVariables",v,f,true,notify)}else{notify()}St["b"].DataObjects.DocumentDO.setDocumentValue("variables",f);St["b"].DataObjects.DocumentDO.setDocumentValue("version",v.version);if(!e.parameters||e.parameters.saveQVF!==false){t.saveExtension()}St["b"].DataObjects.DocumentDO.saveDocument()}};var ze=r(608);St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateVariableAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=e.model;var r=false;if(a.instanceOf==="CompareModel"){var o=a.id.split(".");var l=o[0].replace("tableContainer","chart").replace("containerModel","");var s=St["b"].Factories.ModelFactory.getModelById(n,l);var d=s.extendedModel.contextId;var c=St["b"].DataObjects.ContextRepo.getContextByCid(d);var u="COMP:"+t.getId()+"#ctx1#"+o[0]+"#"+a.id.split(".").pop();var p=c.id+"#"+a.id;p=p.replace(/\(/g,"");p=p.replace(/\)/g,"");p=p.replace(/\[/g,"");p=p.replace(/\]/g,"");p=p.replace(/\ /g,"");var g=a.absolute.text;a.compareType="absolute";if(a.percent.legend!==St["b"].Utils.Constants.TypeValues.indicator.NONE){var m=St["b"].Utils.DOM.getPositionOnExtension(t,{clientX:e.menu.offsetLeft,clientY:e.menu.offsetTop});var h=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(s,n);h.x+=a.percent.position.x;h.y+=a.percent.position.y;if(h.y<=m.y&&h.y+a.percent.dimension.height>=m.y&&h.x<=m.x&&h.x+a.percent.dimension.width>=m.x){g=a.percent.text.replace("(","").replace(")","");a.compareType="percentage"}}var f=new ze["a"](p,u,g,true);f.name=c.name+"#"+a.id;r=St["b"].DataObjects.DocumentDO.addVariable(f)}else{var d=a.contextId;var c=St["b"].DataObjects.ContextRepo.getContextByCid(d);var v=St["b"].Models.Actions.ModelActions.ContextModel.getContextExpressions(c);var b="";for(var T=0;T<v.length;T++){if(v[T].definition===a.dataId_expr){b=v[T].name}}var E=c.id.split(".");var u="EXPR:"+E[0]+"#"+E[1]+"#"+a.dataId_dim+"#"+a.dataId_expr;var p=c.id+"#"+a.dataId_dim+"#"+b;p=p.replace(/\(/g,"");p=p.replace(/\)/g,"");p=p.replace(/\[/g,"");p=p.replace(/\]/g,"");p=p.replace(/\ /g,"");var g=a.relativeValue!==undefined?a.value:"";var f=new ze["a"](p,u,g,true);f.name=c.name+"#"+a.dataId_dim+"#"+b;r=St["b"].DataObjects.DocumentDO.addVariable(f)}if(r){t.showExtensionMessage(Ot["a"].getTranslation("MESSAGE_VARIABLE_ADDED"),3e3)}t.paint()}};var je=r(383);St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CreateXLSAction={valid:function(){return[Le["a"].DEFAULT,Le["a"].READ_ONLY]},execute:function(e){var l=new St["b"].Utils.Format.LabelFormatter;var t=e.contexts;var i=e.charts;var n=[];var a=[];for(var r=0;r<t.length;r++){n.push(t[r]);var o=i[r].split(";");var s=o[0];var d=o[1];var c={};var u=St["b"].DataObjects.DocumentDO.getExtension(s);if(u!==null){var p=[];St["b"].Models.Actions.ViewModelActions.General.getAllCharts(u.getController().getRootModel().firstObjectGrid,p);for(var g=0;g<p.length;g++){var m=p[g];if(m.id===d){c=m;break}}}a.push(c)}var h={objectType:"contextObject",contextArray:prepareContext(n),chartModelArray:prepareRootmodel(a),font:{header:"ARIAL",chart:"ARIAL"},fontSize:{header:St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_TITLE"),chart:St["b"].DataObjects.RuntimeDO.getParameter("FONT_SIZE_CHART")}};h.chartModelArray.forEach(function(e){e.children&&e.children.forEach(function(e){if(e.instanceOf==="InlineModel"&&e.visible===false){e.originalText=""}})});var f=JSON.stringify(h);re["a"].repositoryDownload("createXLS",f);function prepareContext(e){e=Object(V["g"])(e);var r=["factor","displayedDecimals"],o=["unit","value","name"];runRecursive(e);return e;function runRecursive(e){for(var t in e){if(e.hasOwnProperty(t)&&e[t]!==undefined){var i=e[t];if(r.indexOf(t)>-1&&typeof i==="string"){if(isNaN(parseFloat(i))){var n=getValue(i);var a=n?Number(n.value):undefined;switch(t){case"factor":if(!n||a<=0){e[t]="1"}break;case"displayedDecimals":if(!n||a<0){e[t]="0"}break;default:if(a){e[t]=a.toString()}break}}}else if(o.indexOf(t)>-1&&typeof i==="string"){e[t]=l.parseLabel(i)}else if(typeof i==="object"){runRecursive(i)}}}}function getValue(e){var t=e.substring(2,e.length-1);return St["b"].DataObjects.DocumentDO.getVariableById(t)}}function prepareRootmodel(e){var t=Object(V["g"])(e);runRecursive(t,e);return t;function runRecursive(e,t){for(var i in e){if(e.hasOwnProperty(i)&&e[i]!==undefined){if(t instanceof je["a"]&&i==="isHidden"&&t.IsHidden!==undefined){e[i]=t.IsHidden}var n=e[i];if(typeof n==="object"){runRecursive(n,t[i]||{})}}}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteCommentAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){var t=e.extension.getController(),i=t.getRootModel(),n=St["b"].Factories.ModelFactory.getParentContainer(i.firstObjectGrid,e.model)[0],a=n.extendedModel.gridRows.length,r=n.extendedModel.gridColumns.length;if(a===1&&r>1){t.dispatch("deleteRemoveColumn",e)}else if(a>1&&r===1){t.dispatch("deleteRemoveRow",e)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteCommentReference={valid:function(){return[]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();var n=null;if(e.parameters.menuType==="editor"){var a=e.model.id.replace("background","commentReference");n=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),a);var r=t.getController().getRootModel();var o=St["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,n);var l=o[0];var s=o[1];var d=St["b"].DataObjects.CommentRepo.getCommentById(s.extendedModel.commentId,t.getId());if(d){var c=d.currContent.grid[l.row][l.column];if(c.reference.length===0){if(n){St["b"].Factories.ModelFactory.enableDisableCommentReferenceLabel(false,"",n)}}else{for(var u=c.reference.length-1;u>=0;u--){var p="DIV_"+e.model.id.split(".")[0].replace("chart","object")+"_commentReference_"+t.getId()+"_"+u;h=document.getElementById(p);var g={extension:t,selectedReference:u,fixReferenceModel:n,currCommentCell:c,currComment:d,objectId:e.model.id.split(".")[0].replace("chart","object")};St["b"].DataObjects.CommentRepo.deleteSelectedCommentReference(g)}}if(i.id!==null){t.getController().dispatch("updateRootModelState",{extension:t,commentId:d.id,currCommentCell:c,dontConfirmText:true,updateCommentLastModified:true})}}}else{var m=St["b"].DataObjects.CommentRepo.getSelectedCommentReferenceElement();var h=document.getElementById(m);if(h){var f=St["b"].$.data(h);if(f){n=f.fixReferenceModel;if(f.currCommentCell.reference.length>0){f.div=h;St["b"].DataObjects.CommentRepo.deleteSelectedCommentReference(f)}if(i.id!==null){t.getController().dispatch("updateRootModelState",{extension:t,commentId:f.currComment.id,currCommentCell:f.currCommentCell,dontConfirmText:true,updateCommentLastModified:true})}}}}if(n&&n.movedReferenceCounter===0){e.extension.paint()}else{St["b"].DataObjects.CommentRepo.redrawLinkedReferences()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteCommentReferenceLabelLink={valid:function(){return[]},execute:function(e){var t=St["b"].DataObjects.CommentRepo,i=St["b"].DataObjects.CommentRepo.getSelectedCommentReferenceElement(),n=document.getElementById(i);if(n){var a=St["b"].$.data(n);if(a&&a.currCommentCell&&a.currCommentCell.reference[a.selectedReference]){var r=a.currCommentCell.reference[a.selectedReference];var o=St["b"].DataObjects.DocumentDO.getPainter().getCommentReferenceScrollingElement(r.extension,r.chartId);if(o){for(var l=0;l<o.length;l++){if(o[l].divElement===n){o.splice(l,1);break}}}r.elementPath=null;r.elementType=null;r.chartId=a.currCommentCell.created_in_chart;r.extension=a.currComment.extensionId;var s=St["b"].DataObjects.DocumentDO.getExtension(a.currComment.extensionId);t.convertToRelativeReferencePosition(r,{x:parseFloat(n.style.left),y:parseFloat(n.style.top)});if(s.getController().getRootModel().id!==null){var e={extension:s,commentId:a.currComment.id,currCommentCell:a.currCommentCell,dontConfirmText:true,updateCommentLastModified:true};s.getController().dispatch("updateRootModelState",e)}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteCompareAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=e.model.id.split(".");a[0]=a[0].replace("tableContainer","chart").replace("containerModel","");var r=St["b"].Factories.ModelFactory.getModelById(n,a[0]);St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeCompare(r.extendedModel,e.model.id);var o=e.model.id.split(".")[0].replace("tableContainer","chart").replace("containerModel","");var l="COMP:"+t.getId()+"#ctx1#"+o+"#"+e.model.id.split(".").pop();var s=St["b"].DataObjects.DocumentDO.getVariableByDefinition(l);i.updateLayoutDefinition();if(s){St["b"].UI.HiCoConfirm(Ot["a"].getTranslation("CONFIRM_REMOVE_COMPARE_VARIABLE"),function(e){if(e===true){St["b"].DataObjects.DocumentDO.removeVariable(s)}t.paint()})}else{t.paint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteGridContent={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(l){var s=l.extension;var e=l.model;var d=s.getController();var c=d.getRootModel();if(!c.firstObjectGrid){alert(Ot["a"].getTranslation("ALERT_NO_CONTEXT_TO_CLEAR"));return}var t=c.firstObjectGrid.id;var i=e?e.id:c.selectedChart;if(i===t){d.dispatch("getInitialState",l);return}if(i===""){alert(Ot["a"].getTranslation("ALERT_NO_SELECTION"))}else{var u=e?e:St["b"].Factories.ModelFactory.getModelById(c,i);if(u===null){return}var n=true;if(i!==t&&u.extendedModel){if(u.extendedModel.instanceOf==="ContainerCommentGridModel"){if(l.parameters&&l.parameters.type==="cut"){n=true;c.confirmBeforeSaveText=true}else{n=false;var a=confirm(Ot["a"].getTranslation("CONFIRM_COMMENT_EXTENSION"));if(a){St["b"].DataObjects.CommentRepo.removeGridComments(s,u);c.confirmBeforeSaveText=true;goOn();return true}else{return false}}}else if(u.extendedModel.instanceOf==="ContainerGridModel"){if(!l.parameters||l.parameters&&l.parameters.type!=="cut"){St["b"].DataObjects.CommentRepo.removeGridComments(s,u)}n=true;c.confirmBeforeSaveText=c.confirmBeforeSaveText||St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(u)!==null}}if(St["b"].DataObjects.CommentRepo.getCutCopyType()){St["b"].DataObjects.CommentRepo.markTargetReferencesToDelete(c,u.id);if(u.extendedModel&&(u.extendedModel.instanceOf==="ChartModel"||u.extendedModel.instanceOf==="TimeChartModel"||u.extendedModel.instanceOf==="TableModel")){St["b"].DataObjects.CommentRepo.markTargetReferencesToDelete(c,u.id)}else{iterateOverAllGrids(d,u)}}if(n){goOn();return true}}function iterateOverAllGrids(e,t){if(t!==null&&t.children){var i=t.children.length;if(t.extendedModel&&t.extendedModel.instanceOf==="ContainerCommentGridModel"){i--}for(var n=0;n<i;n++){var a=t.children[n];var r=a.extendedModel;if(r&&(r.instanceOf==="ChartModel"||r.instanceOf==="TimeChartModel"||r.instanceOf==="TableModel")){St["b"].DataObjects.CommentRepo.markTargetReferencesToDelete(c,a.id)}else{iterateOverAllGrids(e,a)}}}}function goOn(){var e=u.id;var t=parseInt(e.substr(5));var i=c.firstObjectGrid;var n=St["b"].Factories.ModelFactory.getObjectPosition(i,u);var a=n.position;var r=n.container;var o=St["b"].Factories.ModelFactory.buildPlaceHolder(t);r.children[a]=o;c.selectedChart="";d.updateLayoutDefinition();if(!l.doNotPaint){s.paint()}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteRemoveColumn={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(c){var u=c.extension,e=u.getController(),p=e.getRootModel();function getSelectedColumn(e,t,i){for(var n=0;n<e.length;n++){if(t===e[n].id){return n%i}}return i-1}var g;if(c.model.extendedModel.instanceOf==="CommentModel"||c.parameters==="deleteColumnAboutCellDlg"){g=c.model.id}else{g=p.selectedChart}if(g===""){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}var m=St["b"].Factories.ModelFactory.getModelById(p,g),h=St["b"].Factories.ModelFactory.getParentContainer(p.rootContainerModel,m),f=h[0];if(!f){return}if(m.extendedModel.instanceOf==="CommentModel"){if(f.extendedModel.isTextEditable===false){return}}if(f.extendedModel===null){if(m.instanceOf==="ContainerModel"&&m.extendedModel){f=m}else{console.warn("container not able to delete column");return}}if(!(f.extendedModel.instanceOf==="ContainerGridModel")&&!(f.extendedModel.instanceOf==="ContainerCommentGridModel")){if(f.extendedModel.instanceOf==="ContainerBorderModel"){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_DELETE_GRIDCOL_FROM_BORDER"));return}else if(f.extendedModel.instanceOf==="MultipleContainerModel"){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_DELETE_GRIDCOL_FROM_MULTIPLE"));return}else{St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}if(c.parameters===undefined||c.parameters!=="deleteColumnAboutCellDlg"){St["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_DELETE_MESSAGE"),function(e){St["b"].$(e.data.target).remove();removeColumn()},true)}else{removeColumn()}function removeColumn(){var e=f;if(h[1]&&h[1].extendedModel&&h[1].extendedModel.instanceOf==="MultipleContainerModel"){var t=h[1].extendedModel,i=void 0,n=void 0;if(t.activeElementType==="time"){if(t.timeCellCategoryCount===1){return}i=t.timeCellCategoryCount--;n=t.timeElements}else{if(t[t.activeElementType+"CellValueCount"]===1){return}i=t[t.activeElementType+"CellValueCount"]--;n=t[t.activeElementType+"Elements"]}var a=getSelectedColumn(f.children,g,i);removeColumnFromMultipleElements(n,a,i);p.selectedChart="";u.paint()}else if(e.extendedModel.instanceOf==="ContainerGridModel"||e.extendedModel.instanceOf==="ContainerCommentGridModel"){if(e.extendedModel.instanceOf==="ContainerCommentGridModel"){if(e.children[e.children.length-1].instanceOf==="BackGroundModel"){e.children.pop()}}var i=e.extendedModel.gridColumns.length;if(i===1){return}var r=getSelectedColumn(e.children,g,i);if(e.extendedModel&&e.extendedModel.instanceOf==="ContainerGridModel"){var o=e.extendedModel.gridRows.length,l=e.extendedModel.gridColumns.length;for(var s=0;s<o;s++){var d=e.children[s*l+r];p.confirmBeforeSaveText=p.confirmBeforeSaveText||St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(d)!==null;St["b"].DataObjects.CommentRepo.removeGridComments(u,d)}}else{if(m.extendedModel.instanceOf==="CommentModel"){St["b"].DataObjects.CommentRepo.removeColumn(r,u,e.id)}}St["b"].Models.Actions.ExtendedModelActions.ContainerGridModel.removeColumn(e,r);if(!c.doNotPaint){p.selectedChart="";u.paint()}}function removeColumnFromMultipleElements(e,t,i){for(var n=0;n<e.length;n++){var a=e[n].nodes;for(var r=a.length-t;r>=0;r-=i){a.splice(r,1)}}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteRemoveRow={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(c){var u=c.extension,e=u.getController(),p=e.getRootModel();function getSelectedRow(e,t,i){for(var n=0;n<e.length;n++){if(t===e[n].id){return Math.floor(n/i)}}return i-1}var g;if(c.model.extendedModel.instanceOf==="CommentModel"||c.parameters==="deleteRowAboutCellDlg"){g=c.model.id}else{g=p.selectedChart}if(g===""){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}var m=St["b"].Factories.ModelFactory.getModelById(p,g),h=St["b"].Factories.ModelFactory.getParentContainer(p.rootContainerModel,m),f=h[0];if(!f){return}if(m.extendedModel.instanceOf==="CommentModel"){if(f.extendedModel.isTextEditable===false){return}}if(f.extendedModel===null){if(m.instanceOf==="ContainerModel"&&m.extendedModel){f=m}else{console.warn("container not able to delete row");return}}if(!(f.extendedModel.instanceOf==="ContainerGridModel")&&!(f.extendedModel.instanceOf==="ContainerCommentGridModel")){if(f.extendedModel.instanceOf==="ContainerBorderModel"){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_DELETE_GRIDROW_FROM_BORDER"));return}else if(f.extendedModel.instanceOf==="MultipleContainerModel"){St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_DELETE_GRIDROW_FROM_MULTIPLE"));return}else{St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("NOTIFICATION"),Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}if(c.parameters===undefined||c.parameters!=="deleteRowAboutCellDlg"){St["b"].Factories.DialogFactory.createConfirmationDialog(Ot["a"].getTranslation("CONFIRM_COMMENT_DELETE_TITLE"),Ot["a"].getTranslation("CONFIRM_COMMENT_DELETE_MESSAGE"),function(e){St["b"].$(e.data.target).remove();removeRow()},true)}else{removeRow()}function removeRow(){var e=f;if(h[1]&&h[1].extendedModel&&h[1].extendedModel.instanceOf==="MultipleContainerModel"){var t=h[1].extendedModel,i=void 0,n=void 0;if(t.activeElementType==="time"){if(t.timeCellValueCount===1){return}i=t.timeCellCategoryCount;n=t.timeElements;t.timeCellValueCount--}else{if(t[t.activeElementType+"CellCategoryCount"]===1){return}i=t[t.activeElementType+"CellValueCount"];n=t[t.activeElementType+"Elements"];t[t.activeElementType+"CellCategoryCount"]--}var a=getSelectedRow(f.children,g,i);removeRowFromMultipleElements(n,a,i);p.selectedChart="";u.paint()}else if(e.extendedModel.instanceOf==="ContainerGridModel"||e.extendedModel.instanceOf==="ContainerCommentGridModel"){if(e.extendedModel.instanceOf==="ContainerCommentGridModel"){if(e.children[e.children.length-1].instanceOf==="BackGroundModel"){e.children.pop()}}var i=e.extendedModel.gridColumns.length;if(e.extendedModel.gridRows.length===1){return}var r=getSelectedRow(e.children,g,i);if(e.extendedModel&&e.extendedModel.instanceOf==="ContainerGridModel"){var o=e.extendedModel.gridColumns.length,l=r*o;for(var s=0;s<o;s++){var d=e.children[l+s];p.confirmBeforeSaveText=p.confirmBeforeSaveText||St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(d)!==null;St["b"].DataObjects.CommentRepo.removeGridComments(u,d)}}else{if(m.extendedModel.instanceOf==="CommentModel"){St["b"].DataObjects.CommentRepo.removeRow(r,u,e.id)}}St["b"].Models.Actions.ExtendedModelActions.ContainerGridModel.removeRow(e,r);if(!c.doNotPaint){p.selectedChart="";u.paint()}}function removeRowFromMultipleElements(e,t,i){var n=t*i;for(var a=0;a<e.length;a++){var r=e[a].nodes;for(var o=n+i-1;o>=n;o--){r.splice(o,1)}}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteRootModel={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;St["b"].DataObjects.CommentRepo.removeCommentState(e.id,t);t.getController().deleteRootModelById(e.id);re["a"].repository("deleteRootModel",undefined,{extensionHash:t.getId(),rootHash:e.id,username:St["b"].DataObjects.RuntimeDO.getUser().name,sessionKey:St["b"].DataObjects.RuntimeDO.getUser().sessionKey},false)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteSingleCommentAction={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID]},execute:function(e){re["a"].repository("deleteSingleComment",undefined,{extensionHash:e.extension.getId(),id:e.commentId},false);var t=e.extension.getAdapter().getExtensionDefinition().comments;if(t){for(var i=0,n=t.length;i<n;i++){if(t[i].id===e.commentId){t.splice(i,1);e.extension.setExtensionValue("commentsReplace",t);e.saveLocally&&e.extension.saveExtension();break}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.DeleteSpecialTableRow={valid:function(){return[St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.model;var i=t.extendedModel;for(var n=0;n<i.specialRowContent.length;n++){if(i.specialRowContent[n].row===i.cellSelection.startRow){i.specialRowContent.splice(n,1);if(i.specialRowContent[n]!==undefined&&i.specialRowContent[n].contentType==="empty"){i.specialRowContent.splice(n,1)}n--}}e.extension.paint()}};St["b"].Actions.EditCommentText={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=document.getElementById("touch-dummy");if(!t||!t.dataset.isClicked){return}var i=St["b"].DataObjects.RuntimeDO;var n=e.extension;var a=n.getController().getRootModel();var r=St["b"].Factories.ModelFactory.getParentContainer(a.rootContainerModel,e.model);var o=r[0];var l=r[1];if(l&&l.extendedModel&&!St["b"].Utils.GlobalVariables.isDragDiv&&!St["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(true)){var s=o.position.y;var d=St["b"].DataObjects.DocumentDO.getPainter();d.removeAddCommentIcons();var c=e.model.id.replace(".background",".commentText");var u=document.getElementById(c);var p=u.parentNode;var g=l.extendedModel.commentId;var m=St["b"].DataObjects.CommentRepo.getCommentById(g,n.getId());if(!m){console.warn("Warning: workaround is in action! Please, report this case to HiCo.");var h=l.children[0];var f=l.extendedModel;var v="";if(f.condition!==""){var b=St["b"].DataObjects.DocumentDO.getVariable(f.condition);if(b){v=b.value}}var T={rows:1,cols:1,row:0,col:0,titleLabelType:f.textType||St["b"].Utils.Constants.TypeValues.commentTextTypes.COMMENT,condition:f.condition,conditionValue:v,showCondition:f.showCondition,editCondition:f.editCondition,loggable:f.loggable,showDefaultText:f.showDefaultText,autoSave:f.autoSave,transport:f.transport,allowTop:f.allowTop,allowRight:f.allowRight,allowBottom:f.allowBottom,allowLeft:f.allowLeft,allowNumber:f.allowNumber,chartId:parseInt(h.id.replace("chart","")),commentId:g,insertNewCellOnBuild:true,isDefault:true,isNewRow:false};T.gridId=l.id;T.rootModelId=a.id;T.exists_in_db=false;St["b"].DataObjects.CommentRepo.createNewComment(T,n);St["b"].DataObjects.CommentRepo.addNewCommentCell(T,n);f.commentId=g=T.commentId;m=St["b"].DataObjects.CommentRepo.getCommentById(g,n.getId());h.row=0;h.column=0;l.children.splice(1,l.children.length-1)}var E=m.currContent.grid[o.row][o.column];if(!E){return}var x=St["b"].Factories.ModelFactory.getModelById(a,c);if(!x){return}n.setMode(St["b"].Utils.Enums.EMode.EDIT_COMMENT);var C=d.getMeasuredTextDiv(x.dimension.width,x.text,x.fontSize,x.font,x.fontWeight);if(l.scrollingData.scrollingVer){var y=d.getContainerScrollPosition(l.id,n.getId());if(s+y.top+C>l.scrollingData.height){var M=Math.min(C,l.scrollingData.height)-(l.scrollingData.height-s);var S={left:y.left,top:M};d.setContainerScrollPosition(l.id,n.getId(),S,false)}else if(s+y.top<0){var S={left:y.left,top:s};d.setContainerScrollPosition(l.id,n.getId(),S,false)}d.disableContainerScrolling(l.id,n.getId())}var O=getDivHeight();var L={extension:n,model:x,container:o,parentContainer:l,div:u,parent:p,divHeight:O};var A=new St["b"].Utils.EditorCommon(L);A.createCkEditorInstance();if(l.scrollingData.scrollingVer){var _=C-O;i.setEditCommentTopOffset(_)}}function getDivHeight(){var e=l.border,t=l.padding,i=l.scrollingData.height-e.top.width-e.bottom.width-t.top-t.bottom;return Math.min(x.dimension.height,i-x.position.y)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.EditCompare={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=e.model;var n=t.getCanvasDO().getDOMElement();var a;if(St["b"].UI.IndicationDialog.isOpen()===false){a=new St["b"].UI.IndicationDialog;a.open(n)}else{a=St["b"].UI.IndicationDialog.getDialog();a.setActiveTab(0)}a.openCompareProperties(i,t)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.EditHighlight={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=e.model;var n=t.getController().getRootModel();var a=t.getCanvasDO().getDOMElement();var r=i.id.split(".")[0];var o=St["b"].Utils.Constants.TypeValues.highlightType;var l=St["b"].Utils.Constants.TypeValues.indicator;var s=getType();if(s===o.LEGEND){var d=i.valueRowLabelPosition.split(".")[0];r=r.replace(d,"")}else if(s===o.CATEGORY_LABEL){r=r.substr(9,r.length-1)}var c=St["b"].Factories.ModelFactory.getModelById(n,r);var u;if(s===o.VALUE){var p=i.dataId_expr;for(var g=0;g<c.extendedModel.expressions.length;g++){var m=c.extendedModel.expressions[g];if(m.id.split(".").pop()===p){p=m;break}}if(i.instanceOf==="LabelModel"){var h=l.LABEL;if(i.id.split(".").pop()==="pos"||i.id.split(".").pop()==="neg"){h=l.STACK}u=St["b"].Layout.Common.getHighlight(c.extendedModel,i,s,true,h)}else{u=St["b"].Layout.Common.getHighlight(c.extendedModel,i,s,true,l.ELEMENT)}}else if(s===o.COMPARE){u=St["b"].Layout.Common.getHighlight(c.extendedModel,i,s,false)}else if(s===o.CATEGORY_LABEL){u=St["b"].Layout.Common.getHighlight(c.extendedModel,i,s,true)}else if(s===o.LEGEND){u=St["b"].Layout.Common.getHighlight(c.extendedModel,i,s,false)}if(u){var f;if(St["b"].UI.IndicationDialog.isOpen()===false){f=new St["b"].UI.IndicationDialog;f.open(a);f.setActiveTab(1)}else{f=St["b"].UI.IndicationDialog.getDialog();f.setActiveTab(1)}f.openHighlightProperties(u.highlight,c,t)}function getType(){if(i.id.indexOf("representation")>-1){return o.VALUE}else if(i.id.indexOf("valueRowLabelModel")>-1){return o.LEGEND}else if(i.id.indexOf("dimensionchart")>-1){return o.CATEGORY_LABEL}else if(i.id.indexOf("compare")>-1){return o.COMPARE}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetBackgroundSingleClickAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension.getController();var i=e.extension;var n=e.model;var a=t.getRootModel();var r=n.chartId;var o=St["b"].Factories.ModelFactory.getModelById(a,r);var l=null;if(o!==null){l=o.extendedModel;if(l.instanceOf==="ContainerCommentGridModel"&&l.isTextEditable&&!o.scrollingData.scrollingVer&&St["b"].DataObjects.RuntimeDO.getAllowIcon(l.allowBottom)&&l.textType!==St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE&&l.textType!==St["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){var s=St["b"].Factories.ViewFactory.getViewById(i.getController().getRootPanel(),o.id);if(s){var d=St["b"].Utils.DOM.getAbsoluteCoordinates(i.getAdapter().getContainerElement());var c={x:e.event.pageX-d.x-window.pageXOffset,y:e.event.pageY-d.y-window.pageYOffset};var u=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(o,a);var p=St["b"].DataObjects.RuntimeDO.getParameterParsed("FONT_SIZE_CHART");p=St["b"].Utils.Calculator.Converter.pt2pix(p);var g=s.getLayout().getCommentSize(s);var m=o.dimension.height-g;if(c.y>u.y+g&&m>p){var h=u.x;var f=null;var v=null;for(var b=0;b<o.children.length;b++){var T=o.children[b];h+=T.dimension.width;if(c.x>=u.x+T.position.x&&c.x<=h){var E=b+(l.gridRows.length-1)*l.gridColumns.length;v=o.children[E];f=b;break}}if(v){var x={chartContainerModel:o,model:v,extension:i,parameters:{position:"below",caller:"commentModel"}};i.getController().dispatch("createAddRow",x);var C=f+(l.gridRows.length-1)*l.gridColumns.length;var y=o.children[C];St["b"].DataObjects.CommentRepo.openEditField(i,y)}}}}}}};var Xe=r(58);var Ye=r(195);St["b"].Actions.GetButtonEditorAction={valid:function(){return[]},renderActionEditor:function(i,n){return Me["b"](this,void 0,void 0,function(){var t;return Me["e"](this,function(e){switch(e.label){case 0:t=Ye["a"].convertButton(i);return[4,St["b"].Actions.GetButtonEditorAction.renderEditor({state:t.extendedModel.states[0],onClose:function(e){var t=e.state;if(t){n({value:t.triggers.map(we["a"].convertButtonTrigger)})}}})];case 1:return[2,e.sent()]}})})},renderEditor:function(a,r,o){return Me["b"](this,void 0,void 0,function(){var t,i,n;return Me["e"](this,function(e){switch(e.label){case 0:return[4,St["b"].DataObjects.DocumentDO.getConnector().loadComponents()];case 1:e.sent();if(document.querySelector(".hico.button.editor")!==null){return[2]}t=a.extension&&a.extension.createNewScope()||qvangularGlobal.$rootScope.$new();i=new nt["a"](null);t.state=a.state;t.onClose=a.onClose;t.condition=i.decode(a.state.condition.formula);!r&&Object(J["d"])(t,[a.state]);n=Ue["a"].compile('<div data-hico-button-editor state="state" on-close="onClose" default-styles="nmStyles" condition="condition" class="hico-lui hico-fa"></div>',t);!o&&document.body.insertBefore(n,document.body.childNodes[0]);return[2,n]}})})},execute:function(a){return Me["b"](this,void 0,void 0,function(){var t,i,n;return Me["e"](this,function(e){switch(e.label){case 0:if(a.goOldWay){return[2,St["b"].Actions.GetButtonEditorAction.renderEditor(a)]}t=Object(Xe["h"])(a.model.id,a.extension.LayoutDefinition.rootCell);if(!t){return[2]}i=function(e){t.content=e;a.extension.getController().updateRootModel(false);St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()};return[4,Promise.all([r.e(0),r.e(1)]).then(r.bind(null,88))];case 1:n=e.sent().ButtonDialog;n.show(t.content,i);return[2]}})})}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetCellDialog={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID]},execute:function(e){if(document.getElementById("cellDialog")!==null){return}var t=St["b"].DataObjects.RuntimeDO.getUser();if(t&&t.permissions.indexOf("Consumer")!==-1){return}var i=e.extension.getController();var n=i.getRootModel();var a=n.selectedChart;var r=null;var o=null;if(e.model!==undefined){if(e.model.instanceOf!=="ContainerModel"){var l=St["b"].Factories.ModelFactory.getParentContainer(n.rootContainerModel,e.model);if(l.length>0){if(l[2]&&l[2].extendedModel&&l[2].extendedModel.instanceOf==="MultipleContainerModel"){r=l[2];o=l[0]}else{r=l[0]}}}else{var s=e.model.extendedModel;var d=St["b"].Factories.ModelFactory.getModelById(n,a);if(d!==null&&d.extendedModel.instanceOf==="EmptyModel"){r=d}else if(s.instanceOf==="CommentModel"){var c=null;var u=St["b"].Factories.ModelFactory.getParentContainer(n.rootContainerModel,e.model)[0];for(var p=0;p<u.children.length;p++){if(u.children[p].id===e.model.id){c=u;break}}r=c===null?e.model:c}else if(s.instanceOf==="ContainerGridModel"){r=St["b"].Factories.ModelFactory.getParentContainer(n.rootContainerModel,e.model)[0];o=e.model}else if(e.model.multiplePath!==undefined&&(s.instanceOf==="ChartModel"||s.instanceOf==="TimeChartModel"||s.instanceOf==="TableModel")){r=St["b"].Factories.ModelFactory.getParentContainer(n.rootContainerModel,e.model)[1];o=e.model}else if(d&&d.extendedModel.instanceOf==="ContainerGridModel"){r=d}else{r=e.model}}}else{if(a===""){alert(Ot["a"].getTranslation("ALERT_NO_SELECTION"))}else if(n.selectedChart===n.firstObjectGrid.id){alert(Ot["a"].getTranslation("ALERT_CHANGE_GLOBAL_CONTEXT"))}else{r=St["b"].Factories.ModelFactory.getModelById(n,a)}}if(r===null){return}if(r&&r.id===St["b"].Factories.ModelFactory.idCollection.chartGridContainer){return}if(r.extendedModel&&e.model.instanceOf==="BackGroundModel"&&r.extendedModel.instanceOf==="ContainerCommentGridModel"){return}var g=new CellDialog({extension:e.extension,containerModel:r,multipleSubcell:o,landingTab:e.landingTab});g.open()}};var Ke=r(614);var Ze=r(68);var Qe=r(24);var qe=function(){function UIContent(){}UIContent.getSpecialCommentReferenceViewContent=function(e){var t=[];if(e!==Le["a"].READ_ONLY){t=[{name:"NUMBER",title:"HELP_CONTEXTMENU_COMMENT_REFERENCE_ADD",level:"Consumer",models:["LabelModel"],extendedModels:[],attributes:[],parameters:{menuType:"comment"},thumbnail:"plus-circle",action:"copyReferenceAction"},{name:"NUMBER ",title:"HELP_CONTEXTMENU_COMMENT_REFERENCE_REMOVE",level:"Consumer",models:["LabelModel"],extendedModels:[],attributes:[],parameters:{menuType:"comment"},thumbnail:"minus-circle",action:"deleteCommentReference"},{name:"LINK",title:"HELP_CONTEXTMENU_LINK",level:"Consumer",models:["LabelModel"],extendedModels:[],attributes:[],parameters:{},thumbnail:"minus-circle",action:"deleteCommentReferenceLabelLink"}]}return this.getContextMenuContentByPermission(t,e)};UIContent.getSpecialMenuContent=function(e){var t=[{name:"AXIS",title:"HELP_CONTEXTMENU_AXIS",level:"Consumer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel"],attributes:[],thumbnail:"bar-chart",action:"updateHighlightAxis"},{name:"SCALING",title:"HELP_CONTEXTMENU_SCALING",level:"Consumer",models:["BarModel","NeedleModel","StructureWaterfallModel","StructureLineModel","TimeColumnModel","TimeWaterfallModel","RodModel","TimeLineModel"],extendedModels:[],attributes:[],thumbnail:"expand",entries:[{name:"FIXATEALL",title:"HELP_CONTEXTMENU_FIXATE_ALL",level:"Consumer",models:["BarModel","NeedleModel","StructureWaterfallModel","StructureLineModel","TimeColumnModel","TimeWaterfallModel","RodModel","TimeLineModel"],extendedModels:[],attributes:[],thumbnail:"",action:"updateFixateAllScalingGroups",getDynamicData:St["b"].Models.Actions.ViewModelActions.BarModel.getFixateAllGroupsContextmenuItem},{name:"FIXATE",title:Ot["a"].getTranslation("HELP_CONTEXTMENU_FIXATE"),level:"Consumer",models:["BarModel","NeedleModel","StructureWaterfallModel","StructureLineModel","TimeColumnModel","TimeWaterfallModel","RodModel","TimeLineModel"],extendedModels:[],attributes:[],thumbnail:"",action:"updateFixateScalingGroup",getDynamicData:St["b"].Models.Actions.ViewModelActions.BarModel.getFixateScalingGroupContextmenuItem}]},{name:"CYCLE_GROUP",title:"HELP_CONTEXTMENU_CYCLE_GROUP",level:"Consumer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel"],attributes:[],thumbnail:"refresh",getDynamicData:St["b"].Models.Actions.ViewModelActions.ContainerModel.getCycleGroupContextmenuItem},{name:"ADD_VARIABLE",title:"HELP_CONTEXTMENU_VARIABLE_ADD",level:"Designer",models:[],extendedModels:[],attributes:[],thumbnail:"tag",show:function(e,t){return e.getMode()!==Le["a"].READ_ONLY&&t&&Object.keys(t.entries).length},entries:[{name:"ADD",title:"HELP_CONTEXTMENU_VARIABLE_ADD",level:"Designer",models:[],extendedModels:[],attributes:["dataId_expr"],thumbnail:"plus-circle",action:"createVariableAction"},{name:"ADD",title:"HELP_CONTEXTMENU_VARIABLE_ADD",level:"Designer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"plus-circle",action:"createVariableAction"}]},{name:"HIGHLIGHT",title:"HELP_CONTEXTMENU_HIGHLIGHT",level:"Consumer",models:["BarModel","NeedleModel","TimeColumnModel","StructureWaterfallModel","TimeWaterfallModel","RodModel","TimeLineModel","StructureLineModel","LabelModel","CompareModel"],extendedModels:["ChartModel","TimeChartModel","TableModel","DimensionLabelModel"],attributes:[],thumbnail:"sun-o",action:"updateHighlightRepresentation",entries:[{name:"EDIT",title:"HELP_CONTEXTMENU_HIGHLIGHT_EDIT",level:"Consumer",models:["BarModel","NeedleModel","TimeColumnModel","StructureWaterfallModel","TimeWaterfallModel","RodModel","TimeLineModel","StructureLineModel","LabelModel","CompareModel"],extendedModels:[],attributes:[],thumbnail:"pencil-square-o",action:"editHighlight",getDynamicData:St["b"].Models.Actions.ViewModelActions.General.getHighlightEdit},{name:"ADD_DELETE",title:"HELP_CONTEXTMENU_HIGHLIGHT_ADD_REMOVE",level:"Consumer",models:["BarModel","NeedleModel","TimeColumnModel","StructureWaterfallModel","TimeWaterfallModel","RodModel","TimeLineModel","StructureLineModel","CompareModel","LabelModel"],extendedModels:[],attributes:[],thumbnail:"",action:"updateHighlightRepresentation",getDynamicData:St["b"].Models.Actions.ViewModelActions.General.getHighlightState}]},{name:"COMPARE",title:"HELP_CONTEXTMENU_COMPARE",level:"Consumer",models:[],extendedModels:[],attributes:[],thumbnail:"arrows-h",entries:[{name:"ADD",title:"HELP_CONTEXTMENU_COMPARE_ADD",level:"Consumer",models:[],extendedModels:[],attributes:[],parameters:{compareType:1},thumbnail:"plus-circle",action:"updateCompareCollecting"},{name:"SeparatorComp1",level:"Consumer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"",action:"",needsTranslation:false},{name:"EDIT",title:"HELP_CONTEXTMENU_COMPARE_EDIT",level:"Consumer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"pencil-square-o",action:"editCompare"},{name:"RATING",title:"HELP_CONTEXTMENU_COMPARE_RATING",level:"Consumer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"exchange",action:"updateCompareNegativeIsPositive"},{name:"SIGNS",title:"HELP_CONTEXTMENU_COMPARE_SIGNS",level:"Consumer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"exchange",action:"updateComparePositive"},{name:"DELETE",title:"HELP_CONTEXTMENU_COMPARE_DELETE",level:"Consumer",models:["CompareModel"],extendedModels:[],attributes:[],thumbnail:"minus-circle",action:"deleteCompareAction"}]},{name:"INPUT",title:"HELP_CONTEXTMENU_INPUT",level:"Consumer",models:["ContainerModel"],extendedModels:["TableModel","ContainerCommentGridModel"],attributes:[],thumbnail:"commenting-o",platforms:[Y["a"].QlikSense],parameters:{},getDynamicData:function(e){var t=e.entries.SAVE_CHANGED,i={};if(t){i.action=t.action;i.title="HELP_CONTEXTMENU_INPUT_WITH_SAVE";if(e.useNativeMenu&&St["b"].Connector.ConnectorHelper.getNativeContextMenuContent(e)){i.commandText="INPUT_SAVE"}}return i},show:function(e,t){if(e.getMode()===Le["a"].READ_ONLY){return false}if(t.model.extendedModel.instanceOf==="TableModel"&&!St["b"].Models.Actions.ViewModelActions.ContainerModel.hasInlineComments(t)){return false}for(var i in t.entries){if(t.entries.hasOwnProperty(i)){var n=t.entries[i];if(n.show===undefined||n.show(e,t)){return true}}}return false},entries:[{name:"SAVE_CHANGED",title:"HELP_CONTEXTMENU_INPUT_SAVE_CHANGED",level:"Consumer",models:["ContainerModel"],extendedModels:["TableModel"],attributes:[],parameters:{saveChanged:true},thumbnail:"floppy-o",action:"updateInputSaveStates",getDynamicData:function(e){return{commandText:e.model.extendedModel.input.autoSave?"":undefined}}},{name:"SAVE_CHANGED",title:"HELP_CONTEXTMENU_INPUT_SAVE_CHANGED",level:"Consumer",models:["ContainerModel"],extendedModels:["ContainerCommentGridModel"],attributes:[],parameters:{saveChanged:true},thumbnail:"floppy-o",action:"updateRootModel",getDynamicData:function(e){var t=e.extension.getMode()!==Le["a"].READ_ONLY&&!e.model.extendedModel.autoSave;return{commandText:!t?"":undefined}}},{name:"SAVE_ALL",title:"HELP_CONTEXTMENU_INPUT_SAVE_ALL",level:"Consumer",models:["ContainerModel"],extendedModels:["TableModel"],attributes:[],parameters:{saveChanged:false},thumbnail:"floppy-o",action:"updateInputSaveStates"},{name:"RELEASE",title:"HELP_CONTEXTMENU_INPUT_RELEASE",level:"Consumer",models:["ContainerModel"],extendedModels:["TableModel"],attributes:[],thumbnail:"unlock-alt",getDynamicData:St["b"].Models.Actions.ViewModelActions.ContainerModel.isInlineCommentsReleaseOn,action:"updateInputReleaseStates"},{name:"COPY_COMMENT",title:"HELP_CONTEXTMENU_COPY_COMMENT",level:"Consumer",models:["ContainerModel"],extendedModels:["TableModel","CommentModel"],attributes:[],thumbnail:"clipboard",platforms:[Y["a"].QlikSense],getDynamicData:function(e){if(e.model&&e.model.extendedModel.instanceOf==="CommentModel"){return{isValid:true,additionalData:e.model}}var t=St["b"].Factories.ModelFactory.collectModelsAtPosition(e.model.children,e.position,true,e.extension);for(var i=0,n=t;i<n.length;i++){var a=n[i];if(a&&a.instanceOf==="InlineModel"&&a.type===rt["a"].tableRepresentation.COMMENT){return{isValid:true,additionalData:a}}}return{isValid:false}},action:"CopyCommentToClipboardAction"}]}];return this.getContextMenuContentByPermission(t,e)};UIContent.getLayoutMenuContent=function(e){var t=[{name:"CELL",title:"HELP_CONTEXTMENU_CELL",level:"Designer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel","PlaceHolderModel","EmptyModel","ButtonPlusModel","CommentModel","ContainerGridModel","MultipleContainerModel","ContainerCommentGridModel","UrlContainerModel"],attributes:[],thumbnail:"cog",action:"getCellSettingsEditor",getDynamicData:St["b"].Models.Actions.ViewModelActions.ContainerModel.isInMultipleIfGrid,platforms:[Y["a"].QlikSense],entries:[{name:"CONTENT",title:"HELP_CONTEXTMENU_CELL_CONTENT",level:"Designer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel","PlaceHolderModel","EmptyModel","ButtonPlusModel","CommentModel","ContainerGridModel","MultipleContainerModel","ContainerCommentGridModel","UrlContainerModel"],attributes:[],thumbnail:"pencil-square",action:"getCellSettingsEditor",getDynamicData:St["b"].Models.Actions.ViewModelActions.ContainerModel.isInMultipleIfGrid},{name:"TABLE",title:"HELP_CONTEXTMENU_CELL_TABLE",level:"Designer",models:["ContainerModel"],extendedModels:["TableModel"],attributes:[],thumbnail:"table",action:"getTableMover",platforms:[Y["a"].QlikSense]},{name:"LINK",title:"HELP_CONTEXTMENU_CELL_LINK",level:"Designer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel"],attributes:[],thumbnail:"link",action:"getLinkDialog"},{name:"SeparatorC1",level:"Designer",models:[],extendedModels:[],attributes:[],thumbnail:"",action:""},{name:"CUT",title:"HELP_CONTEXTMENU_CELL_CUT",level:"Designer",models:["ContainerModel"],extendedModels:[],attributes:[],parameters:{type:"cut"},thumbnail:"scissors",action:"getGridCopy"},{name:"COPY",title:"HELP_CONTEXTMENU_CELL_COPY",level:"Designer",models:["ContainerModel"],extendedModels:[],attributes:[],thumbnail:"clipboard",action:"getGridCopy"},{name:"PASTE",title:"HELP_CONTEXTMENU_CELL_PASTE",level:"Designer",models:["ContainerModel"],extendedModels:[],attributes:[],thumbnail:"clipboard",action:"updateGridPaste"}]},{name:"LAYOUT_EDITOR",title:"HELP_CONTEXTMENU_OPEN_LAYOUT_EDITOR",level:"Designer",models:[],extendedModels:[],attributes:[],thumbnail:"th-large",action:"getLayoutEditMode",platforms:[Y["a"].QlikSense]}];return this.getContextMenuContentByPermission(t,e)};UIContent.getContextMenuContent=function(e){var t=[{name:"DATA",title:"HELP_CONTEXTMENU_CONTEXT",level:"Designer",models:["ContainerModel"],extendedModels:["ChartModel","TimeChartModel","TableModel","PlaceHolderModel","ButtonPlusModel","EmptyModel","UrlContainerModel"],attributes:[],thumbnail:"database",parameters:{initialPage:Qe["c"].Data},action:"getCellSettingsEditor",platforms:[Y["a"].QlikSense]}];return this.getContextMenuContentByPermission(t,e)};UIContent.getObjectContextMenuContent=function(e){var t=[{name:"OBJECT",title:"HELP_CONTEXTMENU_OBJECT",level:"Consumer",thumbnail:"object-group",platforms:[Y["a"].QlikSense],getDynamicData:function(e){var t=e.entries.SAVE_ACTION,i={};if(t){i.action=t.action;i.title="HELP_CONTEXTMENU_OBJECT_WITH_SAVE";if(e.useNativeMenu&&St["b"].Connector.ConnectorHelper.getNativeContextMenuContent(e)){i.commandText="OBJECT_SAVE";i.thumbnail="floppy-o"}}return i},entries:[{name:"SAVE_ACTION",title:"HELP_CONTEXTMENU_OBJECT_SAVE",level:"Designer",thumbnail:"floppy-o",action:"updateRootModel",show:function(e){return e.getMode()!==Le["a"].READ_ONLY}},{name:"INITIALIZE",title:"HELP_CONTEXTMENU_OBJECT_INITIALIZE",level:"Designer",thumbnail:"file",action:"getInitialState"},{name:"SeparatorObj1",serviceRequired:true,level:"Consumer",thumbnail:"",action:"",needsTranslation:false},{name:"EXPORT_AS_PNG",title:"HELP_CONTEXTMENU_OBJECT_EXPORT_PNG",serviceRequired:true,level:"Consumer",thumbnail:"file-image-o",action:"createPNG"},{name:"EXPORT_AS_PDF",title:"HELP_CONTEXTMENU_OBJECT_EXPORT_PDF",serviceRequired:true,level:"Consumer",thumbnail:"file-pdf-o",action:"createPDF"},{name:"EXPORT_AS_EMF",title:"HELP_CONTEXTMENU_OBJECT_EXPORT_EMF",serviceRequired:true,level:"Consumer",thumbnail:"file-image-o",action:"createEMF"},{name:"EXPORT_AS_XLS",title:"HELP_CONTEXTMENU_OBJECT_EXPORT_EXCEL",serviceRequired:true,level:"Consumer",thumbnail:"table",getDynamicData:function(e){var t=e.extension.getController().getRootModel();var i=e.model.id.split(".")[0];var n=Object(Ze["d"])(t,i);if(n&&["ChartModel","TimeChartModel","TableModel","MultipleContainerModel"].indexOf(n.extendedModel.instanceOf)>-1){return{}}else{return null}},action:"getXLSExporterDialog",platforms:[Y["a"].QlikSense]},{name:"SeparatorObj2",level:"Designer",thumbnail:"",action:"",needsTranslation:false},{name:"IS_DRILLABLE_ACTIVATE",title:"HELP_CONTEXTMENU_OBJECT_IS_DRILLABLE_ACTIVATE",level:"Designer",thumbnail:"",getDynamicData:St["b"].Models.Actions.ModelActions.DrillDownElementModel.isDrillable}]},{name:"OVERALL_MENU",title:"HELP_CONTEXTMENU_OVERALL_MENU",level:"Consumer",thumbnail:"cogs",entries:[{name:"INDICATIONS",title:"HELP_CONTEXTMENU_OVERALL_MENU_INDICATIONS",level:"Consumer",thumbnail:"thermometer-half",action:"getIndicationDialog"},{name:"MY_SETTINGS",title:"HELP_CONTEXTMENU_OVERALL_MENU_MY_SETTINGS",level:"Consumer",thumbnail:"user",action:"getUserSettingsDialog"},{name:"SeparatorObj3",level:"Consumer",thumbnail:"",action:"",needsTranslation:false},{name:"DOCUMENT",title:"HELP_CONTEXTMENU_OVERALL_MENU_DOCUMENT",level:"Designer",thumbnail:"file",action:"getNumberFormat"},{name:"SeparatorObj4",level:"Designer",thumbnail:"",action:"",needsTranslation:false},{name:"NOTATION_MANUAL",title:"HELP_CONTEXTMENU_OVERALL_MENU_NOTATION_MANUAL",level:"NotationManual",thumbnail:"book",action:"getNotationManual",parameters:{}}]},{name:"SeparatorShowEdit1",level:"Consumer",thumbnail:"",action:"",show:function(e){return e.getMode()!==Le["a"].READ_ONLY&&!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()},needsTranslation:false},{name:"",level:"Consumer",models:[],extendedModels:[],attributes:[],thumbnail:"",action:"updateDocumentMode",platforms:[Y["a"].QlikSense],title:"HELP_CONTEXTMENU_EDIT_TEXT",getDynamicData:St["b"].Models.Actions.ViewModelActions.General.getDocumentModeText,show:function(e){return e.getMode()!==Le["a"].READ_ONLY&&!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()}},{name:"SHOW_OBJECTS",title:"HELP_CONTEXTMENU_OBJECT_SHOW",level:"Designer",models:[],extendedModels:[],attributes:[],thumbnail:"square-o",action:"updateHighlightObjects",getDynamicData:function(){return St["b"].DataObjects.DocumentDO.getSettings().documentMode.value==="PRESENTATION"?null:{commandText:"SHOW_OBJECTS",thumbnail:"square-o"}},show:function(e){return e.getMode()!==Le["a"].READ_ONLY&&!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()}},{name:"SeparatorHelp1",level:"Consumer",thumbnail:"",action:"",needsTranslation:false},{name:"HELP_HELPABOUT",title:"HELP_CONTEXTMENU_HELP",level:"Consumer",models:[],extendedModels:[],attributes:[],thumbnail:"question-circle",action:"getHelpMessage"}];return this.getContextMenuContentByPermission(t,e)};UIContent.getContextMenuContentByPermission=function(e,t){var i=[];for(var n=0,a=e;n<a.length;n++){var r=a[n];if(r.entries){r.entries=this.getContextMenuContentByPermission(r.entries,t)}if(t===Le["a"].READ_ONLY){if(r.level==="Consumer"){i.push(r)}}else if(r.level==="Consumer"||St["b"].DataObjects.RuntimeDO.getUser().permissions.indexOf(r.level)!==-1){i.push(r)}}return i};return UIContent}();St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetCommentReferenceMenuContent={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var r=e.extension;var t={x:e.pageX,y:e.pageY};var i={};var n={x:e.x,y:e.y};var a=e.divId;St["b"].DataObjects.CommentRepo.setSelectedCommentReferenceElement(a);var o=r.getMode();var l=selectSpecialContent(n,qe.getSpecialCommentReferenceViewContent(o));for(var s in l){if(l.hasOwnProperty(s)){i[l[s].name]=l[s]}}St["b"].DataObjects.DocumentDO.getConnector().openContextMenu(t,i,r,false);function selectSpecialContent(e,t){var i={},n={},a,r;for(var o=0,l=t.length;o<l;o++){a=t[o];i=fillSpecialContent(a,i,e);if(i[a.name]&&i[a.name].entries){for(var s=0;s<i[a.name].entries.length;s++){r=i[a.name].entries[s];n=fillSpecialContent(r,n,e)}i[a.name].entries=n}}return i}function fillSpecialContent(e,t,i){if(checkSpecialRules(e)){var n=e.name;if(e.getDynamicData!==undefined){var a=e.getDynamicData({extension:r,position:i});if(!a){return}if(a.commandText!==undefined){n=a.commandText}if(a.thumbnail!==undefined){e.thumbnail=a.thumbnail}if(a.isValid!==undefined&&a.isValid===false){return}}t[n]=e}return t}function checkSpecialRules(e){if(e.action==="deleteCommentReferenceLabelLink"&&!isCommentReferenceLinkToLabelModel()){return false}return true}function isCommentReferenceLinkToLabelModel(){var e=null;var t=St["b"].$.data(document.getElementById(a));var i=t.selectedReference;if(t.currCommentCell&&t.currCommentCell.reference[i]){e=t.currCommentCell.reference[i].elementPath}return!!e}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetCommonInlineComment={valid:function(){return[]},execute:function(e){return St["b"].Utils.GlobalVariables.hasService?re["a"].repository("getCommonInlineComment",undefined,e,false):null}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetCommonTableComments={valid:function(){return[]},execute:function(e){return St["b"].Utils.GlobalVariables.hasService?re["a"].repository("getCommonTableComments",undefined,e,false):[]}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetCommonTableListAction={valid:function(){return[]},execute:function(){return St["b"].Utils.GlobalVariables.hasService?re["a"].repository("getCommonTableList",undefined,{},false):St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().commonTables}};St["b"].Actions=St["b"].Actions||{};var Je=St["b"].Actions.GetContextMenuContentAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.HIGHLIGHT,St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.EDIT_LABEL,St["b"].Utils.Enums.EMode.EDIT_SORT,St["b"].Utils.Enums.EMode.EDIT_EXPR,St["b"].Utils.Enums.EMode.EDIT_GRID,St["b"].Utils.Enums.EMode.EDIT_OPTION,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.EDIT_BORDER,St["b"].Utils.Enums.EMode.EDIT_DIM,St["b"].Utils.Enums.EMode.DOCUMENT,St["b"].Utils.Enums.EMode.DATA_ERROR,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var h=e.extension,t=St["b"].DataObjects.DocumentDO.getConnector(),i={x:e.pageX,y:e.pageY},n={},a={x:e.x,y:e.y},f=h.getController().getRootModel(),o=f.rootContainerModel,d=St["b"].Factories.ModelFactory.collectModelsAtPosition([o],a,true,h),r=f.selectedChart;var l=false;if(r!==""){var s=St["b"].Factories.ModelFactory.getModelById(f,r);if(s!==null){if(s.extendedModel.instanceOf==="ContainerGridModel"){if(s.children[0].extendedModel.instanceOf!=="CommentModel"){l=true}}else if(s.extendedModel.instanceOf!=="ContainerBorderModel"&&s.extendedModel.instanceOf!=="CommentModel"){var c=St["b"].Factories.ModelFactory.getParentContainer(f.firstObjectGrid,s)[0];if(c.extendedModel.instanceOf==="ContainerGridModel"){l=true}}}}var u=h.getMode();var v=!!e.useNativeMenu;if(e.useNativeMenu===undefined){v=St["b"].Connector.ConnectorHelper.UseNativeMenu(h,t);if(v){var p=St["b"].Connector.ConnectorHelper.getNativeContextMenuContent(e);if(p){e.useNativeMenu=false;n["trueChart"]=p}}}var g=selectSpecialContent(a,qe.getSpecialMenuContent(u)),m=selectSpecialContent(a,qe.getLayoutMenuContent(u)),b=selectSpecialContent(a,qe.getContextMenuContent(u)),T=addModelsToActions(h,a,qe.getObjectContextMenuContent(u));for(var E in g){if(g.hasOwnProperty(E)){n[E]=g[E]}}if(Object.keys(g).length){n["Separator1"]={}}for(var E in m){if(m.hasOwnProperty(E)){n[E]=m[E]}}if(Object.keys(m).length){n["Separator2"]={}}for(var E in b){if(b.hasOwnProperty(E)){n[E]=b[E]}}for(var E in T){if(T.hasOwnProperty(E)){n[E]=T[E]}}t.openContextMenu(i,n,h,v);function addModelsToActions(e,t,i){var n={};if(f.isCompareMode){return n}for(var a=0,r=i.length;a<r;a++){var o=i[a];var l=o.name;o.model=d[0];if(o.entries){o.entries=addModelsToActions(e,t,o.entries)}if(o.getDynamicData){var s=o.getDynamicData({model:d[0],extension:e,position:t,entries:o.entries,useNativeMenu:v});if(!s){continue}s.action!==undefined&&(o.action=s.action);s.additionalData!==undefined&&(o.additionalData=s.additionalData);s.commandText!==undefined&&(l=s.commandText);s.height!==undefined&&(o.height=s.height);s.needsTranslation!==undefined&&(o.needTranslation=s.needsTranslation);s.thumbnail!==undefined&&(o.thumbnail=s.thumbnail);s.title!==undefined&&(o.title=s.title)}if(l===""||Object.keys(o.entries||{}).length===0&&!o.action){continue}n[l]=o}return n}function selectSpecialContent(a,e){var t=[];if(d.length>0){t=St["b"].Factories.ModelFactory.getParentContainer(o,d[0])}if(t.length>0){var i=t[0];var r=i.extendedModel}function selectSpecialContentRecursion(e){var t={};for(var i=0;i<e.length;i++){var n=e[i];if(n.entries){n.entries=selectSpecialContentRecursion(n.entries)}t=fillSpecialContent(n,d,r,t,a)}return t}return selectSpecialContentRecursion(e)}function fillSpecialContent(l,s,d,c,u){var e=function(e){var t=s[e];var i=!l.models.length||l.models.some(function(e){return e===t.instanceOf&&(!l.extendedModels.length||t.instanceOf!=="ContainerModel"||t.extendedModel!==null&&l.extendedModels.some(function(e){return t.extendedModel.instanceOf===e}))});var n=!l.attributes.length||l.attributes.some(function(e){return t[e]});var a=t.instanceOf==="ContainerModel"||!l.extendedModels.length||d===null||l.extendedModels.some(function(e){return d.instanceOf===e});if(i&&n&&a&&checkSpecialRules(l,h,t,f)){p=l.name,g=l.thumbnail;if(l.getDynamicData){var r={model:t,extension:h,position:u,entries:l.entries,useNativeMenu:v};l.parameters&&(r.parameters=l.parameters);var o=l.getDynamicData(r);if(!o){return"continue"}o.action!==undefined&&(l.action=o.action);o.additionalData!==undefined&&(l.additionalData=o.additionalData);o.commandText!==undefined&&(p=o.commandText);o.entries!==undefined&&(l.entries=o.entries);o.needsTranslation!==undefined&&(l.needsTranslation=o.needsTranslation);o.thumbnail!==undefined&&(g=o.thumbnail);o.title!==undefined&&(l.title=o.title);o.type!==undefined&&(m=o.type);if(o.isValid===false){return"continue"}}if(p===""||Object.keys(l.entries||{}).length===0&&!l.action){return"continue"}if(l.model!=undefined&&(l.model.instanceOf==="BarModel"||l.model.instanceOf==="NeedleModel"||l.model.instanceOf==="StructureLineModel"||l.model.instanceOf==="TimeColumnModel"||l.model.instanceOf==="TimeWaterfallModel"||l.model.instanceOf==="RodModel"||l.model.instanceOf==="TimeLineModel"||l.model.instanceOf==="CompareModel"||l.model.instanceOf==="LabelModel")){if(l.model.zIndex<t.zIndex){l.model=t;l.thumbnail=g;l.type=m;c[p]=l}}else if(l.name==="AXIS"){if(f.isCompareMode){l.model=t;l.thumbnail=g;c[p]=l}}else{l.model=t;l.thumbnail=g;l.type=m;c[p]=l}return"break"}};var p,g,m;for(var t=0;t<s.length;t++){var i=e(t);if(i==="break")break}return c}function checkSpecialRules(e,t,i,n){if(e.action==="getCellDialog"&&n.selectedChart===St["b"].Factories.ModelFactory.idCollection.chartGridContainer){if(e.name==="CONTENT"){return false}e.action=""}if(e.action==="createVariableAction"){if(i.dataId_dim===null||i.dataId_expr===null){return false}}if(i.id.indexOf("merkmalsLabel")>-1||i.id.indexOf("stackLineLabel")>-1){if(e.name==="HIGHLIGHT"){return false}}if(e.action==="updateCompareCollecting"&&!n.firstObjectGrid){return false}if(i.id==="basemodel"){if(n.firstObjectGrid!==null&&e.action==="getCellDialog"||e.action==="getGridCopy"&&!l){return false}}if(e.action==="updateGridPaste"&&St["b"].DataObjects.RuntimeDO.isClipboardEmpty()){return false}if(e.action==="updateInputSaveStates"&&!e.parameters.saveChanged&&St["b"].Models.Actions.ViewModelActions.ContainerModel.isSaveAllNotAllowed(t,i)){return false}if(e.action==="updateFixateScalingGroup"&&St["b"].Models.Actions.ViewModelActions.BarModel.isScalingGroupFixable(i,t)){return false}if((e.action==="deleteCommentReference"||e.action==="copyReferenceAction")&&!St["b"].Models.Actions.ViewModelActions.LabelModel.isCommentReference(i)){return false}if(e.gridSelected&&e.gridSelected!==l){if(e.action==="updateGridPaste"){if(n.firstObjectGrid&&n.objectCounter!==0){return false}}else if(e.name==="SeparatorC1"&&!n.firstObjectGrid&&n.objectCounter===0){if(St["b"].DataObjects.RuntimeDO.isClipboardEmpty()){return false}}else{return false}}if(e.name==="COMMENT"){var a=St["b"].Factories.ModelFactory.getParentContainer(n.firstObjectGrid,i)[0];if(a&&a.extendedModel.instanceOf==="ContainerCommentGridModel"&&!a.extendedModel.isTextEditable){return false}}if(n.isCompareMode&&e.action!=="updateHighlightAxis"){return false}return true}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetGridCopyAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID]},execute:function(a){var g=a.extension;var r=g.getController();var o=r.getRootModel();var l=false;function selectRightContainer(e){if(e&&e.extendedModel){if(e.extendedModel.instanceOf==="CommentModel"){var t=St["b"].Factories.ModelFactory.getParentContainer(o.rootContainerModel,a.model)[0];for(var i=0;i<t.children.length;i++){if(t.children[i].id===a.model.id){o.selectedChart=t.id.split(".")[0];l=true;break}}}else{o.selectedChart=a.model.id.split(".")[0];l=true}}}if(o.selectedChart===""){selectRightContainer(a.model)}if(o.selectedChart===""){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}var s=St["b"].Factories.ModelFactory.getModelById(o,o.selectedChart);if(s===null||s.instanceOf!=="ContainerModel"){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));if(l){o.selectedChart=""}return}function goOn(){var e=St["b"].Factories.ModelFactory.getParentContainer(o.firstObjectGrid,s);if(e[0]&&e[0].extendedModel.instanceOf==="MultipleContainerModel"||e[1]&&e[1].extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ONLY_WHOLE_MULTIPLE_ALLOWED"));if(l){o.selectedChart=""}return}St["b"].DataObjects.RuntimeDO.setClipboardState(s,g.getId());if(a.parameters&&a.parameters.type==="cut"){var t=St["b"].DataObjects.DocumentDO.getHiCoVariables();var i=[];for(var n=0;n<t.length;n++){if(t[n].definition.substring(0,4)==="COMP"){i.push(t[n])}}markVariablesFromCompares(s,i);a.model=null;r.dispatch("deleteGridContent",a)}if(l){o.selectedChart=""}}function markVariablesFromCompares(e,t){if(t.length===0){return}var i=e.extendedModel;if(e.charts&&(i.instanceOf==="ChartModel"||i.instanceOf==="TimeChartModel"||i.instanceOf==="TableModel")){for(var n=0;n<e.charts.length;n++){i=e.charts[n].model;var a=St["b"].DataObjects.ContextRepo.getContextByCid(i.contextId);if(a===null){continue}for(var r=0;r<i.compares.length;r++){var o=i.compares[r].id.split(".");var l="COMP:"+g.getId()+"#ctx1#"+o[0]+"#"+o[1];for(var s=t.length-1;s>=0;s--){if(t[s].definition===l){t[s].temporaryDisabled=true;t.splice(s,1)}}if(t.length===0){break}}if(t.length===0){break}}}else if(i.instanceOf==="ContainerGridModel"||i.instanceOf==="MultipleContainerModel"){for(var n=0;n<e.children.length;n++){if(e.children[n].instanceOf==="ContainerModel"){markVariablesFromCompares(e.children[n],t)}}}}function containsMultiple(e){if(e.extendedModel&&e.extendedModel.instanceOf==="MultipleContainerModel"){return true}for(var t=0;t<e.children.length;t++){if(e.children[t].instanceOf==="ContainerModel"&&containsMultiple(e.children[t])){return true}}return false}function containsComment(e){if(e.extendedModel&&e.extendedModel.instanceOf==="ContainerCommentGridModel"){return true}for(var t=0;t<e.children.length;t++){if(e.children[t].instanceOf==="ContainerModel"&&containsComment(e.children[t])){return true}}return false}function containsReferences(e){var t=St["b"].DataObjects.CommentRepo.getLoadedCommentsByReferencedExtension(g.getId());var n=false;for(var i=0;i<t.length;i++){var a=t[i];for(var r=0;r<a.comments.length;r++){var o=a.comments[r];for(var l=0;l<o.grid.length;l++){var s=o.grid[l];for(var d=0;d<s.length;d++){var c=s[d];for(var u=0;u<c.reference.length;u++){var p=c.reference[u];if(p.extension===g.getId()){searchContainerModel(e,p)}}}}}}return n;function searchContainerModel(e,t){if(e.instanceOf==="ContainerModel"&&e.id===t.chartId){n=true;return}if(e.children){for(var i=0;i<e.children.length;i++){searchContainerModel(e.children[i],t);if(n){return}}}}}if(containsMultiple(s)){alert(Ot["a"].getTranslation("ALERT_COPYING_MULTIPLE_DISABLED"));if(l){o.selectedChart=""}return}St["b"].DataObjects.CommentRepo.setCutCopyContainsComment(g.getId()+"#"+g.getController().getRootModel().id,false);St["b"].DataObjects.CommentRepo.setCutCopyRootModelId(g.getController().getRootModel().id);St["b"].DataObjects.CommentRepo.setCutCopyExtensionId(g.getId());if(containsComment(s)||containsReferences(s)){if(g.getMode()===St["b"].Utils.Enums.EMode.EDIT_GRID){continueWithComments(true)}else{St["b"].UI.HiCoConfirm(Ot["a"].getTranslation("ALERT_SAVE_COMMENT_ON_INSERT"),continueWithComments)}}else if(St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(s)==="title"){if(g.getMode()===St["b"].Utils.Enums.EMode.EDIT_GRID){continueWithTitle(true)}else{St["b"].UI.HiCoConfirm(Ot["a"].getTranslation("ALERT_SAVE_TITLE_ON_INSERT"),continueWithTitle)}}else{goOn()}function continueWithComments(e){if(e===true){var t=a.parameters&&a.parameters.type==="cut"?a.parameters.type:null;St["b"].DataObjects.CommentRepo.setCutCopyType(t);St["b"].DataObjects.CommentRepo.setCutCopyContainsComment(g.getId()+"#"+g.getController().getRootModel().id,true);var i=o.selectedChart!==o.firstObjectGrid.id;St["b"].DataObjects.CommentRepo.setCCReferencesAndMarkToDelete(s,g,i);St["b"].DataObjects.CommentRepo.setCCCommentsAndMarkToDelete(s,g,i);goOn()}else{if(l){o.selectedChart=""}}}function continueWithTitle(e){if(e===true){goOn()}else if(l){o.selectedChart=""}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetHelpMessage={valid:function(){return[]},execute:function(e){var t=document.createElement("div");t.id="helpDialog";t.innerHTML='<div id="helpDoc">'+"<h2>"+Ot["a"].getTranslation("HELPDIALOG_DOCUMENTATION")+"</h2>"+"<p>"+Ot["a"].getTranslation("HELPDIALOG_DOCUMENTATION_TEXT")+"</p>"+"</div>"+'<div id="helpTooltips">'+"<h2>"+Ot["a"].getTranslation("HELPDIALOG_TOOLTIPS")+"</h2>"+"<p>"+Ot["a"].getTranslation("HELPDIALOG_TOOLTIPS_TEXT")+"</p>"+"</div>"+'<div id="helpAbout">'+"<h2>"+Ot["a"].getTranslation("HELPDIALOG_ABOUT")+"</h2>"+"<div>"+'<img style="max-width: 50%" src="'+de["c"]+'img/truechart_logo_dark.svg">'+"<p><strong>trueChart 2019.5.1</strong><br>"+"Version 2019.5.1_4<br>"+'&copy;&thinsp;2019 by <a href="http://www.highcoordination.com" target="_blank">HighCoordination GmbH</a></p>'+"<h3>"+Ot["a"].getTranslation("HELPDIALOG_EXTLIBS")+"</h3>"+"<ul><li>"+Object.keys(JSON.parse('{"@highcoordination/common-sense":"^3.0.0","@highcoordination/common-utils":"^1.0.25","@highcoordination/models":"^1.0.3","bootstrap":"^3.4.0","ckeditor":"git+https://github.com/HighCoordination/ckeditor-releases.git#a51ba15fb27a1361cbdf66f81a5a6eafa8d482a5","codemirror":"^5.46.0","crypto-js":"^3.1.9-1","font-awesome":"^4.7.0","jquery-slimscroll":"^1.3.8","jquery-ui-touch-punch":"^0.2.3","leonardo-ui":"^1.6.0","log4javascript":"^1.4.15","react":"^16.8.6","react-dom":"^16.8.6"}')).join("</li><li>")+"</li></ul>"+"</div>"+"</div>";var i=St["b"].DataObjects.DocumentDO.getApi().GlobalFeatureManager.Actions;if(i&&i.isEnabled&&i.Feature.supports("GoToURL")){var n=t.getElementsByTagName("a");for(var a=0;a<n.length;a++){n.item(a).addEventListener("click",function(e){i.Feature.execute.GoToURL({url:e.target.href});e.preventDefault()})}}St["b"].Factories.UIFactory.createDialog(Ot["a"].getTranslation("HELP_HELPABOUT"),t,undefined,{maxwidth:"450px"})}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetInitialStateAction={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension,i=t.getController();St["b"].Connector.ConnectorHelper.GetInitialStateAction_execute(t);i.setDefaultRootModel(t);i.switchRootModel(0);t.setValid("layout",false);t.setMode(St["b"].Utils.Enums.EMode.SET_CONTEXT);if(!e.doNotPaint){t.paint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetInlineCommentAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension.getController();if(e.model.edit){if(e.model.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST){t.dispatch("updateRepresentationList",e)}else if(e.model.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT){t.dispatch("updateRepresentationInlineComment",e)}else if(e.model.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG){t.dispatch("updateRepresentationFlag",e);t.dispatch("updateInlineCommentsOnAutoSave",e)}}else{t.dispatch("updateHiCoNavigation",e)}}};var et=r(322);var tt=r(1109);St["b"].Actions.GetLayoutEditMode={valid:function(){return[]},execute:function(e){var n=e.extension,a=n.getController(),t=St["b"].Utils.GlobalFunctions.deepCopy(a.getLayoutDefinition(),true);var r=a.getRootModel();n.setMode(St["b"].Utils.Enums.EMode.EDIT_GRID);var i;if(e.model){if(e.model.instanceOf==="ContainerModel"){i=e.model.id}else if(r.firstObjectGrid){var o=J["b"](r.firstObjectGrid,e.model);if(o&&o.length){var l=o[0].layoutType!=="comment"?o[0]:o[1];if(l){i=l.id}}}}tt["FormatConverter"].updatePreferredSize(r.layoutDefinition,r,true);tt["showLayoutEditor"]({extension:n,extensionElement:n.getAdapter().getContainerElement(),selectedCell:i,onExit:layoutEditorClosed,onChanged:layoutChanged,onShowSettingsEditor:showSettingsEditor,onSaveTemplate:saveTemplate,onLoadTemplate:loadTemplate,onCellCopy:copyCell,onCellCut:cutCell,onCellPaste:pasteCell,translator:et["a"],initialLayout:r.layoutDefinition});function showSettingsEditor(e){n.getController().dispatch("getCellSettingsEditor",{extension:n,model:n.getChartById(e)});return e}function saveTemplate(e){n.getController().dispatch("getSaveTemplateDialog",{extension:n,cellContainer:e})}function loadTemplate(t){return new Promise(function(e){n.getController().dispatch("getLoadTemplateDialog",{extension:n,cellContainer:t,callback:e})})}function copyCell(e){r=n.RootModel;var t={extension:n,model:J["a"](r,e)};r.selectedChart=e;a.dispatch("getGridCopy",t)}function cutCell(e){r=n.RootModel;var t={parameters:{type:"cut"},extension:n,model:J["a"](r,e)};r.selectedChart=e;a.dispatch("getGridCopy",t)}function pasteCell(e){if(!e.Layout.rootModelReference){throw new Error("Can not paste a cell without a valid rootModelReference")}r=n.RootModel;var t=e.Layout.rootModelReference;var i={extension:n,model:J["a"](r,t)};r.selectedChart=t;a.dispatch("updateGridPaste",i);if(e.Layout.contentType==="grid"){syncLayoutDefinition(J["a"](r,t),e.Layout);e.removeHandlers();e.showCellContent(e.Layout.contentType,true)}J["e"](r,tt["getLayout"]().rootCell,n.getChartsMap());return!St["b"].DataObjects.RuntimeDO.isClipboardEmpty();function syncLayoutDefinition(e,t){t.rootModelReference=e.id;t.name=e.name;if(e.extendedModel.instanceOf==="ContainerGridModel"){for(var i=0,n=e.children.length;i<n;i++){syncLayoutDefinition(e.children[i],t.contentSpec.cells[i])}}}}function layoutEditorClosed(e){if(e){a.getRootModel().layoutDefinition=e;a.updateLayoutDefinition()}else{a.setLayoutDefinition(t)}n.setMode(St["b"].Utils.Enums.EMode.DEFAULT,true);n.ignoreShowCondition=false;a.dispatch("updateAbsoluteLayout",{extension:n});St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}function layoutChanged(e,t){if(e===void 0){e=false}if(e){a.updateRootModel();r=a.getRootModel();t&&t(r.layoutDefinition)}else{r=n.RootModel;r.layoutDefinition=tt["getLayout"]();J["e"](r,r.layoutDefinition.rootCell,n.getChartsMap());a.updateLayoutDefinition()}a.dispatch("updateAbsoluteLayout",{extension:n,noPreferredSize:true});St["b"].DataObjects.DocumentDO.triggerDelayedRepaint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetLeafAction={valid:function(){return[]},execute:function(a){var e=St["b"].DataObjects.RuntimeDO.getUser().sessionKey;if(e!==""){var t=St["b"].DataObjects.DocumentDO.getPainter();var r=a.extension.getController();var o=r.getRootPanel();var i=a.model;var n=a.event.target;if(n.id==="touch-dummy"&&n.parentElement&&getActionAndExecute(n.parentElement.id)||n.id==="delete-comment-icon"){return}var l=t.getModelIdsAtPosition(a.event.clientX,a.event.clientY,a.extension);for(var s=0;s<l.length;s++){if(l[s].indexOf("##cellBackground")>-1||l[s].indexOf("##clickDummy")>-1){l[s]=l[s].split("##")[0]}var d=Object(Ze["e"])(i.children,l[s]);if(d!==null){var c=d.view!=null&&d.view!==""?d.view:d.id;if(getActionAndExecute(c)){break}}}getActionAndExecute()}else{a.extension.getController().dispatch("getUnlicensedState",a)}function getActionAndExecute(e){if(St["b"].Components.LayoutEditor.isOpen()){a.model=d;r.dispatch("getLayoutEditMode",a);return true}if(!e){return false}var t=St["b"].Factories.ViewFactory.getViewById(o,e),i=false;if(t!==null){var n=t.getActions()[a.action];if(n){a.model=t.getModel();r.dispatch(n,a);i=true}}return i}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetLinkDialog={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=document.getElementById("linkDialog");if(i!==null){return}var n=new St["b"].UI.LinkDialog(t);n.createLinkDiv()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetIndicationDialog={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getCanvasDO().getDOMElement();if(St["b"].UI.IndicationDialog.isOpen()){return}var n=new St["b"].UI.IndicationDialog;n.open(i)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetNotationManualAction={valid:function(){return[]},execute:function(e){var t=document.getElementById("notationManual");if(t!==null){return}var i=St["b"].DataObjects.RuntimeDO;switch(e.parameters.use){case"local":i.useLocalVersion();break;case"central":i.useCentralVersion();break}var n=e?e.parameters:{};var a=new St["b"].UI.NotationManual(n.onApply);var r=i.getLocalNotationManual();var o=i.getCentralNotationManual();var l=St["b"].Utils.GlobalFunctions.isDifferent(r.parameters,o.parameters,["_UPDATED_AT","_UPDATED_BY"]);var s=St["b"].Utils.GlobalFunctions.isDifferent(r.datatypes,o.datatypes,[]);if(!n.supressDiffDialog&&(l||s)){var d=[{legend:Ot["a"].getTranslation("LOCAL_VERSION"),user:r.parameters._UPDATED_BY,date:new Date(r.parameters._UPDATED_AT).toLocaleString()},{legend:Ot["a"].getTranslation("CENTRAL_VERSION"),user:o.parameters._UPDATED_BY,date:new Date(o.parameters._UPDATED_AT).toLocaleString()}];var c=Ot["a"].getTranslation("NOTATION_MANUAL_DIFFERS")+"! "+Ot["a"].getTranslation("NOTATION_MANUAL_CENTRAL_VERSION_IN_USE")+".<br>"+Ot["a"].getTranslation("NOTATION_MANUAL_PLEASE_CHECK")+"";St["b"].Factories.DialogFactory.createDiffNotationManualNotificationDialog(d,c,function(){a.open()})}else{a.open()}n.repaint===true&&a.repaintAllExtensions()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetNumberFormatAction={valid:function(){return[]},execute:function(){var e=document.getElementById("numberFormat");if(e!==null){return}var t=new St["b"].UI.DocumentSettings;t.open()}};St["b"].Actions.GetPropertiesDialogAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.FILL_DATA_ERROR,St["b"].Utils.Enums.EMode.NOPAINT]},execute:function(e){var t=e.extension;if(e.model){var i=t.getController().getRootModel();var n=St["b"].Factories.ModelFactory.getParentContainer(i.rootContainerModel,e.model);n.unshift(e.model);for(var a=0;a<n.length;a++){var r=n[a];var o=r.extendedModel&&r.instanceOf==="ContainerModel"?r.extendedModel.contextId:r.contextId;if(o){var l=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(o);if(l!==null){t=l.extension;break}}}}}};var ct=r(1191);var ut=r(388);var pt={valid:function(){return[Le["a"].DEFAULT,Le["a"].SET_CONTEXT,Le["a"].CONTEXTMENU,Le["a"].EDIT_GRID,Le["a"].EDIT_SETTINGS]},execute:function(n){if(!St["b"].DataObjects.RuntimeDO.getUser().IsDesigner){return}Promise.all([n.optionsData||St["b"].DataObjects.DocumentDO.getOptionsData(),n.template||ut["a"].createTemplate(n.extension,n.cellContainer)]).then(function(e){var t=e[0],i=e[1];ct["a"].show({mode:n.mode||"create",optionsData:t,template:i,onClose:n.onClose,onSaveByService:ut["a"].addTemplate,onSaveAsFile:ut["a"].saveAsFile,onUpdateByService:ut["a"].updateTemplate})})}};St["b"].Actions.GetSaveTemplateDialog=pt;St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetTableMover={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.DOCUMENT]},execute:function(e){var t=document.getElementById("tableMoverDialog");if(t!==null){return}if((e.extendedModel||e.model.extendedModel).instanceOf!=="TableModel"){q["a"].warn("We can't open the table mover for a non tableModel.");return}return new L(e.extension,e.model,e.extendedModel,e.showDraggers===undefined?true:e.showDraggers)}};HiCo.Actions=HiCo.Actions||{};HiCo.Actions.GetTableSelectionMove={valid:function(){return[HiCo.Utils.Enums.EMode.DEFAULT]},execute:function(e){var t=e.position;var i=e.model;var n=i.extendedModel;var a=HiCo.Models.Actions.ExtendedModelActions.TableModel.getCellAt(i,t);var r=n.cellSelection;if(n.cellSelectionDraggingData.isDragging===false||a===null||r.rowLength===0||r.columnLength===0){return}var o=n.cellSelectionDraggingData.originalStart;if(o===null){o=new Fe["a"].CellSelection;o.startRow=r.startRow;o.startColumn=r.startColumn;o.rowLength=r.rowLength;o.columnLength=r.columnLength;n.cellSelectionDraggingData.originalStart=o}var l=r.rowLength;var s=r.columnLength;var d=r.startColumn;var c=r.startRow;r.rowLength=Math.abs(o.startRow-a.row)+1;r.columnLength=Math.abs(o.startColumn-a.column)+1;if(o.startRow>=a.row){r.startRow=a.row}if(o.startColumn>=a.column){r.startColumn=a.column}if(l===r.rowLength&&s===r.columnLength&&d===r.startColumn&&c===r.startRow){return}e.extension.paint()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetTableSelectionStart={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){var t=e.position;var i=e.model;var n=i.extendedModel;if(n.cellSelectionDraggingData.isDragging===true){n.cellSelectionDraggingData.isDragging=false;n.cellSelectionDraggingData.originalStart=null;return}else{n.cellSelectionDraggingData.isDragging=true}var a=St["b"].Models.Actions.ExtendedModelActions.TableModel.getCellAt(i,t);var r=n.cellSelection;if(a===null||a.row===r.startRow&&a.column===r.startColumn){if(r.rowLength===0&&r.columnLength===0){return}r.startRow=0;r.startColumn=0;r.rowLength=0;r.columnLength=0}else{r.startRow=a.row;r.startColumn=a.column;r.rowLength=1;r.columnLength=1}if(a!==null){console.log("clicked: "+a.row+", "+a.column)}e.extension.paint()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetUnlicensedStateAction={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.UNLICENSED,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){console.info("getUnlicensedState");var t=e.extension;var i=t.getController();var n=St["b"].DataObjects.DocumentDO.getDocSettings(true);i.setDefaultRootModel(t);i.switchRootModel(0);var a=i.getRootModelAtPosition(0);a.rootContainerModel.children[0].text="Unlicensed";t.setMode(St["b"].Utils.Enums.EMode.UNLICENSED);t.paint();if(n.showUnlicensed.value==="true"){console.info("this extension should not be shown")}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetUserSettingsDialogAction={valid:function(){return[]},execute:function(){var e=document.getElementById("userSettingsDialog");if(e!==null){return}var t=new St["b"].UI.UserSettings;t.open()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetVisualizationMenu={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=null;if(e.model===undefined){a=St["b"].Factories.ModelFactory.getModelById(n,n.selectedChart)}else{if(!(e.model.instanceOf==="ContainerModel")){var r=St["b"].Factories.ModelFactory.getParentContainer(n.rootContainerModel,e.model);if(r.length>0){a=r[0]}}else{a=e.model}}if(a!==null){if(a.extendedModel.instanceOf==="ChartModel"||a.extendedModel.instanceOf==="TableModel"||a.extendedModel.instanceOf==="TimeChartModel"){var o=document.getElementById("visualizationMenu");if(o!==null){return}var l=new St["b"].UI.VisualizationMenu({extension:t,model:a});l.open()}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.GetXLSExporterDialog={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=document.getElementById("xlsExporterDialog");if(i!==null){return}var n=new St["b"].UI.XLSExporterDialog(t);n.open()}};var gt=r(1471);var mt=St["b"].Actions.GetLoadTemplateDialog={valid:function(){return[Le["a"].DEFAULT,Le["a"].SET_CONTEXT,Le["a"].CONTEXTMENU,Le["a"].EDIT_GRID,Le["a"].EDIT_SETTINGS]},execute:function(t){if(!St["b"].DataObjects.RuntimeDO.getUser().IsDesigner){return}var a=t.extension;if(t.cellContainer.cells.length>1){se["a"].show({onCancel:undefined,onConfirm:showTemplateDialog,header:Ot["a"].getTranslation("TEMPLATES_MULTIPLE_CELL_CONTENTS_HEADER"),content:Ot["a"].getTranslation("TEMPLATES_MULTIPLE_CELL_CONTENTS_CONTENT"),confirmText:Ot["a"].getTranslation("CONTINUE"),cancelText:Ot["a"].getTranslation("CANCEL"),open:true})}else{showTemplateDialog()}function showTemplateDialog(){St["b"].DataObjects.DocumentDO.getOptionsData().then(function(n){gt["a"].show({templates:[],optionsData:n,onClose:function(e){if(typeof e==="object"){return ut["a"].applyTemplate(Me["a"]({extension:a,cellContainer:t.cellContainer,settings:t.settings},e)).then(function(e){t.callback&&t.callback(e);return e})}else{t.callback&&t.callback(null);return Promise.resolve(null)}},getDataMap:function(e,t){return ut["a"].getDataMap(e,t,a)},onValidateDataMap:function(e,t){return ut["a"].validateDataMap(e,t,a)},onEditTemplate:function(t,i){if(i===void 0){i="update"}return new Promise(function(e){a.getController().dispatch("getSaveTemplateDialog",{extension:a,optionsData:n,template:t,mode:i,onClose:e})})},onDataUpdate:function(){return St["b"].DataObjects.DocumentDO.getOptionsData()},loadData:ut["a"].loadData,loadTemplates:ut["a"].loadTemplates,readFromFile:ut["a"].readFromFile,onSaveAsFile:ut["a"].saveAsFile,onSaveByService:ut["a"].addTemplate,onUpdateByService:ut["a"].updateTemplate,deleteTemplate:ut["a"].deleteTemplate,sortTemplates:ut["a"].sortTemplates,checkAndConfirm:ut["a"].checkAndConfirm,mapHasErrors:ut["a"].mapHasErrors,getMaxError:ut["a"].getMaxError,hasDataMapExisitingContextWithNewChild:ut["a"].hasDataMapExisitingContextWithNewChild,autoMapContextData:function(e,t,i){ut["a"].autoMapContextData(e,t,i,a)}})})}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CompareEndDraggingReferenceAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(r){function getCompareBoundingRect(){var e=r.dragTargetPosition.y;var t=r.dragTargetPosition.x;var i=r.dragTargetPosition.x+r.dragTargetPosition.width;var n=r.dragTargetPosition.y+r.dragTargetPosition.height;var a=St["b"].Utils.Constants.TypeValues.indicator;if(r.draggedModel.absolute.legend!==a.NONE){t=Math.min(t,r.dragTargetAbsolutePosition.x);i=Math.max(r.dragTargetAbsolutePosition.x+r.dragTargetAbsolutePosition.width,i);e=Math.min(e,r.dragTargetAbsolutePosition.y);n=Math.max(r.dragTargetAbsolutePosition.y+r.dragTargetAbsolutePosition.height,n)}if(r.draggedModel.percent.legend!==a.NONE){t=Math.min(t,r.dragTargetPercentPosition.x);i=Math.max(r.dragTargetPercentPosition.x+r.dragTargetPercentPosition.width,i);e=Math.min(e,r.dragTargetPercentPosition.y);n=Math.max(r.dragTargetPercentPosition.y+r.dragTargetPercentPosition.height,n)}if(r.draggedModel.text.legend!==a.NONE&&r.draggedModel.text.text!==""){t=Math.min(t,r.dragTargetTextPosition.x);i=Math.max(r.dragTargetTextPosition.x+r.dragTargetTextPosition.width,i);e=Math.min(e,r.dragTargetTextPosition.y);n=Math.max(r.dragTargetTextPosition.y+r.dragTargetTextPosition.height,n)}return{x:t,y:e,width:i-t,height:n-e}}var e=r.draggedModel.id.split(".")[0];e=e.replace("tableContainer","chart").replace("containerModel","");var t=St["b"].Factories.ModelFactory.getModelById(r.extension.getController().getRootModel(),e);if(t.layoutType==="structure"||t.layoutType==="table"||t.layoutType==="elementType.0"||t.layoutType==="elementType.1"){r.dragTargetPosition.x=r.draggedModel.position.x;r.dragTargetAbsolutePosition.x=r.draggedModel.absolute.position.x;r.dragTargetPercentPosition.x=r.draggedModel.percent.position.x;r.dragTargetTextPosition.x=r.draggedModel.text.position.x;var i=getCompareBoundingRect();var n=i.y;var a=i.height;var o=St["b"].Utils.Constants.Parameters.idContainerContent+"."+t.id,l=St["b"].Utils.Constants.Parameters.idTableContent+"."+t.id,s=t.scrollingData.children&&(t.scrollingData.children[o]||t.scrollingData.children[l])||t.scrollingData;r.outOfBounds=isNaN(n)||n<0||n+a>=s.realHeight}else if(t.layoutType==="time"||t.layoutType==="elementType.2"){r.dragTargetPosition.y=r.draggedModel.position.y;r.dragTargetAbsolutePosition.y=r.draggedModel.absolute.position.y;r.dragTargetPercentPosition.y=r.draggedModel.percent.position.y;r.dragTargetTextPosition.y=r.draggedModel.text.position.y;var i=getCompareBoundingRect();var d=i.x;var c=i.width;var u=St["b"].Utils.Constants.Parameters.idContainerContent+"."+t.id,s=t.scrollingData.children&&t.scrollingData.children[u]||t.scrollingData;r.outOfBounds=isNaN(d)||d<0||d+c>=s.realWidth}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.CompareStartDraggingReferenceAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.ReferenceLabelLeftClick={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.HIGHLIGHT,St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){if(e.model.dataId_dim!==undefined&&e.model.dataId_dim!==null){e.extension.getController().dispatch("updateHiCoNavigation",e);if(e.model.dataId_expr!==undefined&&e.model.dataId_expr!==null){e.extension.getController().dispatch("updateHighlightLabel",e)}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.RepresentationLeftClickReferenceAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.HIGHLIGHT,St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){e.extension.getController().dispatch("updateHiCoNavigation",e);e.extension.getController().dispatch("updateHighlightRepresentation",e)}};var ht="https://kb.highcoordination.com/truechart/";var ft=ht+"dimension-settings#rest";var vt=r(87);var bt={valid:function(){return[Le["a"].DEFAULT,Le["a"].EDIT_SETTINGS,Le["a"].EDIT_DIM,Le["a"].SET_CONTEXT]},execute:function(){j["a"].info(Ot["a"].getTranslation("MESSAGE_DIMENSION_AUTOLIMIT",vt["a"].defaultLimitation.toString(),'<a target="documentation" href="'+ft+'">'+Ot["a"].getTranslation("DOCUMENTATION_")+"</a>"),undefined,{escapeHtml:false,preventDuplicates:true})}};St["b"].Actions.ShowDimensionLimitationsInfoAction=bt;var Et=r(487);St["b"].Actions.UpdateAbsoluteLayout={valid:function(){return[]},execute:function(e){var t=null,i=e.extension,n=i.getController(),a=n.getRootModel();if(tt["isOpen"]()&&[Le["a"].EDIT_GRID,Le["a"].EDIT_SETTINGS].indexOf(i.getMode())===-1||i.isHidden()){return}if(a.firstObjectGrid===null){St["b"].Factories.ModelFactory.createInitialLayout(a,i.getChartsMap())}if(!a.layoutDefinition){a.layoutDefinition=tt["FormatConverter"].rootModelToLayout(a)}var r=e.noPreferredSize?a.layoutDefinition:St["b"].Utils.GlobalFunctions.deepCopy(a.layoutDefinition);tt["FormatConverter"].updatePreferredSize(r,a,e.noPreferredSize);if(!tt["isOpen"]()){t=tt["getAbsoluteLayout"]({extension:i,extensionElement:i.getAdapter().getContainerElement(),luiInstance:St["b"].Components.LeonardoUI,initialLayout:r})}else if(i.getMode()===Le["a"].EDIT_SETTINGS){tt["reload"]({selectedCell:Et["a"].Instance&&Et["a"].Instance.SelectedCellId,initialLayout:r});t=tt["getAbsoluteLayout"]()}else if(i.getMode()===Le["a"].EDIT_GRID){t=tt["getAbsoluteLayout"]()}if(t){J["e"](a,t.rootCell,i.getChartsMap(),true)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateBISelection={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=e.model;var n=i.contextId;var a=i.dataId_dim||i.text;var r=parseInt(i.id.split(".").pop());if(!a||!t.getIsDrillable()||St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){return}if(!n){var o=St["b"].Factories.ModelFactory.getParentContainer(t.getController().getRootModel().firstObjectGrid,i)[0];o&&o.extendedModel&&(n=o.extendedModel.contextId)}if(n){t=St["b"].DataObjects.ContextRepo.getExtensionByContextCid(n)}var l=a.split("@");var s=l;if(l.length>1&&l.length!==r+1){s=[];for(var d=0;d<=r;d++){s.push(l[d])}}t.getAdapter().applySelection(s,n)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateCompareCollecting={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();n.compareCollectingFirst=null;n.compareCollectingSecond=null;n.compareType=e.parameters.compareType;n.isCompareMode=true;i.updateLayoutDefinition(false);t.setMode(St["b"].Utils.Enums.EMode.COMPARE)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateCompareNegativeIsPositive={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController().getRootModel();var n=St["b"].Factories.ModelFactory.getModelById(i,e.model.id);n.negativeIsPositive=!n.negativeIsPositive;t.getController().updateLayoutDefinition(false);t.paint()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateComparePositive={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=e.model.id.split(".");a[0]=a[0].replace("tableContainer","chart").replace("containerModel","");var r=St["b"].Utils.Constants.TypeValues.indicator;var o=St["b"].Factories.ModelFactory.getModelById(n,e.model.id);var l=o.from;o.from=o.to;o.to=l;l=o.fromAbsolutePosition;o.fromAbsolutePosition=o.toAbsolutePosition;o.toAbsolutePosition=l;l=o.positionFromInput;o.positionFromInput=o.positionToInput;o.positionToInput=l;l=o.compareFromPos;o.compareFromPos=o.compareToPos;o.compareToPos=l;l=o.compareFromCat;o.compareFromCat=o.compareToCat;o.compareToCat=l;l=o.compareFromStart;o.compareFromStart=o.compareToStart;o.compareToStart=l;if(o.compareLegend===r.TO){o.compareLegend=r.FROM}else if(o.compareLegend===r.FROM){o.compareLegend=r.TO}i.updateLayoutDefinition(false);t.paint()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateDeleteChartExpressions={valid:function(){return[]},execute:function(e){var r=null;var o=false;if(e&&e.expressionList){o=true;r=e.expressionList}function deleteColumnInTable(e,t){var i=e.columnDefinitions;for(var n=0;n<i.length;n++){if(i[n].exprId===t){i.splice(n,1)}}}function renameCids(e){for(var t=0;t<e.charts.length;t++){var i=e.charts[t].model;if(o){for(var n=i.expressions.length-1;n>=0;n--){if(r.indexOf(i.expressions[n].id)!==-1){i.instanceOf==="TableModel"&&deleteColumnInTable(i,i.expressions[n].id.split(".").pop());i.expressions.splice(n,1)}}}else{var a=St["b"].DataObjects.ContextRepo.getContextByCid(i.contextId);if(a!==null){for(var n=i.expressions.length-1;n>=0;n--){if(St["b"].Models.Actions.ModelActions.ContextModel.getExpressionIndexById(a,i.expressions[n].id)===-1){i.instanceOf==="TableModel"&&deleteColumnInTable(i,i.expressions[n].id.split(".").pop());i.expressions.splice(n,1)}}}}}}function processMultiple(e){if(e){for(var t=0;t<e.length;t++){var i=e[t].nodes;for(var n=0;n<i.length;n++){var a={charts:i[n].nodes};renameCids(a)}}}}function processContainer(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(i.instanceOf==="ContainerModel"){if(i.charts){renameCids(i)}else if(i.extendedModel&&i.extendedModel.instanceOf==="ContainerGridModel"){processContainer(i)}else if(i.extendedModel&&i.extendedModel.instanceOf==="MultipleContainerModel"){processMultiple(i.extendedModel.timeElements);processMultiple(i.extendedModel.structureElements);processMultiple(i.extendedModel.tableElements)}}}}var t=St["b"].DataObjects.DocumentDO.getAllExtensions();for(var i=0;i<t.length;i++){var n=t[i];var a=n.getController().getRootModel();if(a.firstObjectGrid!=null){processContainer(a.firstObjectGrid)}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateDisableCompareCollecting={valid:function(){return[St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();if(n.compareCollectingFirst){n.compareCollectingFirst.highlightedCompare=false;n.compareCollectingFirst=null}if(n.compareCollectingSecond){n.compareCollectingSecond.highlightedCompare=false;n.compareCollectingSecond=null}n.isCompareMode=false;if(t.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY){t.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}i.updateLayoutDefinition(false);St["b"].Factories.ViewFactory.redrawViews(e.extension)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateDocumentAction={valid:function(){return[]},execute:function(e){var t=St["b"].DataObjects.DocumentDO,i=t.getConnector(),n=t.getDocSettings(true);if(n.unitPosition===undefined){n.unitPosition={value:"END"}}var a=JSON.parse(JSON.stringify(n));a.scalingGroups.value=JSON.stringify(n.scalingGroups.value);a.scalingSettings.value=JSON.stringify(n.scalingSettings.value);var r={documentHash:t.getHash(),version:i.isPublished?i.getDocumentValues().version:C["a"].createFormattedDate()};St["b"].Utils.GlobalVariables.hasService&&re["a"].repository("updateDocument",r,a,false);t.setDocumentValue("settings",n);t.setDocumentValue("version",r.version);if(e.saveQVF){t.saveDocument()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateDocumentMode={valid:function(){return[]},execute:function(e){var t=St["b"].DataObjects.RuntimeDO;var i=St["b"].DataObjects.DocumentDO;var n=i.getDocSettings(true);var a=n.userSpecific&&n.userSpecific.value==="true";var r=a?t.getUser().userSpecific:n;var o=St["b"].Utils.Constants.ParameterSets.documentModesValue;if(a&&r==null){r={decimalSep:{name:"Decimal",value:n.decimalSep.value},thousandSep:{name:"Thousand",value:n.thousandSep.value},unitPosition:{name:"Position",value:n.unitPosition.value},negativeStyle:{name:"Style",value:n.negativeStyle.value},docLanguage:{name:"Default language",value:n.docLanguage.value},documentMode:{name:"DOCUMENT_MODE",value:n.documentMode.value},scalingGroups:{name:"SCALING_GROUPS",value:n.scalingGroups.value},dateFormat:{name:"DATEFORMAT",value:n.dateFormat.value}};t.getUser().userSpecific=r}var l=document.getElementById("userPropertyType_documentMode");var s=document.getElementById("docPropertyType_documentMode");var d;if(e.editMode!==undefined){d=e.editMode?0:1}else{d=r.documentMode.value===o[0]?1:0}r.documentMode.value=o[d];if(a){l&&(l.selectedIndex=d)}else{s&&(s.selectedIndex=d)}i.getDocumentController().dispatch(a?"updateUserSettings":"updateDocument",{saveQVF:true});i.triggerDelayedRepaint()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateFixateAllScalingGroups={valid:function(){return[]},execute:function(e){var t=e.extension;var i=e.model;var n=t.getController().getRootModel();var a=i.id.split(".")[0];var r=St["b"].Factories.ModelFactory.getModelById(n,a);var o=r.extendedModel;var l=St["b"].DataObjects.ContextRepo.getContextByCid(o.contextId);if(l===null){return}var s=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(l,i.dataId_expr);if(s===null){return}var d=St["b"].DataObjects.DocumentDO.getScalingGroups();var c=d[s.scalingGroup].auto;for(var u in d){var p=d[u];if(c){if(p.auto){p.manualFactor=p.scalingFactor;p.leastDecimalPosition=0;var g,m;var h=1;do{g=p.manualFactor*h;m=Math.floor(g);if(m<g){p.leastDecimalPosition++}else{break}h*=10}while(true);p.scalingFactor=null;p.auto=false}}else{p.manualFactor=null;p.auto=true}}if(!c){t.paint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateFixateScalingGroup={valid:function(){return[]},execute:function(e){var t=e.extension;var i=e.model;var n=t.getController().getRootModel();var a=i.id.split(".")[0];var r=St["b"].Factories.ModelFactory.getModelById(n,a);var o=r.extendedModel;var l=St["b"].DataObjects.ContextRepo.getContextByCid(o.contextId);if(l===null){return}var s=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(l,i.dataId_expr);if(s===null){return}var d;for(var c=0;c<o.expressions.length;c++){if(o.expressions[c].id===s.id){d=o.expressions[c];break}}if(d.scalingMaximize){return}var u=St["b"].DataObjects.DocumentDO.getScalingGroups();var p=u[s.scalingGroup];if(p&&p.auto){p.manualFactor=p.scalingFactor;p.leastDecimalPosition=0;var g,m;var h=1;do{g=p.manualFactor*h;m=Math.floor(g);if(m<g){p.leastDecimalPosition++}else{break}h*=10}while(true);p.scalingFactor=null;p.auto=false}else{p.manualFactor=null;p.auto=true;t.paint()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateGridContent={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(A){return Me["b"](this,void 0,void 0,function(){function removeRowAndColumnsFromGridContainer(){if(b<M){for(var e=M;e>b;e--){var t;for(var i=0;i<l.children.length;i++){if(l.children[i].column===0&&l.children[i].row===e-1){t=l.children[i];break}}a.dispatch("deleteRemoveRow",{extension:n,model:t,parameters:"deleteRowAboutCellDlg",doNotPaint:true})}}if(T<S){for(var e=S;e>T;e--){var t;for(var i=0;i<l.children.length;i++){if(l.children[i].column===e-1&&l.children[i].row===0){t=l.children[i];break}}a.dispatch("deleteRemoveColumn",{extension:n,model:t,parameters:"deleteColumnAboutCellDlg",doNotPaint:true})}}}function addRowAndColumnsToGridContainer(){if(b>M){for(var e=M;e<b;e++){a.dispatch("createAddRow",{extension:n,doNotPaint:true})}}if(T>S){for(var e=S;e<T;e++){a.dispatch("createAddColumn",{extension:n,doNotPaint:true})}}}var n,a,t,i,r,o,l,s,d,c,u,p,g,m,h,f,v,b,T,E,x,C,y,f,v,b,M,T,S,O,L;return Me["e"](this,function(e){switch(e.label){case 0:n=A.extension;a=n.getController();t=a.getRootModel();i=A.insertType;r=A.insertSubType;o=A.charts;l=A.chartContainerModel;s=A.multipleModel;d=A.navigationVariable;c=parseInt(l.id.substr(5));u=St["b"].Factories.ModelFactory.getObjectPosition(t.firstObjectGrid,l);if(!(u===null))return[3,2];console.warn("updateGridContent: containers position was not found");return[4,n.paint()];case 1:e.sent();n.setMode(St["b"].Utils.Enums.EMode.DEFAULT);return[2];case 2:p=u.position;g=u.container;m=true;if(A.insertNewObject){t.confirmBeforeSaveText=t.confirmBeforeSaveText||St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(l)!==null;h=null;m=a.dispatch("deleteGridContent",{extension:n,doNotPaint:true,model:l});if(m){switch(i){case"chart":h=St["b"].Factories.ModelFactory.buildChartContainer(t,c,o);break;case"multiple":h=St["b"].Factories.ModelFactory.buildMultipleContainer(t,c,s);break;case"container":f=r.split(";");v=f[0];if(v==="grid"){b=f[1];T=f[2];h=St["b"].Factories.ModelFactory.buildGridContainer(t,c,b,T)}break;case"empty":h=St["b"].Factories.ModelFactory.buildEmpty(t,c,d);break;case"url":h=St["b"].Factories.ModelFactory.buildUrl(c,r);break;case"comment":h=St["b"].Factories.ModelFactory.buildComment(n,c,r,d);break;case"buttonplus":h=St["b"].Factories.ModelFactory.buildButtonPlus(c,d,r);break}h.row=l.row;h.column=l.column;h.name=l.name;h.border=l.border;h.padding=l.padding;g.children[p]=h}}else{switch(l.extendedModel.instanceOf){case"MultipleContainerModel":s.timeDataStorage=l.extendedModel.timeDataStorage;s.structureDataStorage=l.extendedModel.structureDataStorage;s.tableDataStorage=l.extendedModel.tableDataStorage;l.extendedModel=s;break;case"ContainerCommentGridModel":E=St["b"].DataObjects.CommentRepo.getLoadedCommentsByExtension(n.getId());x=false;for(C=0;C<E.length;C++){for(y=0;y<E[C].comments.length;y++){if(E[C].comments[y].conditionValue===r.conditionValue){x=true}}}if(!x){r.chartId=St["b"].Models.Actions.ModelActions.RootModel.getNextId(t);r.commentId=l.extendedModel.commentId;r.text="";St["b"].DataObjects.CommentRepo.addNewCommentCell(r,n)}St["b"].DataObjects.RuntimeDO.setRebuildComments(n.getId()+"#"+t.id,true);St["b"].DataObjects.CommentRepo.updateCommentValues(r,n,l);l.extendedModel.navigationVariable=d;break;case"ContainerGridModel":f=r.split(";");v=f[0];if(v==="grid"){b=parseInt(f[1]);M=l.extendedModel.gridRows.length;T=parseInt(f[2]);S=l.extendedModel.gridColumns.length;if(b<M||T<S){removeRowAndColumnsFromGridContainer()}if(b>M||T>S){addRowAndColumnsToGridContainer()}}break;case"ButtonPlusModel":l.extendedModel=r.button;St["b"].Factories.ModelFactory.rebuildButtonPlus(t,l);break;default:St["b"].Factories.ModelFactory.rebuildChartContainer(t,l,o)}}if(h){O=St["b"].Components.LayoutEditor.FormatConverter.getAllCells(t.layoutDefinition.rootCell);L=O[h.id];if(L){L.contentType="legacy"}else{console.warn("No cell found with rootModelReference",h.id,O)}}if(!m)return[3,4];return[4,n.paint()];case 3:e.sent();n.setMode(St["b"].Utils.Enums.EMode.DEFAULT);e.label=4;case 4:return[2]}})})}};var xt=r(307);St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateGridPasteAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.EDIT_GRID]},execute:function(e){var t=e.extension,i=t.getController(),r=i.getRootModel(),n=St["b"].DataObjects.RuntimeDO,a=n.getClipboardState();var o=false,l=a.state;!r.selectedChart&&e.model&&e.model.extendedModel&&(r.selectedChart=selectRightContainer(e.model));if(r.selectedChart===""||r.firstObjectGrid===null){if(r.firstObjectGrid===null&&r.objectCounter===0){St["b"].Factories.ModelFactory.createInitialLayout(r,t.getChartsMap());if(l.id===St["b"].Factories.ModelFactory.idCollection.chartGridContainer){r.selectedChart=r.firstObjectGrid.id}else{r.selectedChart=r.firstObjectGrid.children[0].id}t.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}else{alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));return}}var s=St["b"].Factories.ModelFactory.getModelById(r,r.selectedChart);if(s===null||s.instanceOf!=="ContainerModel"){alert(Ot["a"].getTranslation("ALERT_NO_CONTAINER_SELECTED"));if(o){r.selectedChart=""}return}var d=St["b"].Factories.ModelFactory.getParentContainer(r.firstObjectGrid,s);if(d[0]&&d[0].extendedModel.instanceOf==="MultipleContainerModel"||d[1]&&d[1].extendedModel.instanceOf==="MultipleContainerModel"){alert(Ot["a"].getTranslation("ALERT_ONLY_WHOLE_MULTIPLE_ALLOWED"));if(o){r.selectedChart=""}return}if(s.extendedModel.instanceOf==="ContainerCommentGridModel"&&s.extendedModel.textType.indexOf("title")>=0){var c=s.row;for(var u=0;u<d.length;u++){if(d[u]&&d[u].extendedModel&&d[u].extendedModel.gridRowsFixed[c]){d[u].extendedModel.gridRowsFixed[c]=false;c=d[u].row}else{c=0}}}var p=l.cellDefinition?xt["a"].parse(l.cellDefinition):null;var g=p?Ye["a"].convertCell(p,r,t):l;St["b"].Actions.UpdateGridPasteAction.updateContainerTree(g,s,r,a.sourceExtensionId,e);Object(Ze["c"])(g,function(e){e.guid=C["a"].createGuid();if(e.cellDefinition){e.cellDefinition.id=e.id;e.cellDefinition.guid=e.guid}});St["b"].DataObjects.DocumentDO.updateDocumentScalingGroups(true);St["b"].Models.Actions.ModelActions.RootModel.updateChartsMap(r.firstObjectGrid,t.getChartsMap());if(t.getMode()!==St["b"].Utils.Enums.EMode.EDIT_GRID){t.getController().updateLayoutDefinition();t.paint()}if(o){r.selectedChart=""}function selectRightContainer(e){var t="";if(e.extendedModel.instanceOf==="CommentModel"){var i=St["b"].Factories.ModelFactory.getParentContainer(r.rootContainerModel,e)[0];for(var n=0,a=i.children.length;n<a;n++){if(i.children[n].id===e.id){o=true;t=i.id.split(".")[0];break}}}else{o=true;t=e.id.split(".")[0]}return t}},updateContainerTree:function(e,t,h,f,i){var v=[];collectDisabledVariables();if(t.id===St["b"].Factories.ModelFactory.idCollection.chartGridContainer&&t.id===h.firstObjectGrid.id){if(e.extendedModel.instanceOf!=="ContainerGridModel"){alert(Ot["a"].getTranslation("ALERT_REPLACE_ROOT_GRID"));return}St["b"].DataObjects.CommentRepo.pasteComment(h,e);i.doNotPaint=true;for(var n=0;n<h.firstObjectGrid.children.length;n++){i.model=h.firstObjectGrid.children[n];var a=i.extension.getController().dispatch("deleteGridContent",i);if(a===false){return}}e.row=e.column=0;e.id=St["b"].Factories.ModelFactory.idCollection.chartGridContainer;h.rootContainerModel.children[0].children[0]=e;h.firstObjectGrid=h.rootContainerModel.children[0].children[0];for(var n=0;n<h.firstObjectGrid.children.length;n++){updateObjectCounter(h.firstObjectGrid.children[n])}pasteCommentReferences(e);updateDisabledVariables(e)}else{var r=parseInt(t.id.substr(5));if(isNaN(r)){r=St["b"].Models.Actions.ModelActions.RootModel.getNextId(h)}var o=St["b"].Models.Actions.ViewModelActions.ContainerModel.containsTextModels(t);St["b"].DataObjects.CommentRepo.pasteComment(h,e);i.doNotPaint=true;i.model=t;var a=i.extension.getController().dispatch("deleteGridContent",i);if(a===false){return}var b=false;adjustContainerIds(e,r);adjustCommentGridContainerIds(e,r);var l=St["b"].Factories.ModelFactory.getObjectPosition(h.firstObjectGrid,t);var s=l.position;var d=l.container;e.row=Math.floor(s/d.extendedModel.gridColumns.length);e.column=s%d.extendedModel.gridColumns.length;d.children[s]=e}if(St["b"].DataObjects.CommentRepo.getCutCopyContainsComment(f+"#"+St["b"].DataObjects.CommentRepo.getCutCopyRootModelId())){St["b"].DataObjects.CommentRepo.saveCommentDependendModels(f,h,o);if(St["b"].DataObjects.CommentRepo.getCutCopyType()==="cut"){St["b"].DataObjects.RuntimeDO.clearClipboardState(f);St["b"].DataObjects.CommentRepo.setCutCopyContainsComment(f+"#"+St["b"].DataObjects.CommentRepo.getCutCopyRootModelId(),false)}}else if(o!==null||St["b"].DataObjects.RuntimeDO.getClipboardTextContent()!==null){var c=false;if(h.id!==null){i.extension.getController().dispatch("updateRootModelState",{extension:i.extension,dontConfirmText:c});c=true}else{}var u=St["b"].DataObjects.DocumentDO.getExtension(f);var p=u.getController().getRootModel();if(f!==h.extensionHash&&St["b"].DataObjects.RuntimeDO.getClipboardTextContent()!==null&&p.id!==null){i.extension.getController().dispatch("updateRootModelState",{extension:u,dontConfirmText:c})}}if(v.length>0){console.warn("some marked variables left after pasting",v,e)}function collectDisabledVariables(){var e=St["b"].DataObjects.DocumentDO.getHiCoVariables();for(var t=0;t<e.length;t++){if(e[t].temporaryDisabled&&e[t].definition.substring(0,4)==="COMP"){v.push(e[t])}}}function updateObjectCounter(e){var t=parseInt(e.id.substr(5));h.objectCounter=isNaN(t)||t<=h.objectCounter?h.objectCounter:t;if(e.extendedModel&&e.extendedModel.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){updateObjectCounter(e.children[i])}}}function updateDisabledVariables(e){var t=e.extendedModel;if(v.length===0){return}if(!t){return}if(e.charts&&(t.instanceOf==="ChartModel"||t.instanceOf==="TimeChartModel"||t.instanceOf==="TableModel")){for(var i=0;i<e.charts.length;i++){t=e.charts[i].model;for(var n=0;n<t.compares.length;n++){var a=t.compares[n].id.split(".");var r="COMP:"+f+"#ctx1#"+a[0]+"#"+a[1];for(var o=v.length-1;o>=0;o--){if(v[o].definition===r){delete v[o].temporaryDisabled;if(f!==h.extensionHash){v[o].definition=v[o].definition.replace(f,h.extensionHash)}v.splice(o,1)}}if(v.length===0){break}}if(v.length===0){break}}}else if(t.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){updateDisabledVariables(e.children[i])}}}function pasteCommentReferences(e){var t=e.extendedModel;if(!t){return}if(e.charts&&(t.instanceOf==="ChartModel"||t.instanceOf==="TimeChartModel"||t.instanceOf==="TableModel")){St["b"].DataObjects.CommentRepo.markTargetReferencesToDelete(h,e.id);St["b"].DataObjects.CommentRepo.pasteReferences(h,e.id,e.id)}else if(t.instanceOf==="ContainerGridModel"){for(var i=0;i<e.children.length;i++){pasteCommentReferences(e.children[i])}}}function adjustCommentGridContainerIds(e,t){var i=e.extendedModel;if(!i){return}if(i.instanceOf==="ContainerCommentGridModel"){e.id="chart"+t;i.id="griddata"+t;var n=St["b"].DataObjects.CommentRepo.getCommentById(i.commentId,h.extensionHash);n.grid="chart"+t;Object(Ze["b"])(n.comments,function(e){var t=St["b"].Models.Actions.ModelActions.RootModel.getNextId(h);e.created_in_chart="chart"+t;for(var i=0;i<e.reference.length;i++){var n=e.reference[i];if(n&&n.elementPath==null){n.chartId=e.created_in_chart}}})}else if(i.instanceOf==="ContainerGridModel"){for(var a=0;a<e.children.length;a++){var r=e.children[a];if(!b||r.instanceOf==="ContainerModel"){var o=null;if(r.extendedModel.instanceOf==="ContainerCommentGridModel"){o=St["b"].Models.Actions.ModelActions.RootModel.getNextId(h)}adjustCommentGridContainerIds(r,o)}}}}function adjustContainerIds(e,t){var i=e.id;var n="chart"+t;e.id=n;var a=e.extendedModel;if(!a){return}if(e.charts&&(a.instanceOf==="ChartModel"||a.instanceOf==="TimeChartModel"||a.instanceOf==="TableModel")){for(var r=0;r<e.charts.length;r++){a=e.charts[r].model;a.id="chartdata"+t;a.dimensionLabelModel.id=n+".dimensionLabelsData";for(var o=0;o<a.compares.length;o++){if(v.length>0){var l=a.compares[o].id.split(".");var s="COMP:"+f+"#ctx1#"+l[0]+"#"+l[1];for(var d=v.length-1;d>=0;d--){if(v[d].definition===s){v[d].definition="COMP:"+h.extensionHash+"#ctx1#"+l[0].replace(i,n)+"#"+l[1];delete v[d].temporaryDisabled;v.splice(d,1)}}}a.compares[o].id=a.compares[o].id.replace(i,n)}for(var o=0;o<a.highlights.length;o++){a.highlights[o].id=a.highlights[o].id.replace(i,n);a.highlights[o].name=a.highlights[o].name.replace(i,n)}St["b"].DataObjects.CommentRepo.markTargetReferencesToDelete(h,n);St["b"].DataObjects.CommentRepo.pasteReferences(h,i,n)}}else if(a.instanceOf==="EmptyModel"){a.id="emptydata"+t;for(var r=0;r<e.children.length;r++){e.children[r].id=e.children[r].id.replace(i,n);e.children[r].chartId=e.id}}else if(a.instanceOf==="UrlContainerModel"){a.id="urldata"+t;for(var r=0;r<e.children.length;r++){e.children[r].id=e.children[r].id.replace(i,n)}}else if(a.instanceOf==="ButtonPlusModel"){a.id="buttondata"+t;e.children.forEach(function(e){if(e.instanceOf==="LabelModel"){e.id=e.id.replace(i.replace("chart","object"),n.replace("chart","object"))}else{e.id=e.id.replace(i,n)}})}else if(a.instanceOf==="PlaceHolderModel"){a.id="placeholderdata"+t;var c=i.replace("chart","object"),u="object"+t;for(var r=0;r<e.children.length;r++){e.children[r].id=e.children[r].id.replace(c,u);e.children[r].chartId=e.id}}else if(a.instanceOf==="ContainerGridModel"){a.id="griddata"+t;for(var r=0;r<e.children.length;r++){var p=e.children[r];if(!b||p.instanceOf==="ContainerModel"){var g=St["b"].Models.Actions.ModelActions.RootModel.getNextId(h);adjustContainerIds(p,g)}else{var m=p.id.split(".");m[0]=n;p.id=m.join(".")}}}}}};var Ct=r(185);St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateHiCoNavigation={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension;var p=t.getController().getRootModel();var i=St["b"].DataObjects.DocumentDO.getApi().GlobalFeatureManager.Mashup;var g=e.model;var n=St["b"].DataObjects.RuntimeDO;var m=n.getParameter("TEXT_NAVIGATION_SEPARATOR_DIM_KEY");var h=n.getParameter("TEXT_NAVIGATION_SEPARATOR_KEY_VAL");var r=n.getParameter("TEXT_NAVIGATION_SEPARATOR_DIM_DIM");var o=n.getParameter("TEXT_NAVIGATION_SEPARATOR_DIM_CAT");var f=g.contextId&&St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(g.contextId);var v=St["b"].Factories.ModelFactory.getParentContainer(p.rootContainerModel,e.model);var b=v[0];var T=b?b.extendedModel:null;var a=T?T.navigationVariable:undefined;var E=new St["b"].Utils.Format.LabelFormatter;if(p.isCompareMode){return}if(T.instanceOf==="DimensionLabelModel"&&isChart(v[1])){if(v[1].multiplePath!==undefined&&isMultiple(v[3])){a=v[3].extendedModel.navigationVariable}else{a=v[1].extendedModel.navigationVariable}}else if(isChart(b)&&b.multiplePath!==undefined&&isMultiple(v[2])){a=v[2].extendedModel.navigationVariable;if(!f){f=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(b.extendedModel.contextId)}}else if(T.instanceOf==="ContainerGridModel"&&isMultiple(v[1])){a=v[1].extendedModel.navigationVariable;f=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(v[1].extendedModel.contextId)}else if(T.instanceOf==="CommentModel"){a=v[1].extendedModel.navigationVariable}var l=a==undefined||a.useQVNav;if(g.instanceOf==="LabelModel"&&g.id.indexOf("valueRowLabelModel")!==-1){l=false}var x=undefined;if(a){fillVariableValues();if(x&&x!==""&&(!x.startsWith("'")||!x.endsWith("'"))){x="'"+Object(V["y"])(x,"'","''")+"'"}}if(a){try{var s=[];for(var d=0,c=v;d<c.length;d++){var u=c[d];if(u.cellDefinition){for(var C=0,y=u.cellDefinition.triggers;C<y.length;C++){var M=y[C];if(M.type===Ct["a"].Click){for(var S=0,O=M.actions;S<O.length;S++){var L=O[S];L.name===ee["a"].SetVariable&&s.push(L)}break}}}}var A=(s[0]||{params:{}}).params,_=A.name,I=_===void 0?"":_,D=A.value,R=D===void 0?"":D;var N={position:e.position,variableName:I,variableValue:R,variableValueAuto:x},P={isMashUp:i.isEnabled&&i.Feature.isMashup()}}catch(e){console.error("Error in customClickBehavior",e)}}if(!St["b"].DataObjects.DocumentDO.preventLeftClickAndActions()){var w={event:e.event,variableValueAuto:x,clickInfo:N,contextType:P};for(var U=0,F=v;U<F.length;U++){var u=F[U];if(u.cellDefinition&&B["ActionManager"].Instance.performTrigger(u.cellDefinition,Ct["a"].Click,w)){break}}}if(l&&g.dataId_dim&&a&&(a.check===undefined||a.check["default"])){t.getController().dispatch("updateBISelection",e)}function isChart(e){var t=e?e.extendedModel:null;return t&&(t.instanceOf==="ChartModel"||t.instanceOf==="TimeChartModel"||t.instanceOf==="TableModel")}function isMultiple(e){return e&&e.extendedModel&&e.extendedModel.instanceOf==="MultipleContainerModel"}function fillVariableValues(){var e=null,t=null;if(f){e=f.context;t=f.extension}if(isChart(b)){if(!f){return}var i=t.getAdapter().getDimensions(e.cid);var n=g.id.split(".");if(g.instanceOf==="BackGroundModel"){var a=g.dataId_dim.split("@");x=buildDimensionName(i,a,a.length-1)}else if(g.instanceOf==="LabelModel"&&g.id.indexOf("dimensionchart")===0&&T.instanceOf==="TableModel"){var a=g.dataId_dim.split("@");var r=buildDimensionName(i,a,parseInt(n[3]));x=E.parseLabel(r)}else if(g.instanceOf==="LabelModel"&&(n.length>=3&&n[2].indexOf("valueRowLabelModel")===0||n[1].indexOf("valueRowLabelModel")===0||n[1]==="merkmalsLabel")){x=E.parseLabel(g.text)}else if(g.instanceOf==="LabelModel"&&n[1]==="annotationLabel"){var o=g.text;if(parseInt(n[3])===T.headerRows-2){o=getExpressionName(e,g.dataId_expr)}x=E.parseLabel(o)}else if(e!==null){var a=g.dataId_dim.split("@");var r=buildDimensionName(i,a,a.length-1);var l="",s;if(g.isStackSum&&g.instanceOf==="LabelModel"&&g.view.indexOf("representationLabel")!==-1){l="StackTotal";s=St["b"].Factories.ModelFactory.getStackSum(g,b).toString(10)}else{l=getExpressionName(e,g.dataId_expr);if(g.instanceOf==="LabelModel"&&g.view.indexOf("representationLabel")!==-1){s=getValueOfLabel(g,p,b,e)}else if(g.instanceOf==="InlineModel"){if(g.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST){s=g.originalText.toString(10)}else if(g.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT){s=St["b"].Utils.DOM.textWithoutTags(g.originalText.toString(10))}else if(g.type===St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG){s=g.text===true?"1":"0"}}else{s=g.value.toString(10)}}var o=r+m+l+h+s;x=E.parseLabel(o)}}else if(T.instanceOf==="DimensionLabelModel"){if(!f){return}var r="";var i=t.getAdapter().getDimensions(e.cid);if(i.length>1){var a=g.dataId_dim.split("@");var d=parseInt(g.id.split(".").pop());r=buildDimensionName(i,a,d)}else{r=buildDimensionName(i,[g.dataId_dim],0)}x=E.parseLabel(r)}else if(T.instanceOf==="ContainerGridModel"&&isMultiple(v[1])){if(!f){return}var c=b.children[0].multiplePath.split("@");var i=t.getAdapter().getDimensions(e.cid);var r=buildDimensionName(i,c,c.length-1);x=E.parseLabel(r)}else if(T.instanceOf==="CommentModel"){var u=St["b"].Utils.DOM.textWithoutTags(g.text);x=E.parseLabel(u)}else if(T.instanceOf==="EmptyModel"){x=""}}function buildDimensionName(e,t,i){function getName(e){return e.dimensionType==="drill"||e.dimensionType==="cyclic"?e.groupMembers[e.groupActualLevel].name:e.name}var n="";for(var a=0;a<i;a++){n+=getName(e[a])+o+t[a]+r}n+=getName(e[i])+o+t[i];return n}function getExpressionName(e,t){for(var i=0;i<e.columns.length;i++){if(e.columns[i].id.split(".").pop()===t){return e.columns[i].name}}return""}function getValueOfLabel(e,t,i,n){var a=e.text;var r=St["b"].Factories.ModelFactory.findRepresentationForLabel(t,e,i);if(r){a=r.value.toString(10)}else{var o=St["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(n.dataModel,e.dataId_dim);if(o){for(var l=0;l<o.nodes.length;l++){var s=o.nodes[l];if(s.key===e.dataId_expr){a=s.value.toString(10);break}}}}return a}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateHiCoObject={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.SET_CONTEXT]},execute:function(e){var t=e.extension;var i=t.getController();var n=false;var a=e.isNotify;if(a===undefined){a=true}var r={extensionHash:t.getId(),hidden:t.isHidden(),allowSelection:t.getIsDrillable()};if(St["b"].Utils.GlobalVariables.hasService){re["a"].repository("updateHiCoObject",r,{},false,function(){n=true})}else{n=true}var o=t.getAdapter().getExtensionDefinition().hicoObject;o.hidden=r.hidden;o.allowSelection=r.allowSelection;t.setExtensionValue("hicoObject",o);t.saveExtension();i.dispatch("createContextState",{extension:t,saveQVF:true});var l=St["b"].DataObjects.DocumentDO.getHiCoVariables();function notify(){if(!n||!a){return}var e=document.createElement("div");St["b"].Utils.DOM.createSpan(e,Ot["a"].getTranslation("MESSAGE_SAVE_SUCCESS"))}var s={documentId:St["b"].DataObjects.DocumentDO.getHash(),version:St["b"].DataObjects.DocumentDO.getConnector().isPublished?St["b"].DataObjects.DocumentDO.getConnector().getDocumentValues().version:C["a"].createFormattedDate()};if(St["b"].Utils.GlobalVariables.hasService){re["a"].repository("createVariables",s,l,true,notify)}else{notify()}St["b"].DataObjects.DocumentDO.setDocumentValue("variables",l);St["b"].DataObjects.DocumentDO.setDocumentValue("version",s.version);St["b"].DataObjects.DocumentDO.saveDocument()}};var yt=r(582);St["b"].Actions.UpdateHighlightAxis={valid:function(){return[St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension.getController();var i=e.extension;var n=t.getRootModel();var a=e.model;var r;for(var o=0;o<a.children.length;o++){if(a.children[o].instanceOf==="AxisModel"){r=a.children[o];break}}if(n.compareCollectingFirst===null){n.compareCollectingFirst=r;n.compareCollectingSecond=null;St["b"].Factories.ViewFactory.redrawViews(i)}else{n.compareCollectingSecond=r;if(i.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY){i.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}n.isCompareMode=false;var l=false;var s;if(n.compareCollectingFirst.instanceOf==="AxisModel"){alert(Ot["a"].getTranslation("ALERT_AXIS_CLICKED_AGAIN"));l=true}else{s=n.compareCollectingFirst.id.split(".")[0];if(s!==a.id){alert(Ot["a"].getTranslation("ALERT_COMPARE_DIFFERENT_CHARTS"));l=true}}if(l===false){var d=St["b"].Factories.ModelFactory.getModelById(n,s);var c=d.extendedModel.expressions;var u="";for(var p=0;c.length<0;p++){if(n.compareCollectingFirst.dataId_expr===c[p].id.split(".").pop()){u=c[p].id.split(".").pop();break}}var g=new yt["a"];var m=0;var h=d.extendedModel.compares[d.extendedModel.compares.length-1];if(h){m=parseInt(h.id.split(".")[1].match(/\d+/g));m+=1}g.id=s+".compare"+m;var f=n.compareCollectingFirst.dataId_dim+"#"+u;g.linkType=1;g.from=f;g.to=f;g.compareFromPos="position";g.compareToPos="position";if(n.compareCollectingFirst.instanceOf==="LabelModel"){var v=St["b"].Factories.ModelFactory.findRepresentationForLabel(n,n.compareCollectingFirst);g.fromAbsolutePosition=v.absolutePosition;g.positionFromInput=g.fromAbsolutePosition.groupIndex+1;g.fromAbsolutePosition.notReversed=true}else{g.fromAbsolutePosition=n.compareCollectingFirst.absolutePosition;g.positionFromInput=g.fromAbsolutePosition.groupIndex+1;g.fromAbsolutePosition.notReversed=true}g.compareToCat="axis";g.toAbsolutePosition=g.fromAbsolutePosition;g.positionToInput=g.positionFromInput;if(d.extendedModel.stackMode){var b=n.compareCollectingFirst;b.instanceOf==="LabelModel"&&(b=St["b"].Factories.ModelFactory.findRepresentationForLabel(n,b));var T=n.compareCollectingSecond;T.instanceOf==="LabelModel"&&(T=St["b"].Factories.ModelFactory.findRepresentationForLabel(n,T));g.isStackCompare=b.instanceOf!=="AxisModel"&&b.isStack||T.instanceOf!=="AxisModel"&&T.isStack}St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(d.extendedModel,g)}n.compareCollectingFirst.highlightedCompare=false;n.compareCollectingFirst=null;n.compareCollectingSecond=null;t.updateLayoutDefinition();i.paint(true)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateHighlightCommentReferenceElement={valid:function(){return[]},execute:function(e){var r=e.model;var t=e.extension;var i=St["b"].Utils.Constants.TypeValues;var o=false;var l=null;function setSymbolBorder(){o=true;if(s.extendedModel.instanceOf==="TimeChartModel"){if(r.shapeSymbol==="triangle"){l={x:r.position.x-r.dimension.width/4,y:r.position.y,width:r.dimension.width+r.dimension.width/4,height:r.dimension.height}}else if(r.shapeSymbol==="diamond"){var e;if(r.needleSize!==undefined&&r.needleSize!==null){e=r.needleSize}else{e=r.dimension.width}var t=Math.round(e/Math.sqrt(2));var i=(e-t)/2;var n=r.position.y;var a=r.position.x;n+=i;a+=i;l={x:a,y:n,width:r.dimension.width,height:r.dimension.height}}else{l={x:r.position.x,y:r.position.y,width:r.dimension.width,height:r.dimension.height}}}else{l={x:r.needlepos.x,y:r.needlepos.y,width:r.needledim.width,height:r.needledim.height}}}var s=St["b"].Factories.ModelFactory.getParentContainer(t.getController().getRootModel().firstObjectGrid,r)[0];if(r.id.indexOf("dimensionchart")===-1&&r.id.indexOf("representationLabel")===-1&&r.id.indexOf("structureLegendType")===-1&&r.id.indexOf("valueRowLabelModel")===-1&&r.id.indexOf("compare")===-1&&r.id.indexOf("merkmalsLabel")===-1&&r.id.indexOf("annotationLabel")===-1&&r.id.indexOf("multipleDimensionTitleLabel")===-1){var n;for(var a=0;a<s.extendedModel.expressions.length;a++){if(s.extendedModel.expressions[a].id.split(".")[2]===r.dataId_expr){n=s.extendedModel.expressions[a].representation;break}}var d;if(s.extendedModel.instanceOf==="TimeChartModel"){d=St["b"].Utils.Constants.TypeValues.timeRepresentation}else if(s.extendedModel.instanceOf==="ChartModel"){d=St["b"].Utils.Constants.TypeValues.structureRepresentation}else{d=St["b"].Utils.Constants.TypeValues.tableRepresentation}if(n===d.LINE||n===d.SYMBOL_LINE){var c=St["b"].Factories.ViewFactory.getViewById(t.getController().getRootPanel(),r.view);var u=null;if(c.getPreviousPosition().x!==0||c.getNextPosition().x!==0){u=St["b"].Layout.CommentReference.getMaxLineChartPosition(c,n)}}if(n===d.BAR||n===d.COLUMN||n===d.WATERFALL){l={x:r.position.x,y:r.position.y,width:r.dimension.width,height:r.dimension.height}}else if(n===d.NEEDLE){if(r.instanceOf==="RodModel"){l={x:r.position.x,y:r.position.y,width:r.dimension.width+1,height:r.dimension.height}}else{if(r.value>0){l={x:r.position.x,y:r.position.y,width:r.dimension.width+r.needleSize/2,height:r.dimension.height+r.needleSize/2}}else{l={x:Math.min(r.position.x,r.needlepos.x),y:r.position.y,width:r.dimension.width+r.needleSize/2,height:r.dimension.height+r.needleSize/2}}}}else if(n===d.LINE||n===d.SYMBOL_LINE){if(u){l={x:u.position.x,y:u.position.y,width:u.dimension.width,height:u.dimension.height}}else{setSymbolBorder()}}else if(n===d.SYMBOL){setSymbolBorder()}}else{if(r.id.indexOf("compare")!==-1){if(r.absolute.legend===i.indicator.NONE&&r.percent.legend===i.indicator.NONE&&r.text.legend===i.indicator.NONE){var p=St["b"].Layout.Common.getMaxPosition(r);l={x:p.position.x,y:p.position.y,width:p.dimension.width,height:p.dimension.height}}else{if(e.element.id.split(".")[2]==="absolute"){if(r.absolute.legend!==i.indicator.NONE){l={x:r.absolute.position.x,y:r.absolute.position.y,width:r.absolute.dimension.width,height:r.absolute.dimension.height}}}else if(e.element.id.split(".")[2]==="percent"){if(r.percent.legend!==i.indicator.NONE){l={x:r.percent.position.x,y:r.percent.position.y,width:r.percent.dimension.width,height:r.percent.dimension.height}}}else if(e.element.id.split(".")[2]==="text"){if(r.text.legend!==i.indicator.NONE){l={x:r.text.position.x,y:r.text.position.y,width:r.text.dimension.width,height:r.text.dimension.height}}}}}else{l={x:r.position.x,y:r.position.y,width:r.dimension.width,height:r.dimension.height}}}if(l){St["b"].DataObjects.DocumentDO.getPainter().updateCommentHighlightElement(e.element,l,r.textAnchor,o)}}};var Mt=r(404);St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateHighlightLabel={valid:function(){return[St["b"].Utils.Enums.EMode.HIGHLIGHT,St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension.getController();var i=e.extension;var n=e.model;var a=t.getRootModel();var r=St["b"].Utils.Constants.TypeValues.highlightType;var o=St["b"].Utils.Constants.TypeValues.indicator;if(i.getMode()===St["b"].Utils.Enums.EMode.COMPARE||a.isCompareMode){var l=null;var s=St["b"].Factories.ModelFactory.findRepresentationForLabel(a,n);if(s!==null){l=St["b"].Factories.ViewFactory.getViewById(t.getRootPanel(),s.view)}if(l!==null){t.dispatch("updateHighlightRepresentation",e)}}else{var d=n.id.substr(0,5);if((n.instanceOf==="LabelModel"||n.instanceOf==="CompareModel")&&(d==="chart"||d==="table"||d==="dimen")){var c=n.id.split(".");var u=c[0];var p=getType();var g;if(!p){return}if(p===r.CATEGORY_LABEL){u=u.substr(9,u.length-1)}if(p===r.LEGEND){var m=n.valueRowLabelPosition.split(".")[0];u=u.replace(m,"")}var h=St["b"].Factories.ModelFactory.getModelById(a,u);var f=h.extendedModel;if(p===r.COMPARE){g=e.type}var v;if(p===r.VALUE){var b=n.dataId_expr;for(var T=0;T<f.expressions.length;T++){var E=f.expressions[T];if(E.id.split(".").pop()===b){b=E;break}}v=St["b"].Layout.Common.getHighlight(f,n,p,true)}else if(p===r.COMPARE){v=St["b"].Layout.Common.getHighlight(f,n,p,false)}else if(p===r.CATEGORY_LABEL){v=St["b"].Layout.Common.getHighlight(f,n,p,true)}else if(p===r.LEGEND){v=St["b"].Layout.Common.getHighlight(f,n,p,false)}if(v){if(p!==r.COMPARE&&p!==r.CATEGORY_LABEL){St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(f,v.highlight.id);n.isHighlighted=false}else if(p===r.COMPARE){if(g===o.ABSOLUTE){var x=!n.absolute.isHighlighted;n.absolute.isHighlighted=x;f.highlights[v.index].compare.element.absolute=x}else if(g===o.PERCENT){var x=!n.percent.isHighlighted;n.percent.isHighlighted=x;f.highlights[v.index].compare.element.percent=x}else if(g===o.TEXT){var x=!n.text.isHighlighted;n.text.isHighlighted=x;f.highlights[v.index].compare.element.text=x}if(!n.absolute.isHighlighted&&!n.percent.isHighlighted&&!n.text.isHighlighted){St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(f,v.highlight.id)}}else{var C=v.highlight.categoryLabel.elements.split("@");var y=false;for(var T=0;T<C.length;T++){if(C[T]===n.text){n.isHighlighted=false;y=true;C.splice(T,1);break}}if(!y){C.push(n.text);C=C.join("@");n.isHighlighted=true;f.highlights[v.index].categoryLabel.elements=C}else{if(C.length!==0){C=C.join("@");f.highlights[v.index].categoryLabel.elements=C}else{St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(f,v.highlight.id)}}}}else{var M=new Mt["a"];M.type=p;if(p===r.CATEGORY_LABEL){M.categoryLabel.path=n.dataId_dim;M.categoryLabel.category=o.TEXT;M.categoryLabel.elements=n.text}else if(p===r.LEGEND){var b=n.dataId_expr;for(var T=0;T<f.expressions.length;T++){var E=f.expressions[T];if(E.id.split(".").pop()===b){b=E;break}}M.legend.keyfigure=b.id}else if(p===r.VALUE){if(n.instanceOf==="LabelModel"){if(n.id.split(".").pop()==="pos"||n.id.split(".").pop()==="neg"){M.value.type=o.STACK;M.value.keyfigure="#"+n.id.split(".").pop()+"#"}else{M.value.type=o.LABEL;M.value.keyfigure=b.id}}else{M.value.type=o.ELEMENT;M.value.keyfigure=b.id}M.value.path=n.dataId_dim;M.value.category=o.TEXT}else if(p===r.COMPARE){M.compare.id=n.id;M.compare.name=n.name;if(g===o.ABSOLUTE){M.compare.element.absolute=true;n.absolute.isHighlighted=true}else if(g===o.PERCENT){M.compare.element.percent=true;n.percent.isHighlighted=true}else if(g===o.TEXT){M.compare.element.text=true;n.text.isHighlighted=true}}M.active=true;var S=St["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(f.highlights);M.id=u+".highlight."+S;M.name=u+".highlight."+S;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(f,M);if(p!==r.COMPARE){n.isHighlighted=true}}t.updateLayoutDefinition();if(p===r.LEGEND){i.paint()}else{St["b"].Factories.ViewFactory.redrawViews(i)}}}function getType(){if(n.id.indexOf("representation")>-1){return r.VALUE}else if(n.id.indexOf("valueRowLabelModel")>-1||n.id.indexOf("annotationLabel")>-1){return r.LEGEND}else if(n.id.indexOf("dimensionchart")>-1){return r.CATEGORY_LABEL}else if(n.id.indexOf("compare")>-1){return r.COMPARE}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateHighlightObjects={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){if(St["b"].DataObjects.DocumentDO.getSettings().documentMode.value==="DESIGN"&&St["b"].DataObjects.RuntimeDO.getUser().permissions.indexOf("Designer")!==-1){var t=St["b"].DataObjects.DocumentDO.getAllExtensions();t.forEach(function(e){var t=e.getCanvasDO().getDOMElement().parentNode;t.classList.add("hiCoExtensionHighlight");setTimeout(function(){t.classList.remove("hiCoExtensionHighlight")},5e3)})}}};St["b"].Actions.UpdateHighlightRepresentation={valid:function(){return[St["b"].Utils.Enums.EMode.HIGHLIGHT,St["b"].Utils.Enums.EMode.COMPARE,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension.getController();var i=e.extension;var n=e.model;var a=t.getRootModel();St["b"].DataObjects.DocumentDO.getPainter().updateDom(i.getCanvasDO());var r=St["b"].Utils.Constants.TypeValues.highlightType;var o=St["b"].Utils.Constants.TypeValues.indicator;if(i.getMode()===St["b"].Utils.Enums.EMode.COMPARE||a.isCompareMode){if(n.instanceOf==="BarModel"||n.instanceOf==="StructureWaterfallModel"||n.instanceOf==="NeedleModel"||n.instanceOf==="TimeColumnModel"||n.instanceOf==="TimeWaterfallModel"||n.instanceOf==="RodModel"||n.instanceOf==="TimeLineModel"||n.instanceOf==="LabelModel"||n.instanceOf==="StructureLineModel"){if(n.id.substr(0,5)==="chart"||n.id.substr(0,5)==="table"){if(a.compareCollectingFirst===null){a.compareCollectingFirst=n;a.compareCollectingFirst.highlightedCompare=true;a.compareCollectingSecond=null;var l=St["b"].Factories.ModelFactory.findRepresentationForLabel(a,a.compareCollectingFirst);var s=St["b"].Factories.ModelFactory.getModelById(a,n.id.split(".")[0]);var d=n.instanceOf==="LabelModel"?l:n;if(s.extendedModel.stackMode&&d.isStack){for(var c=0;c<s.children.length;c++){var u=s.children[c];if((u.instanceOf==="BarModel"||u.instanceOf==="TimeColumnModel")&&n.dataId_dim===u.dataId_dim&&u.isStack&&(d.value>=0&&u.value>=0||d.value<0&&u.value<0)){u.highlightedCompare=true}}}St["b"].Factories.ViewFactory.redrawViews(i)}else{a.compareCollectingSecond=n;if(i.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY){i.setMode(St["b"].Utils.Enums.EMode.DEFAULT)}a.isCompareMode=false;var p=a.compareCollectingFirst.id.split(".")[0];var g;if(a.compareCollectingFirst.instanceOf==="AxisModel"||a.compareCollectingFirst.layoutType==="table"&&a.compareCollectingFirst.instanceOf=="ContainerModel"){g="axis"}else{var s=St["b"].Factories.ModelFactory.getModelById(a,p);var m=s.extendedModel.expressions;var h="";for(var f=0;f<m.length;f++){if(a.compareCollectingFirst.dataId_expr===m[f].id.split(".").pop()){h=a.compareCollectingFirst.dataId_expr;break}}g=a.compareCollectingFirst.dataId_dim+"#"+h}var v=a.compareCollectingSecond.id.split(".")[0];var b=St["b"].Factories.ModelFactory.getModelById(a,v);var T=b.extendedModel.expressions;var E="";for(var f=0;f<T.length;f++){if(a.compareCollectingSecond.dataId_expr===T[f].id.split(".").pop()){E=a.compareCollectingSecond.dataId_expr;break}}var x=a.compareCollectingSecond.dataId_dim+"#"+E;var C=false;if(p!==v){alert(Ot["a"].getTranslation("ALERT_COMPARE_DIFFERENT_CHARTS"));C=true}if(g===x){alert(Ot["a"].getTranslation("ALERT_SAME_PRESENTATION_CLICKED"));C=true}if(C===false){var y=a.compareCollectingFirst.instanceOf==="LabelModel"?St["b"].Factories.ModelFactory.findRepresentationForLabel(a,a.compareCollectingFirst):a.compareCollectingFirst;var M=a.compareCollectingSecond.instanceOf==="LabelModel"?St["b"].Factories.ModelFactory.findRepresentationForLabel(a,a.compareCollectingSecond):a.compareCollectingSecond;var S=b;var O=new yt["a"];var L=St["b"].Models.Actions.ViewModelActions.CompareModel.getNewId(S.extendedModel.compares);O.id=p+".compare"+L;O.linkType=1;O.compareFromPos="position";O.compareToPos="position";if(a.compareCollectingFirst.instanceOf==="AxisModel"){O.compareFromCat="axis";O.fromAbsolutePosition=M.absolutePosition;O.positionFromInput=M.absolutePosition.groupIndex+1;O.from=x;O.fromAbsolutePosition.notReversed=true}else{O.fromAbsolutePosition=y.absolutePosition;O.positionFromInput=y.absolutePosition.groupIndex+1;O.fromAbsolutePosition.notReversed=true;O.from=g}O.toAbsolutePosition=M.absolutePosition;O.positionToInput=M.absolutePosition.groupIndex+1;O.toAbsolutePosition.notReversed=true;O.to=x;if(S.extendedModel.stackMode&&(y!=="AxisModel"&&y.isStack||M.isStack)){O.isStackCompare=true}St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addCompare(S.extendedModel,O)}a.compareCollectingFirst=null;a.compareCollectingSecond=null;t.updateLayoutDefinition();i.paint(true)}return}}}else{if(n.instanceOf==="BarModel"||n.instanceOf==="NeedleModel"||n.instanceOf==="StructureWaterfallModel"||n.instanceOf==="TimeColumnModel"||n.instanceOf==="TimeWaterfallModel"||n.instanceOf==="RodModel"||n.instanceOf==="TimeLineModel"||n.instanceOf==="LabelModel"||n.instanceOf==="StructureLineModel"||n.instanceOf==="CompareModel"){var A=n.id.split(".");var _=A[0];var I=getType();var D;if(I===r.CATEGORY_LABEL){_=_.substr(9,_.length-1)}if(I===r.LEGEND){var R=n.valueRowLabelPosition.split(".")[0];_=_.replace(R,"")}var S=St["b"].Factories.ModelFactory.getModelById(a,_);var N=S.extendedModel;if(I===r.COMPARE){D=e.type}var P;if(I===r.VALUE){var w=n.dataId_expr;for(var U=0;U<N.expressions.length;U++){var F=N.expressions[U];if(F.id.split(".").pop()===w){w=F;break}}if(n.instanceOf==="LabelModel"){P=St["b"].Layout.Common.getHighlight(N,n,I,true)}else{P=St["b"].Layout.Common.getHighlight(N,n,I,true)}}else if(I===r.COMPARE){P=St["b"].Layout.Common.getHighlight(N,n,I,false)}else if(I===r.CATEGORY_LABEL){P=St["b"].Layout.Common.getHighlight(N,n,I,true)}else if(I===r.LEGEND){P=St["b"].Layout.Common.getHighlight(N,n,I,false)}if(P){if(I!==r.COMPARE&&I!==r.CATEGORY_LABEL){St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(N,P.highlight.id);n.isHighlighted=false}else if(I===r.COMPARE){if(D===o.ABSOLUTE){var B=!n.absolute.isHighlighted;n.absolute.isHighlighted=B;N.highlights[P.index].compare.element.absolute=B}else if(D===o.PERCENT){var B=!n.percent.isHighlighted;n.percent.isHighlighted=B;N.highlights[P.index].compare.element.percent=B}else if(D===o.TEXT){var B=!n.text.isHighlighted;n.text.isHighlighted=B;N.highlights[P.index].compare.element.text=B}if(!n.absolute.isHighlighted&&!n.percent.isHighlighted&&!n.text.isHighlighted){St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(N,P.highlight.id)}}else if(I===r.CATEGORY_LABEL){var H=P.highlight.categoryLabel.elements.split("@");var k=false;for(var U=0;U<H.length;U++){if(H[U]===n.text){n.isHighlighted=false;k=true;H.splice(U,1);break}}if(!k){H.push(n.text);H=H.join("@");n.isHighlighted=true;N.highlights[P.index].categoryLabel.elements=H}else{if(H.length!==0){H=H.join("@");N.highlights[P.index].categoryLabel.elements=H}else{St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.removeHighlight(N,P.highlight.id)}}}}else{var G=new Mt["a"];G.type=I;if(I===r.CATEGORY_LABEL){G.categoryLabel.path=n.dataId_dim;G.categoryLabel.category=o.TEXT;G.categoryLabel.elements=n.text}else if(I===r.LEGEND){var w=n.dataId_expr;for(var U=0;U<N.expressions.length;U++){var F=N.expressions[U];if(F.id.split(".").pop()===w){w=F;break}}G.legend.keyfigure=w.id}else if(I===r.VALUE){if(n.instanceOf==="LabelModel"){if(n.id.split(".").pop()==="pos"||n.id.split(".").pop()==="neg"){G.value.type=o.STACK;G.value.keyfigure="#"+n.id.split(".").pop()+"#"}else{G.value.type=o.LABEL;G.value.keyfigure=w.id}}else{G.value.type=o.ELEMENT;G.value.keyfigure=w.id}G.value.path=n.dataId_dim;G.value.category=o.TEXT}else if(I===r.COMPARE){G.compare.id=n.id;G.compare.name=n.name;if(D===o.ABSOLUTE){G.compare.element.absolute=true;n.absolute.isHighlighted=true}else if(D===o.PERCENT){G.compare.element.percent=true;n.percent.isHighlighted=true}else if(D===o.TEXT){G.compare.element.text=true;n.text.isHighlighted=true}}G.active=true;var V=St["b"].Models.Actions.ViewModelActions.General.getNewHighlightId(N.highlights);G.id=_+".highlight."+V;G.name=_+".highlight."+V;St["b"].Models.Actions.ExtendedModelActions.AnyChartModel.addHighlight(N,G);if(I!==r.COMAPRE){n.isHighlighted=true}}t.updateLayoutDefinition();if(I===r.LEGEND){i.paint()}else{St["b"].Factories.ViewFactory.redrawViews(i)}}}function getType(){if(n.id.indexOf("representation")>-1){return r.VALUE}else if(n.id.indexOf("valueRowLabelModel")>-1||n.id.indexOf("annotationLabel")>-1){return r.LEGEND}else if(n.id.indexOf("dimensionchart")>-1){return r.CATEGORY_LABEL}else if(n.id.indexOf("compare")>-1){return r.COMPARE}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateInlineCommentsOnAutoSave={valid:function(){return[]},execute:function(e){var t=e.extension.getController(),i;if(e.containerModel){i=e.containerModel}else{i=St["b"].Factories.ModelFactory.getParentContainer(t.getRootModel().firstObjectGrid,e.model)[0]}var n=i&&i.extendedModel;if(((n||{}).input||{}).autoSave){t.dispatch("updateInputSaveStates",{extension:e.extension,model:i,parameters:{saveChanged:true,savedBecauseCopied:true}})}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateInputReleaseStates={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=e.model;var n=i.saveName;var a=t.getController().getRootModel();var r=St["b"].DataObjects.InlineCommentRepo.getReleaseRepresentations(t,a,n);var o={extensionHash:t.getId()};re["a"].repository("updateInputReleaseStates",o,r,false,function(){t.showExtensionMessage(Ot["a"].getTranslation("MESSAGE_SAVE_SUCCESS"),3e3)})}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateInputSaveStates={valid:function(){return[St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU]},execute:function(e){var t=e.extension;var i=St["b"].Factories.ModelFactory.getModelById(t.getController().getRootModel(),e.model.id.split(".")[0]);var n=0;var a=e.parameters&&e.parameters.saveChanged;var r=!e.parameters||e.parameters.saveLocally!==false;var o=[t];var l=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(i.extendedModel.contextId);if(l.extension.getId()!==t.getId()&&l.extension.getMode()!==St["b"].Utils.Enums.EMode.READ_ONLY){o.push(l.extension)}for(var s=0;s<o.length;s++){var d=o[s];var c=St["b"].DataObjects.InlineCommentRepo.getRepresentationInlineCommentObjects(d,i,a);if(c&&c.length>0){var u={extensionHash:d.getId()};if(St["b"].Utils.GlobalVariables.hasService){n--;re["a"].repository("updateInputSaveStates",u,c,false,function(){n++})}d.setExtensionValue("inlineComments",c);r&&d.saveExtension()}}var p=[];for(s=0;s<i.extendedModel.expressions.length;s++){var g=i.extendedModel.expressions[s].commonTable;if(g&&p.indexOf(g)===-1){p.push(g)}}if(p.length>0){t.getController().dispatch("createCommonTable",{tableHashes:p,parameters:{saveLocally:false}});for(s=0;s<p.length;s++){g=p[s];c=St["b"].DataObjects.InlineCommentRepo.getRepresentationCommonCommentObjects(g,i,a);u={commonTable:g};if(St["b"].Utils.GlobalVariables.hasService){n--;re["a"].repository("updateInputSaveStates",u,c,false,function(){n++})}St["b"].DataObjects.DocumentDO.setDocumentValue("commonInlineComments",c)}r&&St["b"].DataObjects.DocumentDO.saveDocument()}if((n===0||!St["b"].Utils.GlobalVariables.hasService)&&e.parameters.savedBecauseCopied!==true){t.showExtensionMessage(Ot["a"].getTranslation("MESSAGE_SAVE_SUCCESS"),3e3)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateIsDrillableActivate={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension.getController();var i=e.extension;i.setIsDrillable(true);i.showExtensionMessage(Ot["a"].getTranslationHtml("IS_DRILLABLE_ACTIVATE_SHORT"),3e3);t.dispatch("updateHiCoObject",e)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateIsDrillableDeactivate={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=e.extension.getController();var i=e.extension;i.setIsDrillable(false);i.showExtensionMessage(Ot["a"].getTranslation("IS_DRILLABLE_DEACTIVATE_SHORT"),3e3);t.dispatch("updateHiCoObject",e)}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateQVDrillLevel={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT,St["b"].Utils.Enums.EMode.CONTEXTMENU,St["b"].Utils.Enums.EMode.SET_CONTEXT,St["b"].Utils.Enums.EMode.READ_ONLY]},execute:function(e){var t=St["b"].DataObjects.ContextRepo.getContextAndExtensionByCid(e.parameters.contextId);if(t.context){var i=e.parameters.dimensionIdx;var n=t.context.rows[i];if(n.dimensionType==="cyclic"){t.extension.getAdapter().cycle(t.context.cid,i,e.parameters.level)}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateRepresentationFlagAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){var t=e.model;var i=e.extension;var n=St["b"].DataObjects.InlineCommentRepo;var a=true;if(t.text){a=false}var r=t.id.split(".")[0],o=St["b"].DataObjects.DocumentDO.getPainter(),l=o.getContainerScrollPosition(r,i.getId());n.setInlineComment(t,a,i);St["b"].Factories.ViewFactory.redrawViews(i);if(l){o.setContainerScrollPosition(r,i.getId(),l)}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateRepresentationInlineCommentAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){var t=document.getElementById("touch-dummy");if(!t||!t.dataset.isClicked){return}var i=e.model;if(!i.edit||St["b"].DataObjects.RuntimeDO.testAndSetTextEditMode(true)){return}var n=e.extension;n.setMode(St["b"].Utils.Enums.EMode.EDIT_COMMENT);var a={extension:n,model:i,container:null,parentContainer:null,div:null,parent:null,divHeight:null};St["b"].Utils.DOM.disableInlineComments(n.getController().getRootModel(),i);var r=new St["b"].Utils.EditorCommon(a);r.createCkEditorInstance()}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateRepresentationListAction={valid:function(){return[St["b"].Utils.Enums.EMode.DEFAULT]},execute:function(e){var n=e.model;if(!n){return}var a=e.extension,l=a.getController(),s=St["b"].DataObjects.InlineCommentRepo,r=new St["b"].Utils.Format.LabelFormatter,t=St["b"].DataObjects.RuntimeDO;var i=St["b"].Utils.Calculator.Converter.pt2pix(t.getParameterParsed("FONT_SIZE_CHART"));var o=a.getAdapter().getContainerElement(),d=St["b"].$(o).find(St["b"].Utils.DOM.escapeForJQ(n.id+"##cellBackground")),c=St["b"].DataObjects.DocumentDO.getConnector().getMainContainer();if(!d[0]||!c){return}var u=d[0].getBoundingClientRect(),p=c.getBoundingClientRect(),g={left:u.left-p.left+c.scrollLeft,top:u.top-p.top+c.scrollTop};St["b"].Utils.DOM.disableInlineComments(a.getController().getRootModel(),n);var m=document.createElement("div");m.id="HiCoInlineCommentListSelectBox";var h=document.createElement("ul");for(var f=0,v=n.listContent.length;f<v;f++){createEntry(f)}m.appendChild(h);c.appendChild(m);var b=Math.max(n.background.dimension.width,n.dimension.width+8),T=h.children[0].clientHeight*7;if(T<h.clientHeight){var E=getScrollBarWidth();b+=E}m.style.fontFamily=t.getParameter("FONT_FAMILY");m.style.fontSize=i+"px";m.style.top=g.top+"px";m.style.left=g.left+"px";m.style.width=b+"px";m.style.maxHeight=T+"px";function getScrollBarWidth(){var e=St["b"].$("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=St["b"].$("<div>").css({width:"100%"}).appendTo(e).outerWidth();e.remove();return 100-t}function createEntry(e){var t=document.createElement("li");t.id=n.listContent[e].key+"##"+a.getId()+"##"+n.id;if(e===0){t.style.color="rgb(150, 150, 150)"}else if(e===n.text){t.style.fontWeight="bold"}St["b"].$(t).hover(function(){St["b"].$(this).addClass("highlightListElement")},function(){St["b"].$(this).removeClass("highlightListElement")});St["b"].$(t).click(selectListBoxElement);var i=n.listContent[e].originalDescription;if(r.checkVariable(i)){i=r.parseLabel(i)}t.innerHTML=i;h.appendChild(t)}function selectListBoxElement(){var e=this.id.split("##"),t=St["b"].DataObjects.DocumentDO.getExtension(e[1]),i=t.getController().getRootModel(),n=St["b"].Factories.ModelFactory.getModelById(i,e[2]);if(n){s.setInlineComment(n,e[0],t);St["b"].Utils.DOM.enableInlineCommentRows();l.dispatch("updateInlineCommentsOnAutoSave",{model:n,extension:t})}St["b"].$(m).remove();var a=n.id.split(".")[0],r=St["b"].DataObjects.DocumentDO.getPainter(),o=r.getContainerScrollPosition(a,t.getId());St["b"].Factories.ViewFactory.redrawViews(t);if(o){r.setContainerScrollPosition(a,t.getId(),o)}return false}}};St["b"].Actions=St["b"].Actions||{};var _t=St["b"].Actions.UpdateRootModelAction={valid:function(){return[Le["a"].SET_CONTEXT,Le["a"].DEFAULT,Le["a"].CONTEXTMENU]},execute:function(n){var e=n.extension.getController(),t=e.getRootModel(),i=St["b"].DataObjects.DocumentDO,a=new G["a"];var r=false;if(t!==null&&t.id===""){St["b"].DataObjects.CommentRepo.removeMarkedCommentsAndInternalReferences(n.extension);St["b"].DataObjects.CommentRepo.removeMarkedReferenceAndSaveExternalChanges(n.extension);var o=n.extension.getDeletedRootModelData();if(o){e.dispatch("deleteRootModel",o);e.dispatch("deleteLayoutDefinition",o);n.extension.setDeletedRootModelData(undefined)}t.saveName=n.extension.getAdapter().getServerId();e.dispatch("createRootModel",{extension:n.extension,parameters:{saveQVF:false,dontNotifyText:n.dontNotifyText}});a.resolve(false)}else{e.dispatch("updateRootModelState",{extension:n.extension,parameters:{saveQVF:false},dontConfirmText:n.dontConfirmText,commentId:n.commentId,currCommentCell:n.currCommentCell,callback:function(){r=true}});!n.updateOnlyComments&&e.dispatch("createContextState",{extension:n.extension,saveQVF:false});var l=St["b"].DataObjects.DocumentDO.getHiCoVariables(),s=i.getConnector(),d={documentId:i.getHash(),version:s.isPublished?s.getDocumentValues().version:C["a"].createFormattedDate()};if(St["b"].Utils.GlobalVariables.hasService&&!n.updateOnlyComments){re["a"].repository("createVariables",d,l,true,function(){a.resolve(true)})}else{a.resolve(true)}i.setDocumentValue("variables",l);i.setDocumentValue("version",d.version);i.saveDocument()}var c=n.saveLocally!==false?n.extension.saveExtension().then(function(e){return e&&(n.showMessage||n.showMessage===undefined)}).catch(function(){return false}):Promise.resolve(true);Promise.all([c,a.promise]).then(function(e){var t=e[0],i=e[1];if((r&&i&&t||!St["b"].Utils.GlobalVariables.hasService)&&!n.dontNotifyText){n.extension.showExtensionMessage(Ot["a"].getTranslation("MESSAGE_SAVE_SUCCESS"),3e3,"check")}})}};St["b"].Actions.UpdateRootModelState={valid:function(){return[Le["a"].SET_CONTEXT,Le["a"].DEFAULT,Le["a"].CONTEXTMENU]},execute:function(e){var t=e.extension;var i=t.getController();var n=i.getRootModel();var a=n.id;var r=n.saveName;var o=St["b"].DataObjects.RuntimeDO.getUser().username;var l=n.currVisibleOnExtension;var s=e.commentId;if(n.confirmBeforeSaveText){if(!e.dontConfirmText){if(!confirm(Ot["a"].getTranslation("CONFIRM_FINAL_TEXT_DELETE"))){return"cancel"}}delete n.confirmBeforeSaveText}n.selectedChart="";n.isCompareMode=false;St["b"].DataObjects.CommentRepo.removeMarkedCommentsAndInternalReferences(t);var d=St["b"].DataObjects.CommentRepo.getCutCopyContainsComment(t.getId()+"#"+n.id);St["b"].DataObjects.CommentRepo.removeMarkedReferenceAndSaveExternalChanges(t);St["b"].DataObjects.CommentRepo.updateCommentRepository(t);if(s!=null&&!d){var c=o;var u=C["a"].createFormattedDate();var p=St["b"].DataObjects.CommentRepo.getCommentById(s,t.getId());if(p.exists_in_db===false){i.dispatch("createOrUpdateCommentAction",{extension:t,comment:p,caller:"update"})}else{if(e.currCommentCell){if(e.updateCommentLastModified){var g=e.currCommentCell;!g.originalLastModified&&(g.originalLastModified=g.lastModified);g.lastModifiedBy=c;g.lastModified=u}if(e.currTargetCommentCell){!e.currTargetCommentCell.originalLastModified&&(e.currTargetCommentCell.originalLastModified=e.currTargetCommentCell.lastModified);e.currTargetCommentCell.lastModifiedBy=c;e.currTargetCommentCell.lastModified=u}i.dispatch("createOrUpdateCommentAction",{extension:t,comment:p,lastModified:u})}}}else{var m=St["b"].DataObjects.CommentRepo.getAllSelectedExtensionComments(t);for(var h=0;h<m.length;h++){i.dispatch("createOrUpdateCommentAction",{extension:t,comment:m[h],caller:"update",lastModified:null})}}var f={extensionHash:t.getId(),modelHash:a,modifier:o,mode:t.getMode(),saveName:r,modelInUseId:i.getRootModel().id,displayed:l,hidden:t.isHidden(),bookmarkId:n.bookmarkId,noteId:n.noteId};var v=i.getLayoutDefinition().getPreparedForSave();var b=st["a"].filterKeys(n,["newLayoutDefinition"],false);b=st["a"].filterKeys(b,["cellDefinition"],true);var T=St["b"].Models.Actions.ModelActions.RootModel.prepareForSave(b);b=st["a"].filterKeys(b,["compiledFormula"],true);if(T.usedCommonTables&&T.usedCommonTables.length){i.dispatch("createCommonTable",{tableHashes:T.usedCommonTables})}var E=e.callback?e.callback:undefined;if(t.getAdapter().storeRemotely()&&Se["a"].hasService){var x=false;re["a"].repository("updateLayoutDefinition",f,v,false,function(){x=true});re["a"].repository("updateRootModel",f,b,false,function(e){x&&E&&E(e)})}else{E&&E()}t.setExtensionValue("layoutDefinition",v);t.setExtensionValue("rootModel",b);if(!e.parameters||e.parameters.saveQVF!==false){t.saveExtension()}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateScalingDocSettings={valid:function(){return[]},execute:function(e){var t=St["b"].DataObjects.ContextRepo.getAllContexts();var i=St["b"].DataObjects.DocumentDO.getDocSettings(true);var n=i.scalingSettings.value;var a=[];for(var r=0;r<t.length;r++){var o=t[r].columns;for(var l=0;l<o.length;l++){var s=o[l].scalingGroup;if(St["b"].$.inArray(s,a)===-1){a.push(s)}}}for(var r=0;r<a.length;r++){if(n[a[r]]==undefined){n[a[r]]={value:"",number:"Auto"}}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateScalingGroups={valid:function(){return[]},execute:function(e){var t=St["b"].DataObjects.DocumentDO.getDocSettings(true);var i=St["b"].DataObjects.RuntimeDO.getUser().userSpecific;var n;if(e.type==="document"){n=t}else{n=i?i:t}var a=n.scalingGroups.value;for(var r in a){a[r].scalingFactor=null}var o={};var l=St["b"].DataObjects.DocumentDO.getAllExtensions();var s={};for(var d=0;d<l.length;d++){var c=l[d];var u=c.getController().getRootModel().globalZoom;for(var r in u){if(s[r]===undefined){s[r]=u[r]}}}var p=St["b"].DataObjects.ContextRepo.getAllContexts();for(var d=0;d<p.length;d++){var g=p[d];for(var m=0;m<g.columns.length;m++){var h=g.columns[m];if(h.representation===St["b"].Utils.Constants.TypeValues.tableRepresentation.LIST||h.representation===St["b"].Utils.Constants.TypeValues.tableRepresentation.COMMENT||h.representation===St["b"].Utils.Constants.TypeValues.tableRepresentation.FLAG){continue}var f=St["b"].Utils.Calculator.resolveQvVars(h.scalingGroup);if(o[h.scalingGroup]===undefined){o[h.scalingGroup]=s[f]!==undefined?s[f]:null}}}for(var r in o){if(a[r]==undefined){a[r]={scalingFactor:o[r],auto:true,manualFactor:null}}else if(a[r].auto){a[r].scalingFactor=o[r]}}}};St["b"].Actions=St["b"].Actions||{};St["b"].Actions.UpdateUserSettingsAction={valid:function(){return[]},execute:function(){var e=St["b"].DataObjects.DocumentDO;var t=St["b"].DataObjects.RuntimeDO.getUser().userSpecific;var i={documentHash:e.getHash(),documentName:e.getName(),decimalSep:t.decimalSep.value,thousandSep:t.thousandSep.value,negativeStyle:t.negativeStyle.value,docLanguage:t.docLanguage.value,unitPosition:t.unitPosition.value,documentMode:t.documentMode.value,scalingGroups:JSON.stringify(t.scalingGroups.value),dateFormat:t.dateFormat.value};var n={version:e.getConnector().isPublished?e.getConnector().getDocumentValues().version:C["a"].createFormattedDate()};if(St["b"].Utils.GlobalVariables.hasService){re["a"].repository("updateUserSettings",i,n,false)}e.setDocumentValue("userSettings",t);e.setDocumentValue("version",n.version);e.saveDocument()}};var It=r(123);var Dt=r(70);var Rt=r(486);var Nt=St["b"].Models.Actions.ViewModelActions={General:{getAllCharts:function(e,t){if(!e||!e.children){return[]}var i=e.children;for(var n=0;n<i.length;n++){var a=i[n];if(a.instanceOf==="ContainerModel"){var r="";if(a.extendedModel!==null){r=a.extendedModel.instanceOf}if(r==="ChartModel"||r==="TimeChartModel"||r==="TableModel"){t.push(a)}else{St["b"].Models.Actions.ViewModelActions.General.getAllCharts(a,t)}}}},getAllChartsByChartProperty:function(e,t){if(!e||!e.children){return}var i=e.children;for(var n=0;n<i.length;n++){var a=i[n];if(a.instanceOf==="ContainerModel"){if(a.charts){t.push(a)}else if(a.extendedModel&&(a.extendedModel.instanceOf==="ContainerGridModel"||a.extendedModel.instanceOf==="MultipleContainerModel")){St["b"].Models.Actions.ViewModelActions.General.getAllChartsByChartProperty(a,t)}}}},getAllChartsByType:function(e,t,i){if(!e||!e.children){return[]}var n=e.children;for(var a=0;a<n.length;a++){var r=n[a];if(r.instanceOf==="ContainerModel"){var o="";if(r.extendedModel!==null){o=r.extendedModel.instanceOf}if(o===i){t.push(r)}else{St["b"].Models.Actions.ViewModelActions.General.getAllChartsByType(r,t,i)}}}},getAllSingleChartsByType:function(e,a){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],n=i.extendedModel?i.extendedModel.instanceOf:"";if(n===a){r.push(i)}else if(n==="ContainerGridModel"){search(i)}}}e.extendedModel&&e.extendedModel.instanceOf==="ContainerGridModel"&&search(e);return r},getHighlightState:function(e){var t=e.model;var i="",n="",a="";if(t.instanceOf!=="CompareModel"){if(t.isHighlighted){i="DELETE";n="minus-circle"}else{i="ADD";n="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(Ze["d"])(r,l);var d=St["b"].DataObjects.RuntimeDO;var c=St["b"].Utils.Constants.TypeValues.indicator;var u=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_WIDTH");var p=d.getParameterParsed("FACTOR_HIGHLIGHT_ELLIPSE_HEIGHT");var g=St["b"].Models.Actions.ViewModelActions.General.getAbsolutePositionWithScrolling(s,r);var m={clientX:e.position.x,clientY:e.position.y};m=St["b"].Utils.DOM.getPositionOnExtension(e.extension,m);if(t.absolute.legend!==c.NONE){var h=t.absolute.position,f=t.absolute.dimension;var v={width:f.width*u*2,height:f.height*p};var b={width:v.width-f.width,height:v.height-f.height};var T=intersect(h.x-b.width/2+g.x,h.x-b.width/2+g.x+f.width+b.width,m.x);var E=intersect(h.y-b.height/2+g.y,h.y-b.height/2+g.y+f.height+b.height,m.y);if(T&&E){a=c.ABSOLUTE;if(t.absolute.isHighlighted){i="DELETE";n="minus-circle"}}}if(!i){if(t.text.legend!==c.NONE&&t.text.text!==""){var h=t.text.position,f=t.text.dimension;var v={width:f.width*u*2,height:f.height*p};var b={width:v.width-f.width,height:v.height-f.height};var T=intersect(h.x-b.width/2+g.x,h.x-b.width/2+g.x+f.width+b.width,m.x);var E=intersect(h.y-b.height/2+g.y,h.y-b.height/2+g.y+f.height+b.height,m.y);if(T&&E){a=c.TEXT;if(t.text.isHighlighted){i="DELETE";n="minus-circle"}}}}if(!i){if(t.percent.legend!==c.NONE){var h=t.percent.position,f=t.percent.dimension;var v={width:f.width*u*2,height:f.height*p};var b={width:v.width-f.width,height:v.height-f.height};var T=intersect(h.x-b.width/2+g.x,h.x-b.width/2+g.x+f.width+b.width,m.x);var E=intersect(h.y-b.height/2+g.y,h.y-b.height/2+g.y+f.height+b.height,m.y);if(T&&E){a=c.PERCENT;if(t.percent.isHighlighted){i="DELETE";n="minus-circle"}}}}if(!i){i="ADD";n="plus-circle"}}return{commandText:i,thumbnail:n,type:a};function intersect(e,t,i){return e<i&&i<t||e===i||t===i}},getHighlightEdit:function(e){var t=e.model,i=St["b"].Utils.Constants.TypeValues.indicator.NONE;var n="",a="";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!=="")){n="EDIT";a="pencil-square-o"}return{commandText:n,thumbnail:a}},getNewHighlightId:function(e){var t=0;for(var i=0;i<e.length;i++){var n=e[i].id;n=parseInt(n.split(".").pop());if(t<=n){t=n+1}}return t},getDocumentModeText:function(){if(St["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(Ze["f"])(t.firstObjectGrid,e);var n=e.position.x,a=e.position.y;for(var r=0;r<i.length;r++){var o=i[r],l=o.border,s=o.padding;n+=o.position.x+l.left.width+s.left;a+=o.position.y+l.top.width+s.top}return{x:n,y:a}},getAbsolutePositionWithScrolling:function(e,t){var i=Object(Ze["f"])(t.firstObjectGrid,e),n=e.scrollingData,a=e.position.x+(e.border?e.border.left.width:0)+(e.padding?e.padding.left:0)-(n&&!isNaN(n.scrollLeft)?n.scrollLeft:0),r=e.position.y+(e.border?e.border.top.width:0)+(e.padding?e.padding.top:0)-(n&&!isNaN(n.scrollTop)?n.scrollTop:0);for(var o=0;o<i.length;o++){var l=i[o],s=l.border,d=l.padding,c=l.scrollingData;a+=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:a,y:r}}},AxisModel:{},BackGroundModel:{},BarModel:{getFixateScalingGroupContextmenuItem:function(e){var t=e.model;var i=e.extension;var n=i.getController().getRootModel();var a=t.id.split(".")[0];var r=Object(Ze["d"])(n,a);var o=St["b"].DataObjects.ContextRepo.getContextByCid(r.extendedModel.contextId);var l="";var s="";if(o){var d=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(o,t.dataId_expr);if(d){var c=new St["b"].Utils.Calculator(null);if(St["b"].DataObjects.DocumentDO.getScalingGroups()[d.scalingGroup]!==undefined&&St["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 n=i.getController().getRootModel();var a=t.id.split(".")[0];var r=Object(Ze["d"])(n,a);var o=St["b"].DataObjects.ContextRepo.getContextByCid(r.extendedModel.contextId);var l="";var s="";if(o){var d=St["b"].Models.Actions.ModelActions.ContextModel.getContextContentById(o,t.dataId_expr);if(d){var c=St["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 n=e.id.split(".")[0];var a=Object(Ze["d"])(i,n);var r=a.extendedModel;var o=St["b"].DataObjects.ContextRepo.getContextByCid(r.contextId);if(o===null){return false}var l=St["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=St["b"].DataObjects.DocumentDO.getScalingGroups();var u=l.scalingGroup;return!c[u]}},CompareModel:{getDifferenceData:function(e,t,a){var i=St["b"].DataObjects.DocumentDO.getDocSettings();var r=St["b"].Utils.Constants.TypeValues.indicator;var n=e.compareFrom;var o=e.compareTo;var l,s;var d,c="",u;var p=0,g="",m=true;function getReferenceValue(e,t,i){var n;if(e===r.AXIS||i===r.AXIS){n=0}else if(e.instanceOf==="TimeWaterfallModel"||e.instanceOf==="StructureWaterfallModel"){n=e.relativeValue-(t===r.START?e.value:0)}else if(a&&e.isStack&&a.extendedModel.stackMode){n=e.stackModel.startOn+(t===r.START?0:e.value)}else{n=t===r.START?0:e.value}return n}l=getReferenceValue(n,e.compareFromStart,e.compareFromCat);s=getReferenceValue(o,e.compareToStart,e.compareToCat);d=s-l;if(l===0){p=Number.NaN;g="N/A";m=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){m=p>=0}if(e.absolute.legend!==r.NONE){var h={numberFormat:{decimal:ot["a"].numberFormatCompareValueDecimals,decimalSeparator:i.decimalSep.value,decimalThousandSeparator:i.thousandSep.value,negativeStyle:i.negativeStyle.value}};var f=1;var v=0;var b,T;if(n===r.AXIS){b=o.dataId_dim;T=o.dataId_expr}else{b=n.dataId_dim;T=n.dataId_expr}var E=St["b"].Models.Actions.DataModelActions.getDimensionNodeByPath(t.dataModel,b);for(var x=0;x<E.nodes.length;x++){if(E.nodes[x].key===T){v=St["b"].Models.Actions.ModelActions.RuleEntryModel.resolveDisplayedDecimals(E.nodes[x].usedRuledEntry);f=St["b"].Models.Actions.ModelActions.RuleEntryModel.resolveFactor(E.nodes[x].usedRuledEntry);break}}c=St["b"].Utils.Format.NumberFormat.formatNumber(d,h,f,false,v);var C="";var y="";if(n!==r.AXIS){var M=St["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(t,n.dataId_expr);C=St["b"].Utils.Calculator.resolveQvVars(M.scalingGroup)}if(o!==r.AXIS){var M=St["b"].Models.Actions.ModelActions.ContextModel.getExpressionByShortId(t,o.dataId_expr);y=St["b"].Utils.Calculator.resolveQvVars(M.scalingGroup)}if(C.indexOf("%")!==-1||y.indexOf("%")!==-1){c+=" pp"}if(u){c="+"+c}}if(e.percent.legend!==r.NONE&&!isNaN(p)){var S={numberFormat:{decimal:ot["a"].numberFormatCompareValueDecimals,decimalSeparator:i.decimalSep.value,decimalThousandSeparator:i.thousandSep.value,negativeStyle:i.negativeStyle.value}};g=St["b"].Utils.Format.NumberFormat.formatNumber(p,S,.01)+"%";if(m){g="+"+g}}return{textAbsolute:c,isPositiveAbsolute:u,textPercent:g,isPositivePercent:m,realValue:d}},setText:function(e,t,i){if(e.compareFrom&&e.compareTo){var n=St["b"].Models.Actions.ViewModelActions.CompareModel.getDifferenceData(e,t,i);e.absolute.text=n.textAbsolute;e.absolute.real=n.realValue;e.positive=n.isPositiveAbsolute;e.percent.text="("+n.textPercent+")";if(e.text.legend!=="none"){var a=e.text.originalText?e.text.originalText:e.text.text;if(a.indexOf("$")>-1){e.text.originalText=a;var r=new St["b"].Utils.Format.LabelFormatter;a=r.parseLabel(a).replace(/ /g," ")}e.text.text=a}}},getNewId:function(e){var t=0;for(var i=0;i<e.length;i++){var n=e[i].id;n=parseInt(n.split(".")[1].match(/\d+/g));if(t<=n){t=n+1}}return t}},ContainerModel:{init:Oe["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:Oe["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=St["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 St["b"].Utils.Calculator;var i={};t.addQvVariables(i,true);for(var n=0;n<e.charts.length;n++){if(t.calculateFomulaCFM(t,e.charts[n],i,e.charts[n].formula,null,false)===1){return n}}return-1},isInMultipleIfGrid:function(e){var t=e.model;if(t.extendedModel.instanceOf==="ContainerGridModel"){var i=Object(Ze["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 n=i.extendedModel;var r;if(n.instanceOf==="ChartModel"||n.instanceOf==="TimeChartModel"||n.instanceOf==="TableModel"){r=St["b"].DataObjects.ContextRepo.getContextByCid(n.contextId);if(!r){return t}}var a="";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"+a,o,s,"undo"));var d=l.groupActualLevel===l.groupMembers.length-1?0:l.groupActualLevel+1;t.entries.push(entryGenerator("SWITCH_FORWARD"+a,o,d,"repeat"));a+=" ";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,n,a){return{name:e,level:"Consumer",models:["ContainerModel"],extendedModels:[],attributes:[],parameters:{contextId:r.cid,dimensionIdx:t,level:i},thumbnail:n||"",height:n?"11px":undefined,width:n?"7px":undefined,action:"updateQVDrillLevel",needsTranslation:a}}function separatorGenerator(e){return{name:e,level:"Consumer",models:["ContainerModel"],extendedModels:[],attributes:[],thumbnail:""}}return t},containsTextModels:function(e){var n=null;function detectTextContainer(e){var t=e.extendedModel;if(t&&t.instanceOf==="ContainerCommentGridModel"){n="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(n==="comment"){break}}}}}if(e&&e.instanceOf==="ContainerModel"){detectTextContainer(e)}return n},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=St["b"].DataObjects.DocumentDO.getVariableById(t.extendedModel.input.saveVariable);var n=null;if(i){if(!isNaN(parseInt(i.value))&&isFinite(i.value)){n=parseInt(i.value)}else{n=i.value.toLowerCase()}}return n!=null&&n!==1&&n!==true&&n!=="true"||!i},applyDefaultTextBorderStyles:function(e){if(e.extendedModel&&!e.border.bottom.width){if(e.extendedModel.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.TITLE){e.border.bottom.width=St["b"].Utils.Calculator.Converter.mm2pixGlobalFont("MMPT_TITLE_BOTTOM_BORDER_SIZE");e.border.bottom.color=St["b"].DataObjects.RuntimeDO.getParameter("COLOR_TITLE_TITLE_BOTTOM_BORDER")}else if(e.extendedModel.textType===St["b"].Utils.Constants.TypeValues.commentTextTypes.SUBTITLE){e.border.bottom.width=St["b"].Utils.Calculator.Converter.mm2pixGlobalFont("MMPT_SUBTITLE_BOTTOM_BORDER_SIZE");e.border.bottom.color=St["b"].DataObjects.RuntimeDO.getParameter("COLOR_SUBTITLE_BOTTOM_BORDER")}}}},LabelModel:{setFontSize:function(e,t){e.fontSize=St["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,n){var a=St["b"].DataObjects.DocumentDO.getPainter();var r=a.measureTextDim(e,l).width;if(r<=t){return e}var o="";var l="";var s=St["b"].Utils.DOM.createTextArrayFromHTML(e);var d=0,c=[],u=0,p=0;var g=0;var m=false;for(var h=0,f=s[g].length;h<f;h++){l=s[g][h].bold?"bold ":"normal ";l+=s[g][h].italic?"italic ":"";l+=i;var v="";for(var b=0,T=s[g][h].text.length;b<T;b++){v+=s[g][h].text.charAt(b);d=a.measureTextDim(v+"...",l).width;if(d+u>t){v=v.slice(0,v.length-1);m=true;break}}c.push({text:v,bold:s[g][h].bold,underline:s[g][h].underline,italic:s[g][h].italic});if(m){break}u+=a.measureTextDim(v,l).width}m=false;for(var g=0,E=c.length;g<E;g++){if(p+c[g].text.length>=n){var x=n-p;c[g].text=c[g].text.substr(0,x);c[g].text+="...";m=true}if(c[g].bold){o+="<b>"}if(c[g].italic){o+="<i>"}if(c[g].underline){o+="<u>"}if(g===E-1&&!m){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(m){break}p+=c[g].text.length}return o},rewriteLabelToWidthBinary:function(e,t,i){var n=St["b"].DataObjects.DocumentDO.getPainter();var a=e;var r=e;var o=n.measureTextDim(a,i).width;if(o>t){var l=0;var s;var d=a.length;var c=Math.floor((d-l)/2);while(c>=1){s=l+c;a=e.substring(0,s);o=n.measureTextDim(a+"...",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}}};r.d(t,"HiCo",function(){return St["b"]});r(1195)},1195:function(e,t,i){var n={"./Background.png":1196,"./Border.png":1197,"./HiCo_Zeit_Heute.png":1198,"./HiCo_Zeit_Vergangenheit.png":1199,"./HiCo_Zeit_Vorvergangenheit.png":1200,"./HiCo_Zeit_Zukunft.png":1201,"./Pattern.png":1202,"./absolute_active.png":1203,"./absolute_inactive.png":1204,"./add_rest_active.png":1205,"./add_rest_inactive.png":1206,"./add_small.png":1207,"./add_small_inactive.png":1208,"./add_total_active.png":1209,"./add_total_inactive.png":1210,"./align_center.png":1211,"./align_left.png":1212,"./align_right.png":1213,"./arrow_up.png":1214,"./arrow_up_active.png":1215,"./ascending.png":1216,"./ascending_active.png":1217,"./backend.png":1218,"./bold.gif":1219,"./bold_nm.png":1220,"./bullet_arrow_right.png":1221,"./cell_cell.png":1222,"./cell_cell_grey.png":1223,"./cell_left.png":1224,"./cell_left_grey.png":1225,"./cell_top.png":1226,"./cell_top_grey.png":1227,"./chevron_left_small.png":1228,"./circle_info.png":1229,"./circle_question_mark.png":1230,"./copy.png":1231,"./cross.png":1232,"./cycle.png":1233,"./date.png":1234,"./delete.png":1235,"./delete_small.png":1236,"./delete_small_grey.png":1237,"./descending.png":1238,"./descending_active.png":1239,"./deselectAll.png":1240,"./disk.png":1241,"./dropDown.ico":1242,"./duplication.png":1243,"./edit.png":1244,"./envelope.png":1245,"./eye.png":1246,"./eye_gray.png":1247,"./favicon.png":1248,"./favicon_inactive.png":1249,"./file.png":1250,"./floppy_disk.png":1251,"./glasses.png":1252,"./help.png":1253,"./helpdoc.png":1254,"./helptooltips.png":1255,"./hicologo.png":1256,"./hicologo_inactive.png":1257,"./highlight_element.png":1258,"./highlight_element_grey.png":1259,"./highlight_label.png":1260,"./highlight_label_grey.png":1261,"./highlight_position.png":1262,"./highlight_position_grey.png":1263,"./highlight_text.png":1264,"./highlight_text_grey.png":1265,"./invisible.png":1266,"./italic.gif":1267,"./italic_nm.png":1268,"./left_arrow.png":1269,"./link.png":1270,"./loadingChart.gif":1271,"./lock.png":1272,"./logo.png":1273,"./mouse_left_click.png":1274,"./mouse_left_click_small.png":1275,"./mouse_right_click.png":1276,"./mouse_right_click_small.png":1277,"./move.png":1278,"./notation.png":1279,"./notation_grey.png":1280,"./notation_inactive.png":1281,"./numbers.png":1282,"./off.png":1283,"./off_inactive.png":1284,"./on.png":1285,"./on_inactive.png":1286,"./order_auto_HI.png":1287,"./order_auto_N.png":1288,"./order_bottom_HI.png":1289,"./order_bottom_N.png":1290,"./order_sort_HI.png":1291,"./order_sort_N.png":1292,"./order_top_HI.png":1293,"./order_top_N.png":1294,"./page_white_copy.png":1295,"./page_white_copy_small.png":1296,"./paste.png":1297,"./pencil.png":1298,"./pencil_gray.png":1299,"./percent_active.png":1300,"./percent_inactive.png":1301,"./pin.png":1302,"./pin_active.png":1303,"./refresh_small.png":1304,"./restart.png":1305,"./right_arrow.png":1306,"./scissors.png":1307,"./selectAll.png":1308,"./sort_arrow_down.png":1309,"./sort_arrow_up.png":1310,"./sort_down1.png":1311,"./sort_keyfigure.png":1312,"./sort_none.png":1313,"./sort_self.png":1314,"./sort_up1.png":1315,"./spin-button.png":1316,"./spin-down.png":1317,"./spin-up.png":1318,"./stack.png":1319,"./stack_grey.png":1320,"./structure.png":1321,"./switchContext.png":1322,"./table.png":1323,"./text_active.png":1324,"./text_align_bottom.png":1325,"./text_align_bottom_grey.png":1326,"./text_align_center.png":1327,"./text_align_center_grey.png":1328,"./text_align_center_tb_grey.png":1329,"./text_align_left.png":1330,"./text_align_left_grey.png":1331,"./text_align_left_tb_grey.png":1332,"./text_align_mid.png":1333,"./text_align_mid_grey.png":1334,"./text_align_right.png":1335,"./text_align_right_grey.png":1336,"./text_align_right_tb_grey.png":1337,"./text_align_top.png":1338,"./text_align_top_grey.png":1339,"./text_bold.png":1340,"./text_inactive.png":1341,"./text_italic.png":1342,"./text_underline.png":1343,"./tick.png":1344,"./time.png":1345,"./totals_position_cell.png":1346,"./totals_position_cell_grey.png":1347,"./totals_position_left.png":1348,"./totals_position_left_grey.png":1349,"./totals_position_none.png":1350,"./totals_position_none_grey.png":1351,"./totals_position_right.png":1352,"./totals_position_right_grey.png":1353,"./trueChart-icon.svg":1354,"./truechart_logo_dark.svg":1355,"./truechart_logo_light.svg":1356,"./ui-active_state_1x400.png":1357,"./ui-bg_flat_0_aaaaaa_40x100.png":1358,"./ui-bg_glass_55_fbf9ee_1x400.png":1359,"./ui-bg_glass_75_dadada_1x400.png":1360,"./ui-bg_glass_75_e6e6e6_1x400.png":1361,"./ui-bg_inset-soft_95_fef1ec_1x100.png":1362,"./ui-icons_222222_256x240.png":1363,"./ui-icons_2e83ff_256x240.png":1364,"./ui-icons_454545_256x240.png":1365,"./ui-icons_cd0a0a_256x240.png":1366,"./ui-normal_state_1x400.png":1367,"./unlock.png":1368,"./user.png":1369,"./visible.png":1370};function webpackContext(e){var t=webpackContextResolve(e);return i(t)}function webpackContextResolve(e){var t=n[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(n)};webpackContext.resolve=webpackContextResolve;e.exports=webpackContext;webpackContext.id=1195},1196:function(e,t,i){e.exports=i.p+"img/Background.png"},1197:function(e,t,i){e.exports=i.p+"img/Border.png"},1198:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Heute.png"},1199:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Vergangenheit.png"},1200:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Vorvergangenheit.png"},1201:function(e,t,i){e.exports=i.p+"img/HiCo_Zeit_Zukunft.png"},1202:function(e,t,i){e.exports=i.p+"img/Pattern.png"},1203:function(e,t,i){e.exports=i.p+"img/absolute_active.png"},1204:function(e,t,i){e.exports=i.p+"img/absolute_inactive.png"},1205:function(e,t,i){e.exports=i.p+"img/add_rest_active.png"},1206:function(e,t,i){e.exports=i.p+"img/add_rest_inactive.png"},1207:function(e,t,i){e.exports=i.p+"img/add_small.png"},1208:function(e,t,i){e.exports=i.p+"img/add_small_inactive.png"},1209:function(e,t,i){e.exports=i.p+"img/add_total_active.png"},1210:function(e,t,i){e.exports=i.p+"img/add_total_inactive.png"},1211:function(e,t,i){e.exports=i.p+"img/align_center.png"},1212:function(e,t,i){e.exports=i.p+"img/align_left.png"},1213:function(e,t,i){e.exports=i.p+"img/align_right.png"},1214:function(e,t,i){e.exports=i.p+"img/arrow_up.png"},1215:function(e,t,i){e.exports=i.p+"img/arrow_up_active.png"},1216:function(e,t,i){e.exports=i.p+"img/ascending.png"},1217:function(e,t,i){e.exports=i.p+"img/ascending_active.png"},1218:function(e,t,i){e.exports=i.p+"img/backend.png"},1219:function(e,t,i){e.exports=i.p+"img/bold.gif"},1220:function(e,t,i){e.exports=i.p+"img/bold_nm.png"},1221:function(e,t,i){e.exports=i.p+"img/bullet_arrow_right.png"},1222:function(e,t,i){e.exports=i.p+"img/cell_cell.png"},1223:function(e,t,i){e.exports=i.p+"img/cell_cell_grey.png"},1224:function(e,t,i){e.exports=i.p+"img/cell_left.png"},1225:function(e,t,i){e.exports=i.p+"img/cell_left_grey.png"},1226:function(e,t,i){e.exports=i.p+"img/cell_top.png"},1227:function(e,t,i){e.exports=i.p+"img/cell_top_grey.png"},1228:function(e,t,i){e.exports=i.p+"img/chevron_left_small.png"},1229:function(e,t,i){e.exports=i.p+"img/circle_info.png"},1230:function(e,t,i){e.exports=i.p+"img/circle_question_mark.png"},1231:function(e,t,i){e.exports=i.p+"img/copy.png"},1232:function(e,t,i){e.exports=i.p+"img/cross.png"},1233:function(e,t,i){e.exports=i.p+"img/cycle.png"},1234:function(e,t,i){e.exports=i.p+"img/date.png"},1235:function(e,t,i){e.exports=i.p+"img/delete.png"},1236:function(e,t,i){e.exports=i.p+"img/delete_small.png"},1237:function(e,t,i){e.exports=i.p+"img/delete_small_grey.png"},1238:function(e,t,i){e.exports=i.p+"img/descending.png"},1239:function(e,t,i){e.exports=i.p+"img/descending_active.png"},1240:function(e,t,i){e.exports=i.p+"img/deselectAll.png"},1241:function(e,t,i){e.exports=i.p+"img/disk.png"},1242:function(e,t,i){e.exports=i.p+"img/dropDown.ico"},1243:function(e,t,i){e.exports=i.p+"img/duplication.png"},1244:function(e,t,i){e.exports=i.p+"img/edit.png"},1245:function(e,t,i){e.exports=i.p+"img/envelope.png"},1246:function(e,t,i){e.exports=i.p+"img/eye.png"},1247:function(e,t,i){e.exports=i.p+"img/eye_gray.png"},1248:function(e,t,i){e.exports=i.p+"img/favicon.png"},1249:function(e,t,i){e.exports=i.p+"img/favicon_inactive.png"},1250:function(e,t,i){e.exports=i.p+"img/file.png"},1251:function(e,t,i){e.exports=i.p+"img/floppy_disk.png"},1252:function(e,t,i){e.exports=i.p+"img/glasses.png"},1253:function(e,t,i){e.exports=i.p+"img/help.png"},1254:function(e,t,i){e.exports=i.p+"img/helpdoc.png"},1255:function(e,t,i){e.exports=i.p+"img/helptooltips.png"},1256:function(e,t,i){e.exports=i.p+"img/hicologo.png"},1257:function(e,t,i){e.exports=i.p+"img/hicologo_inactive.png"},1258:function(e,t,i){e.exports=i.p+"img/highlight_element.png"},1259:function(e,t,i){e.exports=i.p+"img/highlight_element_grey.png"},1260:function(e,t,i){e.exports=i.p+"img/highlight_label.png"},1261:function(e,t,i){e.exports=i.p+"img/highlight_label_grey.png"},1262:function(e,t,i){e.exports=i.p+"img/highlight_position.png"},1263:function(e,t,i){e.exports=i.p+"img/highlight_position_grey.png"},1264:function(e,t,i){e.exports=i.p+"img/highlight_text.png"},1265:function(e,t,i){e.exports=i.p+"img/highlight_text_grey.png"},1266:function(e,t,i){e.exports=i.p+"img/invisible.png"},1267:function(e,t,i){e.exports=i.p+"img/italic.gif"},1268:function(e,t,i){e.exports=i.p+"img/italic_nm.png"},1269:function(e,t,i){e.exports=i.p+"img/left_arrow.png"},1270:function(e,t,i){e.exports=i.p+"img/link.png"},1271:function(e,t,i){e.exports=i.p+"img/loadingChart.gif"},1272:function(e,t,i){e.exports=i.p+"img/lock.png"},1273:function(e,t,i){e.exports=i.p+"img/logo.png"},1274:function(e,t,i){e.exports=i.p+"img/mouse_left_click.png"},1275:function(e,t,i){e.exports=i.p+"img/mouse_left_click_small.png"},1276:function(e,t,i){e.exports=i.p+"img/mouse_right_click.png"},1277:function(e,t,i){e.exports=i.p+"img/mouse_right_click_small.png"},1278:function(e,t,i){e.exports=i.p+"img/move.png"},1279:function(e,t,i){e.exports=i.p+"img/notation.png"},1280:function(e,t,i){e.exports=i.p+"img/notation_grey.png"},1281:function(e,t,i){e.exports=i.p+"img/notation_inactive.png"},1282:function(e,t,i){e.exports=i.p+"img/numbers.png"},1283:function(e,t,i){e.exports=i.p+"img/off.png"},1284:function(e,t,i){e.exports=i.p+"img/off_inactive.png"},1285:function(e,t,i){e.exports=i.p+"img/on.png"},1286:function(e,t,i){e.exports=i.p+"img/on_inactive.png"},1287:function(e,t,i){e.exports=i.p+"img/order_auto_HI.png"},1288:function(e,t,i){e.exports=i.p+"img/order_auto_N.png"},1289:function(e,t,i){e.exports=i.p+"img/order_bottom_HI.png"},1290:function(e,t,i){e.exports=i.p+"img/order_bottom_N.png"},1291:function(e,t,i){e.exports=i.p+"img/order_sort_HI.png"},1292:function(e,t,i){e.exports=i.p+"img/order_sort_N.png"},1293:function(e,t,i){e.exports=i.p+"img/order_top_HI.png"},1294:function(e,t,i){e.exports=i.p+"img/order_top_N.png"},1295:function(e,t,i){e.exports=i.p+"img/page_white_copy.png"},1296:function(e,t,i){e.exports=i.p+"img/page_white_copy_small.png"},1297:function(e,t,i){e.exports=i.p+"img/paste.png"},1298:function(e,t,i){e.exports=i.p+"img/pencil.png"},1299:function(e,t,i){e.exports=i.p+"img/pencil_gray.png"},1300:function(e,t,i){e.exports=i.p+"img/percent_active.png"},1301:function(e,t,i){e.exports=i.p+"img/percent_inactive.png"},1302:function(e,t,i){e.exports=i.p+"img/pin.png"},1303:function(e,t,i){e.exports=i.p+"img/pin_active.png"},1304:function(e,t,i){e.exports=i.p+"img/refresh_small.png"},1305:function(e,t,i){e.exports=i.p+"img/restart.png"},1306:function(e,t,i){e.exports=i.p+"img/right_arrow.png"},1307:function(e,t,i){e.exports=i.p+"img/scissors.png"},1308:function(e,t,i){e.exports=i.p+"img/selectAll.png"},1309:function(e,t,i){e.exports=i.p+"img/sort_arrow_down.png"},1310:function(e,t,i){e.exports=i.p+"img/sort_arrow_up.png"},1311:function(e,t,i){e.exports=i.p+"img/sort_down1.png"},1312:function(e,t,i){e.exports=i.p+"img/sort_keyfigure.png"},1313:function(e,t,i){e.exports=i.p+"img/sort_none.png"},1314:function(e,t,i){e.exports=i.p+"img/sort_self.png"},1315:function(e,t,i){e.exports=i.p+"img/sort_up1.png"},1316:function(e,t,i){e.exports=i.p+"img/spin-button.png"},1317:function(e,t,i){e.exports=i.p+"img/spin-down.png"},1318:function(e,t,i){e.exports=i.p+"img/spin-up.png"},1319:function(e,t,i){e.exports=i.p+"img/stack.png"},1320:function(e,t,i){e.exports=i.p+"img/stack_grey.png"},1321:function(e,t,i){e.exports=i.p+"img/structure.png"},1322:function(e,t,i){e.exports=i.p+"img/switchContext.png"},1323:function(e,t,i){e.exports=i.p+"img/table.png"},1324:function(e,t,i){e.exports=i.p+"img/text_active.png"},1325:function(e,t,i){e.exports=i.p+"img/text_align_bottom.png"},1326:function(e,t,i){e.exports=i.p+"img/text_align_bottom_grey.png"},1327:function(e,t,i){e.exports=i.p+"img/text_align_center.png"},1328:function(e,t,i){e.exports=i.p+"img/text_align_center_grey.png"},1329:function(e,t,i){e.exports=i.p+"img/text_align_center_tb_grey.png"},1330:function(e,t,i){e.exports=i.p+"img/text_align_left.png"},1331:function(e,t,i){e.exports=i.p+"img/text_align_left_grey.png"},1332:function(e,t,i){e.exports=i.p+"img/text_align_left_tb_grey.png"},1333:function(e,t,i){e.exports=i.p+"img/text_align_mid.png"},1334:function(e,t,i){e.exports=i.p+"img/text_align_mid_grey.png"},1335:function(e,t,i){e.exports=i.p+"img/text_align_right.png"},1336:function(e,t,i){e.exports=i.p+"img/text_align_right_grey.png"},1337:function(e,t,i){e.exports=i.p+"img/text_align_right_tb_grey.png"},1338:function(e,t,i){e.exports=i.p+"img/text_align_top.png"},1339:function(e,t,i){e.exports=i.p+"img/text_align_top_grey.png"},1340:function(e,t,i){e.exports=i.p+"img/text_bold.png"},1341:function(e,t,i){e.exports=i.p+"img/text_inactive.png"},1342:function(e,t,i){e.exports=i.p+"img/text_italic.png"},1343:function(e,t,i){e.exports=i.p+"img/text_underline.png"},1344:function(e,t,i){e.exports=i.p+"img/tick.png"},1345:function(e,t,i){e.exports=i.p+"img/time.png"},1346:function(e,t,i){e.exports=i.p+"img/totals_position_cell.png"},1347:function(e,t,i){e.exports=i.p+"img/totals_position_cell_grey.png"},1348:function(e,t,i){e.exports=i.p+"img/totals_position_left.png"},1349:function(e,t,i){e.exports=i.p+"img/totals_position_left_grey.png"},1350:function(e,t,i){e.exports=i.p+"img/totals_position_none.png"},1351:function(e,t,i){e.exports=i.p+"img/totals_position_none_grey.png"},1352:function(e,t,i){e.exports=i.p+"img/totals_position_right.png"},1353:function(e,t,i){e.exports=i.p+"img/totals_position_right_grey.png"},1354:function(e,t,i){e.exports=i.p+"img/trueChart-icon.svg"},1355:function(e,t,i){e.exports=i.p+"img/truechart_logo_dark.svg"},1356:function(e,t,i){e.exports=i.p+"img/truechart_logo_light.svg"},1357:function(e,t,i){e.exports=i.p+"img/ui-active_state_1x400.png"},1358:function(e,t,i){e.exports=i.p+"img/ui-bg_flat_0_aaaaaa_40x100.png"},1359:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_55_fbf9ee_1x400.png"},1360:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_75_dadada_1x400.png"},1361:function(e,t,i){e.exports=i.p+"img/ui-bg_glass_75_e6e6e6_1x400.png"},1362:function(e,t,i){e.exports=i.p+"img/ui-bg_inset-soft_95_fef1ec_1x100.png"},1363:function(e,t,i){e.exports=i.p+"img/ui-icons_222222_256x240.png"},1364:function(e,t,i){e.exports=i.p+"img/ui-icons_2e83ff_256x240.png"},1365:function(e,t,i){e.exports=i.p+"img/ui-icons_454545_256x240.png"},1366:function(e,t,i){e.exports=i.p+"img/ui-icons_cd0a0a_256x240.png"},1367:function(e,t,i){e.exports=i.p+"img/ui-normal_state_1x400.png"},1368:function(e,t,i){e.exports=i.p+"img/unlock.png"},1369:function(e,t,i){e.exports=i.p+"img/user.png"},1370:function(e,t,i){e.exports=i.p+"img/visible.png"}}]);