Liferay.Loader.define("analytics-reports-web@2.0.38/js/components/Main",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../context/ChartStateContext","../context/StoreContext","../utils/dateFormat","./BasicInformation","./Chart","./TimeSpanSelector","./TotalCount","./TrafficSources"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;p(a("liferay!frontend-js-react-web$prop-types"));var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(a,n,o):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),n=a("../context/ChartStateContext"),o=a("../context/StoreContext"),i=a("../utils/dateFormat"),l=p(a("./BasicInformation")),s=p(a("./Chart")),u=p(a("./TimeSpanSelector")),c=p(a("./TotalCount")),f=p(a("./TrafficSources"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function p(e){return e&&e.__esModule?e:{default:e}}function m({author:e,canonicalURL:t,chartDataProviders:a,className:d,onSelectedLanguageClick:p,onTrafficSourceClick:m,pagePublishDate:g,pageTitle:b,timeSpanOptions:y,totalReadsDataProvider:v,totalViewsDataProvider:h,trafficSourcesDataProvider:S,viewURLs:L}){const{timeSpanKey:P,timeSpanOffset:C}=(0,r.useContext)(n.ChartStateContext),{languageTag:w}=(0,r.useContext)(o.StoreStateContext),x=(0,n.useIsPreviousPeriodButtonDisabled)(),{firstDate:D,lastDate:O}=(0,n.useDateTitle)(),T=(0,r.useMemo)((()=>(0,i.generateDateFormatters)(w)),[w]).formatChartTitle([D,O]);return r.default.createElement("div",{className:"analytics-reports-app-main pb-3 px-3 ".concat(d)},r.default.createElement(l.default,{author:e,canonicalURL:t,onSelectedLanguageClick:p,publishDate:g,title:b,viewURLs:L}),!!y.length&&r.default.createElement("div",{className:"c-mb-2 c-mt-4"},r.default.createElement(u.default,{disabledNextTimeSpan:0===C,disabledPreviousPeriodButton:x,timeSpanKey:P,timeSpanOptions:y})),T&&r.default.createElement("h5",{className:"c-mb-4"},T),r.default.createElement("h5",{className:"mt-3 sheet-subtitle"},Liferay.Language.get("engagement")),r.default.createElement(c.default,{className:"mb-2",dataProvider:h,label:Liferay.Util.sub(Liferay.Language.get("total-views")),popoverHeader:Liferay.Language.get("total-views"),popoverMessage:Liferay.Language.get("this-number-refers-to-the-total-number-of-views-since-the-content-was-published")}),v&&r.default.createElement(c.default,{className:"mb-2",dataProvider:v,label:Liferay.Util.sub(Liferay.Language.get("total-reads")),popoverHeader:Liferay.Language.get("total-reads"),popoverMessage:Liferay.Language.get("this-number-refers-to-the-total-number-of-reads-since-the-content-was-published")}),r.default.createElement(s.default,{dataProviders:a,publishDate:g,timeSpanOptions:y}),r.default.createElement(f.default,{dataProvider:S,onTrafficSourceClick:m}))}m.defaultProps={author:null,className:"",totalReadsDataProvider:null}}}));
//# sourceMappingURL=Main.js.map