Liferay.Loader.define("analytics-reports-web@2.0.38/js/utils/APIService",["module","exports","require","frontend-js-web"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t._getFormDataRequest=o,t.default=void 0;var i=a("frontend-js-web"),n={getHistoricalReads:(e,{namespace:t,plid:a,timeSpanKey:i,timeSpanOffset:n})=>d(e,{body:o({plid:a,timeSpanKey:i,timeSpanOffset:n},t),method:"POST"}),getHistoricalViews:(e,{namespace:t,plid:a,timeSpanKey:i,timeSpanOffset:n})=>d(e,{body:o({plid:a,timeSpanKey:i,timeSpanOffset:n},t),method:"POST"}),getTotalReads:(e,{namespace:t,plid:a})=>d(e,{body:o({plid:a},t),method:"POST"}),getTotalViews:(e,{namespace:t,plid:a})=>d(e,{body:o({plid:a},t),method:"POST"}),getTrafficSources:(e,{namespace:t,plid:a,timeSpanKey:i,timeSpanOffset:n})=>d(e,{body:o({plid:a,timeSpanKey:i,timeSpanOffset:n},t),method:"POST"})};function o(e,t,a=new FormData){return Object.entries(e).forEach((([e,i])=>{a.append("".concat(t).concat(e),i)})),a}function d(e,t={}){return(0,i.fetch)(e,t).then((e=>e.json())).then((e=>{if(e.error)throw e.error;return e}))}t.default=n}}));
//# sourceMappingURL=APIService.js.map