_ncm.js 30 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: rs
  3. // (C) Copyright IBM Corp. 2003, 2022.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. define(["cchl/_2ke"],function(_2ke){"use strict";var s_oTheMoserClient=_2ke._fle;var s_oTheObjectFactory=s_oTheMoserClient.createObjectFactory();var s_oMoserTypeToModelType={};s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.MODULE ]="model";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.FOLDER_TYPE ]="folder"; s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.FOLDER ]="folder";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.QUERY_SUBJECT ]="querySubject";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.MEMBER_TYPE ]="member";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.DEF_LINK_TYPE ]="X-defLink";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.FILTER]="filter";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.DRILL_GROUP]="folder";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.SEGMENT]="segment";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.NAMED_SET]="namedSet";s_oMoserTypeToModelType[ s_oTheMoserClient.MoserObjectTypes.CALCULATION]="queryItem";var s_aMoserTypesWithSourceCategory=[s_oTheMoserClient.MoserObjectTypes.QUERY_SUBJECT, s_oTheMoserClient.MoserObjectTypes.QUERY_ITEM,s_oTheMoserClient.MoserObjectTypes.CALCULATION];var s_oSourceCategoryTypeToModelType={};s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE.name()]="dimension";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR.name()]="dimension";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL.name()]="hierarchy";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD.name()]="hierarchy";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.LEVEL.name()]="level";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.MEASURE.name()]="measure";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.TABLE.name()]="querySubject";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.COLUMN.name()]="queryItem";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.CALCULATION.name()]="queryItem";s_oSourceCategoryTypeToModelType[ s_oTheMoserClient.SourceCategoryType.PROPERTY.name()]="queryItem";var s_aDimensionalSourceCategories=[s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE,s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR,s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL,s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD,s_oTheMoserClient.SourceCategoryType.LEVEL,s_oTheMoserClient.SourceCategoryType.MEASURE];var s_aDimensionSourceCategoryNames=[s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE.name(), s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR.name()];var s_aSourceCategoryContainingDimensions=[s_oTheMoserClient.SourceCategoryType.FOLDER.name()];var s_aHierarchySourceCategoryNames=[s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL.name(), s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD.name()];var s_aSourceCategoryContainingHierarchies=[s_oTheMoserClient.SourceCategoryType.FOLDER.name()].concat(s_aDimensionSourceCategoryNames);var s_aSourceCategoryContainingLevels=s_aSourceCategoryContainingHierarchies.concat(s_aHierarchySourceCategoryNames);var s_aLevelSourceCategoryNames=[s_oTheMoserClient.SourceCategoryType.LEVEL.name()];var s_eOperations=0;var s_eQueryFunctions=1;var s_eReportFunctions=2;var s_eMacroFunctions=3;function _2dj(_xvm){Application._28j(_xvm, {type:"error"});};function _gh6(_9ui){if(_9ui.isHidden){return !_9ui.isHidden();}return true;}function _za(_9ui){var _gg9=_9ui.getReferencedObject&&_9ui.getReferencedObject();if(_gg9){return _gh6(_gg9);}return true;}function _k82(_9ui){var _9ih=_9ui.getObjectType();if(s_aMoserTypesWithSourceCategory.indexOf(_9ih)===-1){return false;}var _nxa=_9ui.getSourceCategory&&_9ui.getSourceCategory(); if(!_nxa){return false;} return s_aDimensionalSourceCategories.indexOf(_nxa)!==-1;}function _u6(_964, _3qm){var _s9h=_7hn._x5g(_964, "./ResponseRoot");return _s9h.item(_3qm);}function _kp2(_d6m, _0vi){s_oTheMoserClient.ModuleUtils.createMembers(s_oTheMoserClient.createObjectFactory(), _d6m, _0vi);return _d6m;}function _sf6(_qbn){if(!_qbn.code||_qbn.code!=200||! _qbn.data||Array.isArray(_qbn.data)&&_qbn.data.length!=1){return Q.reject( {message: "_sf6: unexpected response", response: _qbn} );}var _lch=Array.isArray(_qbn.data)?_qbn.data[0]:_qbn.data; if(_lch.errors){return Q.reject(_lch);}return _lch;}function _cq4(_19m, _9ck, _9ui){var _cpn="v1/metadata/modules/" + encodeURIComponent(_9ck) + "/members?itemID=" + encodeURIComponent(_19m) + "&limit=100&type=module&allProperties=true";return Application.GlassContext.services.fetch.get(_cpn).then(_sf6).then(_kp2.bind(null, _9ui));}function _gu(_qbn){if(!_qbn.code||_qbn.code!=200||!_qbn.data){return Q.reject( {message: "_gu: unexpected response", response: _qbn} );}var _l2m=_qbn.data.querySelector&&_qbn.data.querySelector("member");if(!_l2m){return Q.reject( {message: "_gu: unexpected response", response: _qbn} );}var _dch={};var _34m=_l2m.attributes;var _ytj=_34m.length;for(var i=0; i<_ytj;++i){var _f8n=_34m.item(i);_dch[_f8n.localName]=_f8n.value;}return _dch;}function _7a1(_3en, _ruf){var _cpn="v1/metadata/modules/itemProperties?searchPath=" + encodeURIComponent(_3en) + "&itemId=" + encodeURIComponent(_ruf);return Application.GlassContext.services.fetch.get(_cpn).then(_gu);}function _wu1(_qgl, _9ui){return _cq4(_9ui.getIdForExpression(), _qgl, _9ui);}function _nq8(_9ui){var _pen= _9ui.getUsage()&&_9ui.getUsage().name(); switch(_pen){case "identifier":case "fact":break;default:_pen="attribute";break;}return _pen;};function _9jb(_9ui){var _9ih=_9ui.getObjectType();if(_9ih===s_oTheMoserClient.MoserObjectTypes.QUERY_ITEM){return true;}if(_9ih===s_oTheMoserClient.MoserObjectTypes.CALCULATION){return true;}var _72b=s_aMoserTypesWithSourceCategory.indexOf(_9ih)!==-1&&_9ui.getSourceCategory&&_9ui.getSourceCategory()&&_9ui.getSourceCategory().name();if(_72b){if(s_oSourceCategoryTypeToModelType[ _72b ]=="queryItem"){return true;}}return false;}function _o72(_9ui){var _9ih=_9ui.getObjectType();var _pen;var _72b=s_aMoserTypesWithSourceCategory.indexOf(_9ih)!==-1&&_9ui.getSourceCategory&&_9ui.getSourceCategory()&&_9ui.getSourceCategory().name();if(_72b){_pen=s_oSourceCategoryTypeToModelType[ _72b ];if(_pen=="queryItem"){_pen=_nq8(_9ui);}else if(!_pen){console.warn('no type for source category: ', _72b);}}else if(_9ih===s_oTheMoserClient.MoserObjectTypes.QUERY_ITEM||_9ih===s_oTheMoserClient.MoserObjectTypes.CALCULATION){_pen=_nq8(_9ui);}else{_pen=s_oMoserTypeToModelType[_9ih];if(!_pen){console.warn('no type for objectType: ', _9ih);}}return _pen;}function _t92(_zon){return _zon.split('->',2); }function _po2(_3jd){return _3jd.join('->');}function _8ag(_len){if(_len[0]!='['){return '[' + _len + ']';}else{return _len;}}var re_unbracketed_firstterm_bracketed_remainingterms=/^([^\.]*)(\.\[.*\])$/;function _v71(_0j9){if(_0j9!='['){var _4ul=_t92(_0j9);if(_4ul[0].match(re_unbracketed_firstterm_bracketed_remainingterms)){var _j26=RegExp.$1;var _s1b=RegExp.$2;_4ul[0]=_8ag(_j26)+_s1b;}else{_4ul[0]=_4ul[0].split('.').map( _8ag ).join('.');}return _po2(_4ul);}else{return _0j9;}}function _7q8(_9ui){var _nxa=_9ui.getSourceCategory&&_9ui.getSourceCategory();var _72b=_nxa&&_nxa.name();if(!_72b){return undefined;}switch(_72b){case s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE.name():return "measure";case s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR.name():return "";default:return undefined;}}function _wbg(_9ui){return _9ui.getIdentifier()||_9ui.getLabel();}function _zl4(_9ui){var _mun=_9ui.getHighlevelDatatype&&_9ui.getHighlevelDatatype();var _nun=_mun&&_mun.toString();if(!_nun){return _nun;}switch(_nun){case "integer":case "decimal":case "string":case "interval":case "blob":case "date":case "time":case "float":return _nun;case "datetime":return "dateTime";default:console.warn("unsupported highlevel datatype", _nun);return "unsupported";} }function _toe(_9ui){return(_9ui.getIdentifier&&_9ui.getIdentifier())||(_9ui.getLabel &&_9ui.getLabel());}function _n73(_9ui){var _gon=_toe(_9ui);var _d6m=_9ui.getParent();while(_d6m){var _l0j=_toe(_d6m)||('?' + _d6m.getObjectType() + '?');_gon=_l0j+'.' + _gon;_d6m=_d6m.getParent();}return _gon;}function _5j7(_9ui){return _9ui.getRegularAggregate().name();}function conditionally_define_M_sDataType(_5ui, _9ui){if(_zl4(_9ui)){Object.defineProperty(_5ui,"_w9j",{get:_5ui._v2a,enumerable: true});}}function conditionally_define_M_sModelAggregate(_5ui, _9ui){if(_9jb(_9ui)){if(_5ui._l0n=="fact"){var _d88=_9ui.getRegularAggregate&&_9ui.getRegularAggregate();if(_d88){Object.defineProperty(_5ui,"_sx9",{get:_5ui._kw3,enumerable: true});}}}}function _apc(_9ui){this._i4i=_9ui;this._l0n=_o72(_9ui);this._fvb;Object.defineProperties(this,{ _i4i:{enumerable: false,value: this._i4i},_fvb: {enumerable: false,value: this._fvb,writable: true},_i0n:{get:this._0cg,enumerable: true},_ole:{get:this._cg6,enumerable: true},_3hn:{get:this._ovh,enumerable: true},_g0d:{get: this._mi5,enumerable: true},_6eb:{get:this._pm4,enumerable: true},_2aj: {get:this._w2a,enumerable: true} });conditionally_define_M_sDataType(this, this._i4i);var _9ih=this._i4i.getObjectType();if(_9ih==s_oTheMoserClient.MoserObjectTypes.CALCULATION){Object.defineProperty(this,"_jdb",{value:true,writable: false,enumerable: true});}conditionally_define_M_sModelAggregate(this, this._i4i);if(_9ih===s_oTheMoserClient.MoserObjectTypes.QUERY_ITEM){Object.defineProperty(this,"_mzc",{value:this._i4i.getItem().length>0,writable: false,enumerable: true});}if(_9ih==s_oTheMoserClient.MoserObjectTypes.FOLDER){Object.defineProperty(this,"_yke",{value: false,writable: false,enumerable: true});}}_apc.prototype._9j7=function(_9ui){if(this._fvb!=undefined){return this._fvb;}var _xwm=(_9ui.getObjectType()==s_oTheMoserClient.MoserObjectTypes.MEMBER_TYPE)?_9ui.getIdentifier():_9ui.getIdForExpression();if(!_xwm||_xwm[0]=='['){return _xwm;}else{ this._fvb=_v71(_xwm);return this._fvb;}};_apc.prototype._0cg=function(){return this._i4i.getLabel();};_apc.prototype._cg6=function(){return this._i4i.getDescription();};_apc.prototype._ovh=function(){return this._i4i.getScreenTip();};_apc.prototype._mi5=function(){return this._9j7(this._i4i);};_apc.prototype._pm4=function(){return _7q8(this._i4i);};_apc.prototype._w2a=function(){return _wbg(this._i4i); };_apc.prototype._gib=function(_qgl){return _wu1(_qgl, this._i4i).then(function(_017){return _017.getMembers();});};_apc.prototype._v2a=function(){return _zl4(this._i4i); }; _apc.prototype._kw3=function(){return _5j7(this._i4i); }; function _q3b(_9ui){_q3b.baseConstructor.call(this, _9ui);}_olk._vjl(_q3b, _apc);function _8a4(_f78, _925){_8a4.baseConstructor.call(this, _f78);this._qu4=_925;this._l0n=_o72(_925);Object.defineProperties(this,{_qu4:{enumerable: false,value: this._qu4},_i0n:{get:this._0cg,enumerable: true},_ole:{get:this._cg6,enumerable: true},_3hn:{get:this._ovh,enumerable: true},_g0d:{get: this._mi5,enumerable: true}});};_olk._vjl(_8a4, _q3b);_8a4.prototype._cg6=function(){return this._i4i.getDescription()||this._qu4.getDescription();};_8a4.prototype._ovh=function(){return this._i4i.getScreenTip()||this._qu4.getScreenTip();};_8a4.prototype._mi5=function(){return this._9j7(this._qu4);};_8a4.prototype._pm4=function(){return _7q8(this._qu4);};function _szf(_9ui, _i9l){_szf.baseConstructor.call(this, _9ui);Object.defineProperties(this,{_0hn:{get:this._nvh,enumerable: true}});var _8on=_9ui.getHierarchyUniqueName&&_9ui.getHierarchyUniqueName();if(_8on){this._nsh=_i9l._ele[_v71(_8on)];Object.defineProperty(this,"_nsh",{value:this._nsh,writable: false,enumerable: true});}var _hon=_9ui.getLevelUniqueName&&_9ui.getLevelUniqueName();if(_hon){this._ufm=_i9l._ele[_v71(_hon)];Object.defineProperty(this,"_ufm",{value:this._ufm,writable: false,enumerable: true});}if(_9ui.getParentUniqueName){var _nun=_9ui.getParentUniqueName();this._4th=_nun?_v71(_nun):_nun;Object.defineProperty(this,"_4th",{value:this._4th,writable: false,enumerable: true});} }_olk._vjl(_szf, _apc);_szf.prototype._nvh=function(){return this._mi5();};_szf.prototype._3j7=function(_rgl){return _cq4(this._i4i.getIdentifier(), _rgl, this._i4i).then(function(_iw2){return _iw2.getMembers();});};function _s47(_9ui){_s47.baseConstructor.call(this, _9ui);this._l0n="folder";}_olk._vjl(_s47, _apc);_s47.prototype._3j7=function(_rgl){return Q.reject("_s47._3j7 is not implemented");};function _lz(_9ui, _925){return _925?new _8a4(_9ui, _925):new _q3b(_9ui);}function _68(_jpf){return _lz(_jpf);}function _3h1(_9ui, _i9l){_vzm._6dm(_9ui.getObjectType()==s_oTheMoserClient.MoserObjectTypes.MEMBER_TYPE||s_oTheMoserClient.SourceCategoryType.MEASURE.name()==_9ui.getSourceCategory().name());return new _szf(_9ui, _i9l);}function _7j4(_37k, _7hc){var _dsn=_7hc.getSourceCategory();if(_dsn===s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE){return [new _s47(_7hc)];}else if(_dsn===s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR){return [new _s47(_7hc)];}else if(_dsn===s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL||_dsn===s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD){if(_7hc.hierarchyHasMultipleRoots){return [new _s47(_7hc)];}else{return Q.all([_wu1(_37k._ltk, _7hc), _37k._n56()]).spread(function(_017,_i9l){return _017.getMembers().map(function(_ipf){return _37k._gn4(_ipf, _i9l);});});}}else{console.warn('Unexpected root in _7j4 ', _7hc.getLabel());}}function _u71(_jbk, _90j, _e0c){var _2nj;if(_90j=="exact"){_2nj=[_jbk];}else{_2nj=_jbk.split(/\s+/g);}var _2nj=_2nj.map(_cgm._bie);var _7mj=[]; if(_2nj.length>1){if(_90j=="contained-all"){_7mj=_2nj;}else{_7mj.push(_2nj.join("|"));}}else{_7mj.push(_2nj[0]);}if(_90j=="starts-with"){_vzm._6dm(_7mj.length==1);_7mj[0]="^"+_7mj[0]; }else if(_90j=="ends-with"){_vzm._6dm(_7mj.length==1);_7mj[0]=_7mj[0]+"$";} return _7mj.map(function(_zwm){ return new RegExp(_zwm, _e0c?undefined:"i"); });}function _vj6(_zlm, _nun){for(var i=0; i<_zlm.length; i++){if(!_zlm[i].test(_nun)){return false;}}return true;}function _bhb(_mqg){var _2vk=[];_2ke._hv9(_mqg, function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}var _9ih=_11e.getObjectType();if(s_aMoserTypesWithSourceCategory.indexOf(_9ih)!==-1&&_11e.getSourceCategory()){var _72b=_11e.getSourceCategory().name();if(s_aDimensionSourceCategoryNames.indexOf(_72b)!==-1){_2vk.push(_11e);return false;}return s_aSourceCategoryContainingDimensions.indexOf(_72b)!==-1;}return true;});return _2vk;}function _chb(_pwa){var _2vk=[];_2ke._hv9(_pwa.getItem(), function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}var _psn=_11e.getSourceCategory&&_11e.getSourceCategory()&&_11e.getSourceCategory().name();if(_psn&&s_aLevelSourceCategoryNames.indexOf(_psn)!==-1){_2vk.push(_11e);return false;}return !_psn||s_aSourceCategoryContainingLevels.indexOf(_psn)!==-1;});return _2vk;}function _sg5(_owa){var _2vk=[];_2ke._hv9(_owa.getItem(), function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}var _psn=_11e.getSourceCategory&&_11e.getSourceCategory()&&_11e.getSourceCategory().name();if(_psn&&s_aHierarchySourceCategoryNames.indexOf(_psn)!==-1){_2vk.push(_11e);return false;}return !_psn||s_aSourceCategoryContainingHierarchies.indexOf(_psn)!==-1;});return _2vk;}function _zk4(_owa){if(_owa.getSourceCategory()==s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE){return _owa;}var _z4f=_sg5(_owa);var _5kn=_z4f.length;if(_5kn==0){console.warn('no hierarchies for dimension ', _owa.getLabel() );}else if(_5kn==1){return _z4f[0];}else{return _owa;}}function _b1(_9ui, _sqn){var _2vk=[];_2ke._hv9(_9ui.getItem(), function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}if(_11e.getObjectType()===s_oTheMoserClient.MoserObjectTypes.ITEM_TYPE){return true;}var _psn=_11e.getSourceCategory&&_11e.getSourceCategory()&&_11e.getSourceCategory().name();if(_psn&&_sqn.indexOf(_psn)!==-1){_2vk.push(_11e);}return false;});return _2vk;}var s_aModelObjectTypes=[s_oTheMoserClient.MoserObjectTypes.QUERY_SUBJECT,s_oTheMoserClient.MoserObjectTypes.FOLDER_TYPE,s_oTheMoserClient.MoserObjectTypes.FOLDER,s_oTheMoserClient.MoserObjectTypes.ITEM_HIERARCHY,s_oTheMoserClient.MoserObjectTypes.NAMED_SET,s_oTheMoserClient.MoserObjectTypes.FILTER,s_oTheMoserClient.MoserObjectTypes.QUERY_ITEM,s_oTheMoserClient.MoserObjectTypes.CALCULATION];function _vu3(_9ui){var _0z1=_qkk._qik("EnableDimensionalModules");var _2vk=[];_2ke._hv9([_9ui],function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}if(_9ui===_11e){return true;}if(!_0z1&&_k82(_11e)){return false;}if(s_aModelObjectTypes.indexOf(_11e.getObjectType())!==-1){_2vk.push(_11e);return false;}return true;});return _2vk;}function _101(_9ui){if(_9ui.getObjectType()==s_oTheMoserClient.MoserObjectTypes.MODULE){return _9ui.getMetadataTreeView()[0];}else{return _9ui;}}function _yj(_9ui){return _vu3(_101(_9ui));}_q3b.prototype._iq8=function(_37k){return Q.resolve(_yj(this._i4i).map(_37k._9d.bind(_37k, this)));};_szf.prototype._iq8=function(_37k){return Q.reject('_szf._iq8 is not supported');};_s47.prototype._iq8=function(_37k){var _pen=this._i4i.getObjectType();if(_pen==s_oTheMoserClient.MoserObjectTypes.MODULE){return Q.all(_bhb(this._i4i.basicGetQuerySubject()||[]).map(_zk4).map(_7j4.bind(null, _37k))).then(function(_1mm){var _x3f=[];_1mm.forEach(function(_35f){_x3f=_x3f.concat(_35f);});return _x3f;});}var _psn=this._i4i.getSourceCategory&&this._i4i.getSourceCategory().name();if(_psn==s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE.name()){return _37k._n56().then(function(_i9l){return _b1(this._i4i, [s_oTheMoserClient.SourceCategoryType.MEASURE.name()]).map(function(_mun){return _3h1(_mun, _i9l); });}.bind(this));}if(_psn==s_oTheMoserClient.SourceCategoryType.DIMENSION_REGULAR.name()){return Q.all(_sg5(this._i4i).map(_7j4.bind(null, _37k))).then(function(_1mm){var _x3f=[];_1mm.forEach(function(_z4n){_x3f=_x3f.concat(_z4n);});return _x3f;});}if(_psn===s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL.name()||_psn===s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD.name()){return Q.all([this._gib(_37k._ltk), _37k._n56()]).spread(function(_p8i, _i9l){return _p8i.map(function(_ipf){return _37k._gn4(_ipf, _i9l);});});}return Q.reject( {message: "Unsupported type for _s47._iq8 " + _pen} );};function _jd6(_7gc, _rbh){var _lwa= new _q3b(_rbh);_lwa._nsh=_7gc; _lwa._ksh=_7gc._ksh;return _lwa;}function _e53(_c2e, _pwa){var _7gc=new _q3b(_pwa);_7gc._ksh=_c2e;_7gc._pml=_chb(_pwa).map(_jd6.bind(null, _7gc));return _7gc;}function _d53(_owa){var _c2e=new _q3b(_owa);_c2e._uke=_sg5(_owa).map(_e53.bind(null, _c2e));return _c2e;}function _if5(_jpf){if(!_qkk._qik("EnableModules")){return null;}var _i9l={ };var _1qg=_bhb(_jpf.basicGetQuerySubject()).map(_d53);if(_1qg.length==0){return null;}var _5pf={};function _wxh(_fum){_5pf[_fum._g0d]=_fum;}function _umb(_vti){_5pf[_vti._g0d]=_vti;_vti._pml.forEach(_wxh);}function _tmb(_fti){_5pf[_fti._g0d]=_fti;_fti._uke.forEach(_umb);}_1qg.forEach(_tmb); return {_j8g:_1qg,_ele:_5pf};};function _hk3(_26m){this._4sl=_26m;this._i0n=_frh._c6j("IDS_CCHL_LBL_NAVGROUP_LABEL");this._ole=this._i0n;this._3hn=this._i0n;this._l0n="folder";};_hk3.prototype._iq8=function(_37k){return _37k._37b().then(function(_206){return _206.map(function(_o07){ return _o07._19g;}); });};function _r47(_z78, _825){this._i4i=_z78;this._pr5=_825;Object.defineProperties(this,{ _l0n:{enumerable: false,get: this._1cg},_i4i:{enumerable: false,value: this._i4i},_i0n:{get:this._0cg,enumerable: true},_ole:{get:this._cg6,enumerable: true},_3hn:{get:this._ovh,enumerable: true},_g0d:{get: this._mi5,enumerable: true},_6eb:{get:this._pm4,enumerable: true},_2aj: {get:this._w2a,enumerable: true} });conditionally_define_M_sDataType(this, this._i4i.getReferencedObject());conditionally_define_M_sModelAggregate(this, this._i4i.getReferencedObject());}_r47.prototype._1cg=function(){return this._pr5._l0n;};_r47.prototype._0cg=function(){return this._i4i.getLabel()||this._pr5._i0n;};_r47.prototype._cg6=function(){return this._i4i.getDescription()||this._pr5._ole;};_r47.prototype._ovh=function(){return this._i4i.getScreenTip()||this._pr5._3hn;};_r47.prototype._mi5=function(){return this._pr5._g0d;};_r47.prototype._pm4=function(){return this._pr5._6eb;};_r47.prototype._w2a=function(){return _wbg(this._i4i); };_r47.prototype._v2a=function(){return this._pr5._w9j;};_r47.prototype._kw3=function(){return this._pr5._sx9;};function _6m9(_9ui){_6m9.baseConstructor.call(this, _9ui);}_olk._vjl(_6m9, _q3b);_6m9.prototype._iq8=function(_37k){return this._i4i.getSegment().filter(_gh6).filter(_za).map(_37k._vh1.bind(_37k));};function _ncm(_g6k, _z98){this._zij=_g6k;this._anh();Object.defineProperties(this,{ _iu7:{enumerable: false,value: this._iu7},_1ub: {enumerable: false,value: this._1ub},_10f: {enumerable: false,value: this._10f},_olg: {enumerable: false,value: this._olg},_0da: {enumerable: false,value: this._0da},_sr5: {enumerable: false,value: this._sr5},_2t2: {enumerable: false,value: this._2t2},_bu4: {enumerable: false,value: this._bu4},_1r5: {enumerable: false,value: this._1r5},_821: {enumerable: false,value: this._821},_fr5: {enumerable: false,value: this._fr5}});}_ncm.prototype._anh=function(){if(this._ltk){_2ke._pb(this._ltk);this._ltk=undefined;}this._iu7=undefined;this._1ub=undefined;this._0da=undefined;this._10f={};this._olg={};this._sr5={};this._2t2={};this._bu4=undefined;this._1r5=undefined;this._821=undefined;this._fr5={}; };_ncm.prototype._t2g=function(){return this._zij;};_ncm.prototype._gn4=function(_ipf,_i9l){var _pon=_ipf.getIdentifier();_pon=_v71(_pon);var _16m=this._10f[_pon];if(_16m){if(_vzm._49b()){console.info('Ignoring moser response because we already have member %s in the cache', _pon);}return _16m;}_16m=_3h1(_ipf, _i9l);this._10f[_pon]=_16m;return _16m;};_ncm.prototype._tg5=function(_lsn){return this._olg[_lsn];};_ncm.prototype._vh1=function(_9ui){return this._tg5(_n73(_9ui));};_ncm.prototype._9d=function(_ng9,_9ui){var _lsn=_n73(_9ui);var _5ui=this._tg5(_lsn);if(_5ui){return _5ui;}_5ui=_lz(_9ui, _9ui.getDefLink&&_9ui.getDefLink());this._olg[_lsn]=_5ui; if(_5ui._l0n=="measure"){var _g1e;if(_ng9._l0n=="dimension"){_g1e=_ng9;}else{var _87e=s_oTheMoserClient.SourceCategoryType.DIMENSION_MEASURE.name();var _h1e;var _og9=_ng9._i4i.getParent();while(_og9){var _yck=_og9.getSourceCategory&&_og9.getSourceCategory()&&_og9.getSourceCategory().name();if(_yck==_87e){_h1e=_og9;break;}_og9=_og9.getParent();}_g1e=this._tg5(_n73(_h1e));}_5ui._ksh=_g1e;}else if(_5ui._l0n=="namedSet"){var _yfc;if(_ng9._l0n=="hierarchy"){_yfc=_ng9;}else{var _aqg=[s_oTheMoserClient.SourceCategoryType.HIERARCHY_LEVEL.name(), s_oTheMoserClient.SourceCategoryType.HIERARCHY_PARENT_CHILD.name()];var _zfc;var _og9=_ng9._i4i.getParent();while(_og9){var _yck=_og9.getSourceCategory&&_og9.getSourceCategory()&&_og9.getSourceCategory().name();if(_yck&&_aqg.indexOf(_yck)!==-1){_zfc=_og9;break;}_og9=_og9.getParent();}_yfc=this._tg5(_n73(_zfc));}_5ui._nsh=_yfc;}return _5ui;};_ncm.prototype._dj=function(_f49){return this._n56().then(function(_i9l){ return _f49.map(function(_bui){return this._gn4(_bui, _i9l);},this);}.bind(this));};_ncm.prototype._e3=function(_rui){var _ipf=s_oTheObjectFactory.createMemberType();_ipf.setIdentifier(_rui.memberUniqueName);_ipf.setLabel(_rui.memberCaption);_ipf.setMemberCaption(_rui.memberCaption);_ipf.setDimensionUniqueName(_rui.dimensionUniqueName);_ipf.setHierarchyUniqueName(_rui.hierarchyUniqueName);_ipf.setLevelNumber(parseInt(_rui.levelNumber, 10));_ipf.setLevelLabel(_rui.levelLabel);_ipf.setLevelUniqueName(_rui.levelUniqueName);if(_rui.parentUniqueName){_ipf.setParentUniqueName(_rui.parentUniqueName);_ipf.setParentLevel(parseInt(_rui.parentLevel, 10));}return [_ipf];};_ncm.prototype._nn2=function(){if(this._bu4){return this._bu4;}var _cpn;this._bu4=this._jq8().then(function(_8lc){_cpn="v1/metadata/base_modules/" + encodeURIComponent(_8lc) + "/metadata/functionList";return Application.GlassContext.services.fetch.get(_cpn);}).then(function(_qbn){if(!_qbn.code||_qbn.code!=200||! _qbn.data){_2dj(_frh._c6j("IDS_CCHL_MODULE_RESPONSE_INVALID"));console.error("Unexpected metadata response for: " + _cpn);return null;}var _gpn=_qbn.data.listOfFunctions;var d=_8qn._kph(null, _gpn);if(!d){_2dj(_frh._c6j("IDS_CCHL_MODULE_RESPONSE_INVALID"));console.error("Unexpected metadata response for: " + _cpn);return null;}return d;}).catch(function(){_2dj(_frh._c6j("IDS_CCHL_MODULE_REQUEST_FAILED"));console.error("Module metadata request failed for: " + _cpn);return null;});return this._bu4;};_ncm.prototype._yfe=function(){if(!this._iu7){this._iu7=_1ke._avc(this._zij).then(function(_4ui){this._ltk=_4ui.id;return this._ltk;}.bind(this)).then(_2ke._2q1.bind(_2ke, Application.GlassContext)).then(_68);}return this._iu7;};_ncm.prototype._cg8=function(_92e){ return this._jq8().then(this._n56.bind(this)).then(_92e._iq8.bind(_92e,this)).then(this._gf.bind(this,_92e));};_ncm.prototype._ph5=function(){if(!this._821){this._821=this._37b().then(function(_n4f){if(_n4f.length==0){return null;}return new _hk3(this);}.bind(this)); }return this._821;};_ncm.prototype._gf=function(_d6m,_lyb){if(_d6m._l0n!="model"){return Q.resolve(_lyb);}return this._ph5().then(function(_z74){ if(_z74){_lyb.push(_z74);}return _lyb;});};_ncm.prototype._697=function(){if(!this._1ub){this._1ub=this._yfe().then(function(_6ui){var _jpf=_6ui._i4i;var _z5m=new _s47(_jpf);return _z5m;}.bind(this));}return this._1ub;};_ncm.prototype._jq8=function(){return this._yfe().then(function(_6ui){return this._ltk;}.bind(this));};_ncm.prototype._28b=function(_92e){var _lsn=_92e._g0d;var _ral=this._sr5[_lsn];if(_ral){return _ral;}_ral=this._jq8().then(_92e._gib.bind(_92e)).then(this._dj.bind(this));this._sr5[_lsn]=_ral;return _ral;};_ncm.prototype._597=function(_lon){var _ral=this._2t2[_lon];if(_ral){return _ral;}_ral=Q.all([this._ftc(_lon), this._jq8()]).spread(function(_d6m,_rgl){if(!_d6m){_2dj(_frh._c6j("IDS_MISSING_MUN", _lon));return [];} return _d6m._3j7(_rgl);}.bind(this)).then(this._dj.bind(this));this._2t2[_lon]=_ral;return _ral;};_q3b.prototype._wt8=function(_evk,_554){var _7hc= _101(this._i4i);var _2vk=[];_2ke._hv9([_7hc], function(_11e){if(_11e.isHidden&&_11e.isHidden()){return false;}if(_7hc===_11e){return true;}if(_11e.getLabel&&_vj6(_evk, _11e.getLabel())){_2vk.push(_11e);}return !!(_554||_11e===_7hc); });return Q.resolve(_2vk.map(function(_9ui){return _lz(_9ui, _9ui.getDefLink&&_9ui.getDefLink());}));};_hk3.prototype._wt8=function(_evk,_554){return this._4sl._37b().then(function(_upg){var _2vk=[];_upg.forEach(function(_9ti){_9ti._2lk.forEach(function(_3bl){if(_vj6(_evk, _3bl._i0n)){_2vk.push(_3bl);}}.bind(this));}.bind(this));return _2vk;}.bind(this));};_ncm.prototype._gj8=function(_92e,_jbk,_90j,_e0c,_554){ var _evk=_u71(_jbk, _90j, _e0c);return _92e._wt8(_evk, _554);};_ncm.prototype._n56=function(){if(!this._0da){this._0da=this._yfe().then(function(_6ui){var _i9l=_if5(_6ui._i4i);if(_i9l){Object.keys(_i9l._ele).forEach(function(_ywm){var _5ui=_i9l._ele[_ywm];var _9ui=_5ui._i4i;var _lsn=_n73(_9ui);this._olg[_lsn]=_5ui;}, this);}return _i9l; }.bind(this));}return this._0da;};_ncm.prototype._i97=function(){return this._nn2().then(function(_5rn){return _5rn?_7hn._ij8(_u6(_5rn.documentElement, s_eQueryFunctions), "functionsRoot"):null;});};_ncm.prototype._h66=function(){return this._nn2().then(function(_5rn){return _5rn?_7hn._ij8(_u6(_5rn.documentElement, s_eReportFunctions),"functionsRoot"):null;});};_ncm.prototype._297=function(){return this._nn2().then(function(_5rn){return _5rn?_7hn._ij8(_u6(_5rn.documentElement, s_eMacroFunctions),"functionsRoot"):null;});};_ncm.prototype._dd4=function(){return Q.resolve(null);};_ncm.prototype._2o3=function(){return Q.resolve({isNullSuppressionAllowed: true,isMultiEdgeNullSuppressionAllowed: true,isAccessToNullSuppressionOptionsAllowed: true});};_ncm.prototype._t03=function(){return this._nn2().then(function(_5rn){var _w5h=_5rn?_7hn._ij8(_u6(_5rn.documentElement, s_eOperations),"functionsRoot"):null;if(!_w5h){return {}; }return _bnl._ed1(_8qn._fde(null, _7hn._x5g(_w5h, ".//function[@qosLevel='OK' or @qosLevel='limited' or @qosLevel='restricted']/@id")));});};_ncm.prototype._ttc=function(){return this._nn2().then(function(_5rn){var _w5h=_5rn?_u6(_5rn.documentElement, s_eOperations):null;if(!_w5h){return {}; }if(_w5h){var _4ch={};var nl=_7hn._x5g(_w5h, "*[@value]");for(var i=0; i<nl.length;++i){var n=nl.item(i);_4ch[n.nodeName]=n.getAttribute("value");}return _4ch;}}); };_ncm.prototype._37b=function(){if(!this._1r5){this._1r5=this._yfe().then(function(_qbh){return _qbh._i4i.getDrillGroup().filter(_gh6).map(function(_e2e){var _lsn=_n73(_e2e);var _8al=this._tg5(_lsn);if(!_8al){_8al=new _6m9(_e2e);this._olg[_lsn]=_8al;}var _mvk=_e2e.getSegment().filter(_gh6).filter(_za).map(function(_g2e){var _lsn=_n73(_g2e);var _h6k=this._tg5(_lsn);if(!_h6k){var _gg9=_g2e.getReferencedObject();var _fg9=this._9d(null, _gg9);_h6k=new _r47(_g2e, _fg9);this._olg[_lsn]=_h6k;}return _h6k;}, this);return {_19g: _8al,_2lk: _mvk};},this); }.bind(this)); }return this._1r5;};_ncm.prototype._ftc=function(_lon){var _16m=this._10f[_lon];if(_16m){return Q.resolve(_16m);}var _ral=this._fr5[_lon];if(_ral){return _ral;}_ral=_7a1(this._zij._j0n, _lon).then(this._e3.bind(this)).then(this._dj.bind(this)).then(function(_4vk){_vzm._6dm(_4vk&&_4vk.length==1);return _4vk[0];});this._fr5[_lon]=_ral;return _ral;};_ncm.prototype._266=function(_lon){return this._gq9(_lon).then(function(_d6m){if(_d6m){return this._266(_d6m._0hn).then(function(_p49){return _p49.concat(_d6m);}.bind(this));}else{return [];}}.bind(this));};_ncm.prototype._gq9=function(_lon){return this._ftc(_lon).then(function(_16m){if(_16m._4th){return this._ftc(_16m._4th);}else{return null;}}.bind(this));};_ncm.prototype._9c7=function(_92e,_jbk,_90j,_e0c,_554){return Q.reject('not implemented - _ncm._9c7');};_ncm.prototype._fwc=function(_lon,_jbk,_90j,_e0c,_554){return Q.reject('not implemented - _ncm._fwc');};_ncm.prototype._412=function(){};return _ncm;});