Your IP : 3.144.119.149


Current Path : /home/ncdcgo/admin.ncdc.go.ug/static/js/
Upload File :
Current File : /home/ncdcgo/admin.ncdc.go.ug/static/js/88.7b6d52b1.chunk.js.map

{"version":3,"file":"static/js/88.7b6d52b1.chunk.js","mappings":"0IA+CA,IA3CoB,SAAC,GAAgB,IAAdA,EAAa,EAAbA,OACrB,OACE,gBACEC,UAAU,kEACV,aAAW,aAFb,UAIE,gBAAIA,UAAU,kDAAd,WACE,eAAIA,UAAU,yCAAd,UACE,UAAC,KAAD,CACEC,GAAG,OACHD,UAAU,kHAFZ,WAIE,gBACEA,UAAU,eACVE,KAAK,eACLC,QAAQ,YACRC,MAAM,6BAJR,UAME,iBAAMC,EAAE,uMAVZ,YAFJ,OAiBGN,QAjBH,IAiBGA,OAjBH,EAiBGA,EAAQO,KAAI,SAACC,EAAOC,GACnB,OACE,gBAAIR,UAAU,2BAAd,WACE,SAAC,IAAD,CAAcS,KAAM,GAAIT,UAAU,UAClC,SAAC,KAAD,CACEC,GAAIM,EAAMG,KACVV,UAAU,gIAFZ,SAIGO,EAAMI,SANmCH,EAUjD,QAIR,C,oLCpCYI,EAAiB,SAAC,GAA+B,IAA7BC,EAA4B,EAA5BA,cAAeC,EAAa,EAAbA,OAC9C,OAAOC,EAAAA,EAAAA,WAAS,kBACXD,GADU,IAEbE,SAAU,CAAC,cAAeH,GAC1BI,QAAS,kBARiB,SAAC,GAAuB,IAArBJ,EAAoB,EAApBA,cAC/B,OAAOK,EAAAA,EAAAA,IAAA,wBAA2BL,GACnC,CAMkBM,CAAe,CAAEN,cAAAA,GAAvB,IAEZ,E,kGCPYO,EAAa,SAAC,GAA6B,IAA3BC,EAA0B,EAA1BA,KAAMR,EAAoB,EAApBA,cACjC,OAAOK,EAAAA,EAAAA,KAAA,wBAA4BL,EAA5B,aAAsDQ,EAC9D,EAEDD,EAAWE,UAAY,CACrBT,cAAeU,IAAAA,OAAAA,WACfF,KAAME,IAAAA,MAAgB,CACpBC,UAAWD,IA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,IAGD,K,qCCLA,IAAM6K,EAAaC,EAAAA,YAZnB,SAAoBC,EAAOC,GACzB,OAAoBF,EAAAA,cAAoB,MAAOG,OAAOC,OAAO,CAC3DnL,MAAO,6BACPD,QAAS,YACTD,KAAM,eACN,cAAe,OACfwL,IAAKL,GACJD,GAAqBD,EAAAA,cAAoB,OAAQ,CAClD9K,EAAG,4HAEN,IAGD,K","sources":["components/Layout/Breadcrumbs.jsx","features/directorates/api/getDirectorate.js","features/directorates/api/addManager.js","features/directorates/api/getAllManagers.js","features/directorates/components/AddManager.jsx","features/directorates/api/addSubDirectorate.js","features/directorates/components/AddSubDirectorate.jsx","features/directorates/api/getManagers.js","features/directorates/api/getManager.js","features/directorates/api/deleteManager.js","features/directorates/components/DeleteManager.jsx","features/directorates/components/ManagersList.jsx","features/directorates/api/getSubDirectorates.js","features/directorates/api/deleteSubDirectorate.js","features/directorates/components/DeleteSubDirectorate.jsx","features/directorates/components/SubDirectoratesList.jsx","features/directorates/api/updateDirectorate.js","features/directorates/components/UpdateDirectorate.jsx","features/directorates/routes/Directorate.jsx","features/directorates/api/createDirectorate.js","features/directorates/components/CreateDirectorate.jsx","features/directorates/api/getDirectorates.js","features/directorates/api/deleteDirectorate.js","features/directorates/components/DeleteDirectorate.jsx","features/directorates/components/DirectoratesList.jsx","features/directorates/routes/Directorates.jsx","features/directorates/routes/index.jsx","../node_modules/@heroicons/react/outline/esm/PlusIcon.js","../node_modules/@heroicons/react/solid/esm/PencilIcon.js"],"sourcesContent":["import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { ChevronRight } from \"react-feather\";\n\nconst Breadcrumbs = ({ routes }) => {\n  return (\n    <nav\n      className=\"flex bg-white border border-gray-200 p-2 rounded-full px-4 mt-4\"\n      aria-label=\"Breadcrumb\"\n    >\n      <ol className=\"inline-flex items-center space-x-1 md:space-x-3\">\n        <li className=\"inline-flex items-center text-gray-800\">\n          <Link\n            to=\"/app\"\n            className=\"inline-flex items-center text-sm  text-gray-800 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n          >\n            <svg\n              className=\"w-4 h-4 mr-2\"\n              fill=\"currentColor\"\n              viewBox=\"0 0 20 20\"\n              xmlns=\"http://www.w3.org/2000/svg\"\n            >\n              <path d=\"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z\"></path>\n            </svg>\n            Home\n          </Link>\n        </li>\n        {routes?.map((route, index) => {\n          return (\n            <li className=\"inline-flex items-center\" key={index}>\n              <ChevronRight size={10} className=\"mr-4\" />\n              <Link\n                to={route.path}\n                className=\"inline-flex items-center text-sm font-extrabold text-gray-700 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n              >\n                {route.name}\n              </Link>\n            </li>\n          );\n        })}\n      </ol>\n    </nav>\n  );\n};\n\nBreadcrumbs.propTypes = {};\n\nexport default Breadcrumbs;\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getDirectorate = ({ directorateId }) => {\n  return axios.get(`/directorates/${directorateId}`);\n};\n\nexport const useDirectorate = ({ directorateId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"directorate\", directorateId],\n    queryFn: () => getDirectorate({ directorateId }),\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 addManager = ({ data, directorateId }) => {\n  return axios.post(`/directorates/${directorateId}/managers`, data);\n};\n\naddManager.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n  data: PropTypes.shape({\n    managerId: PropTypes.string.isRequired,\n  }).isRequired,\n};\n\nexport const useAddManager = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n  return useMutation({\n    onMutate: async (newManager) => {\n      await queryClient.cancelQueries(\"managers\");\n\n      const previousManagers = queryClient.getQueryData(\"managers\");\n\n      queryClient.setQueryData(\"managers\", [\n        ...(previousManagers || []),\n        newManager.data,\n      ]);\n\n      return { previousManagers };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousManagers) {\n        queryClient.setQueryData(\"managers\", context.previousManagers);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"managers\");\n      addNotification({\n        type: \"success\",\n        title: \"Manager has been added\",\n      });\n    },\n    ...config,\n    mutationFn: addManager,\n  });\n};\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getAllManagers = () => {\n  return axios.get(\"/managers\");\n};\n\nexport const useManagers = ({ config } = {}) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"allManagers\"],\n    queryFn: () => getAllManagers(),\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport { Form, FormDrawer, SelectField } from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PlusIcon } from \"@heroicons/react/outline\";\nimport * as z from \"zod\";\n\nimport { useAddManager } from \"../api/addManager\";\nimport { useManagers } from \"../api/getAllManagers\";\n\nexport const AddManager = ({ directorateId }) => {\n  const addManagerMutation = useAddManager();\n\n  const managersQuery = useManagers();\n\n  console.log(managersQuery.data);\n\n  if (addManagerMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <FormDrawer\n        size=\"sm\"\n        isDone={addManagerMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            size=\"sm\"\n            startIcon={<PlusIcon className=\"h-4 w-4\" />}\n          >\n            Add Manager\n          </Button>\n        }\n        title=\"Add Manager\"\n        submitButton={\n          <Button\n            form=\"add-manager\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={addManagerMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"add-manager\"\n          onSubmit={async (values) => {\n            await addManagerMutation.mutateAsync({\n              data: values,\n              directorateId,\n            });\n          }}\n        >\n          {({ register, formState, watch, setValue }) => (\n            <>\n              <SelectField\n                label=\"Manager\"\n                error={formState.errors[\"managerId\"]}\n                registration={register(\"managerId\")}\n                options={managersQuery.data?.map((manager) => ({\n                  label: manager.firstName + \" \" + manager.lastName,\n                  value: manager.id,\n                }))}\n              />\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\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 addSubDirectorate = ({ data, directorateId }) => {\n  return axios.post(`/directorates/${directorateId}/sub_directorates`, data);\n};\n\naddSubDirectorate.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n  data: PropTypes.shape({\n    title: PropTypes.string.isRequired,\n    desc: PropTypes.string.isRequired,\n  }).isRequired,\n};\n\nexport const useAddSubDirectorate = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n  return useMutation({\n    onMutate: async (newDirectorate) => {\n      await queryClient.cancelQueries(\"subDirectorates\");\n\n      const previousDirectorates = queryClient.getQueryData(\"subDirectorates\");\n\n      queryClient.setQueryData(\"subDirectorates\", [\n        ...(previousDirectorates || []),\n        newDirectorate.data,\n      ]);\n\n      return { previousDirectorates };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousDirectorates) {\n        queryClient.setQueryData(\n          \"subDirectorates\",\n          context.previousDirectorates\n        );\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"subDirectorates\");\n      addNotification({\n        type: \"success\",\n        title: \"Sub Directorate has been added\",\n      });\n    },\n    ...config,\n    mutationFn: addSubDirectorate,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport { Form, FormDrawer, InputField, TextAreaField } from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PlusIcon } from \"@heroicons/react/outline\";\nimport * as z from \"zod\";\n\nimport { useAddSubDirectorate } from \"../api/addSubDirectorate\";\n\nconst schema = z.object({\n  title: z.string().min(1, \"Required\"),\n  desc: z.string(),\n});\n\nexport const AddSubDirectorate = ({ directorateId }) => {\n  const addSubDirectorateMutation = useAddSubDirectorate();\n\n  if (addSubDirectorateMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <FormDrawer\n        size=\"sm\"\n        isDone={addSubDirectorateMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            size=\"sm\"\n            startIcon={<PlusIcon className=\"h-4 w-4\" />}\n          >\n            Add Sub Directorate\n          </Button>\n        }\n        title=\"Add Sub Directorate\"\n        submitButton={\n          <Button\n            form=\"create-directorate\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={addSubDirectorateMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"create-directorate\"\n          onSubmit={async (values) => {\n            await addSubDirectorateMutation.mutateAsync({\n              data: values,\n              directorateId,\n            });\n          }}\n          schema={schema}\n        >\n          {({ register, formState, watch, setValue }) => (\n            <>\n              <InputField\n                label=\"Title\"\n                error={formState.errors[\"title\"]}\n                registration={register(\"title\")}\n              />\n              <TextAreaField\n                label=\"Description\"\n                error={formState.errors[\"desc\"]}\n                editorContent={watch(\"desc\")}\n                setValue={setValue}\n                value=\"desc\"\n              />\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\n  );\n};\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getManagers = ({ directorateId }) => {\n  return axios.get(`/directorates/${directorateId}/managers`);\n};\n\nexport const useManagers = ({ directorateId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"managers\", directorateId],\n    queryFn: () => getManagers({ directorateId }),\n  });\n};\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getManager = ({ managerId }) => {\n  return axios.get(`/managers/${managerId}`);\n};\n\nexport const useManager = ({ managerId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"manager\", managerId],\n    queryFn: () => getManager({ managerId }),\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 deleteManager = ({ directorateId, managerId }) => {\n  return axios.delete(`/directorates/${directorateId}/managers/${managerId}`);\n};\n\ndeleteManager.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n  managerId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteManager = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (deletedManager) => {\n      await queryClient.cancelQueries(\"managers\");\n\n      const previousManagers = queryClient.getQueryData(\"managers\");\n\n      queryClient.setQueryData(\n        \"managers\",\n        previousManagers?.filter(\n          (directorate) => directorate.id !== deletedManager.directorateId\n        )\n      );\n\n      return { previousManagers };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousManagers) {\n        queryClient.setQueryData(\"managers\", context.previousManagers);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"managers\");\n      addNotification({\n        type: \"success\",\n        title: \"Manager Deleted\",\n      });\n    },\n    ...config,\n    mutationFn: deleteManager,\n  });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeleteManager } from \"../api/deleteManager\";\n\nexport const DeleteManager = ({ directorateId, managerId }) => {\n  const deleteManagerMutation = useDeleteManager();\n\n  if (deleteManagerMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <ConfirmationDialog\n        icon=\"danger\"\n        title=\"Delete Manager\"\n        body=\"Are you sure you want to delete this manager from directorate?\"\n        triggerButton={<button>Remove</button>}\n        confirmButton={\n          <Button\n            isLoading={deleteManagerMutation.isLoading}\n            type=\"button\"\n            className=\"bg-red-600\"\n            onClick={async () =>\n              await deleteManagerMutation.mutateAsync({\n                directorateId,\n                managerId,\n              })\n            }\n          >\n            Delete Manager\n          </Button>\n        }\n      />\n    </Authorization>\n  );\n};\n\nDeleteManager.propTypes = {\n  id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { useManagers } from \"../api/getManagers\";\nimport { useManager } from \"../api/getManager\";\n\nimport { DeleteManager } from \"./DeleteManager\";\n\nexport const ManagersList = ({ directorateId }) => {\n  const managersQuery = useManagers({ directorateId });\n\n  if (managersQuery.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 (!managersQuery.data) return null;\n\n  return (\n    <Table\n      data={managersQuery.data}\n      columns={[\n        {\n          title: \"Managers\",\n          field: \"_id\",\n          Cell({ entry: { _id } }) {\n            const managerQuery = useManager({ managerId: _id });\n\n            if (managerQuery.isLoading)\n              return (\n                <div className=\"flex justify-center items-center\">\n                  <Spinner size=\"xs\" />\n                </div>\n              );\n            return (\n              <span className=\"uppercase\">\n                {managerQuery.data.firstName + \"\" + managerQuery.data.lastName}\n              </span>\n            );\n          },\n        },\n        {\n          title: \"\",\n          field: \"id\",\n          Cell({ entry: { _id } }) {\n            return (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tto={`./${_id}`}\n\t\t\t\t\t\t\t\t\tclassName=\"mr-2 text-black dark:text-gray-200 hover:text-green-400\">\n\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t</Link>{\" \"}\n\t\t\t\t\t\t\t\t<DeleteManager directorateId={directorateId} managerId={_id} />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n          },\n        },\n      ]}\n    />\n  );\n};\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getSubDirectorates = ({ directorateId }) => {\n  return axios.get(`/directorates/${directorateId}/sub_directorates`);\n};\n\nexport const useSubDirectorates = ({ directorateId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"subDirectorates\", directorateId],\n    queryFn: () => getSubDirectorates({ directorateId }),\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 deleteSubDirectorate = ({ directorateId, subDirectoratesId }) => {\n  return axios.delete(\n    `/directorates/${directorateId}/sub_directorates/${subDirectoratesId}`\n  );\n};\n\ndeleteSubDirectorate.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteSubDirectorate = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (deletedDirectorate) => {\n      await queryClient.cancelQueries(\"subDirectorates\");\n\n      const previousSubDirectorates =\n        queryClient.getQueryData(\"subDirectorates\");\n\n      queryClient.setQueryData(\n        \"subDirectorates\",\n        previousSubDirectorates?.filter(\n          (directorate) => directorate.id !== deletedDirectorate.directoratesId\n        )\n      );\n\n      return { previousSubDirectorates };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousSubDirectorates) {\n        queryClient.setQueryData(\n          \"subDirectorates\",\n          context.previousSubDirectorates\n        );\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"subDirectorates\");\n      addNotification({\n        type: \"success\",\n        title: \"Sub-Directorate Deleted\",\n      });\n    },\n    ...config,\n    mutationFn: deleteSubDirectorate,\n  });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeleteSubDirectorate } from \"../api/deleteSubDirectorate\";\n\nexport const DeleteSubDirectorate = ({ directorateId, subDirectoratesId }) => {\n  const deleteSubDirectorateMutation = useDeleteSubDirectorate();\n\n  if (deleteSubDirectorateMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <ConfirmationDialog\n        icon=\"danger\"\n        title=\"Delete Sub Directorate\"\n        body=\"Are you sure you want to delete this sub directorate?\"\n        triggerButton={<button>Remove</button>}\n        confirmButton={\n          <Button\n            isLoading={deleteSubDirectorateMutation.isLoading}\n            type=\"button\"\n            className=\"bg-red-600\"\n            onClick={async () =>\n              await deleteSubDirectorateMutation.mutateAsync({\n                directorateId,\n                subDirectoratesId,\n              })\n            }\n          >\n            Delete Sub Directorate\n          </Button>\n        }\n      />\n    </Authorization>\n  );\n};\n\nDeleteSubDirectorate.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n  subDirectoratesId: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { useSubDirectorates } from \"../api/getSubDirectorates\";\n\nimport { DeleteSubDirectorate } from \"./DeleteSubDirectorate\";\n\nexport const SubDirectoratesList = ({ directorateId }) => {\n  const subDirectoratesQuery = useSubDirectorates({ directorateId });\n\n  if (subDirectoratesQuery.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 (!subDirectoratesQuery.data) return null;\n\n  return (\n    <Table\n      data={subDirectoratesQuery.data}\n      columns={[\n        {\n          title: \"Sub Directorates\",\n          field: \"firstName\",\n          Cell({ entry: { firstName, lastName } }) {\n            return (\n              <span className=\"uppercase\">{firstName + \"\" + lastName}</span>\n            );\n          },\n        },\n        {\n          title: \"\",\n          field: \"id\",\n          Cell({ entry: { _id } }) {\n            return (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tto={`./${_id}`}\n\t\t\t\t\t\t\t\t\tclassName=\"mr-2 text-black dark:text-gray-200 hover:text-green-400\">\n\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t</Link>{\" \"}\n\t\t\t\t\t\t\t\t<DeleteSubDirectorate\n\t\t\t\t\t\t\t\t\tdirectorateId={directorateId}\n\t\t\t\t\t\t\t\t\tsubDirectoratesId={_id}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n          },\n        },\n      ]}\n    />\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 updateDirectorate = ({ data, directorateId }) => {\n  return axios.patch(`/directorates/${directorateId}`, data);\n};\n\nupdateDirectorate.propTypes = {\n  data: PropTypes.shape({\n    title: PropTypes.string.isRequired,\n    desc: PropTypes.string.isRequired,\n  }).isRequired,\n  directorateId: PropTypes.string.isRequired,\n};\n\nexport const useUpdateDirectorate = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (updatingDirectorate) => {\n      await queryClient.cancelQueries([\n        \"directorate\",\n        updatingDirectorate?.directorateId,\n      ]);\n\n      const previousDirectorate =\n        queryClient.getQueryData[\n          (\"directorate\", updatingDirectorate?.directorateId)\n        ];\n\n      queryClient.setQueryData(\n        [\"directorate\", updatingDirectorate?.directorateId],\n        {\n          ...previousDirectorate,\n          ...updatingDirectorate.data,\n          id: updatingDirectorate.directorateId,\n        }\n      );\n\n      return { previousDirectorate };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousDirectorate) {\n        queryClient.setQueryData(\n          [\"directorate\", context.previousDirectorate.id],\n          context.previousDirectorate\n        );\n      }\n    },\n    onSuccess: (data) => {\n      queryClient.refetchQueries([\"directorate\", data.id]);\n      addNotification({\n        type: \"success\",\n        title: \"Directorate Updated\",\n      });\n    },\n    ...config,\n    mutationFn: updateDirectorate,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n  Form,\n  FormDrawer,\n  InputField,\n  TextAreaField,\n  UploadField,\n} from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PencilIcon } from \"@heroicons/react/solid\";\nimport PropTypes from \"prop-types\";\nimport { useState } from \"react\";\nimport * as z from \"zod\";\n\nimport { useDirectorate } from \"../api/getDirectorate\";\nimport { useUpdateDirectorate } from \"../api/updateDirectorate\";\n\nconst schema = z.object({\n  title: z.string().min(1, \"Required\"),\n  desc: z.string().min(1, \"Required\"),\n});\n\nexport const UpdateDirectorate = ({ directorateId }) => {\n  const [image, setImage] = useState(null);\n  const [preview, setPreview] = useState(null);\n  const [editImage, setEditImage] = useState(false);\n  const directorateQuery = useDirectorate({ directorateId });\n  const updateDirectorateMutation = useUpdateDirectorate();\n\n  if (updateDirectorateMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <FormDrawer\n        size=\"sm\"\n        isDone={updateDirectorateMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            startIcon={<PencilIcon className=\"h-4 w-4\" />}\n            size=\"sm\"\n          >\n            Update\n          </Button>\n        }\n        title=\"Update Directorate\"\n        submitButton={\n          <Button\n            form=\"update-directorate\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={updateDirectorateMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"update-directorate\"\n          encType=\"multipart/form-data\"\n          onSubmit={async (values) => {\n            const { title, desc } = values;\n            const bodyFormData = new FormData();\n            bodyFormData.append(\"pageHeaderBgImage\", image);\n            bodyFormData.append(\"title\", title);\n            bodyFormData.append(\"desc\", desc);\n            await updateDirectorateMutation.mutateAsync({\n              data: bodyFormData,\n              directorateId,\n            });\n            setPreview(null);\n          }}\n          options={{\n            defaultValues: {\n              title: directorateQuery.data?.title,\n              desc: directorateQuery.data?.desc,\n              pageHeaderBgImage: directorateQuery.data?.pageHeaderBgImage,\n            },\n          }}\n          schema={schema}\n        >\n          {({ register, formState, watch, setValue }) => (\n            <>\n              <InputField\n                label=\"Title\"\n                error={formState.errors[\"title\"]}\n                registration={register(\"title\")}\n              />\n              <TextAreaField\n                label=\"Content\"\n                error={formState.errors[\"desc\"]}\n                editorContent={watch(\"desc\")}\n                setValue={setValue}\n                value=\"desc\"\n              />\n              {/* button to set edit image */}\n              <div className=\"flex justify-between items-center\">\n                {editImage ? (\n                  <a\n                    href=\"#\"\n                    className=\"bg-green-400 text-gray-800 font-bold p-2 rounded text-sm\"\n                    onClick={(e) => {\n                      e.preventDefault();\n                      setEditImage(false);\n                    }}\n                  >\n                    Close\n                  </a>\n                ) : (\n                  <a\n                    href=\"#\"\n                    className=\"bg-green-400 text-gray-800 font-bold p-2 rounded text-sm\"\n                    onClick={(e) => {\n                      e.preventDefault();\n                      setEditImage(true);\n                    }}\n                  >\n                    Update Image\n                  </a>\n                )}\n              </div>\n              {editImage && (\n                <UploadField\n                  title=\"Update Cover Photo\"\n                  subTitle=\"This will also be used as the thumbnail in feeds\"\n                  error={formState.errors[\"image\"]}\n                  x={1024}\n                  y={768}\n                  onChange={(e) => {\n                    setImage(e.target.files[0]);\n                    setPreview(URL.createObjectURL(e.target.files[0]));\n                  }}\n                  preview={preview}\n                />\n              )}\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\n  );\n};\n\nUpdateDirectorate.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n};\n","import { Spinner, MDPreview } from \"components/Elements\";\nimport { Head } from \"components/Head\";\nimport { ContentLayout } from \"components/Layout\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\nimport { UPLOADS_API_URL } from \"config\";\nimport { LazyLoadImage } from \"react-lazy-load-image-component\";\nimport { useParams } from \"react-router-dom\";\n\nimport { useDirectorate } from \"../api/getDirectorate\";\nimport { AddManager } from \"../components/AddManager\";\nimport { AddSubDirectorate } from \"../components/AddSubDirectorate\";\nimport { ManagersList } from \"../components/ManagersList\";\nimport { SubDirectoratesList } from \"../components/SubDirectoratesList\";\nimport { UpdateDirectorate } from \"../components/UpdateDirectorate\";\n\nexport const Directorate = () => {\n  const { directorateId } = useParams();\n  const directorateQuery = useDirectorate({ directorateId });\n\n  if (directorateQuery.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 (!directorateQuery.data) return null;\n\n  const routes = [\n    {\n      name: \"Directorates\",\n      path: \"/app/directorates\",\n    },\n    {\n      name: directorateQuery.data.title,\n      path: \".\",\n    },\n  ];\n\n  return (\n    <>\n      <Head title={directorateQuery.data.title} />\n      <ContentLayout\n        title={directorateQuery.data.title}\n        button={<UpdateDirectorate directorateId={directorateId} />}\n      >\n        <Breadcrumbs routes={routes} />\n        <div className=\"mt-6 flex flex-col space-y-16\">\n          <div>\n            <div className=\"bg-white dark:bg-gray-700 shadow overflow-hidden sm:rounded-lg\">\n              <LazyLoadImage\n                src={`${UPLOADS_API_URL}/${directorateQuery.data.pageHeaderBgImage}`}\n                alt=\"page header for directorate\"\n                className=\"h-48 w-full object-cover\"\n              />\n              <div className=\"px-4 py-5 sm:px-6\">\n                <div className=\"mt-1 max-w-2xl text-sm text-gray-400 flex flex-wrap\">\n                  <MDPreview value={directorateQuery.data.desc} />\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n        <div className=\"mt-6\">\n          <div className=\"flex justify-end\">\n            <AddSubDirectorate directorateId={directorateQuery.data.id} />\n          </div>\n          <div className=\"bg-white mt-4 dark:bg-gray-700 shadow overflow-hidden sm:rounded-lg\">\n            <SubDirectoratesList directorateId={directorateQuery.data.id} />\n          </div>\n        </div>\n        <div className=\"mt-6\">\n          <div className=\"flex justify-end\">\n            <AddManager directorateId={directorateQuery.data.id} />\n          </div>\n          <div className=\"bg-white mt-4 dark:bg-gray-700 shadow overflow-hidden sm:rounded-lg\">\n            <ManagersList directorateId={directorateQuery.data.id} />\n          </div>\n        </div>\n      </ContentLayout>\n    </>\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 createDirectorate = ({ data }) => {\n  return axios.post(`/directorates`, data);\n};\n\ncreateDirectorate.propTypes = {\n  data: PropTypes.shape({\n    title: PropTypes.string.isRequired,\n    desc: PropTypes.string.isRequired,\n  }).isRequired,\n};\n\nexport const useCreateDirectorate = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n  return useMutation({\n    onMutate: async (newDirectorate) => {\n      await queryClient.cancelQueries(\"directorates\");\n\n      const previousDirectorates = queryClient.getQueryData(\"directorates\");\n\n      queryClient.setQueryData(\"directorates\", [\n        ...(previousDirectorates || []),\n        newDirectorate.data,\n      ]);\n\n      return { previousDirectorates };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousDirectorates) {\n        queryClient.setQueryData(\"directorates\", context.previousDirectorates);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"directorates\");\n      addNotification({\n        type: \"success\",\n        title: \"Directorate has been added\",\n      });\n    },\n    ...config,\n    mutationFn: createDirectorate,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport { Form, FormDrawer, InputField, TextAreaField } from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PlusIcon } from \"@heroicons/react/outline\";\nimport * as z from \"zod\";\n\nimport { useCreateDirectorate } from \"../api/createDirectorate\";\n\nconst schema = z.object({\n  title: z.string().min(1, \"Required\"),\n  desc: z.string(),\n});\n\nexport const CreateDirectorate = () => {\n  const createDirectorateMutation = useCreateDirectorate();\n\n  if (createDirectorateMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <FormDrawer\n        size=\"sm\"\n        isDone={createDirectorateMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            size=\"sm\"\n            startIcon={<PlusIcon className=\"h-4 w-4\" />}\n          >\n            Create Directorate\n          </Button>\n        }\n        title=\"Create Directorate\"\n        submitButton={\n          <Button\n            form=\"create-directorate\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={createDirectorateMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"create-directorate\"\n          onSubmit={async (values) => {\n            await createDirectorateMutation.mutateAsync({ data: values });\n          }}\n          schema={schema}\n        >\n          {({ register, formState, watch, setValue }) => (\n            <>\n              <InputField\n                label=\"Title\"\n                error={formState.errors[\"title\"]}\n                registration={register(\"title\")}\n              />\n              <TextAreaField\n                label=\"Description\"\n                error={formState.errors[\"desc\"]}\n                editorContent={watch(\"desc\")}\n                setValue={setValue}\n                value=\"desc\"\n              />\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\n  );\n};\n","import { axios } from \"lib/axios\";\nimport { useQuery } from \"react-query\";\n\nexport const getDirectorates = () => {\n  return axios.get(\"/directorates\");\n};\n\nexport const useDirectorates = ({ config } = {}) => {\n  return useQuery({\n    ...config,\n    queryKey: [\"directorates\"],\n    queryFn: () => getDirectorates(),\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 deleteDirectorate = ({ directorateId }) => {\n  return axios.delete(`/directorates/${directorateId}`);\n};\n\ndeleteDirectorate.propTypes = {\n  directorateId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteDirectorate = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (deletedDirectorate) => {\n      await queryClient.cancelQueries(\"directorates\");\n\n      const previousDirectorates = queryClient.getQueryData(\"directorates\");\n\n      queryClient.setQueryData(\n        \"directorates\",\n        previousDirectorates?.filter(\n          (directorate) => directorate.id !== deletedDirectorate.directorateId\n        )\n      );\n\n      return { previousDirectorates };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousDirectorates) {\n        queryClient.setQueryData(\"directorates\", context.previousDirectorates);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries(\"directorates\");\n      addNotification({\n        type: \"success\",\n        title: \"Directorate Deleted\",\n      });\n    },\n    ...config,\n    mutationFn: deleteDirectorate,\n  });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeleteDirectorate } from \"../api/deleteDirectorate\";\n\nexport const DeleteDirectorate = ({ id }) => {\n  const deleteDirectorateMutation = useDeleteDirectorate();\n\n  if (deleteDirectorateMutation.isLoading) {\n    return (\n      <div\n        id=\"loading-screen\"\n        className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n      >\n        <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n          <Spinner size=\"sm\" />\n        </span>\n      </div>\n    );\n  }\n\n  return (\n    <Authorization allowedRoles={[ROLES.ADMIN]}>\n      <ConfirmationDialog\n        icon=\"danger\"\n        title=\"Delete Directorate\"\n        body=\"Are you sure you want to delete this directorate?\"\n        triggerButton={<button>Remove</button>}\n        confirmButton={\n          <Button\n            isLoading={deleteDirectorateMutation.isLoading}\n            type=\"button\"\n            className=\"bg-red-600\"\n            onClick={async () =>\n              await deleteDirectorateMutation.mutateAsync({ directorateId: id })\n            }\n          >\n            Delete Directorate\n          </Button>\n        }\n      />\n    </Authorization>\n  );\n};\n\nDeleteDirectorate.propTypes = {\n  id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { useDirectorates } from \"../api/getDirectorates\";\n\nimport { DeleteDirectorate } from \"./DeleteDirectorate\";\n\nexport const DirectoratesList = () => {\n  const directoratesQuery = useDirectorates();\n\n  if (directoratesQuery.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 (!directoratesQuery.data) return null;\n\n  return (\n    <Table\n      data={directoratesQuery.data}\n      columns={[\n        {\n          title: \"Directorates\",\n          field: \"title\",\n          Cell({ entry: { title } }) {\n            return <span className=\"uppercase\">{title}</span>;\n          },\n        },\n        {\n          title: \"\",\n          field: \"id\",\n          Cell({ entry: { _id } }) {\n            return (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tto={`./${_id}`}\n\t\t\t\t\t\t\t\t\tclassName=\"mr-2 text-black dark:text-gray-200 hover:text-green-400\">\n\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t</Link>{\" \"}\n\t\t\t\t\t\t\t\t<DeleteDirectorate id={_id} />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n          },\n        },\n      ]}\n    />\n  );\n};\n","import { ContentLayout } from \"components/Layout\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nimport { CreateDirectorate } from \"../components/CreateDirectorate\";\nimport { DirectoratesList } from \"../components/DirectoratesList\";\n\nexport const Directorates = () => {\n  const routes = [\n    {\n      name: \"Directorates\",\n      path: \".\",\n    },\n  ];\n  return (\n    <ContentLayout title=\"Directorates\" button={<CreateDirectorate />}>\n      <Breadcrumbs routes={routes} />\n      <div className=\"mt-4\">\n        <DirectoratesList />\n      </div>\n    </ContentLayout>\n  );\n};\n","import { Navigate, Route, Routes } from \"react-router-dom\";\nimport { Directorate } from \"./Directorate\";\nimport { Directorates } from \"./Directorates\";\n\nexport const DirectorateRoutes = () => {\n  return (\n    <Routes>\n      <Route path=\"\" element={<Directorates />} />\n      <Route path=\":directorateId\" element={<Directorate />} />\n      <Route path=\"*\" element={<Navigate to=\".\" />} />\n    </Routes>\n  );\n};\n","import * as React from \"react\";\n\nfunction PlusIcon(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: \"M12 4v16m8-8H4\"\n  }));\n}\n\nconst ForwardRef = React.forwardRef(PlusIcon);\nexport default ForwardRef;","import * as React from \"react\";\n\nfunction PencilIcon(props, svgRef) {\n  return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n    xmlns: \"http://www.w3.org/2000/svg\",\n    viewBox: \"0 0 20 20\",\n    fill: \"currentColor\",\n    \"aria-hidden\": \"true\",\n    ref: svgRef\n  }, props), /*#__PURE__*/React.createElement(\"path\", {\n    d: \"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z\"\n  }));\n}\n\nconst ForwardRef = React.forwardRef(PencilIcon);\nexport default ForwardRef;"],"names":["routes","className","to","fill","viewBox","xmlns","d","map","route","index","size","path","name","useDirectorate","directorateId","config","useQuery","queryKey","queryFn","axios","getDirectorate","addManager","data","propTypes","PropTypes","managerId","isRequired","getAllManagers","AddManager","addManagerMutation","addNotification","useNotificationStore","useMutation","onMutate","newManager","queryClient","previousManagers","onError","_","__","context","onSuccess","type","title","mutationFn","useAddManager","managersQuery","useManagers","console","log","isLoading","id","allowedRoles","ROLES","Form","isDone","isSuccess","triggerButton","variant","startIcon","PlusIcon","submitButton","form","onSubmit","values","mutateAsync","register","formState","watch","setValue","label","error","errors","registration","options","manager","firstName","lastName","value","addSubDirectorate","desc","schema","z","min","AddSubDirectorate","addSubDirectorateMutation","newDirectorate","previousDirectorates","useAddSubDirectorate","editorContent","getManagers","useManager","getManager","deleteManager","DeleteManager","deleteManagerMutation","deletedManager","filter","directorate","useDeleteManager","icon","body","confirmButton","onClick","ManagersList","columns","field","Cell","_id","entry","managerQuery","useSubDirectorates","getSubDirectorates","deleteSubDirectorate","subDirectoratesId","DeleteSubDirectorate","deleteSubDirectorateMutation","deletedDirectorate","previousSubDirectorates","directoratesId","useDeleteSubDirectorate","SubDirectoratesList","subDirectoratesQuery","updateDirectorate","UpdateDirectorate","useState","image","setImage","preview","setPreview","editImage","setEditImage","directorateQuery","updateDirectorateMutation","updatingDirectorate","previousDirectorate","useUpdateDirectorate","PencilIcon","encType","bodyFormData","FormData","append","defaultValues","pageHeaderBgImage","href","e","preventDefault","subTitle","x","y","onChange","target","files","URL","createObjectURL","Directorate","useParams","Head","button","Breadcrumbs","LazyLoadImage","src","UPLOADS_API_URL","alt","createDirectorate","CreateDirectorate","createDirectorateMutation","useCreateDirectorate","getDirectorates","deleteDirectorate","DeleteDirectorate","deleteDirectorateMutation","useDeleteDirectorate","DirectoratesList","directoratesQuery","useDirectorates","Directorates","DirectorateRoutes","element","ForwardRef","React","props","svgRef","Object","assign","strokeWidth","stroke","ref","strokeLinecap","strokeLinejoin"],"sourceRoot":""}