Liferay.Loader.define("@liferay/analytics-settings-web@5.0.51/js/App",["module","exports","require","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/tooltip","liferay!frontend-js-react-web$react","./pages/default/DefaultPage","./pages/wizard/WizardPage","./utils/constants"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.useDispatch=t.useData=t.Events=t.AppContextData=t.View=t.EPageView=void 0;var a=r("@frontend-taglib-clay$clayui/icon"),n=r("@frontend-taglib-clay$clayui/tooltip"),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=_interopRequireDefault(r("./pages/default/DefaultPage")),c=_interopRequireDefault(r("./pages/wizard/WizardPage")),l=r("./utils/constants");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let e;t.EPageView=e,function(e){e.Wizard="VIEW_WIZARD_MODE",e.Default="VIEW_DEFAULT_MODE"}(e||(t.EPageView=e={}));const u={[e.Wizard]:c.default,[e.Default]:o.default};t.View=u;const d={connected:!1,liferayAnalyticsURL:"",pageView:e.Wizard,token:""},f=i.default.createContext(d);t.AppContextData=f;const s=i.default.createContext(null),useData=()=>(0,i.useContext)(f);t.useData=useData;const useDispatch=()=>(0,i.useContext)(s);let p;t.useDispatch=useDispatch,t.Events=p,function(e){e.Connect="CONNECT",e.ChangePageView="CHANGE_PAGE_VIEW"}(p||(t.Events=p={}));const AppContent=()=>{const{pageView:e}=useData(),t=u[e];return i.default.createElement("div",{"data-testid":e},i.default.createElement(t,null))};function reducer(e,t){switch(t.type){case p.Connect:return _objectSpread(_objectSpread({},e),t.payload);case p.ChangePageView:return _objectSpread(_objectSpread({},e),{},{pageView:t.payload});default:throw new Error}}var _default=({connected:t,liferayAnalyticsURL:r,token:o})=>{const[c,u]=(0,i.useReducer)(reducer,{connected:t,liferayAnalyticsURL:r,pageView:t?e.Default:e.Wizard,token:o});return i.default.createElement(n.ClayTooltipProvider,null,i.default.createElement(a.ClayIconSpriteContext.Provider,{value:l.SPRITEMAP},i.default.createElement(f.Provider,{value:c},i.default.createElement(s.Provider,{value:u},i.default.createElement("div",{className:"analytics-settings-web mt-5"},i.default.createElement(AppContent,null))))))};t.default=_default}}));
//# sourceMappingURL=App.js.map