{"version":3,"sources":["../src/app/Main.tsx"],"names":["React","ReactDOM","HashRouter","App","flattenContent","initGroupAndItemIds","isExpansion","isModulePageDef","KeycloakService","KeycloakContext","AccountServiceClient","AccountServiceContext","Main","Component","constructor","props","componentDidMount","isReactLoading","toggleReact","render","keycloakService","keycloak","e","createElement","removeHidden","items","visible","item","hidden","eval","push","content","length","pop","loadModule","modulePage","Promise","resolve","reject","console","log","resourceUrl","modulePath","then","module","catch","error","warn","label","message","moduleLoaders","forEach","all","domContainer","document","querySelector"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AACA,OAAO,KAAKC,QAAZ;AAEA,SAAQC,UAAR;AAEA,SAAQC,GAAR;AACA,SAAoCC,cAApC,EAAoDC,mBAApD,EAAyEC,WAAzE,EAAsFC,eAAtF;AAEA,SAAyBC,eAAzB;AACA,SAASC,eAAT;AACA,SAASC,oBAAT;AACA,SAASC,qBAAT;AASA,OAAO,MAAMC,IAAN,SAAmBZ,KAAK,CAACa,SAAzB,CAA8C;AAE1CC,EAAAA,WAAW,CAACC,KAAD,EAAmB;AACjC,UAAMA,KAAN;AACH;;AAEMC,EAAAA,iBAAiB,GAAS;AAC7BC,IAAAA,cAAc,GAAG,KAAjB;AACAC,IAAAA,WAAW;AACd;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B,UAAMC,eAAe,GAAG,IAAIZ,eAAJ,CAAoBa,QAApB,CAAxB;AACA,WACI,oBAAC,UAAD,QACI,oBAAC,eAAD,CAAiB,QAAjB;AAA0B,MAAA,KAAK,EAAED;AAAjC,OACI,oBAAC,qBAAD,CAAuB,QAAvB;AAAgC,MAAA,KAAK,EAAE,IAAIV,oBAAJ,CAAyBU,eAAzB;AAAvC,OACI,oBAAC,GAAD,OADJ,CADJ,CADJ,CADJ;AASH;;AAtBgD;AAuBpD;AAID,MAAME,CAAC,GAAGtB,KAAK,CAACuB,a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,CAAP;AAUH;;AAAA;AAED,MAAMe,aAAuC,GAAG,EAAhD;AACA9C,cAAc,CAAC2B,OAAD,CAAd,CAAwBoB,OAAxB,CAAiCxB,IAAD,IAAuB;AACnD,MAAIpB,eAAe,CAACoB,IAAD,CAAnB,EAA2B;AACvBuB,IAAAA,aAAa,CAACpB,IAAd,CAAmBI,UAAU,CAACP,IAAD,CAA7B;AACH;AACJ,CAJD,E,CAMA;;AACAS,OAAO,CAACgB,GAAR,CAAYF,aAAZ,EAA2BP,IAA3B,CAAgC,MAAM;AAClC,QAAMU,YAAY,GAAGC,QAAQ,CAACC,aAAT,CAAuB,uBAAvB,CAArB;AACAtD,EAAAA,QAAQ,CAACkB,MAAT,CAAgBG,CAAC,CAACV,IAAD,CAAjB,EAAyByC,YAAzB;AACH,CAHD","sourcesContent":["/*\n * Copyright 2018 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nimport {HashRouter} from 'react-router-dom';\n\nimport {App} from './App';\nimport {ContentItem, ModulePageDef, flattenContent, initGroupAndItemIds, isExpansion, isModulePageDef} from './ContentPages';\n\nimport { KeycloakClient, KeycloakService } from './keycloak-service/keycloak.service';\nimport { KeycloakContext } from './keycloak-service/KeycloakContext';\nimport { AccountServiceClient } from './account-service/account.service';\nimport { AccountServiceContext } from './account-service/AccountServiceContext';\n\ndeclare const keycloak: KeycloakClient;\n\ndeclare let isReactLoading: boolean;\ndeclare function toggleReact(): void;\ndeclare const features: { [key: string]: boolean; };\n\nexport interface MainProps {}\nexport class Main extends React.Component {\n\n public constructor(props: MainProps) {\n super(props);\n }\n\n public componentDidMount(): void {\n isReactLoading = false;\n toggleReact();\n }\n\n public render(): React.ReactNode {\n const keycloakService = new KeycloakService(keycloak);\n return (\n \n \n \n \n \n \n \n );\n }\n};\n\ndeclare const resourceUrl: string;\ndeclare let content: ContentItem[];\nconst e = React.createElement;\n\nfunction removeHidden(items: ContentItem[]): ContentItem[] {\n const visible: ContentItem[] = [];\n\n for (let item of items) {\n if (item.hidden && eval(item.hidden)) continue;\n\n if (isExpansion(item)) {\n visible.push(item);\n item.content = removeHidden(item.content);\n if (item.content.length === 0) {\n visible.pop(); // remove empty expansion\n }\n } else {\n visible.push(item);\n }\n }\n\n return visible;\n}\n\ncontent = removeHidden(content);\ninitGroupAndItemIds();\n\nfunction loadModule(modulePage: ModulePageDef): Promise {\n return new Promise ((resolve, reject) => {\n console.log('loading: ' + resourceUrl + modulePage.modulePath);\n import(resourceUrl + modulePage.modulePath).then( (module: React.Component) => {\n modulePage.module = module;\n resolve(modulePage);\n }).catch((error: Error) => {\n console.warn('Unable to load ' + modulePage.label + ' because ' + error.message);\n reject(modulePage);\n });\n });\n};\n\nconst moduleLoaders: Promise[] = [];\nflattenContent(content).forEach((item: ContentItem) => {\n if (isModulePageDef(item)) {\n moduleLoaders.push(loadModule(item));\n }\n});\n\n// load content modules and start\nPromise.all(moduleLoaders).then(() => {\n const domContainer = document.querySelector('#main_react_container');\n ReactDOM.render(e(Main), domContainer);\n});"],"file":"Main.js"}