{"version":3,"sources":["webpack:///./src/main/web/components/ui/alert/Alert.ts","webpack:///./src/main/web/components/ui/alert/index.ts"],"names":["AlertType","Error","message","alert","DANGER","props","getCSS","INFO","WARNING","SUCCESS","NONE","render","D","div","className","classNames","this","isEmpty","children","Component","Alert"],"mappings":"oIA0BYA,E,QAPZ,OACA,QACA,OACA,QAEA,QAEA,SAAYA,GACV,mBACA,mBACA,yBACA,yBACA,uBALF,CAAYA,EAAA,EAAAA,YAAA,EAAAA,UAAS,KAcrB,iBAAgBC,MAAMC,GACpB,MAAO,CACLC,MAAOH,EAAUI,OACjBF,QAASA,IAIb,kBACE,eAAYG,GAAZ,MACE,YAAMA,IAAM,K,OAad,EAAAC,OAAS,SAACH,GACR,OAAQA,GACN,KAAKH,EAAUO,KACb,MAAO,wBACT,KAAKP,EAAUQ,QACb,MAAO,2BACT,KAAKR,EAAUI,OACb,MAAO,0BACT,KAAKJ,EAAUS,QACb,MAAO,2BACT,KAAKT,EAAUU,KACb,MAAO,wBACT,QACE,MAAO,oB,EAGf,OA/B2B,qBAKzB,gBAAAC,OAAA,WACE,OAAOC,EAAEC,IACP,CACEC,UAAWC,EAAW,kBAAmBC,KAAKV,OAAOU,KAAKX,MAAMF,OAAQa,KAAKX,MAAMS,YAErF,EAAAG,QAAQD,KAAKX,MAAMH,SAAW,GAAKc,KAAKX,MAAMH,QAC9Cc,KAAKX,MAAMa,WAoBjB,MA/BA,CAA2B,EAAAC,WAAd,EAAAC,S,2EC5Bb","file":"default~app~mp-account-manager~mp-admin-cache-invalidation-button~mp-admin-config-manager~mp-admin-n~32d0454d-c881af2e51e0729838ed.js","sourcesContent":["/**\n * ResearchSpace\n * Copyright (C) 2020, © Trustees of the British Museum\n * Copyright (C) 2015-2019, metaphacts GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nimport { Component } from 'react';\nimport * as D from 'react-dom-factories';\nimport * as classNames from 'classnames';\nimport { isEmpty } from 'lodash';\n\nimport './alert-component.scss';\n\nexport enum AlertType {\n NONE,\n INFO,\n WARNING,\n SUCCESS,\n DANGER,\n}\n\nexport interface AlertConfig extends React.Props {\n className?: string;\n alert: AlertType;\n message: string;\n}\n\nexport function Error(message: string): AlertConfig {\n return {\n alert: AlertType.DANGER,\n message: message,\n };\n}\n\nexport class Alert extends Component {\n constructor(props: AlertConfig) {\n super(props);\n }\n\n render() {\n return D.div(\n {\n className: classNames('alert-component', this.getCSS(this.props.alert), this.props.className),\n },\n isEmpty(this.props.message) ? '' : this.props.message,\n this.props.children\n );\n }\n\n getCSS = (alert: AlertType) => {\n switch (alert) {\n case AlertType.INFO:\n return 'alert-component__info';\n case AlertType.WARNING:\n return 'alert-component__warning';\n case AlertType.DANGER:\n return 'alert-component__danger';\n case AlertType.SUCCESS:\n return 'alert-component__success';\n case AlertType.NONE:\n return 'alert-component__none';\n default:\n return 'alert-component';\n }\n };\n}\n","/**\n * ResearchSpace\n * Copyright (C) 2020, © Trustees of the British Museum\n * Copyright (C) 2015-2019, metaphacts GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nexport * from './Alert';\n"],"sourceRoot":""}