12 |
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/install/webcontent/bi/js/smarts-js",r(r.s=11)}({1:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(r(2));var u=function(){function e(t){var r=t.logger,n=t.ajaxService;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._logger=r,this._ajaxService=n,this._cachedSupportedChartTypes=null}return n(e,[{key:"_processResponse",value:function(e){return e.data}},{key:"_processError",value:function(e){var t=e.jqXHR,r=t.responseJSON;if(r)throw new o.default(r.status,r.details);var n=t.error();throw new o.default(n.status,n.responseText)}},{key:"GET",value:function(e,t){var r=this;return this._ajaxService.ajax({url:e,type:"GET",headers:{"Content-Type":"application/json"},qs:t,processData:!1}).then(function(e){return r._processResponse(e)}).catch(function(e){return r._processError(e)})}},{key:"POST",value:function(e,t){var r=this;return this._ajaxService.ajax({type:"POST",url:e,contentType:"application/json",data:JSON.stringify(t),xhrFields:{withCredentials:!0}}).then(function(e){return r._processResponse(e)}).catch(function(e){return r._processError(e)})}},{key:"getRecommenderSupportedChartTypes",value:function(){return this._cachedSupportedChartTypes||(this._cachedSupportedChartTypes=this.GET("v1/smarts/visualization-recommender/supportedCharts").then(function(e){return e.chartTypes})),this._cachedSupportedChartTypes}},{key:"getSupportedChartTypes",value:function(e){return this.getRecommenderSupportedChartTypes().then(function(t){return e.filter(function(e){return t.indexOf(e)>-1})})}},{key:"getContentRecommendation",value:function(e){return this.POST("v1/smarts/content-recommender/recommend",e)}},{key:"getSmartModuleProgressSummary",value:function(e){var t="v1/smarts/module/"+e+"/progressSummary";return this.GET(t)}},{key:"getVisRecommendation",value:function(e){return this.POST("v1/smarts/visualization-recommender/recommend",e)}}]),e}();t.default=u},11:function(e,t,r){"use strict";var n,o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e){return e&&e.__esModule?e:{default:e}}(r(1));void 0===(n=function(){return function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{logger:null,ajaxService:null}))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u.default),o(t,[{key:"initialize",value:function(e){return this._logger=e.getCoreSvc(".Logger"),this._ajaxService=e.getCoreSvc(".Ajax"),Promise.resolve()}}]),t}()}.apply(t,[]))||(e.exports=n)},2:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Smarts request failed"));return n.status=e,n.details=r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}();t.default=n}})});
- //# sourceMappingURL=smartsService.min.js.map
|