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AAf,UACE,SAAC2C,EAAD,OAIP,ECPYU,EAAiB,WAC5B,OACE,UAAC,KAAD,YACE,SAAC,KAAD,CAAOC,KAAK,GAAGC,SAAS,SAACH,EAAD,OACxB,SAAC,KAAD,CAAOE,KAAK,aAAaC,SAAS,SAAC3D,EAAD,OAClC,SAAC,KAAD,CAAO0D,KAAK,IAAIC,SAAS,SAAC,KAAD,CAAUJ,GAAG,UAG3C,C,oCCKD,IAAMK,EAAanF,EAAAA,YAhBnB,SAAmBoF,EAAOC,GACxB,OAAoBrF,EAAAA,cAAoB,MAAO/B,OAAOC,OAAO,CAC3D+B,MAAO,6BACPI,KAAM,OACND,QAAS,YACTG,YAAa,EACbD,OAAQ,eACR,cAAe,OACfZ,IAAK2F,GACJD,GAAqBpF,EAAAA,cAAoB,OAAQ,CAClDQ,cAAe,QACfC,eAAgB,QAChBC,EAAG,iIAEN,IAGD,K","sources":["../node_modules/react-feather/dist/icons/mail.js","features/messages/api/getMessage.js","features/messages/routes/Message.jsx","features/messages/api/getMessages.js","features/messages/api/deleteMessage.js","features/messages/components/DeleteMessage.jsx","features/messages/components/MessagesList.jsx","features/messages/routes/Messages.jsx","features/messages/routes/index.jsx","../node_modules/@heroicons/react/outline/esm/TrashIcon.js"],"sourcesContent":["function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nvar Mail = forwardRef(function (_ref, ref) {\n  var _ref$color = _ref.color,\n      color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n      _ref$size = _ref.size,\n      size = _ref$size === void 0 ? 24 : _ref$size,\n      rest = _objectWithoutProperties(_ref, [\"color\", \"size\"]);\n\n  return /*#__PURE__*/React.createElement(\"svg\", _extends({\n    ref: ref,\n    xmlns: \"http://www.w3.org/2000/svg\",\n    width: size,\n    height: size,\n    viewBox: \"0 0 24 24\",\n    fill: \"none\",\n    stroke: color,\n    strokeWidth: \"2\",\n    strokeLinecap: \"round\",\n    strokeLinejoin: \"round\"\n  }, rest), /*#__PURE__*/React.createElement(\"path\", {\n    d: \"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z\"\n  }), /*#__PURE__*/React.createElement(\"polyline\", {\n    points: \"22,6 12,13 2,6\"\n  }));\n});\nMail.propTypes = {\n  color: PropTypes.string,\n  size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n};\nMail.displayName = 'Mail';\nexport default Mail;","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getMessage = ({ messageId }) => {\n  return axios.get(`/messages/${messageId}`);\n};\n\nexport const useMessage = ({ messageId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: ['message', messageId],\n    queryFn: () => getMessage({ messageId }),\n  });\n};\n","import { Spinner, MDPreview } from 'components/Elements';\nimport { Head } from 'components/Head';\nimport { ContentLayout } from 'components/Layout';\nimport { formatDate } from 'utils/format';\nimport { Mail } from 'react-feather';\nimport { useParams } from 'react-router-dom';\n\nimport { useMessage } from '../api/getMessage';\n\nexport const Message = () => {\n  const { messageId } = useParams();\n  const messageQuery = useMessage({ messageId });\n\n  if (messageQuery.isLoading) {\n    return (\n      <div className=\"w-full h-48 flex justify-center items-center\">\n        <Spinner size=\"lg\" />\n      </div>\n    );\n  }\n\n  if (!messageQuery.data) return null;\n\n  return (\n    <>\n      <Head title={messageQuery.data.subject} />\n      <ContentLayout title={messageQuery.data.subject}>\n        <span className=\"text-xs font-bold\">{formatDate(messageQuery.data.createdAt)}</span>\n        <div className=\"mt-6 flex flex-col space-y-16\">\n          <div>\n            <div className=\"bg-white shadow overflow-hidden sm:rounded-lg\">\n              <div className=\"px-4 py-5 sm:px-6\">\n                <div className=\"mt-1 max-w-2xl text-sm text-gray-500\">\n                  <MDPreview value={messageQuery.data.content} />\n                </div>\n              </div>\n            </div>\n          </div>\n          <a\n            href={`mailto:${messageQuery.data.email}`}\n            className=\"flex flex-row space-x-2 text-gray-600\"\n          >\n            <Mail /> <span>Reply From Mail</span>\n          </a>\n          <div></div>\n        </div>\n      </ContentLayout>\n    </>\n  );\n};\n","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getMessages = () => {\n  return axios.get('/messages');\n};\n\nexport const useMessages = ({ config } = {}) => {\n  return useQuery({\n    ...config,\n    queryKey: ['messages'],\n    queryFn: () => getMessages(),\n  });\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const deleteMessage = ({ messageId }) => {\n  return axios.delete(`/messages/${messageId}`);\n};\n\ndeleteMessage.propTypes = {\n  messageId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteMessage = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (deletedMessage) => {\n      await queryClient.cancelQueries('messages');\n\n      const previousMessages = queryClient.getQueryData('messages');\n\n      queryClient.setQueryData(\n        'messages',\n        previousMessages?.filter((post) => post.id !== deletedMessage.messageId)\n      );\n\n      return { previousMessages };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousMessages) {\n        queryClient.setQueryData('messages', context.previousMessages);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries('messages');\n      addNotification({\n        type: 'success',\n        title: 'Message Deleted',\n      });\n    },\n    ...config,\n    mutationFn: deleteMessage,\n  });\n};\n","import { Button, ConfirmationDialog } from 'components/Elements';\nimport { Authorization, ROLES } from 'lib/authorization';\nimport { TrashIcon } from '@heroicons/react/outline';\nimport PropTypes from 'prop-types';\n\nimport { useDeleteMessage } from '../api/deleteMessage';\n\nexport const DeleteMessage = ({ id }) => {\n  const deleteMessageMutation = useDeleteMessage();\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <ConfirmationDialog\n        icon=\"danger\"\n        title=\"Delete Message\"\n        body=\"Are you sure you want to delete this Message?\"\n        triggerButton={\n          <Button variant=\"danger\">\n            <TrashIcon className=\"h-4 w-4\" />\n          </Button>\n        }\n        confirmButton={\n          <Button\n            isLoading={deleteMessageMutation.isLoading}\n            type=\"button\"\n            className=\"bg-red-600\"\n            onClick={async () => await deleteMessageMutation.mutateAsync({ messageId: id })}\n          >\n            Delete Message\n          </Button>\n        }\n      />\n    </Authorization>\n  );\n};\n\nDeleteMessage.propTypes = {\n  id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from 'components/Elements';\nimport { formatDate } from 'utils/format';\n\nimport { useMessages } from '../api/getMessages';\n\nimport { DeleteMessage } from './DeleteMessage';\n\nexport const MessagesList = () => {\n  const messagesQuery = useMessages();\n\n  if (messagesQuery.isLoading) {\n    return (\n      <div className=\"w-full h-48 flex justify-center items-center\">\n        <Spinner size=\"lg\" />\n      </div>\n    );\n  }\n\n  if (!messagesQuery.data) return null;\n\n  return (\n    <Table\n      data={messagesQuery.data}\n      columns={[\n        {\n          title: 'Subject',\n          field: 'subject',\n        },\n        {\n          title: 'Created At',\n          field: 'createdAt',\n          Cell({ entry: { createdAt } }) {\n            return <span>{formatDate(createdAt)}</span>;\n          },\n        },\n        {\n          title: '',\n          field: 'id',\n          Cell({ entry: { _id } }) {\n            return <Link to={`./${_id}`}>View</Link>;\n          },\n        },\n        {\n          title: '',\n          field: 'id',\n          Cell({ entry: { _id } }) {\n            return <DeleteMessage id={_id} />;\n          },\n        },\n      ]}\n    />\n  );\n};\n","import { ContentLayout } from 'components/Layout';\n\nimport { MessagesList } from '../components/MessagesList';\n\nexport const Messages = () => {\n  return (\n    <ContentLayout title=\"Messages\">\n      <div className=\"mt-4\">\n        <MessagesList />\n      </div>\n    </ContentLayout>\n  );\n};\n","import { Navigate, Route, Routes } from 'react-router-dom';\n\nimport { Message } from './Message';\nimport { Messages } from './Messages';\n\nexport const MessagesRoutes = () => {\n  return (\n    <Routes>\n      <Route path=\"\" element={<Messages />} />\n      <Route path=\":messageId\" element={<Message />} />\n      <Route path=\"*\" element={<Navigate to=\".\" />} />\n    </Routes>\n  );\n};\n","import * as React from \"react\";\n\nfunction TrashIcon(props, svgRef) {\n  return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    fill: \"none\",\n    viewBox: \"0 0 24 24\",\n    strokeWidth: 2,\n    stroke: \"currentColor\",\n    \"aria-hidden\": \"true\",\n    ref: svgRef\n  }, props), /*#__PURE__*/React.createElement(\"path\", {\n    strokeLinecap: \"round\",\n    strokeLinejoin: \"round\",\n    d: \"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\"\n  }));\n}\n\nconst ForwardRef = React.forwardRef(TrashIcon);\nexport default ForwardRef;"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","Mail","forwardRef","_ref","ref","_ref$color","color","_ref$size","size","rest","React","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","d","points","propTypes","PropTypes","displayName","useMessage","messageId","config","useQuery","queryKey","queryFn","axios","getMessage","Message","useParams","messageQuery","isLoading","className","data","Head","title","subject","formatDate","createdAt","value","content","href","email","getMessages","deleteMessage","DeleteMessage","id","deleteMessageMutation","addNotification","useNotificationStore","useMutation","onMutate","deletedMessage","queryClient","previousMessages","filter","post","onError","_","__","context","onSuccess","type","mutationFn","useDeleteMessage","allowedRoles","ROLES","icon","body","triggerButton","variant","TrashIcon","confirmButton","onClick","mutateAsync","MessagesList","messagesQuery","useMessages","columns","field","Cell","entry","_id","to","Messages","MessagesRoutes","path","element","ForwardRef","props","svgRef"],"sourceRoot":""}