ethyca-fides 2.70.5rc0__py2.py3-none-any.whl → 2.71.0rc0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ethyca-fides might be problematic. Click here for more details.
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/METADATA +5 -3
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/RECORD +236 -214
- fides/_version.py +3 -3
- fides/api/alembic/migrations/versions/0eef0016cf06_adding_oauth2_config_for_.py +69 -0
- fides/api/alembic/migrations/versions/9e0dcbf67b9f_add_digest_config.py +84 -0
- fides/api/alembic/migrations/versions/a8e0c016afd_add_classification_benchmark_table.py +126 -0
- fides/api/alembic/migrations/versions/cd8649be3a2b_add_classifications_and_user_assigned_.py +74 -0
- fides/api/alembic/migrations/versions/e2cda8d6abc3_add_dismissed_in_activity_view_to_.py +29 -0
- fides/api/api/v1/endpoints/connection_endpoints.py +153 -2
- fides/api/api/v1/endpoints/privacy_request_endpoints.py +18 -2
- fides/api/db/base.py +2 -0
- fides/api/db/crud.py +30 -2
- fides/api/db/database.py +1 -1
- fides/api/db/safe_crud.py +377 -0
- fides/api/migrations/post_upgrade_index_creation.py +10 -0
- fides/api/models/conditional_dependency/__init__.py +0 -0
- fides/api/models/conditional_dependency/conditional_dependency_base.py +82 -0
- fides/api/models/connection_oauth_credentials.py +57 -0
- fides/api/models/connectionconfig.py +7 -0
- fides/api/models/detection_discovery/__init__.py +2 -0
- fides/api/models/detection_discovery/classification_benchmark.py +140 -0
- fides/api/models/detection_discovery/core.py +11 -0
- fides/api/models/detection_discovery/monitor_task.py +2 -1
- fides/api/models/digest/__init__.py +10 -0
- fides/api/models/digest/conditional_dependencies.py +9 -0
- fides/api/models/digest/digest_config.py +76 -0
- fides/api/models/manual_task/conditional_dependency.py +21 -77
- fides/api/models/policy.py +24 -0
- fides/api/models/privacy_notice.py +1 -1
- fides/api/models/privacy_request/privacy_request.py +68 -0
- fides/api/models/privacy_request/webhook.py +3 -1
- fides/api/oauth/roles.py +2 -0
- fides/api/schemas/connection_configuration/connection_oauth_config.py +42 -0
- fides/api/schemas/privacy_request.py +5 -2
- fides/api/schemas/user.py +2 -2
- fides/api/service/connectors/http_connector.py +48 -12
- fides/api/service/privacy_request/dsr_package/dsr_report_builder.py +2 -2
- fides/api/service/storage/streaming/smart_open_streaming_storage.py +36 -28
- fides/api/service/storage/util.py +11 -102
- fides/api/task/conditional_dependencies/sql_schemas.py +301 -0
- fides/api/task/conditional_dependencies/sql_translator.py +757 -0
- fides/api/task/manual/manual_task_utils.py +5 -6
- fides/common/api/v1/urn_registry.py +1 -0
- fides/ui-build/static/admin/404.html +1 -1
- fides/ui-build/static/admin/_next/static/chunks/155-047c3806cc41295e.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/2962-e92d525bf570a9a3.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/3550-83cb70e80cbe41ba.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{3700-dc3f05d21e2a5ff6.js → 3700-08e0703b1ef770da.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{504-afd3588f1908ac33.js → 504-88caa30c03374e9b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/5643-de406832755d9515.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/6419-9b3a86af57c86791.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/7218-e2983b96b95e33b4.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{7476-0b6e114658b15eaa.js → 7476-d055aa931da47ac0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/7725-f2a7be705b75dcc3.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/{_app-a4e3c999afb28ee7.js → _app-a77584f9ad3334af.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{manual-939253f8daf349b2.js → manual-75e99306393938e8.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/[projectUrn]/{[resourceUrn]-293c1f2d9aefb447.js → [resourceUrn]-2fa4b3a58f75f81d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/resources/{[resourceUrn]-18501152fa1e4f40.js → [resourceUrn]-5b31e3d7727b917a.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-2e1e2b7808d3b21f.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/{[monitorId]-e8ec4080d9a3e22f.js → [monitorId]-0d512528b498d75c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/discovery/{[resourceUrn]-1901c26cdde820da.js → [resourceUrn]-5525cf287d4ab493.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{discovery-0cea22af5929c81f.js → discovery-ed4723e1b67d890e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{datamap-619f27c745188adb.js → datamap-15616bea02397ef4.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{[id]-cc149157d290a94d.js → [id]-816e02b6cbe4a684.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{new-4c9fb068a5561658.js → new-b6838162200141b3.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations/{[id]-8b13bb5f7bee61c6.js → [id]-01e025f878ba806c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{integrations-6f109ef64304ef59.js → integrations-14120a529d7dac27.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/{[id]-8566e3b7b2a632fa.js → [id]-82ebad17eb17c149.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{privacy-requests-2c82cf73d20416f2.js → privacy-requests-7af00f72cf694077.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/reporting/{datamap-5b423687e227ad4d.js → datamap-f7753e9effae3816.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields/[id]-a653c05606c53063.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields/new-90848e4a15057af1.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields-5edfec10a945ca43.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/messaging-providers/{[key]-b0d93bf478bf63ee.js → [key]-77239269acc2d31a.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/messaging-providers/{new-084f9756b9987285.js → new-8bf1821722b082e9.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/{[id]-1895c6a13b543436.js → [id]-547c6ef0ad52b85d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{systems-d266cc062b56beb2.js → systems-7238e025208078ec.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-a8cfa7de4948b374.js +1 -0
- fides/ui-build/static/admin/_next/static/css/64fac6fb884435c2.css +1 -0
- fides/ui-build/static/admin/_next/static/fY61mOXDNbYtO-3MNEDrx/_buildManifest.js +1 -0
- fides/ui-build/static/admin/add-systems/manual.html +1 -1
- fides/ui-build/static/admin/add-systems/multiple.html +1 -1
- fides/ui-build/static/admin/add-systems.html +1 -1
- fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
- fides/ui-build/static/admin/consent/configure.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
- fides/ui-build/static/admin/consent/properties.html +1 -1
- fides/ui-build/static/admin/consent/reporting.html +1 -1
- fides/ui-build/static/admin/consent.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
- fides/ui-build/static/admin/data-catalog.html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
- fides/ui-build/static/admin/data-discovery/activity.html +1 -1
- fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/detection.html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
- fides/ui-build/static/admin/datamap.html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
- fides/ui-build/static/admin/dataset/new.html +1 -1
- fides/ui-build/static/admin/dataset.html +1 -1
- fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
- fides/ui-build/static/admin/datastore-connection/new.html +1 -1
- fides/ui-build/static/admin/datastore-connection.html +1 -1
- fides/ui-build/static/admin/index.html +1 -1
- fides/ui-build/static/admin/integrations/[id].html +1 -1
- fides/ui-build/static/admin/integrations.html +1 -1
- fides/ui-build/static/admin/login/[provider].html +1 -1
- fides/ui-build/static/admin/login.html +1 -1
- fides/ui-build/static/admin/messaging/[id].html +1 -1
- fides/ui-build/static/admin/messaging/add-template.html +1 -1
- fides/ui-build/static/admin/messaging.html +1 -1
- fides/ui-build/static/admin/poc/ant-components.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/AntForm.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikAntFormItem.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikControlled.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikField.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikSpreadField.html +1 -1
- fides/ui-build/static/admin/poc/forms.html +1 -1
- fides/ui-build/static/admin/poc/table-migration.html +1 -1
- fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
- fides/ui-build/static/admin/privacy-requests.html +1 -1
- fides/ui-build/static/admin/properties/[id].html +1 -1
- fides/ui-build/static/admin/properties/add-property.html +1 -1
- fides/ui-build/static/admin/properties.html +1 -1
- fides/ui-build/static/admin/reporting/datamap.html +1 -1
- fides/ui-build/static/admin/settings/about/alpha.html +1 -1
- fides/ui-build/static/admin/settings/about.html +1 -1
- fides/ui-build/static/admin/settings/consent/[configuration_id]/[purpose_id].html +1 -1
- fides/ui-build/static/admin/settings/consent.html +1 -1
- fides/ui-build/static/admin/settings/custom-fields/[id].html +1 -0
- fides/ui-build/static/admin/settings/custom-fields/new.html +1 -0
- fides/ui-build/static/admin/settings/custom-fields.html +1 -1
- fides/ui-build/static/admin/settings/domain-records.html +1 -1
- fides/ui-build/static/admin/settings/domains.html +1 -1
- fides/ui-build/static/admin/settings/email-templates.html +1 -1
- fides/ui-build/static/admin/settings/locations.html +1 -1
- fides/ui-build/static/admin/settings/messaging-providers/[key].html +1 -1
- fides/ui-build/static/admin/settings/messaging-providers/new.html +1 -1
- fides/ui-build/static/admin/settings/messaging-providers.html +1 -1
- fides/ui-build/static/admin/settings/organization.html +1 -1
- fides/ui-build/static/admin/settings/privacy-requests.html +1 -1
- fides/ui-build/static/admin/settings/regulations.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id].html +1 -1
- fides/ui-build/static/admin/systems.html +1 -1
- fides/ui-build/static/admin/taxonomy.html +1 -1
- fides/ui-build/static/admin/user-management/new.html +1 -1
- fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
- fides/ui-build/static/admin/user-management.html +1 -1
- fides/ui-build/static/admin/_next/static/PZe9jkBWNOGDEEZ4Y_Rvq/_buildManifest.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/155-88303b05c6e115a5.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3550-d04125c828d591a1.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6419-d0c00d661b01f8fa.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/7725-dd6736855807936a.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/9951-651d521d9a02b6df.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-b0e3f1886de28d66.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields-26ce8fc493993765.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-07848c232d960f6a.js +0 -1
- fides/ui-build/static/admin/_next/static/css/1866822702989bb3.css +0 -1
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/WHEEL +0 -0
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/entry_points.txt +0 -0
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/licenses/LICENSE +0 -0
- {ethyca_fides-2.70.5rc0.dist-info → ethyca_fides-2.71.0rc0.dist-info}/top_level.txt +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{1115-7888473b3dc28cda.js → 1115-90baef2a89f361ad.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{1817-ee9e29a6b8c4af50.js → 1817-ca6473f31a67a804.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{2040-ab6212a3074f34f9.js → 2040-fdecc41a18e40bdc.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3585-451504ea5ed7a1ea.js → 3585-efd5d41f08e180c4.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3696-c25dc8d1b0e1aee1.js → 3696-90c8b336bbc46782.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3872-3514b712afd683c0.js → 3872-04d3afbfa41a7782.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3923-a551756b413367ea.js → 3923-98bea73b618292aa.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{4608-b22905c65f61db15.js → 4608-a9941d0c236ebca1.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{502-a40d39e615f7b664.js → 502-d3ecae97b67befbd.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{5185-33f50cf9ae17b42e.js → 5185-51eaa78e3ed6bfb7.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{5574-b8c4cba5a6938c00.js → 5574-c31ea831371610d5.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{5783-8de76df87af55e98.js → 5783-d119cb132abd8a91.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{6084-2cd165179c428a6f.js → 6084-d0943ee628bf4388.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{6416-264aadc6b336ee0a.js → 6416-0ccadfefcdad00cc.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{6882-447f15e87b8c48a5.js → 6882-10296485ec326e6b.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{6954-599f2de2c902e9b2.js → 6954-4b24e1731c1cc3b3.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{7158-835ba42fd881d8dd.js → 7158-04745cc8d684b2e7.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{7630-e7ea13be69c118a1.js → 7630-d0d3a0fe3f95e971.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{796-e07ac2c543f569e3.js → 796-02086581996a0548.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{8002-25fd174aec9b077b.js → 8002-ed832921ad190832.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{9226-2f960b7ca530642a.js → 9226-4a7027057f55ca2a.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{9826-c02be5882205bbbc.js → 9826-ccedc28e978ca9e1.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{multiple-83ed7da0bb90b0a5.js → multiple-2ca59996860a33c5.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{add-systems-f90aa48500c1cbde.js → add-systems-58920afe2b67f952.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/configure/{add-vendors-46b88bda3d7b15c5.js → add-vendors-7a258b7ecd6da4b8.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{configure-c0db068d1863222f.js → configure-fb5017ff5fa54fcc.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-experience-92a337ee96845af2.js → privacy-experience-92182be6603c2842.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{[id]-1fd2cda8707314f6.js → [id]-9c23fbe813c997d0.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{new-2987e397445713c5.js → new-0e5e38bbcfe59fd2.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-notices-59a8aff5935482ec.js → privacy-notices-ab54b19609bff325.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{consent-e5a33654a2dfaf35.js → consent-d2bf72508c3cad55.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/{[projectUrn]-6a4b0d49dcbf17a8.js → [projectUrn]-4a1af12d2d7cd660.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{projects-be7b385073f22414.js → projects-99573a1ee3ef8f4c.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{resources-af80fdca3bbdc82f.js → resources-6e429b7511028d60.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{data-catalog-351caadeef03876a.js → data-catalog-56fd0f3e465e52b6.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-1554afcb8b9da2ab.js → action-center-040813022f0890c9.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/detection/{[resourceUrn]-0497f3ffdb632516.js → [resourceUrn]-844a8de0d1b506e2.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{detection-a780390da99f3e43.js → detection-11b07cf2d91b17ef.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/[collectionName]/{[...subfieldNames]-ef71f387fbbab425.js → [...subfieldNames]-d4031e438c363fff.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/{[collectionName]-d790553662caf5c3.js → [collectionName]-9463af37079762d0.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{[datasetId]-cb63db8594fe8dc1.js → [datasetId]-60a4a9eb4aab4c11.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{new-78e052c8f95110c4.js → new-ea198c4a7869f402.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{dataset-d6d7ee8bd8858a8a.js → dataset-0e3a6ac4797ffbbb.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{datastore-connection-a832084ce294f8af.js → datastore-connection-223c2d1ded51bfb1.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{index-269b8f81546dad66.js → index-b74d1e8608ae5b5d.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/messaging/{[id]-d8c5c03fb2f31d65.js → [id]-e8d2140787045acd.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/messaging/{add-template-0e0c06e3c8aabe02.js → add-template-e3f93462a08251bf.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{messaging-3f15804cf9625f01.js → messaging-b5f7d6afdecd013d.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/poc/{table-migration-e551fccfcaae76e7.js → table-migration-29fb7b39f8962650.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/{storage-1b38b656807ed0cd.js → storage-648d775d0fce49dc.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/{configure-b00532a0ad4f6927.js → configure-8f577df28ebca869.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/properties/{[id]-322a01e2bceab3fb.js → [id]-57a75c7e9659271a.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/properties/{add-property-777ed2d73812043d.js → add-property-8964c2300206bc89.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{consent-55e36839d219a503.js → consent-e5d781b28f8e29c8.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domain-records-7ddf9d992fe714a6.js → domain-records-744f669431b84f71.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domains-7c78ae51f0dd7102.js → domains-a3275554ffe8e640.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{email-templates-05ffbda19ab894b9.js → email-templates-604790638c656fbd.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{locations-77fb85bdd0be42b5.js → locations-be2a885150adc133.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{messaging-providers-6c51ffd46bb598e7.js → messaging-providers-8d92be437793c96f.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{organization-44456bfe54ac4ad5.js → organization-3c86162afe9759df.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{privacy-requests-fbe7e8030d837aed.js → privacy-requests-8cbdfd08e0fa88fb.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{regulations-2866ac99faa5a542.js → regulations-4fe3b90747d885e5.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/{test-datasets-a86bafe1b4e1205f.js → test-datasets-2deb6becece69d46.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/user-management/{new-6304dad2c5fab694.js → new-629c88e90699369b.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/user-management/profile/{[id]-ff4711db191099cd.js → [id]-98f737e735eaa0f0.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{user-management-82fcf1151e2fe2ba.js → user-management-562624e5461083ec.js} +0 -0
- /fides/ui-build/static/admin/_next/static/{PZe9jkBWNOGDEEZ4Y_Rvq → fY61mOXDNbYtO-3MNEDrx}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9650],{6554:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests/[id]",function(){return i(50107)}])},77213:function(e,t,i){"use strict";i.d(t,{Z:function(){return p}});var s=i(24246),n=i(96306),a=i(88038),l=i.n(a),r=i(86677);i(27378);var o=i(25980),c=i(90867),d=i(42478),u=i(77830),m=()=>{let e=(0,r.useRouter)();return(0,s.jsx)(n.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,s.jsxs)(n.xuv,{children:[(0,s.jsxs)(n.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,s.jsx)(n.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,s.jsx)(n.wpx,{onClick:()=>{e.push(u.AD)},children:"Configure"})]}),(0,s.jsxs)(n.xvT,{children:["Before Fides can process your privacy requests we need two simple steps to configure your storage and email client."," "]})]})})},p=e=>{let{children:t,title:i,padded:a=!0,mainProps:u}=e,p=(0,o.hz)(),h=(0,r.useRouter)(),x="/privacy-requests"===h.pathname||"/datastore-connection"===h.pathname,g=!(p.flags.messagingConfiguration&&x),{data:j}=(0,d.JE)(void 0,{skip:g}),{data:v}=(0,c.PW)(void 0,{skip:g}),y=p.flags.messagingConfiguration&&(!j||!v)&&x;return(0,s.jsxs)(n.kCb,{"data-testid":i,direction:"column",h:"100vh",children:[(0,s.jsxs)(l(),{children:[(0,s.jsxs)("title",{children:["Fides Admin UI - ",i]}),(0,s.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,s.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,s.jsxs)(n.kCb,{as:"main",direction:"column",py:a?6:0,px:a?10:0,h:a?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...u,children:[y?(0,s.jsx)(m,{}):null,t]})]})}},50107:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return eK}});var s,n,a,l,r=i(24246),o=i(96306),c=i(86677),d=i(77213),u=i(77830),m=i(58754),p=i(99716),h=i(27378),x=i(21910),g=i(19904);(s=a||(a={})).IN_PROCESSING="in_processing",s.PENDING="pending",s.COMPLETE="complete",s.ERROR="error",s.PAUSED="paused",s.AWAITING_PROCESSING="awaiting_processing",s.RETRYING="retrying",s.SKIPPED="skipped";let j={in_processing:"In processing",pending:"Pending",complete:"Complete",error:"Error",paused:"Paused",awaiting_processing:"Awaiting input",retrying:"Retrying",skipped:"Skipped"},v={error:"error",skipped:"warning",awaiting_processing:"minos",in_processing:void 0,pending:void 0,complete:void 0,paused:void 0,retrying:void 0};(n=l||(l={})).REQUEST_UPDATE="Request update",n.INTERNAL_COMMENT="Internal comment",n.MANUAL_TASK="Manual task";let y={"Request update":"sandstone","Internal comment":"marble","Manual task":"nectar"};var f=i(90005),_=i.n(f),b=i(16394),T=i(38450),w=i.n(T);let E=e=>{let{attachments:t}=e;if(!t.length)return null;if(1===t.length){let e=t[0];return(0,r.jsx)("div",{className:"flex flex-wrap gap-2 text-sm text-gray-600","data-testid":"activity-timeline-attachments",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(o.PJP.PgN,{className:"mr-1 size-4"}),(0,r.jsx)(o.AntTypography.Text,{ellipsis:{tooltip:!0},className:"!max-w-[200px]",children:e.file_name})]})})}let i=(0,r.jsx)("ul",{className:"list-disc pl-4",children:t.map(e=>(0,r.jsx)("li",{children:e.file_name},e.id))});return(0,r.jsx)("div",{className:"flex flex-wrap gap-2 text-sm text-gray-600","data-testid":"activity-timeline-attachments",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(o.PJP.PgN,{className:"mr-1 size-4"}),(0,r.jsx)(o.esZ,{title:i,children:(0,r.jsxs)(o.AntTypography.Text,{ellipsis:!0,className:"!max-w-[200px]",children:[t.length," attachments"]})})]})})};var R=e=>{let{item:t}=e,{author:i,title:s,date:n,type:a,onClick:c,isError:d,isAwaitingInput:u,description:m,attachments:p,showViewLog:h}=t,x=(0,b.p6)(n),g=!!c,j=p&&p.length>0,v=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:w().header,children:[(0,r.jsxs)("span",{className:w().author,"data-testid":"activity-timeline-author",children:[i,":"]}),s&&(0,r.jsxs)(o.AntTypography.Text,{className:_()(w().title,{[w()["title--error"]]:d,[w()["title--awaiting-input"]]:u}),ellipsis:{tooltip:!0},"data-testid":"activity-timeline-title",children:[s,d&&" failed"]}),(0,r.jsx)("div",{className:"hidden xl:block",children:(0,r.jsx)(o.AntTypography.Text,{className:w().timestamp,"data-testid":"activity-timeline-timestamp",children:x})}),(0,r.jsx)("div",{className:"xl:hidden",children:(0,r.jsx)(o.esZ,{title:x,children:(0,r.jsx)(o.PJP.qpU,{"data-testid":"activity-timeline-timestamp-icon"})})}),(0,r.jsx)(o.j8w,{className:w().type,color:y[a],"data-testid":"activity-timeline-type",children:a}),h&&(0,r.jsx)("span",{className:w().viewLogs,"data-testid":"activity-timeline-view-logs",children:"View Log"})]}),(m||j)&&(0,r.jsxs)("div",{className:"mt-2 flex justify-between pl-2.5 align-top",children:[(0,r.jsx)(o.AntTypography.Paragraph,{className:"!mb-0 whitespace-pre-wrap","data-testid":"activity-timeline-description",children:m||""}),j&&(0,r.jsx)(E,{attachments:p})]})]}),f={className:_()(w().itemButton,{[w()["itemButton--error"]]:d,[w()["itemButton--awaiting-input"]]:u,[w()["itemButton--clickable"]]:g,[w()["itemButton--comment"]]:a===l.INTERNAL_COMMENT,[w()["itemButton--manual-task"]]:a===l.MANUAL_TASK}),"data-testid":"activity-timeline-item"};return g?(0,r.jsx)("button",{type:"button",onClick:c,...f,children:v}):(0,r.jsx)("div",{...f,children:v})},A=i(25980),k=i(54427),C=i(78780);let{useGetCommentsQuery:q,useCreateCommentMutation:S,useGetCommentDetailsQuery:N,useLazyGetCommentDetailsQuery:P}=C.u.injectEndpoints({endpoints:e=>({getComments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:s}=e;return{url:"plus/privacy-request/".concat(t,"/comment"),method:"GET",params:{page:i,size:s}}},providesTags:["Privacy Request Comments"]}),createComment:e.mutation({query:e=>{let{privacy_request_id:t,comment_text:i,comment_type:s}=e,n=new FormData;return n.append("comment_text",i),n.append("comment_type",s),{url:"plus/privacy-request/".concat(t,"/comment"),method:"POST",body:n,formData:!0}},invalidatesTags:["Privacy Request Comments","Request"]}),getCommentDetails:e.query({query:e=>{let{privacy_request_id:t,comment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/comment/").concat(i),method:"GET"}}})})}),{reducer:I}=(0,k.oM)({name:"privacyRequestComments",initialState:{},reducers:{}}),D=e=>{let{plus:t}=(0,A.hz)(),{data:i,isLoading:s,error:n}=q({privacy_request_id:e,size:100},{skip:!t});return(0,h.useEffect)(()=>{n&&o.Pg3.error("Failed to fetch the request comments")},[n]),{commentItems:(null==i?void 0:i.items)?i.items.map(e=>({author:e.user_first_name&&e.user_last_name?"".concat(e.user_first_name," ").concat(e.user_last_name):e.username||"Unknown",date:new Date(e.created_at),type:l.INTERNAL_COMMENT,showViewLog:!1,description:e.comment_text,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"comment-".concat(e.id)})):[],isLoading:s}},O=(e,t)=>{if(0===e.length)return!1;let i=Array.from(e).sort((e,t)=>new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime());if(!i[0].collection_name)return i[0].status===t;let s={};return i.forEach(e=>{e.collection_name&&!s[e.collection_name]&&(s[e.collection_name]=e)}),Object.values(s).some(e=>e.status===t)},M=e=>O(e,a.ERROR),U=e=>O(e,a.SKIPPED),z=e=>O(e,a.AWAITING_PROCESSING),L=e=>{let t=!e;return{eventItems:e?Object.entries(e).map(e=>{let[t,i]=e,s=M(i),n=U(i),a=z(i);return{author:"Fides",title:t,date:new Date(i[0].updated_at),type:l.REQUEST_UPDATE,showViewLog:s||n||a,onClick:()=>{},isError:s,isSkipped:n,isAwaitingInput:a,id:"request-".concat(t)}}):[],isLoading:t}};var W=i(91317),B=i(45116);let F=e=>{let{plus:t}=(0,A.hz)(),{data:i,isLoading:s,error:n}=(0,B.Ym)({page:1,size:100,privacyRequestId:e,status:void 0,includeFullSubmissionDetails:!0},{skip:!t});return(0,h.useEffect)(()=>{n&&o.Pg3.error("Failed to fetch manual tasks")},[n]),{manualTaskItems:i?i.items.filter(e=>e.status===x.OS.COMPLETED||e.status===x.OS.SKIPPED).map(e=>{var t,i;let s=e.submission_user?(0,b.gJ)(e.submission_user):"Unknown User";(0,W.PN)(null===(t=e.submission_user)||void 0===t?void 0:t.id)&&(s=(null===(i=e.submission_user)||void 0===i?void 0:i.id)||"Unknown User");let n=e.status===x.OS.SKIPPED,a="Task ".concat(n?"skipped":"completed"," - ").concat(e.name),r=e.comments&&e.comments.length>0?e.comments[e.comments.length-1].comment_text:void 0,o=e.attachments||[];return{author:s,title:a,date:new Date(e.updated_at),type:l.MANUAL_TASK,showViewLog:!1,description:r,isError:!1,isSkipped:n,isAwaitingInput:!1,id:"manual-task-".concat(e.manual_field_id),attachments:o}}):[],taskCommentIds:(0,h.useMemo)(()=>{let e=new Set;return(null==i?void 0:i.items)&&i.items.filter(e=>e.status===x.OS.COMPLETED||e.status===x.OS.SKIPPED).forEach(t=>{var i;null===(i=t.comments)||void 0===i||i.forEach(t=>{e.add(t.id)})}),e},[i]),isLoading:s}};var Z=i(88340),J=e=>{let{errorMessage:t,status:i=a.ERROR}=e;return(0,r.jsxs)(o.xuv,{height:"100%",id:"outer",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[(0,r.jsx)(o.xvT,{size:"sm",color:"gray.700",fontWeight:"medium",marginRight:"8px",lineHeight:"20px",children:"Status"}),(0,r.jsx)(o.j8w,{color:v[i],children:j[i]}),(0,r.jsx)(o.xuv,{padding:"0px",marginBottom:"3px",children:(0,r.jsx)(Z.Z,{copyText:t})})]}),(0,r.jsx)(o.izJ,{marginTop:"4px",marginBottom:"6px"}),(0,r.jsx)(o.xuv,{id:"errorWrapper",overflow:"auto",height:"100%",children:(0,r.jsx)(o.xvT,{children:t})})]})},G=i(3124),K=i.n(G);let H=e=>{switch(e){case x.Us.ACCESS:return"Data Retrieval";case x.Us.ERASURE:return"Data Deletion";case x.Us.CONSENT:return"Consent";case x.Us.UPDATE:return"Data Update";default:return e}},Y=e=>{if(e.status!==a.COMPLETE||!e.collection_name)return"-";let t=(e.message||"").match(/(?:retrieved|masked|processed)\s+(\d+)\s+records?$/i);return t?parseInt(t[1],10).toLocaleString():"-"},V=(e,t)=>{let i=e.filter(e=>e.action_type===t&&e.status===a.COMPLETE&&e.collection_name).sort((e,t)=>new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime()),s={};i.forEach(e=>{let t=e.collection_name||"unknown";s[t]||(s[t]=e)});let n=0,l=!1,r=/(?:retrieved|masked|processed)\s+(\d+)\s+records?$/i;return Object.values(s).forEach(e=>{if(e.message){let t=e.message.match(r);if(t){l=!0;let e=parseInt(t[1],10);n+=e}}}),l?n:null},Q=(e,t,i)=>{if("finished"===e.status&&!e.collection_name&&i){let e=V(t,i);return null!==e?e.toLocaleString():"-"}return Y(e)};var $=e=>{var t,i,s;let{eventLogs:n,allEventLogs:l,onDetailPanel:c,privacyRequest:d}=e,u=(null==n?void 0:n.some(e=>e.collection_name))||(null==n?void 0:n.some(e=>"finished"===e.status&&!e.collection_name))||!1,m=null==n?void 0:n.every(e=>"finished"===e.status&&!e.collection_name),p=null==d?void 0:null===(s=d.policy)||void 0===s?void 0:null===(i=s.rules)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.action_type,h=e=>e?H(e):p?H(p):"-",x=null==n?void 0:n.map(e=>(0,r.jsxs)(o.Tr,{backgroundColor:e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING?K().FIDESUI_NEUTRAL_50:"unset",onClick:()=>{(e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING)&&c(e.message,e.status)},style:{cursor:e.message?"pointer":"unset"},_hover:{backgroundColor:K().FIDESUI_NEUTRAL_50},children:[(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:(0,b.p6)(e.updated_at)})}),(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:h(e.action_type)})}),(0,r.jsx)(o.Td,{children:j[e.status]?(0,r.jsx)(o.j8w,{color:v[e.status],children:j[e.status]}):(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:e.status})}),u&&(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:Q(e,l||n,p)})}),u&&!m&&(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"finished"===e.status?"Request completed":e.collection_name})})]},e.updated_at));return(0,r.jsx)(o.xuv,{width:"100%",paddingTop:"0px",height:"100%",children:(0,r.jsx)(o.xJi,{id:"tableContainer",height:"100%",style:{overflowY:"auto"},children:(0,r.jsxs)(o.iA_,{size:"sm",id:"table",position:"relative",children:[(0,r.jsx)(o.hrZ,{id:"tableHeader",position:"sticky",top:"0px",backgroundColor:"white",zIndex:10,children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Time"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Action Type"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Status"})}),u&&(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Records"})}),u&&!m&&(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Collection"})})]})}),(0,r.jsx)(o.p3B,{id:"tableBody",children:x})]})})})},X=e=>{let{isOpen:t,onClose:i,currentLogs:s,allEventLogs:n,isViewingError:l,errorMessage:c,currentStatus:d=a.ERROR,onCloseErrorPanel:u,onOpenErrorPanel:m,privacyRequest:p}=e;return(0,r.jsxs)(o.dys,{isOpen:t,placement:"right",onClose:i,size:"full",autoFocus:!1,"data-testid":"log-drawer",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{style:{width:"50%"},"data-testid":"log-drawer",children:[(0,r.jsx)(o.OXI,{style:{paddingBottom:"0px"},children:(0,r.jsxs)(o.kCb,{justifyContent:"space-between",alignItems:"center",height:"40px",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[l&&(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.Rpv,{}),"aria-label":"Close error logs",size:"small",onClick:u}),(0,r.jsx)(o.xvT,{color:"gray.900",fontSize:"md",lineHeight:"6",fontWeight:"medium",ml:1,children:l?"Event detail":"Event log"})]}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.LGN,{width:"17px"}),"aria-label":"Stop viewing error message",size:"small",onClick:i,"data-testid":"log-drawer-close"})]})}),(0,r.jsxs)(o.Ng0,{id:"drawerBody",overflow:"hidden",children:[s&&!l?(0,r.jsx)($,{eventLogs:s,allEventLogs:n,onDetailPanel:m,privacyRequest:p}):null,l?(0,r.jsx)(J,{errorMessage:c,status:d}):null]})]})]})},ee=e=>{let{subjectRequest:t}=e,{isOpen:i,onOpen:s,onClose:n}=(0,o.qY0)(),[c,d]=(0,h.useState)([]),[u,m]=(0,h.useState)(""),[p,x]=(0,h.useState)(!1),[g,j]=(0,h.useState)(""),[v,y]=(0,h.useState)(a.ERROR),{results:f,id:_}=t,{commentItems:b,isLoading:T}=D(_),{eventItems:E,isLoading:A}=L(f),{manualTaskItems:k,taskCommentIds:C,isLoading:q}=F(_);(0,h.useEffect)(()=>{u&&f&&f[u]&&d(f[u])},[f,u]);let S=()=>{x(!1)},N=(0,h.useCallback)((e,t)=>{m(e),d(t),s()},[s]),P=(0,h.useMemo)(()=>f?Object.values(f).flat():[],[f]),I=(0,h.useMemo)(()=>b.filter(e=>{let t=e.id.replace("comment-","");return!C.has(t)}),[b,C]),O=(0,h.useMemo)(()=>{let e=E.map(e=>{if("Request update"===e.type&&e.title&&f){let t=e.title;if(f[t])return{...e,onClick:()=>N(t,f[t])}}return e});return[{author:"Fides",title:"Access request received",date:new Date(t.created_at),type:l.REQUEST_UPDATE,showViewLog:!1,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"initial-request"},...e,...I,...k].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())},[E,I,k,f,N,t.created_at]);return(0,r.jsxs)(o.xuv,{width:"100%",children:[(0,r.jsx)(o.krs,{className:"!border-none",bordered:!1,split:!1,"data-testid":"activity-timeline-list",children:(0,r.jsx)("ul",{className:"!list-none",children:T||A||q?(0,r.jsx)("div",{className:w().itemButton,"data-testid":"timeline-skeleton",children:(0,r.jsx)(o.N_L,{paragraph:{rows:2},active:!0})}):O.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(R,{item:e})},e.id))})}),(0,r.jsx)(X,{isOpen:i,onClose:()=>{p&&S(),m(""),n()},currentLogs:c,allEventLogs:P,isViewingError:p,errorMessage:g,currentStatus:v,onOpenErrorPanel:(e,t)=>{j(e),t&&y(t),x(!0)},onCloseErrorPanel:S,privacyRequest:t})]})},et=i(66187);let ei=e=>{let{privacyRequestId:t,onCancel:i}=e,[s,n]=(0,h.useState)(""),a=(0,h.useRef)(null),[l,{isLoading:c}]=S();(0,h.useEffect)(()=>{a.current&&a.current.focus()},[]);let d=async()=>{if(s.trim())try{await l({privacy_request_id:t,comment_text:s,comment_type:et.i.NOTE}).unwrap(),n(""),i()}catch(e){console.error("Failed to add comment:",e),o.Pg3.error({content:"Failed to add comment",duration:5})}},u=[{key:"internal",label:"Internal comment",children:(0,r.jsx)(o.uFc.TextArea,{ref:a,value:s,onChange:e=>n(e.target.value),rows:3,className:"mb-3 h-[150px] w-full !resize-none","data-testid":"comment-input"})}];return(0,r.jsxs)("div",{children:[(0,r.jsx)(o.A5g,{items:u}),(0,r.jsxs)(o.jqI,{justify:"flex-end",className:"gap-2",children:[(0,r.jsx)(o.wpx,{onClick:i,"data-testid":"cancel-comment-button",children:"Cancel"}),(0,r.jsx)(o.wpx,{onClick:d,loading:c,disabled:!s.trim(),type:"primary",htmlType:"button","data-testid":"submit-comment-button",children:"Save"})]})]})};var es=e=>{let{subjectRequest:t}=e,[i,s]=(0,h.useState)(!1);return(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)(ee,{subjectRequest:t}),i?(0,r.jsx)(ei,{privacyRequestId:t.id,onCancel:()=>s(!1)}):(0,r.jsx)(g.ZP,{scopes:[x.Sh.COMMENT_CREATE],children:(0,r.jsx)(o.jqI,{justify:"flex-start",className:"mt-2",children:(0,r.jsxs)(o.wpx,{type:"default",onClick:()=>s(!0),className:"flex items-center","data-testid":"add-comment-button",children:["Add comment ",(0,r.jsx)("span",{className:"ml-1",children:"+"})]})})})]})},en=i(14207),ea=i(46238),el=i(72281),er=i(17245),eo=i(90867),ec=i(16134);let ed=e=>Array.from(new Set(e.filter(e=>Object.values(x.Us).includes(e.action_type)).map(e=>e.action_type)));var eu=e=>{let{rules:t}=e,i=ed(t).map(e=>(0,b.kC)(e)).map(e=>e);return(0,r.jsx)(o.AntTypography.Text,{children:i.join(" - ")})},em=i(34090),ep=i(55484),eh=e=>{let{connectorName:t,data:i,isSubmitting:s=!1,onSaveClick:n}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,h.useRef)(null),u=async(e,t)=>{n({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(em.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:ep.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual access"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please complete the following PII fields that have been collected for the selected subject."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(em.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map((e,t)=>{let[i]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(em.gN,{id:i,name:i,children:e=>{let{field:s}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:i,w:"50%",children:i}),(0,r.jsx)(o.IIB,{...s,autoComplete:"off",color:"gray.700",placeholder:"Please enter ".concat(i),ref:0===t?d:void 0,size:"sm"})]})}})},i)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:s,htmlType:"submit",children:"Save"})]})})]})]})})]})},ex=e=>{let{connectorName:t,data:i,isSubmitting:s=!1,onSaveClick:n}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,h.useRef)(null),u=async(e,t)=>{n({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(em.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:ep.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual erasure"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please delete the following PII fields associated with the selected subject if they are available. Once deleted, check the box to confirm the deletion."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(em.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map(e=>{let[t]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(em.gN,{id:t,name:t,children:e=>{let{field:i}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:t,w:"50%",children:t}),(0,r.jsx)(o.XZJ,{...i,isChecked:!!i.value,onChange:i.onChange,name:t,id:t})]})}})},t)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:s,htmlType:"submit",children:"Save"})]})})]})]})})]})};let eg=(e,t,i)=>e.includes(x.Us.ACCESS)?{ProcessingDetailComponent:eh,uploadMutation:t,getUploadedWebhookDataEndpoint:eo.$I.endpoints.getUploadedManualAccessWebhookData}:e.includes(x.Us.ERASURE)?{ProcessingDetailComponent:ex,uploadMutation:i,getUploadedWebhookDataEndpoint:eo.$I.endpoints.getUploadedManualErasureWebhookData}:null;var ej=e=>{let{subjectRequest:t,onComplete:i}=e,s=(0,ec.T)(),{errorAlert:n,successAlert:a}=(0,er.VY)(),{handleError:l}=(0,er.HK)(),[c,d]=(0,h.useState)([]),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)(!1),{data:j,isFetching:v,isLoading:y,isSuccess:f}=(0,en.W6)(),[_]=(0,eo.w3)(),b=ed(t.policy.rules),[T]=(0,eo.nL)(),[w]=(0,eo.UR)(),{ProcessingDetailComponent:E,uploadMutation:R,getUploadedWebhookDataEndpoint:A}=eg(b,T,w),k=async()=>{try{m(!0),await _(t.id).unwrap(),a("Manual request has been received. Request now processing."),i()}catch(e){l(e)}finally{m(!1)}},C=async e=>{try{g(!0),await R(e).unwrap();let t={connection_key:e.connection_key,fields:{}};Object.entries(e.body).forEach(e=>{let[i,s]=e;t.fields[i]=s||""});let i=c.map(e=>e.connection_key===t.connection_key?{...e,checked:!0,fields:{...t.fields}}:e);d(i),a("Manual input successfully saved!")}catch(e){l(e)}finally{g(!1)}};return((0,h.useEffect)(()=>(f&&j.length>0&&0===c.length&&(()=>{if(c.length>0)return;let e=[],i=null==j?void 0:j.map(e=>e.connection_config.key);null==i||i.every(i=>e.push(s(A.initiate({connection_key:i,privacy_request_id:t.id})))),Promise.allSettled(e).then(e=>{let t=[];e.forEach((e,i)=>{if("fulfilled"===e.status&&e.value.isSuccess&&e.value.data){let i={checked:e.value.data.checked,fields:{},connection_key:e.value.originalArgs.connection_key,privacy_request_id:e.value.originalArgs.privacy_request_id};Object.entries(e.value.data.fields).forEach(e=>{let[t,s]=e;i.fields[t]=s||""}),t.push(i)}else n("An error occurred while loading manual input data for ".concat(j[i].connection_config.name))}),d(t)})})(),()=>{}),[j,c.length,s,n,f,t.id,A]),b.includes(x.Us.ACCESS)||b.includes(x.Us.ERASURE))?(0,r.jsxs)(o.gCW,{align:"stretch",spacing:8,children:[(0,r.jsx)(o.xuv,{children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",children:"The following table details the integrations that require manual input from you."})}),(0,r.jsxs)(o.xuv,{children:[(v||y)&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),f&&j?(0,r.jsx)(o.xJi,{children:(0,r.jsxs)(o.iA_,{size:"sm",variant:"unstyled",children:[(0,r.jsx)(o.hrZ,{children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{fontSize:"sm",fontWeight:"semibold",pl:"0",textTransform:"none",children:"Integration Identifier"}),(0,r.jsx)(o.Th,{})]})}),(0,r.jsxs)(o.p3B,{children:[j.length>0&&j.map(e=>(0,r.jsxs)(o.Tr,{display:"block",children:[(0,r.jsx)(o.Td,{pl:"0",children:e.connection_config.key}),(0,r.jsx)(o.Td,{children:c.length>0?(0,r.jsx)(E,{connectorName:e.connection_config.name,data:c.find(t=>t.connection_key===e.connection_config.key),isSubmitting:p,onSaveClick:C}):null})]},e.id)),0===j.length&&(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Td,{colSpan:3,pl:"0",children:(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.xvT,{children:"You don‘t have any Manual Process connections set up yet."})})})})]}),c.length>0&&c.every(e=>e.checked)?(0,r.jsx)(o.$RU,{children:(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Th,{pl:"0px",children:(0,r.jsx)(o.wpx,{type:"primary",loading:u,onClick:k,className:"mt-2",children:"Complete DSR"})})})}):null]})}):null]})]}):null},ev=e=>{let{subjectRequest:t,onComplete:i}=e,s=(0,c.useRouter)(),{data:n}=(0,en.AZ)({}),a=(0,h.useMemo)(()=>{var e;return(null==n?void 0:null===(e=n.items)||void 0===e?void 0:e.filter(e=>e.connection_type===x.Rj.MANUAL_TASK))||[]},[n]),{data:l}=(0,en.W6)(),d=(l||[]).length>0,{data:m}=(0,B.Ym)({page:1,size:100,privacyRequestId:t.id}),p=(null==m?void 0:m.items)||[],g=p.length,j=p.filter(e=>e.status===x.OS.NEW).length,v=a.length>0;return v||d?(0,r.jsxs)(o.Kqy,{spacing:6,children:[v&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{marginBottom:12},children:"Manual tasks"}),(0,r.jsxs)(o.Kqy,{spacing:2,children:[(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:g})," task",1!==g?"s":""," ","linked to this privacy request"]}),(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:j})," pending task",1!==j?"s":""]}),g>0&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(o.wpx,{type:"primary",onClick:()=>{s.push({pathname:u.Jw,query:{privacy_request_id:t.id,tab:el.G.MANUAL_TASK}})},children:"View all tasks for this request →"})})]})]}),d&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsxs)(o.kCb,{alignItems:"center",style:{marginBottom:12},children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{margin:0,marginRight:8},children:"Manual steps (legacy)"}),(0,r.jsx)(ea.b,{label:"This is the legacy manual steps feature. The new manual tasks feature provides more advanced capabilities and better user experience."})]}),(0,r.jsx)(ej,{subjectRequest:t,onComplete:i||(()=>{})})]})]}):(0,r.jsx)(o.xuv,{p:4,children:(0,r.jsx)(o.AntTypography.Text,{type:"secondary",children:"No manual tasks or legacy manual steps configured for this request."})})},ey=i(59969);let ef={approved:{color:"success",label:"Approved"},complete:{color:"success",label:"Completed"},awaiting_email_send:{color:"marble",label:"Awaiting Email Send"},denied:{color:"warning",label:"Denied"},canceled:{color:"marble",label:"Canceled"},error:{color:"error",label:"Error"},in_processing:{color:"caution",label:"In Progress"},paused:{color:"marble",label:"Paused"},pending:{color:"info",label:"New"},identity_unverified:{color:"marble",label:"Unverified"},requires_input:{color:"minos",label:"Requires Input"},requires_manual_finalization:{color:"minos",label:"Requires Finalization"}};var e_=e=>{let{status:t}=e;return(0,r.jsx)(o.j8w,{color:ef[t].color,className:"justify-center","data-testid":"request-status-badge",children:ef[t].label})},eb=i(18225),eT=i(812),ew=i(7842);let{useGetAttachmentsQuery:eE,useUploadAttachmentMutation:eR,useGetAttachmentDetailsQuery:eA,useLazyGetAttachmentDetailsQuery:ek}=C.u.injectEndpoints({endpoints:e=>({getAttachments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:s}=e;return{url:"plus/privacy-request/".concat(t,"/attachment"),method:"GET",params:{page:i,size:s}}},providesTags:["Privacy Request Attachments"]}),uploadAttachment:e.mutation({query:e=>{let{privacy_request_id:t,attachment_type:i,attachment_file:s}=e,n=new FormData;return n.append("attachment_type",i),n.append("attachment_file",s),{url:"plus/privacy-request/".concat(t,"/attachment"),method:"POST",body:n,params:{}}},invalidatesTags:["Privacy Request Attachments"]}),getAttachmentDetails:e.query({query:e=>{let{privacy_request_id:t,attachment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/attachment/").concat(i),method:"GET"}}})})}),{reducer:eC}=(0,k.oM)({name:"privacyRequestAttachments",initialState:{},reducers:{}}),eq=e=>{var t;let{file:i}=e,[s,n]=(0,h.useState)(!1),[a]=ek(),l=async()=>{var e,t,s;if((null===(e=i.customData)||void 0===e?void 0:e.attachment_id)&&(null===(t=i.customData)||void 0===t?void 0:t.privacy_request_id)){n(!0);try{let e=await a({privacy_request_id:i.customData.privacy_request_id,attachment_id:i.customData.attachment_id}),t=null===(s=e.data)||void 0===s?void 0:s.retrieved_attachment_url,n=null==t?void 0:t.startsWith("http");t&&n?window.open(t,"_blank"):t&&!n?o.Pg3.info("Download is not available when using local storage methods."):o.Pg3.error("No download URL available for ".concat(i.name))}catch(e){o.Pg3.error("Failed to fetch attachment download URL")}finally{n(!1)}}},c=(null===(t=i.customData)||void 0===t?void 0:t.attachment_type)===x.sf.INCLUDE_WITH_ACCESS_PACKAGE;return(0,r.jsxs)(o.jqI,{align:"center",gap:8,children:[(0,r.jsx)(o.PJP.PgN,{className:"shrink-0"}),(0,r.jsx)(o.lKn,{ellipsis:{tooltip:i.name},className:"grow",children:i.name}),c&&(0,r.jsx)(o.esZ,{title:"This attachment will be included in the access package.",children:(0,r.jsx)(o.PJP.wvC,{className:"shrink-0",title:"User icon"})}),(0,r.jsx)(o.wpx,{type:"text",icon:(0,r.jsx)(o.PJP.UWx,{}),onClick:l,loading:s,className:"shrink-0"})]})},eS=(e,t)=>(0,r.jsx)(eq,{file:t});var eN=e=>{let{subjectRequest:t}=e,[i,s]=(0,h.useState)(!1),n=(0,g.Tg)([x.Sh.ATTACHMENT_READ]),a=(0,g.Tg)([x.Sh.ATTACHMENT_CREATE]),[l]=eR(),{data:c,isLoading:d,error:u}=(0,eo.PW)(),{data:m,isLoading:p}=eE({privacy_request_id:t.id}),{refetch:j}=eE({privacy_request_id:t.id}),v=(null==m?void 0:m.items.map(e=>({uid:e.id,name:e.file_name,status:"done",customData:{attachment_id:e.id,privacy_request_id:t.id,attachment_type:e.attachment_type}})))||[],y=(0,h.useCallback)(()=>(0,r.jsx)(o.PJP.PgN,{}),[]);if(!n)return null;let f=a&&(null==c?void 0:c.key),_=[".pdf",".doc",".docx",".xls",".xlsx",".txt",".csv",".jpg",".jpeg",".png",".zip"];return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.lQT,{level:3,children:"Attachments"})}),d||p?(0,r.jsx)(eb.Z,{size:"md",alignment:"start"}):(0,r.jsx)(o.pMK,{name:"attachment_file",fileList:v,iconRender:y,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:eS,accept:_.join(","),customRequest:async e=>{let{file:i,onSuccess:n,onError:a}=e,r=i.name;try{s(!0),await l({privacy_request_id:t.id,attachment_file:i,attachment_type:ew.s.INTERNAL_USE_ONLY}).unwrap(),o.Pg3.success("".concat(r," file uploaded successfully")),j(),null==n||n(i)}catch(e){o.Pg3.error("".concat(r," file upload failed.")),null==a||a(e)}finally{s(!1)}},disabled:!f,children:a&&(0,r.jsx)(o.esZ,{title:u&&"Add attachment not available: ".concat((0,eT.e$)(u)),placement:"top",children:(0,r.jsxs)(o.jqI,{align:"center",gap:12,className:"mb-4",children:[(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.mm_,{}),iconPosition:"end",disabled:!f||i,loading:i,children:i?"Uploading":"Add"}),(0,r.jsx)(ea.b,{label:"Uploaded attachments are for internal use and won't be send as part of the request package.\n Accepted filetypes: ".concat(_.join(", ")),placement:"top"})]})})})]})})},eP=i(15709),eI=i.n(eP),eD=e=>{let{label:t,children:i}=e;return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"shrink-0 grow-0 basis-1/2 pr-2 ".concat(eI().label),children:(0,r.jsxs)(o.AntTypography.Text,{children:[t,":"]})}),(0,r.jsx)("div",{className:"min-w-0 shrink grow ".concat(eI().value),"data-testid":"request-detail-value-".concat(t),children:i})]})},eO=e=>{let{subjectRequest:t}=e,{custom_privacy_request_fields:i}=t;return(0,r.jsx)("div",{className:"flex flex-col gap-2",children:i&&Object.keys(i).length>0&&Object.entries(i).filter(e=>{let[,t]=e;return t.value}).map(e=>{let[t,i]=e;return(0,r.jsx)(eD,{label:i.label,children:(0,r.jsx)(o.AntTypography.Text,{children:Array.isArray(i.value)?i.value.join(", "):i.value})},t)})})},eM=e=>{let{subjectRequest:t}=e,{plus:i}=(0,A.hz)(),{id:s,status:n,policy:a,identity:l,identity_verified_at:c}=t;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.AntTypography.Title,{level:2,children:"Request details"})}),(0,r.jsxs)(o.jqI,{vertical:!0,gap:12,className:"mb-6",children:[(0,r.jsx)(eD,{label:"Status",children:(0,r.jsx)(e_,{status:n})}),(0,r.jsx)(eD,{label:"Time remaining",children:(0,r.jsx)(ey.Z,{daysLeft:t.days_left,includeText:!0,status:t.status})}),(0,r.jsx)(eD,{label:"Request type",children:(0,r.jsx)(eu,{rules:a.rules})}),(0,r.jsx)(eD,{label:"Source",children:i&&(0,r.jsx)(o.AntTypography.Text,{children:t.source||"-"})}),Object.entries(l).filter(e=>{let[,{value:t}]=e;return null!==t}).map(e=>{let[t,{value:i="",label:s}]=e,n="".concat(i).concat(c?"":" (Unverified)");return(0,r.jsx)(eD,{label:"Subject ".concat(s.toLocaleLowerCase()),children:(0,r.jsx)(o.esZ,{title:n,trigger:"click",children:(0,r.jsx)(o.AntTypography.Text,{ellipsis:!0,children:n})})},t)}),(0,r.jsx)(eO,{subjectRequest:t})]}),(0,r.jsxs)(o.PPS,{layout:"vertical",children:[(0,r.jsx)(o.PPS.Item,{label:"Request ID:",className:"mb-4",children:(0,r.jsx)(o.jqI,{gap:1,children:(0,r.jsxs)(o.vyj.Compact,{style:{width:"100%"},children:[(0,r.jsx)(o.uFc,{readOnly:!0,value:s,"data-testid":"request-detail-value-id"}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(Z.Z,{copyText:s})})]})})}),(0,r.jsx)(o.PPS.Item,{label:"Policy key:",className:"mb-4",children:(0,r.jsx)(o.uFc,{readOnly:!0,value:t.policy.key,"data-testid":"request-detail-value-policy"})})]}),(0,r.jsx)(eN,{subjectRequest:t})]})};let eU=[x.q2.COMPLETE,x.q2.CANCELED,x.q2.DENIED,x.q2.ERROR];var ez=e=>{var t;let{data:i}=e,s=(0,h.useMemo)(()=>({id:i.id,verbose:!0}),[i.id]),{data:n}=(0,p.QA)(s,{pollingInterval:eU.includes(i.status)?0:2e3,skip:!i.id}),a=null!==(t=null==n?void 0:n.items[0])&&void 0!==t?t:i,l=a.status===x.q2.REQUIRES_INPUT,[c,d]=(0,h.useState)("activity"),u=(0,h.useMemo)(()=>[{key:"activity",label:"Activity",children:(0,r.jsx)(es,{subjectRequest:a})},{key:"manual-tasks",label:"Manual tasks",children:(0,r.jsx)(ev,{subjectRequest:a,onComplete:()=>d("activity")}),disabled:!l}],[l,a]);return(0,r.jsxs)("div",{className:"flex gap-8",children:[(0,r.jsx)("div",{className:"w-0 grow",children:(0,r.jsx)(o.A5g,{items:u,activeKey:c,onChange:d})}),(0,r.jsx)("div",{className:"w-1/3 2xl:w-[432px]","data-testid":"privacy-request-details",children:(0,r.jsx)(eM,{subjectRequest:a})})]})},eL=i(57526),eW=i(66548),eB=i(45489),eF=e=>{let{privacyRequest:t,action:i}=e,{handleApproveRequest:s,handleDenyRequest:n}=(0,eB.Z)({subjectRequest:t}),a=t.status===x.q2.PENDING,l=(0,o.qY0)(),r=async e=>{let{reason:t}=e,a=o.Pg3.loading({content:"approve"===i?"Approving request...":"Denying request..."});"deny"===i&&await n(t),"approve"===i&&await s(),a()};return{showAction:a,closeModal:l.onClose,performAction:r,openConfirmationModal:l.onOpen,isModalOpen:l.isOpen}},eZ=e=>{var t,i,s;let{privacyRequest:n}=e,a=null===(i=(0,A.hz)())||void 0===i?void 0:null===(t=i.flags)||void 0===t?void 0:t.downloadAccessRequestResults,l=n.status===x.q2.COMPLETE,r=ed(n.policy.rules).includes(x.Us.ACCESS),o=(0,g.Tg)([x.Sh.PRIVACY_REQUEST_ACCESS_RESULTS_READ]),{data:c,isLoading:d,isError:u,error:m}=(0,eo.br)({privacy_request_id:n.id}),p=null!==(s=null==c?void 0:c.access_result_urls[0])&&void 0!==s?s:"",h=!!p&&"your local fides_uploads folder"!==p,j=null;return u?j=(0,eT.e$)(m,"Unable to resolve download URL"):h||(j="Requests stored locally cannot be downloaded"),{showDownloadResults:a&&o&&r&&l,downloadResults:()=>{let e=document.createElement("a");e.href=p,e.target="_blank",e.rel="noopener noreferrer",e.click(),e.remove()},infoTooltip:j,isLoading:d,isDisabled:!h}},eJ=e=>{let{privacyRequest:t}=e,{errorAlert:i,successAlert:s}=(0,er.VY)(),n=t.status===x.q2.ERROR,[a]=(0,eo.Fq)();return{reprocessPrivacyRequest:async()=>{if(!t)return;let e=o.Pg3.loading("Reprocessing privacy request...",0),n=await a(t);"error"in n?i((0,eT.e$)(n.error),"DSR automation has failed for this privacy request due to the following:",{duration:null}):s("Privacy request is now being reprocessed."),e()},showReprocess:n}},eG=e=>{let{privacyRequest:t}=e,{showDownloadResults:i,downloadResults:s,infoTooltip:n,isDisabled:a}=eZ({privacyRequest:t}),{isModalOpen:l,closeModal:c,performAction:d,openConfirmationModal:u,showAction:m}=eF({privacyRequest:t,action:"approve"}),{isModalOpen:p,closeModal:g,performAction:j,openConfirmationModal:v,showAction:y}=eF({privacyRequest:t,action:"deny"}),{reprocessPrivacyRequest:f,showReprocess:_}=eJ({privacyRequest:t}),{handleFinalizeRequest:b,finalizeRequestResult:T}=(0,eB.Z)({subjectRequest:t}),w=(0,h.useMemo)(()=>{let e=[];return e.push({key:"approve",label:(0,r.jsx)("span",{"data-testid":"privacy-request-approve-btn",children:"Approve"}),onClick:u,disabled:!m}),e.push({key:"deny",label:(0,r.jsx)("span",{"data-testid":"privacy-request-deny-btn",children:"Deny"}),onClick:v,disabled:!y}),e.push({key:"reprocess",label:(0,r.jsx)("span",{"data-testid":"privacy-request-action-reprocess",children:"Reprocess"}),onClick:f,disabled:!_}),t.status===x.q2.REQUIRES_MANUAL_FINALIZATION&&e.push({key:"finalize",label:(0,r.jsx)("span",{"data-testid":"privacy-request-action-finalize",children:"Finalize"}),onClick:b,disabled:T.isLoading}),i&&e.push({key:"download",label:(0,r.jsx)(o.esZ,{title:a?n:null,placement:"bottom",children:(0,r.jsx)("span",{"data-testid":"download-results-btn",children:"Download request results"})}),onClick:s,disabled:a}),e},[i,s,n,a,m,y,u,v,_,f,t.status,b,T.isLoading]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.S0p,{menu:{items:w},trigger:["click"],overlayStyle:{minWidth:"160px"},children:(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.pO,{}),"data-testid":"privacy-request-actions-dropdown-btn",iconPosition:"end",type:"primary",disabled:!w.length,size:"large",children:"Actions"})}),(0,r.jsx)(eL.Z,{isOpen:l,isLoading:!1,onClose:c,onApproveRequest:()=>d({reason:""}),subjectRequest:t}),(0,r.jsx)(eW.Z,{isOpen:p,onClose:g,onDenyRequest:e=>j({reason:e})})]})},eK=()=>{let e=(0,c.useRouter)().query.id,{data:t,isLoading:i}=(0,p.QA)({id:e,verbose:!0},{skip:!e}),s=(null==t?void 0:t.items[0])||null;return(0,r.jsxs)(d.Z,{title:"Privacy Request - ".concat(e),children:[(0,r.jsx)(m.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests",href:u.Jw},{title:"Request details"}],rightContent:!!s&&(0,r.jsx)(eG,{privacyRequest:s})}),i&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),!i&&!s&&(0,r.jsx)(o.xvT,{children:"404 no privacy request found"}),!i&&s&&(0,r.jsx)(ez,{data:s})]})}},15709:function(e){e.exports={value:"RequestDetailsRow_value__WMXn3",label:"RequestDetailsRow_label__dn3CQ"}},38450:function(e){e.exports={container:"ActivityTimelineEntry_container__tCva0","container--open":"ActivityTimelineEntry_container--open__1d9mA",itemButton:"ActivityTimelineEntry_itemButton__MlmWS","itemButton--error":"ActivityTimelineEntry_itemButton--error__UizD2","itemButton--comment":"ActivityTimelineEntry_itemButton--comment__g98SH","itemButton--awaiting-input":"ActivityTimelineEntry_itemButton--awaiting-input__6lB5t",header:"ActivityTimelineEntry_header__GYibj",title:"ActivityTimelineEntry_title__rm_g0","title--error":"ActivityTimelineEntry_title--error__fOi0s","title--awaiting-input":"ActivityTimelineEntry_title--awaiting-input__3sPAo",timestamp:"ActivityTimelineEntry_timestamp__uMEMT",viewLogs:"ActivityTimelineEntry_viewLogs___T4jN",logs:"ActivityTimelineEntry_logs__T7R0J","logs--open":"ActivityTimelineEntry_logs--open__o_9Io"}}},function(e){e.O(0,[431,4558,2888,9774,179],function(){return e(e.s=6554)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9650],{6554:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests/[id]",function(){return i(50107)}])},77213:function(e,t,i){"use strict";i.d(t,{Z:function(){return h}});var s=i(24246),n=i(96306),a=i(88038),l=i.n(a),r=i(86677);i(27378);var o=i(25980),c=i(90867),d=i(42478),u=i(77830),m=()=>{let e=(0,r.useRouter)();return(0,s.jsx)(n.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,s.jsxs)(n.xuv,{children:[(0,s.jsxs)(n.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,s.jsx)(n.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,s.jsx)(n.wpx,{onClick:()=>{e.push(u.AD)},children:"Configure"})]}),(0,s.jsxs)(n.xvT,{children:["Before Fides can process your privacy requests we need two simple steps to configure your storage and email client."," "]})]})})},h=e=>{let{children:t,title:i,padded:a=!0,mainProps:u}=e,h=(0,o.hz)(),p=(0,r.useRouter)(),x="/privacy-requests"===p.pathname||"/datastore-connection"===p.pathname,g=!(h.flags.messagingConfiguration&&x),{data:v}=(0,d.JE)(void 0,{skip:g}),{data:j}=(0,c.PW)(void 0,{skip:g}),y=h.flags.messagingConfiguration&&(!v||!j)&&x;return(0,s.jsxs)(n.kCb,{"data-testid":i,direction:"column",h:"100vh",children:[(0,s.jsxs)(l(),{children:[(0,s.jsxs)("title",{children:["Fides Admin UI - ",i]}),(0,s.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,s.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,s.jsxs)(n.kCb,{as:"main",direction:"column",py:a?6:0,px:a?10:0,h:a?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...u,children:[y?(0,s.jsx)(m,{}):null,t]})]})}},50107:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return eK}});var s,n,a,l,r=i(24246),o=i(96306),c=i(86677),d=i(77213),u=i(77830),m=i(58754),h=i(99716),p=i(27378),x=i(21910),g=i(19904);(s=a||(a={})).IN_PROCESSING="in_processing",s.PENDING="pending",s.COMPLETE="complete",s.ERROR="error",s.PAUSED="paused",s.AWAITING_PROCESSING="awaiting_processing",s.RETRYING="retrying",s.SKIPPED="skipped";let v={in_processing:"In processing",pending:"Pending",complete:"Complete",error:"Error",paused:"Paused",awaiting_processing:"Awaiting input",retrying:"Retrying",skipped:"Skipped"},j={error:"error",skipped:"warning",awaiting_processing:"minos",in_processing:void 0,pending:void 0,complete:void 0,paused:void 0,retrying:void 0};(n=l||(l={})).REQUEST_UPDATE="Request update",n.INTERNAL_COMMENT="Internal comment",n.MANUAL_TASK="Manual task";let y={"Request update":"sandstone","Internal comment":"marble","Manual task":"nectar"};var f=i(90005),_=i.n(f),b=i(16394),T=i(38450),w=i.n(T);let E=e=>{let{attachments:t}=e;if(!t.length)return null;if(1===t.length){let e=t[0];return(0,r.jsx)("div",{className:"flex flex-wrap gap-2 text-sm text-gray-600","data-testid":"activity-timeline-attachments",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(o.PJP.PgN,{className:"mr-1 size-4"}),(0,r.jsx)(o.AntTypography.Text,{ellipsis:{tooltip:!0},className:"!max-w-[200px]",children:e.file_name})]})})}let i=(0,r.jsx)("ul",{className:"list-disc pl-4",children:t.map(e=>(0,r.jsx)("li",{children:e.file_name},e.id))});return(0,r.jsx)("div",{className:"flex flex-wrap gap-2 text-sm text-gray-600","data-testid":"activity-timeline-attachments",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(o.PJP.PgN,{className:"mr-1 size-4"}),(0,r.jsx)(o.esZ,{title:i,children:(0,r.jsxs)(o.AntTypography.Text,{ellipsis:!0,className:"!max-w-[200px]",children:[t.length," attachments"]})})]})})};var A=e=>{let{item:t}=e,{author:i,title:s,date:n,type:a,onClick:c,isError:d,isAwaitingInput:u,description:m,attachments:h,showViewLog:p}=t,x=(0,b.p6)(n),g=!!c,v=h&&h.length>0,j=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:w().header,children:[(0,r.jsxs)("span",{className:w().author,"data-testid":"activity-timeline-author",children:[i,":"]}),s&&(0,r.jsxs)(o.AntTypography.Text,{className:_()(w().title,{[w()["title--error"]]:d,[w()["title--awaiting-input"]]:u}),ellipsis:{tooltip:!0},"data-testid":"activity-timeline-title",children:[s,d&&" failed"]}),(0,r.jsx)("div",{className:"hidden xl:block",children:(0,r.jsx)(o.AntTypography.Text,{className:w().timestamp,"data-testid":"activity-timeline-timestamp",children:x})}),(0,r.jsx)("div",{className:"xl:hidden",children:(0,r.jsx)(o.esZ,{title:x,children:(0,r.jsx)(o.PJP.qpU,{"data-testid":"activity-timeline-timestamp-icon"})})}),(0,r.jsx)(o.j8w,{className:w().type,color:y[a],"data-testid":"activity-timeline-type",children:a}),p&&(0,r.jsx)("span",{className:w().viewLogs,"data-testid":"activity-timeline-view-logs",children:"View Log"})]}),(m||v)&&(0,r.jsxs)("div",{className:"mt-2 flex justify-between pl-2.5 align-top",children:[(0,r.jsx)(o.AntTypography.Paragraph,{className:"!mb-0 whitespace-pre-wrap","data-testid":"activity-timeline-description",children:m||""}),v&&(0,r.jsx)(E,{attachments:h})]})]}),f={className:_()(w().itemButton,{[w()["itemButton--error"]]:d,[w()["itemButton--awaiting-input"]]:u,[w()["itemButton--clickable"]]:g,[w()["itemButton--comment"]]:a===l.INTERNAL_COMMENT,[w()["itemButton--manual-task"]]:a===l.MANUAL_TASK}),"data-testid":"activity-timeline-item"};return g?(0,r.jsx)("button",{type:"button",onClick:c,...f,children:j}):(0,r.jsx)("div",{...f,children:j})},R=i(25980),C=i(54427),k=i(78780);let{useGetCommentsQuery:q,useCreateCommentMutation:S,useGetCommentDetailsQuery:N,useLazyGetCommentDetailsQuery:P}=k.u.injectEndpoints({endpoints:e=>({getComments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:s}=e;return{url:"plus/privacy-request/".concat(t,"/comment"),method:"GET",params:{page:i,size:s}}},providesTags:["Privacy Request Comments"]}),createComment:e.mutation({query:e=>{let{privacy_request_id:t,comment_text:i,comment_type:s}=e,n=new FormData;return n.append("comment_text",i),n.append("comment_type",s),{url:"plus/privacy-request/".concat(t,"/comment"),method:"POST",body:n,formData:!0}},invalidatesTags:["Privacy Request Comments","Request"]}),getCommentDetails:e.query({query:e=>{let{privacy_request_id:t,comment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/comment/").concat(i),method:"GET"}}})})}),{reducer:I}=(0,C.oM)({name:"privacyRequestComments",initialState:{},reducers:{}}),D=e=>{let{plus:t}=(0,R.hz)(),{data:i,isLoading:s,error:n}=q({privacy_request_id:e,size:100},{skip:!t});return(0,p.useEffect)(()=>{n&&o.Pg3.error("Failed to fetch the request comments")},[n]),{commentItems:(null==i?void 0:i.items)?i.items.map(e=>({author:e.user_first_name&&e.user_last_name?"".concat(e.user_first_name," ").concat(e.user_last_name):e.username||"Unknown",date:new Date(e.created_at),type:l.INTERNAL_COMMENT,showViewLog:!1,description:e.comment_text,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"comment-".concat(e.id)})):[],isLoading:s}},O=(e,t)=>{if(0===e.length)return!1;let i=Array.from(e).sort((e,t)=>new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime());if(!i[0].collection_name)return i[0].status===t;let s={};return i.forEach(e=>{e.collection_name&&!s[e.collection_name]&&(s[e.collection_name]=e)}),Object.values(s).some(e=>e.status===t)},M=e=>O(e,a.ERROR),U=e=>O(e,a.SKIPPED),z=e=>O(e,a.AWAITING_PROCESSING),L=e=>{let t=!e;return{eventItems:e?Object.entries(e).map(e=>{let[t,i]=e,s=M(i),n=U(i),a=z(i);return{author:"Fides",title:t,date:new Date(i[0].updated_at),type:l.REQUEST_UPDATE,showViewLog:s||n||a,onClick:()=>{},isError:s,isSkipped:n,isAwaitingInput:a,id:"request-".concat(t)}}):[],isLoading:t}};var W=i(91317),B=i(45116);let F=e=>{let{plus:t}=(0,R.hz)(),{data:i,isLoading:s,error:n}=(0,B.Ym)({page:1,size:100,privacyRequestId:e,status:void 0,includeFullSubmissionDetails:!0},{skip:!t});return(0,p.useEffect)(()=>{n&&o.Pg3.error("Failed to fetch manual tasks")},[n]),{manualTaskItems:i?i.items.filter(e=>e.status===x.OS.COMPLETED||e.status===x.OS.SKIPPED).map(e=>{var t,i;let s=e.submission_user?(0,b.gJ)(e.submission_user):"Unknown User";(0,W.PN)(null===(t=e.submission_user)||void 0===t?void 0:t.id)&&(s=(null===(i=e.submission_user)||void 0===i?void 0:i.id)||"Unknown User");let n=e.status===x.OS.SKIPPED,a="Task ".concat(n?"skipped":"completed"," - ").concat(e.name),r=e.comments&&e.comments.length>0?e.comments[e.comments.length-1].comment_text:void 0,o=e.attachments||[];return{author:s,title:a,date:new Date(e.updated_at),type:l.MANUAL_TASK,showViewLog:!1,description:r,isError:!1,isSkipped:n,isAwaitingInput:!1,id:"manual-task-".concat(e.manual_field_id),attachments:o}}):[],taskCommentIds:(0,p.useMemo)(()=>{let e=new Set;return(null==i?void 0:i.items)&&i.items.filter(e=>e.status===x.OS.COMPLETED||e.status===x.OS.SKIPPED).forEach(t=>{var i;null===(i=t.comments)||void 0===i||i.forEach(t=>{e.add(t.id)})}),e},[i]),isLoading:s}};var Z=i(88340),J=e=>{let{errorMessage:t,status:i=a.ERROR}=e;return(0,r.jsxs)(o.xuv,{height:"100%",id:"outer",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[(0,r.jsx)(o.xvT,{size:"sm",color:"gray.700",fontWeight:"medium",marginRight:"8px",lineHeight:"20px",children:"Status"}),(0,r.jsx)(o.j8w,{color:j[i],children:v[i]}),(0,r.jsx)(o.xuv,{padding:"0px",marginBottom:"3px",children:(0,r.jsx)(Z.Z,{copyText:t})})]}),(0,r.jsx)(o.izJ,{marginTop:"4px",marginBottom:"6px"}),(0,r.jsx)(o.xuv,{id:"errorWrapper",overflow:"auto",height:"100%",children:(0,r.jsx)(o.xvT,{children:t})})]})},G=i(3124),K=i.n(G);let H=e=>{switch(e){case x.Us.ACCESS:return"Data Retrieval";case x.Us.ERASURE:return"Data Deletion";case x.Us.CONSENT:return"Consent";case x.Us.UPDATE:return"Data Update";default:return e}},Y=e=>{if(e.status!==a.COMPLETE||!e.collection_name)return"-";let t=(e.message||"").match(/(?:retrieved|masked|processed)\s+(\d+)\s+records?$/i);return t?parseInt(t[1],10).toLocaleString():"-"},V=(e,t)=>{let i=e.filter(e=>e.action_type===t&&e.status===a.COMPLETE&&e.collection_name).sort((e,t)=>new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime()),s={};i.forEach(e=>{let t=e.collection_name||"unknown";s[t]||(s[t]=e)});let n=0,l=!1,r=/(?:retrieved|masked|processed)\s+(\d+)\s+records?$/i;return Object.values(s).forEach(e=>{if(e.message){let t=e.message.match(r);if(t){l=!0;let e=parseInt(t[1],10);n+=e}}}),l?n:null},Q=(e,t,i)=>{if("finished"===e.status&&!e.collection_name&&i){let e=V(t,i);return null!==e?e.toLocaleString():"-"}return Y(e)};var $=e=>{var t,i,s;let{eventLogs:n,allEventLogs:l,onDetailPanel:c,privacyRequest:d}=e,u=(null==n?void 0:n.some(e=>e.collection_name))||(null==n?void 0:n.some(e=>"finished"===e.status&&!e.collection_name))||!1,m=null==n?void 0:n.every(e=>"finished"===e.status&&!e.collection_name),h=null==d?void 0:null===(s=d.policy)||void 0===s?void 0:null===(i=s.rules)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.action_type,p=e=>e?H(e):h?H(h):"-",x=null==n?void 0:n.map(e=>(0,r.jsxs)(o.Tr,{backgroundColor:e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING?K().FIDESUI_NEUTRAL_50:"unset",onClick:()=>{(e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING)&&c(e.message,e.status)},style:{cursor:e.message?"pointer":"unset"},_hover:{backgroundColor:K().FIDESUI_NEUTRAL_50},children:[(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:(0,b.p6)(e.updated_at)})}),(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:p(e.action_type)})}),(0,r.jsx)(o.Td,{children:v[e.status]?(0,r.jsx)(o.j8w,{color:j[e.status],children:v[e.status]}):(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:e.status})}),u&&(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:Q(e,l||n,h)})}),u&&!m&&(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"finished"===e.status?"Request completed":e.collection_name})})]},e.updated_at));return(0,r.jsx)(o.xuv,{width:"100%",paddingTop:"0px",height:"100%",children:(0,r.jsx)(o.xJi,{id:"tableContainer",height:"100%",style:{overflowY:"auto"},children:(0,r.jsxs)(o.iA_,{size:"sm",id:"table",position:"relative",children:[(0,r.jsx)(o.hrZ,{id:"tableHeader",position:"sticky",top:"0px",backgroundColor:"white",zIndex:10,children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Time"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Action Type"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Status"})}),u&&(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Records"})}),u&&!m&&(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Collection"})})]})}),(0,r.jsx)(o.p3B,{id:"tableBody",children:x})]})})})},X=e=>{let{isOpen:t,onClose:i,currentLogs:s,allEventLogs:n,isViewingError:l,errorMessage:c,currentStatus:d=a.ERROR,onCloseErrorPanel:u,onOpenErrorPanel:m,privacyRequest:h}=e;return(0,r.jsxs)(o.dys,{isOpen:t,placement:"right",onClose:i,size:"full",autoFocus:!1,"data-testid":"log-drawer",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{style:{width:"50%"},"data-testid":"log-drawer",children:[(0,r.jsx)(o.OXI,{style:{paddingBottom:"0px"},children:(0,r.jsxs)(o.kCb,{justifyContent:"space-between",alignItems:"center",height:"40px",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[l&&(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.Rpv,{}),"aria-label":"Close error logs",size:"small",onClick:u}),(0,r.jsx)(o.xvT,{color:"gray.900",fontSize:"md",lineHeight:"6",fontWeight:"medium",ml:1,children:l?"Event detail":"Event log"})]}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.LGN,{width:"17px"}),"aria-label":"Stop viewing error message",size:"small",onClick:i,"data-testid":"log-drawer-close"})]})}),(0,r.jsxs)(o.Ng0,{id:"drawerBody",overflow:"hidden",children:[s&&!l?(0,r.jsx)($,{eventLogs:s,allEventLogs:n,onDetailPanel:m,privacyRequest:h}):null,l?(0,r.jsx)(J,{errorMessage:c,status:d}):null]})]})]})},ee=e=>{let{subjectRequest:t}=e,{isOpen:i,onOpen:s,onClose:n}=(0,o.qY0)(),[c,d]=(0,p.useState)([]),[u,m]=(0,p.useState)(""),[h,x]=(0,p.useState)(!1),[g,v]=(0,p.useState)(""),[j,y]=(0,p.useState)(a.ERROR),{results:f,id:_}=t,{commentItems:b,isLoading:T}=D(_),{eventItems:E,isLoading:R}=L(f),{manualTaskItems:C,taskCommentIds:k,isLoading:q}=F(_);(0,p.useEffect)(()=>{u&&f&&f[u]&&d(f[u])},[f,u]);let S=()=>{x(!1)},N=(0,p.useCallback)((e,t)=>{m(e),d(t),s()},[s]),P=(0,p.useMemo)(()=>f?Object.values(f).flat():[],[f]),I=(0,p.useMemo)(()=>b.filter(e=>{let t=e.id.replace("comment-","");return!k.has(t)}),[b,k]),O=(0,p.useMemo)(()=>{let e=E.map(e=>{if("Request update"===e.type&&e.title&&f){let t=e.title;if(f[t])return{...e,onClick:()=>N(t,f[t])}}return e});return[{author:"Fides",title:"Access request received",date:new Date(t.created_at),type:l.REQUEST_UPDATE,showViewLog:!1,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"initial-request"},...e,...I,...C].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())},[E,I,C,f,N,t.created_at]);return(0,r.jsxs)(o.xuv,{width:"100%",children:[(0,r.jsx)(o.krs,{className:"!border-none",bordered:!1,split:!1,"data-testid":"activity-timeline-list",children:(0,r.jsx)("ul",{className:"!list-none",children:T||R||q?(0,r.jsx)("div",{className:w().itemButton,"data-testid":"timeline-skeleton",children:(0,r.jsx)(o.N_L,{paragraph:{rows:2},active:!0})}):O.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(A,{item:e})},e.id))})}),(0,r.jsx)(X,{isOpen:i,onClose:()=>{h&&S(),m(""),n()},currentLogs:c,allEventLogs:P,isViewingError:h,errorMessage:g,currentStatus:j,onOpenErrorPanel:(e,t)=>{v(e),t&&y(t),x(!0)},onCloseErrorPanel:S,privacyRequest:t})]})},et=i(66187);let ei=e=>{let{privacyRequestId:t,onCancel:i}=e,[s,n]=(0,p.useState)(""),a=(0,p.useRef)(null),[l,{isLoading:c}]=S();(0,p.useEffect)(()=>{a.current&&a.current.focus()},[]);let d=async()=>{if(s.trim())try{await l({privacy_request_id:t,comment_text:s,comment_type:et.i.NOTE}).unwrap(),n(""),i()}catch(e){console.error("Failed to add comment:",e),o.Pg3.error({content:"Failed to add comment",duration:5})}},u=[{key:"internal",label:"Internal comment",children:(0,r.jsx)(o.uFc.TextArea,{ref:a,value:s,onChange:e=>n(e.target.value),rows:3,className:"mb-3 h-[150px] w-full !resize-none","data-testid":"comment-input"})}];return(0,r.jsxs)("div",{children:[(0,r.jsx)(o.A5g,{items:u}),(0,r.jsxs)(o.jqI,{justify:"flex-end",className:"gap-2",children:[(0,r.jsx)(o.wpx,{onClick:i,"data-testid":"cancel-comment-button",children:"Cancel"}),(0,r.jsx)(o.wpx,{onClick:d,loading:c,disabled:!s.trim(),type:"primary",htmlType:"button","data-testid":"submit-comment-button",children:"Save"})]})]})};var es=e=>{let{subjectRequest:t}=e,[i,s]=(0,p.useState)(!1);return(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)(ee,{subjectRequest:t}),i?(0,r.jsx)(ei,{privacyRequestId:t.id,onCancel:()=>s(!1)}):(0,r.jsx)(g.ZP,{scopes:[x.Sh.COMMENT_CREATE],children:(0,r.jsx)(o.jqI,{justify:"flex-start",className:"mt-2",children:(0,r.jsxs)(o.wpx,{type:"default",onClick:()=>s(!0),className:"flex items-center","data-testid":"add-comment-button",children:["Add comment ",(0,r.jsx)("span",{className:"ml-1",children:"+"})]})})})]})},en=i(14207),ea=i(46238),el=i(72281),er=i(17245),eo=i(90867),ec=i(16134);let ed=e=>Array.from(new Set(e.filter(e=>Object.values(x.Us).includes(e.action_type)).map(e=>e.action_type)));var eu=e=>{let{rules:t}=e,i=ed(t).map(e=>(0,b.kC)(e)).map(e=>e);return(0,r.jsx)(o.AntTypography.Text,{children:i.join(" - ")})},em=i(34090),eh=i(55484),ep=e=>{let{connectorName:t,data:i,isSubmitting:s=!1,onSaveClick:n}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,p.useRef)(null),u=async(e,t)=>{n({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(em.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:eh.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual access"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please complete the following PII fields that have been collected for the selected subject."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(em.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map((e,t)=>{let[i]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(em.gN,{id:i,name:i,children:e=>{let{field:s}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:i,w:"50%",children:i}),(0,r.jsx)(o.IIB,{...s,autoComplete:"off",color:"gray.700",placeholder:"Please enter ".concat(i),ref:0===t?d:void 0,size:"sm"})]})}})},i)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:s,htmlType:"submit",children:"Save"})]})})]})]})})]})},ex=e=>{let{connectorName:t,data:i,isSubmitting:s=!1,onSaveClick:n}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,p.useRef)(null),u=async(e,t)=>{n({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(em.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:eh.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual erasure"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please delete the following PII fields associated with the selected subject if they are available. Once deleted, check the box to confirm the deletion."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(em.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map(e=>{let[t]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(em.gN,{id:t,name:t,children:e=>{let{field:i}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:t,w:"50%",children:t}),(0,r.jsx)(o.XZJ,{...i,isChecked:!!i.value,onChange:i.onChange,name:t,id:t})]})}})},t)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:s,htmlType:"submit",children:"Save"})]})})]})]})})]})};let eg=(e,t,i)=>e.includes(x.Us.ACCESS)?{ProcessingDetailComponent:ep,uploadMutation:t,getUploadedWebhookDataEndpoint:eo.$I.endpoints.getUploadedManualAccessWebhookData}:e.includes(x.Us.ERASURE)?{ProcessingDetailComponent:ex,uploadMutation:i,getUploadedWebhookDataEndpoint:eo.$I.endpoints.getUploadedManualErasureWebhookData}:null;var ev=e=>{let{subjectRequest:t,onComplete:i}=e,s=(0,ec.T)(),{errorAlert:n,successAlert:a}=(0,er.VY)(),{handleError:l}=(0,er.HK)(),[c,d]=(0,p.useState)([]),[u,m]=(0,p.useState)(!1),[h,g]=(0,p.useState)(!1),{data:v,isFetching:j,isLoading:y,isSuccess:f}=(0,en.W6)(),[_]=(0,eo.w3)(),b=ed(t.policy.rules),[T]=(0,eo.nL)(),[w]=(0,eo.UR)(),{ProcessingDetailComponent:E,uploadMutation:A,getUploadedWebhookDataEndpoint:R}=eg(b,T,w),C=async()=>{try{m(!0),await _(t.id).unwrap(),a("Manual request has been received. Request now processing."),i()}catch(e){l(e)}finally{m(!1)}},k=async e=>{try{g(!0),await A(e).unwrap();let t={connection_key:e.connection_key,fields:{}};Object.entries(e.body).forEach(e=>{let[i,s]=e;t.fields[i]=s||""});let i=c.map(e=>e.connection_key===t.connection_key?{...e,checked:!0,fields:{...t.fields}}:e);d(i),a("Manual input successfully saved!")}catch(e){l(e)}finally{g(!1)}};return((0,p.useEffect)(()=>(f&&v.length>0&&0===c.length&&(()=>{if(c.length>0)return;let e=[],i=null==v?void 0:v.map(e=>e.connection_config.key);null==i||i.every(i=>e.push(s(R.initiate({connection_key:i,privacy_request_id:t.id})))),Promise.allSettled(e).then(e=>{let t=[];e.forEach((e,i)=>{if("fulfilled"===e.status&&e.value.isSuccess&&e.value.data){let i={checked:e.value.data.checked,fields:{},connection_key:e.value.originalArgs.connection_key,privacy_request_id:e.value.originalArgs.privacy_request_id};Object.entries(e.value.data.fields).forEach(e=>{let[t,s]=e;i.fields[t]=s||""}),t.push(i)}else n("An error occurred while loading manual input data for ".concat(v[i].connection_config.name))}),d(t)})})(),()=>{}),[v,c.length,s,n,f,t.id,R]),b.includes(x.Us.ACCESS)||b.includes(x.Us.ERASURE))?(0,r.jsxs)(o.gCW,{align:"stretch",spacing:8,children:[(0,r.jsx)(o.xuv,{children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",children:"The following table details the integrations that require manual input from you."})}),(0,r.jsxs)(o.xuv,{children:[(j||y)&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),f&&v?(0,r.jsx)(o.xJi,{children:(0,r.jsxs)(o.iA_,{size:"sm",variant:"unstyled",children:[(0,r.jsx)(o.hrZ,{children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{fontSize:"sm",fontWeight:"semibold",pl:"0",textTransform:"none",children:"Integration Identifier"}),(0,r.jsx)(o.Th,{})]})}),(0,r.jsxs)(o.p3B,{children:[v.length>0&&v.map(e=>(0,r.jsxs)(o.Tr,{display:"block",children:[(0,r.jsx)(o.Td,{pl:"0",children:e.connection_config.key}),(0,r.jsx)(o.Td,{children:c.length>0?(0,r.jsx)(E,{connectorName:e.connection_config.name,data:c.find(t=>t.connection_key===e.connection_config.key),isSubmitting:h,onSaveClick:k}):null})]},e.id)),0===v.length&&(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Td,{colSpan:3,pl:"0",children:(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.xvT,{children:"You don‘t have any Manual Process connections set up yet."})})})})]}),c.length>0&&c.every(e=>e.checked)?(0,r.jsx)(o.$RU,{children:(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Th,{pl:"0px",children:(0,r.jsx)(o.wpx,{type:"primary",loading:u,onClick:C,className:"mt-2",children:"Complete DSR"})})})}):null]})}):null]})]}):null},ej=e=>{let{subjectRequest:t,onComplete:i}=e,s=(0,c.useRouter)(),{data:n}=(0,en.AZ)({}),a=(0,p.useMemo)(()=>{var e;return(null==n?void 0:null===(e=n.items)||void 0===e?void 0:e.filter(e=>e.connection_type===x.Rj.MANUAL_TASK))||[]},[n]),{data:l}=(0,en.W6)(),d=(l||[]).length>0,{data:m}=(0,B.Ym)({page:1,size:100,privacyRequestId:t.id}),h=(null==m?void 0:m.items)||[],g=h.length,v=h.filter(e=>e.status===x.OS.NEW).length,j=a.length>0,y=h.length>0;return j||d||y?(0,r.jsxs)(o.Kqy,{spacing:6,children:[j&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{marginBottom:12},children:"Manual tasks"}),(0,r.jsxs)(o.Kqy,{spacing:2,children:[(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:g})," task",1!==g?"s":""," ","linked to this privacy request"]}),(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:v})," pending task",1!==v?"s":""]}),g>0&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(o.wpx,{type:"primary",onClick:()=>{s.push({pathname:u.Jw,query:{privacy_request_id:t.id,tab:el.G.MANUAL_TASK}})},children:"View all tasks for this request →"})})]})]}),d&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsxs)(o.kCb,{alignItems:"center",style:{marginBottom:12},children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{margin:0,marginRight:8},children:"Manual steps (legacy)"}),(0,r.jsx)(ea.b,{label:"This is the legacy manual steps feature. The new manual tasks feature provides more advanced capabilities and better user experience."})]}),(0,r.jsx)(ev,{subjectRequest:t,onComplete:i||(()=>{})})]})]}):(0,r.jsx)(o.xuv,{p:4,children:(0,r.jsx)(o.AntTypography.Text,{type:"secondary",children:"No manual tasks or legacy manual steps configured for this request."})})},ey=i(59969);let ef={approved:{color:"success",label:"Approved"},complete:{color:"success",label:"Completed"},awaiting_email_send:{color:"marble",label:"Awaiting Email Send"},denied:{color:"warning",label:"Denied"},canceled:{color:"marble",label:"Canceled"},error:{color:"error",label:"Error"},in_processing:{color:"caution",label:"In Progress"},paused:{color:"marble",label:"Paused"},pending:{color:"info",label:"New"},identity_unverified:{color:"marble",label:"Unverified"},requires_input:{color:"minos",label:"Requires Input"},requires_manual_finalization:{color:"minos",label:"Requires Finalization"}};var e_=e=>{let{status:t}=e;return(0,r.jsx)(o.j8w,{color:ef[t].color,className:"justify-center","data-testid":"request-status-badge",children:ef[t].label})},eb=i(18225),eT=i(812),ew=i(7842);let{useGetAttachmentsQuery:eE,useUploadAttachmentMutation:eA,useGetAttachmentDetailsQuery:eR,useLazyGetAttachmentDetailsQuery:eC}=k.u.injectEndpoints({endpoints:e=>({getAttachments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:s}=e;return{url:"plus/privacy-request/".concat(t,"/attachment"),method:"GET",params:{page:i,size:s}}},providesTags:["Privacy Request Attachments"]}),uploadAttachment:e.mutation({query:e=>{let{privacy_request_id:t,attachment_type:i,attachment_file:s}=e,n=new FormData;return n.append("attachment_type",i),n.append("attachment_file",s),{url:"plus/privacy-request/".concat(t,"/attachment"),method:"POST",body:n,params:{}}},invalidatesTags:["Privacy Request Attachments"]}),getAttachmentDetails:e.query({query:e=>{let{privacy_request_id:t,attachment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/attachment/").concat(i),method:"GET"}}})})}),{reducer:ek}=(0,C.oM)({name:"privacyRequestAttachments",initialState:{},reducers:{}}),eq=e=>{var t;let{file:i}=e,[s,n]=(0,p.useState)(!1),[a]=eC(),l=async()=>{var e,t,s;if((null===(e=i.customData)||void 0===e?void 0:e.attachment_id)&&(null===(t=i.customData)||void 0===t?void 0:t.privacy_request_id)){n(!0);try{let e=await a({privacy_request_id:i.customData.privacy_request_id,attachment_id:i.customData.attachment_id}),t=null===(s=e.data)||void 0===s?void 0:s.retrieved_attachment_url,n=null==t?void 0:t.startsWith("http");t&&n?window.open(t,"_blank"):t&&!n?o.Pg3.info("Download is not available when using local storage methods."):o.Pg3.error("No download URL available for ".concat(i.name))}catch(e){o.Pg3.error("Failed to fetch attachment download URL")}finally{n(!1)}}},c=(null===(t=i.customData)||void 0===t?void 0:t.attachment_type)===x.sf.INCLUDE_WITH_ACCESS_PACKAGE;return(0,r.jsxs)(o.jqI,{align:"center",gap:8,children:[(0,r.jsx)(o.PJP.PgN,{className:"shrink-0"}),(0,r.jsx)(o.lKn,{ellipsis:{tooltip:i.name},className:"grow",children:i.name}),c&&(0,r.jsx)(o.esZ,{title:"This attachment will be included in the access package.",children:(0,r.jsx)(o.PJP.wvC,{className:"shrink-0",title:"User icon"})}),(0,r.jsx)(o.wpx,{type:"text",icon:(0,r.jsx)(o.PJP.UWx,{}),onClick:l,loading:s,className:"shrink-0"})]})},eS=(e,t)=>(0,r.jsx)(eq,{file:t});var eN=e=>{let{subjectRequest:t}=e,[i,s]=(0,p.useState)(!1),n=(0,g.Tg)([x.Sh.ATTACHMENT_READ]),a=(0,g.Tg)([x.Sh.ATTACHMENT_CREATE]),[l]=eA(),{data:c,isLoading:d,error:u}=(0,eo.PW)(),{data:m,isLoading:h}=eE({privacy_request_id:t.id}),{refetch:v}=eE({privacy_request_id:t.id}),j=(null==m?void 0:m.items.map(e=>({uid:e.id,name:e.file_name,status:"done",customData:{attachment_id:e.id,privacy_request_id:t.id,attachment_type:e.attachment_type}})))||[],y=(0,p.useCallback)(()=>(0,r.jsx)(o.PJP.PgN,{}),[]);if(!n)return null;let f=a&&(null==c?void 0:c.key),_=[".pdf",".doc",".docx",".xls",".xlsx",".txt",".csv",".jpg",".jpeg",".png",".zip"];return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.lQT,{level:3,children:"Attachments"})}),d||h?(0,r.jsx)(eb.Z,{size:"md",alignment:"start"}):(0,r.jsx)(o.pMK,{name:"attachment_file",fileList:j,iconRender:y,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:eS,accept:_.join(","),customRequest:async e=>{let{file:i,onSuccess:n,onError:a}=e,r=i.name;try{s(!0),await l({privacy_request_id:t.id,attachment_file:i,attachment_type:ew.s.INTERNAL_USE_ONLY}).unwrap(),o.Pg3.success("".concat(r," file uploaded successfully")),v(),null==n||n(i)}catch(e){o.Pg3.error("".concat(r," file upload failed.")),null==a||a(e)}finally{s(!1)}},disabled:!f,children:a&&(0,r.jsx)(o.esZ,{title:u&&"Add attachment not available: ".concat((0,eT.e$)(u)),placement:"top",children:(0,r.jsxs)(o.jqI,{align:"center",gap:12,className:"mb-4",children:[(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.mm_,{}),iconPosition:"end",disabled:!f||i,loading:i,children:i?"Uploading":"Add"}),(0,r.jsx)(ea.b,{label:"Uploaded attachments are for internal use and won't be send as part of the request package.\n Accepted filetypes: ".concat(_.join(", ")),placement:"top"})]})})})]})})},eP=i(15709),eI=i.n(eP),eD=e=>{let{label:t,children:i}=e;return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"shrink-0 grow-0 basis-1/2 pr-2 ".concat(eI().label),children:(0,r.jsxs)(o.AntTypography.Text,{children:[t,":"]})}),(0,r.jsx)("div",{className:"min-w-0 shrink grow ".concat(eI().value),"data-testid":"request-detail-value-".concat(t),children:i})]})},eO=e=>{let{subjectRequest:t}=e,{custom_privacy_request_fields:i}=t;return(0,r.jsx)("div",{className:"flex flex-col gap-2",children:i&&Object.keys(i).length>0&&Object.entries(i).filter(e=>{let[,t]=e;return t.value}).map(e=>{let[t,i]=e;return(0,r.jsx)(eD,{label:i.label,children:(0,r.jsx)(o.AntTypography.Text,{children:Array.isArray(i.value)?i.value.join(", "):i.value})},t)})})},eM=e=>{var t,i;let{subjectRequest:s}=e,{plus:n}=(0,R.hz)(),{id:a,status:l,policy:c,identity:d,identity_verified_at:u}=s;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.AntTypography.Title,{level:2,children:"Request details"})}),(0,r.jsxs)(o.jqI,{vertical:!0,gap:12,className:"mb-6",children:[(0,r.jsx)(eD,{label:"Status",children:(0,r.jsx)(e_,{status:l})}),(0,r.jsx)(eD,{label:"Time remaining",children:(0,r.jsx)(ey.Z,{daysLeft:s.days_left,includeText:!0,status:s.status})}),(0,r.jsx)(eD,{label:"Request type",children:(0,r.jsx)(eu,{rules:c.rules})}),(0,r.jsx)(eD,{label:"Source",children:n&&(0,r.jsx)(o.AntTypography.Text,{children:s.source||"-"})}),s.submitted_by&&(0,r.jsx)(eD,{label:"Created by",children:(0,r.jsx)(o.AntTypography.Text,{children:(null===(t=s.submitter)||void 0===t?void 0:t.username)||"-"})}),(0,r.jsx)(eD,{label:"Reviewed by",children:(0,r.jsx)(o.AntTypography.Text,{children:(null===(i=s.reviewer)||void 0===i?void 0:i.username)||"-"})}),Object.entries(d).filter(e=>{let[,{value:t}]=e;return null!==t}).map(e=>{let[t,{value:i="",label:s}]=e,n="".concat(i).concat(u?"":" (Unverified)");return(0,r.jsx)(eD,{label:"Subject ".concat(s.toLocaleLowerCase()),children:(0,r.jsx)(o.esZ,{title:n,trigger:"click",children:(0,r.jsx)(o.AntTypography.Text,{ellipsis:!0,children:n})})},t)}),(0,r.jsx)(eO,{subjectRequest:s})]}),(0,r.jsxs)(o.PPS,{layout:"vertical",children:[(0,r.jsx)(o.PPS.Item,{label:"Request ID:",className:"mb-4",children:(0,r.jsx)(o.jqI,{gap:1,children:(0,r.jsxs)(o.vyj.Compact,{style:{width:"100%"},children:[(0,r.jsx)(o.uFc,{readOnly:!0,value:a,"data-testid":"request-detail-value-id"}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(Z.Z,{copyText:a})})]})})}),(0,r.jsx)(o.PPS.Item,{label:"Policy key:",className:"mb-4",children:(0,r.jsx)(o.uFc,{readOnly:!0,value:s.policy.key,"data-testid":"request-detail-value-policy"})})]}),(0,r.jsx)(eN,{subjectRequest:s})]})};let eU=[x.q2.COMPLETE,x.q2.CANCELED,x.q2.DENIED,x.q2.ERROR];var ez=e=>{var t;let{data:i}=e,s=(0,p.useMemo)(()=>({id:i.id,verbose:!0}),[i.id]),{data:n}=(0,h.QA)(s,{pollingInterval:eU.includes(i.status)?0:2e3,skip:!i.id}),a=null!==(t=null==n?void 0:n.items[0])&&void 0!==t?t:i,l=a.status===x.q2.REQUIRES_INPUT,[c,d]=(0,p.useState)("activity"),u=(0,p.useMemo)(()=>[{key:"activity",label:"Activity",children:(0,r.jsx)(es,{subjectRequest:a})},{key:"manual-tasks",label:"Manual tasks",children:(0,r.jsx)(ej,{subjectRequest:a,onComplete:()=>d("activity")}),disabled:!l}],[l,a]);return(0,r.jsxs)("div",{className:"flex gap-8",children:[(0,r.jsx)("div",{className:"w-0 grow",children:(0,r.jsx)(o.A5g,{items:u,activeKey:c,onChange:d})}),(0,r.jsx)("div",{className:"w-1/3 2xl:w-[432px]","data-testid":"privacy-request-details",children:(0,r.jsx)(eM,{subjectRequest:a})})]})},eL=i(57526),eW=i(66548),eB=i(45489),eF=e=>{let{privacyRequest:t,action:i}=e,{handleApproveRequest:s,handleDenyRequest:n}=(0,eB.Z)({subjectRequest:t}),a=t.status===x.q2.PENDING,l=(0,o.qY0)(),r=async e=>{let{reason:t}=e,a=o.Pg3.loading({content:"approve"===i?"Approving request...":"Denying request..."});"deny"===i&&await n(t),"approve"===i&&await s(),a()};return{showAction:a,closeModal:l.onClose,performAction:r,openConfirmationModal:l.onOpen,isModalOpen:l.isOpen}},eZ=e=>{var t,i,s;let{privacyRequest:n}=e,a=null===(i=(0,R.hz)())||void 0===i?void 0:null===(t=i.flags)||void 0===t?void 0:t.downloadAccessRequestResults,l=n.status===x.q2.COMPLETE,r=ed(n.policy.rules).includes(x.Us.ACCESS),o=(0,g.Tg)([x.Sh.PRIVACY_REQUEST_ACCESS_RESULTS_READ]),{data:c,isLoading:d,isError:u,error:m}=(0,eo.br)({privacy_request_id:n.id}),h=null!==(s=null==c?void 0:c.access_result_urls[0])&&void 0!==s?s:"",p=!!h&&"your local fides_uploads folder"!==h,v=null;return u?v=(0,eT.e$)(m,"Unable to resolve download URL"):p||(v="Requests stored locally cannot be downloaded"),{showDownloadResults:a&&o&&r&&l,downloadResults:()=>{let e=document.createElement("a");e.href=h,e.target="_blank",e.rel="noopener noreferrer",e.click(),e.remove()},infoTooltip:v,isLoading:d,isDisabled:!p}},eJ=e=>{let{privacyRequest:t}=e,{errorAlert:i,successAlert:s}=(0,er.VY)(),n=t.status===x.q2.ERROR,[a]=(0,eo.Fq)();return{reprocessPrivacyRequest:async()=>{if(!t)return;let e=o.Pg3.loading("Reprocessing privacy request...",0),n=await a(t);"error"in n?i((0,eT.e$)(n.error),"DSR automation has failed for this privacy request due to the following:",{duration:null}):s("Privacy request is now being reprocessed."),e()},showReprocess:n}},eG=e=>{let{privacyRequest:t}=e,{showDownloadResults:i,downloadResults:s,infoTooltip:n,isDisabled:a}=eZ({privacyRequest:t}),{isModalOpen:l,closeModal:c,performAction:d,openConfirmationModal:u,showAction:m}=eF({privacyRequest:t,action:"approve"}),{isModalOpen:h,closeModal:g,performAction:v,openConfirmationModal:j,showAction:y}=eF({privacyRequest:t,action:"deny"}),{reprocessPrivacyRequest:f,showReprocess:_}=eJ({privacyRequest:t}),{handleFinalizeRequest:b,finalizeRequestResult:T}=(0,eB.Z)({subjectRequest:t}),w=(0,p.useMemo)(()=>{let e=[];return e.push({key:"approve",label:(0,r.jsx)("span",{"data-testid":"privacy-request-approve-btn",children:"Approve"}),onClick:u,disabled:!m}),e.push({key:"deny",label:(0,r.jsx)("span",{"data-testid":"privacy-request-deny-btn",children:"Deny"}),onClick:j,disabled:!y}),e.push({key:"reprocess",label:(0,r.jsx)("span",{"data-testid":"privacy-request-action-reprocess",children:"Reprocess"}),onClick:f,disabled:!_}),t.status===x.q2.REQUIRES_MANUAL_FINALIZATION&&e.push({key:"finalize",label:(0,r.jsx)("span",{"data-testid":"privacy-request-action-finalize",children:"Finalize"}),onClick:b,disabled:T.isLoading}),i&&e.push({key:"download",label:(0,r.jsx)(o.esZ,{title:a?n:null,placement:"bottom",children:(0,r.jsx)("span",{"data-testid":"download-results-btn",children:"Download request results"})}),onClick:s,disabled:a}),e},[i,s,n,a,m,y,u,j,_,f,t.status,b,T.isLoading]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.S0p,{menu:{items:w},trigger:["click"],overlayStyle:{minWidth:"160px"},children:(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.pO,{}),"data-testid":"privacy-request-actions-dropdown-btn",iconPosition:"end",type:"primary",disabled:!w.length,size:"large",children:"Actions"})}),(0,r.jsx)(eL.Z,{isOpen:l,isLoading:!1,onClose:c,onApproveRequest:()=>d({reason:""}),subjectRequest:t}),(0,r.jsx)(eW.Z,{isOpen:h,onClose:g,onDenyRequest:e=>v({reason:e})})]})},eK=()=>{let e=(0,c.useRouter)().query.id,{data:t,isLoading:i}=(0,h.QA)({id:e,verbose:!0},{skip:!e}),s=(null==t?void 0:t.items[0])||null;return(0,r.jsxs)(d.Z,{title:"Privacy Request - ".concat(e),children:[(0,r.jsx)(m.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests",href:u.Jw},{title:"Request details"}],rightContent:!!s&&(0,r.jsx)(eG,{privacyRequest:s})}),i&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),!i&&!s&&(0,r.jsx)(o.xvT,{children:"404 no privacy request found"}),!i&&s&&(0,r.jsx)(ez,{data:s})]})}},15709:function(e){e.exports={value:"RequestDetailsRow_value__WMXn3",label:"RequestDetailsRow_label__dn3CQ"}},38450:function(e){e.exports={container:"ActivityTimelineEntry_container__tCva0","container--open":"ActivityTimelineEntry_container--open__1d9mA",itemButton:"ActivityTimelineEntry_itemButton__MlmWS","itemButton--error":"ActivityTimelineEntry_itemButton--error__UizD2","itemButton--comment":"ActivityTimelineEntry_itemButton--comment__g98SH","itemButton--awaiting-input":"ActivityTimelineEntry_itemButton--awaiting-input__6lB5t",header:"ActivityTimelineEntry_header__GYibj",title:"ActivityTimelineEntry_title__rm_g0","title--error":"ActivityTimelineEntry_title--error__fOi0s","title--awaiting-input":"ActivityTimelineEntry_title--awaiting-input__3sPAo",timestamp:"ActivityTimelineEntry_timestamp__uMEMT",viewLogs:"ActivityTimelineEntry_viewLogs___T4jN",logs:"ActivityTimelineEntry_logs__T7R0J","logs--open":"ActivityTimelineEntry_logs--open__o_9Io"}}},function(e){e.O(0,[431,4558,2888,9774,179],function(){return e(e.s=6554)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2369],{1565:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests",function(){return s(19509)}])},35287:function(e,t,s){"use strict";var i=s(24246),l=s(96306),a=s(88038),r=s.n(a);s(27378),t.Z=e=>{let{children:t,title:s,mainProps:a}=e;return(0,i.jsxs)(l.kCb,{"data-testid":s,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,i.jsxs)(r(),{children:[(0,i.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,i.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,i.jsx)(l.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...a,children:t})]})}},87361:function(e,t,s){"use strict";var i=s(24246),l=s(96306);t.Z=e=>{let{title:t,text:s,onClose:a}=e;return(0,i.jsxs)(l.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[a&&(0,i.jsx)(l.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:a}),(0,i.jsx)(l.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,i.jsxs)(l.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,i.jsx)(l.X6q,{fontSize:"md",children:t}),(0,i.jsx)(l.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:s})]})]})}},96718:function(e,t,s){"use strict";s.d(t,{z:function(){return a}});var i=s(24246),l=s(96306);let a=e=>{let{...t}=e;return(0,i.jsx)(l.WPr,{defaultActiveFirstOption:!1,maxTagCount:"responsive",allowClear:!0,styles:t.mode?void 0:{popup:{root:{width:"auto",minWidth:"200px"}}},className:"w-auto","data-testid":"filter-select",...t})}},97181:function(e,t,s){"use strict";s.d(t,{d:function(){return o}});var i=s(24246),l=s(96306),a=s(34090),r=s(27378),n=s(46238),d=s(40324);let o=e=>{let{name:t,label:s,labelProps:o,tooltip:c,isRequired:u,layout:p="inline",helperText:m,...x}=e,[h,v,{setValue:y}]=(0,a.U$)(t),j=!!(v.touched&&v.error),[g,_]=(0,r.useState)("");h.value||"tags"!==x.mode&&"multiple"!==x.mode||(h.value=[]),"tags"===x.mode&&"string"==typeof h.value&&(h.value=[h.value]);let f="tags"===x.mode?(e,t)=>e?e.value!==g||h.value.includes(g)?x.optionRender?x.optionRender(e,t):e.label:'Create "'.concat(g,'"'):void 0:x.optionRender||void 0,b=e=>{_(e),x.onSearch&&x.onSearch(e)},q=(e,t)=>{y(e),x.onChange&&x.onChange(e,t)};return"inline"===p?(0,i.jsx)(l.NIc,{isInvalid:j,isRequired:u,children:(0,i.jsxs)(l.rjZ,{templateColumns:s?"1fr 3fr":"1fr",children:[s?(0,i.jsx)(d.__,{htmlFor:x.id||t,...o,children:s}):null,(0,i.jsxs)(l.jqI,{align:"center",children:[(0,i.jsxs)(l.jqI,{vertical:!0,flex:1,className:"mr-2",children:[(0,i.jsx)(l.WPr,{...h,id:x.id||t,"data-testid":"controlled-select-".concat(h.name),...x,optionRender:f,onSearch:"tags"===x.mode?b:void 0,onChange:q,value:h.value||void 0,status:j?"error":void 0}),m&&(0,i.jsx)(l.Q6r,{children:m}),(0,i.jsx)(d.Bc,{isInvalid:j,message:v.error,fieldName:h.name})]}),(0,i.jsx)(n.b,{label:c,className:j?"mt-2 self-start":void 0})]})]})}):(0,i.jsx)(l.NIc,{isInvalid:j,isRequired:u,children:(0,i.jsxs)(l.gCW,{alignItems:"start",children:[(0,i.jsxs)(l.jqI,{align:"center",children:[s?(0,i.jsx)(d.__,{htmlFor:x.id||t,fontSize:"xs",my:0,mr:1,...o,children:s}):null,(0,i.jsx)(n.b,{label:c})]}),(0,i.jsx)(l.WPr,{...h,id:x.id||t,"data-testid":"controlled-select-".concat(h.name),...x,optionRender:f,onSearch:"tags"===x.mode?b:void 0,onChange:q,value:h.value||void 0,status:j?"error":void 0}),m&&(0,i.jsx)(l.Q6r,{style:{marginTop:0},children:m}),(0,i.jsx)(d.Bc,{isInvalid:j,message:v.error,fieldName:h.name})]})})}},71784:function(e,t,s){"use strict";s.d(t,{DE:function(){return n},I3:function(){return l},kN:function(){return r},rE:function(){return a}});var i=s(21910);let l=[...new Map([[i.q2.APPROVED,"Approved"],[i.q2.AWAITING_EMAIL_SEND,"Awaiting email send"],[i.q2.CANCELED,"Canceled"],[i.q2.COMPLETE,"Completed"],[i.q2.DENIED,"Denied"],[i.q2.ERROR,"Error"],[i.q2.IN_PROCESSING,"In progress"],[i.q2.PENDING,"New"],[i.q2.PAUSED,"Paused"],[i.q2.IDENTITY_UNVERIFIED,"Unverified"],[i.q2.REQUIRES_INPUT,"Requires input"],[i.q2.REQUIRES_MANUAL_FINALIZATION,"Requires finalization"]])].map(e=>{let[t,s]=e;return{label:s,value:t}}),a=new Map([[i.Us.ACCESS,"Access"],[i.Us.ERASURE,"Erasure"],[i.Us.CONSENT,"Consent"],[i.Us.UPDATE,"Update"]]),r=[...a].map(e=>{let[t,s]=e;return{label:s,value:t}}),n={local:"local",s3:"s3",gcs:"gcs"}},19509:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ez}});var i,l,a=s(24246),r=s(35287),n=s(96306),d=s(65218),o=s.n(d),c=s(27378),u=s(25980),p=s(19904),m=s(56141),x=s.n(m),h=s(86677),v=s(16134),y=s(91317),j=s(18225),g=s(77830),_=s(28407),f=s(16394),b=s(21910),q=s(32735),C=s(59969),S=s(71784),k=s(45116);let E=e=>{let{label:t,children:s}=e;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"shrink-0 grow-0 basis-1/3 pr-2",children:(0,a.jsxs)(n.AntTypography.Text,{className:"text-gray-700",children:[t,":"]})}),(0,a.jsx)("div",{className:"min-w-0 shrink grow text-gray-600",children:s})]})},R=e=>{let{task:t}=e,s=t.request_type===b.k6.ACCESS?b.Us.ACCESS:b.Us.ERASURE,i=S.rE.get(s)||t.request_type;return(0,a.jsxs)("div",{className:"flex flex-col space-y-3","data-testid":"task-details-container",children:[(0,a.jsx)(E,{label:"Name",children:(0,a.jsx)(n.AntTypography.Text,{children:t.name})}),(0,a.jsx)(E,{label:"Description",children:(0,a.jsx)(n.AntTypography.Text,{children:t.description||"-"})}),(0,a.jsx)(E,{label:"Request Type",children:(0,a.jsx)(n.AntTypography.Text,{children:i})}),(0,a.jsx)(E,{label:"Assigned To",children:t.assigned_users&&t.assigned_users.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1","data-testid":"assigned-users-tags",children:t.assigned_users.map(e=>(0,a.jsx)(n.j8w,{"data-testid":"assigned-user-tag-".concat(e.id),children:"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.email_address||"Unknown User"},e.id))}):(0,a.jsx)(n.AntTypography.Text,{children:"No one assigned"})}),t.privacy_request.subject_identities&&Object.keys(t.privacy_request.subject_identities).length>0?(0,a.jsx)(E,{label:"Subject identities",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.subject_identities).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",String(s)]},t)})})}):null,t.privacy_request.custom_fields&&Object.keys(t.privacy_request.custom_fields).length>0?(0,a.jsx)(E,{label:"Custom fields",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.custom_fields).filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",String(s)]},t)})})}):null]})},w=e=>{let{isOpen:t,onClose:s,task:i}=e,[l,{isLoading:r}]=(0,k.HP)(),[d,o]=(0,c.useState)(""),[u,p]=(0,c.useState)(!1),[m,x]=(0,c.useState)(""),[h,v]=(0,c.useState)([]),y=async()=>{try{await l({privacy_request_id:i.privacy_request.id,manual_field_id:i.manual_field_id,field_value:i.input_type===b.PF.TEXT?d:i.input_type===b.PF.CHECKBOX?u.toString():void 0,comment_text:m||void 0,attachments:h.length>0?h.map(e=>e.originFileObj).filter(Boolean):void 0}).unwrap(),o(""),p(!1),x(""),v([]),s()}catch(e){n.Pg3.error("Failed to complete task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"complete-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Complete Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(R,{task:i})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(()=>{switch(i.input_type){case b.PF.TEXT:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Subject data"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Enter your response...",rows:4,"data-testid":"complete-modal-text-input"})]});case b.PF.CHECKBOX:return(0,a.jsx)("div",{className:"space-y-2",children:(0,a.jsx)(n.E_O,{checked:u,onChange:e=>p(e.target.checked),"data-testid":"complete-modal-checkbox",children:"The task has been completed"})});default:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Upload Files"}),(0,a.jsx)("div",{children:(0,a.jsx)(n.pMK,{fileList:h,onChange:e=>{let{fileList:t}=e;return v(t)},beforeUpload:()=>!1,"data-testid":"complete-modal-file-upload",multiple:!0,children:(0,a.jsx)(n.wpx,{"data-testid":"complete-modal-upload-button",children:"Click to Upload"})})})]})}})(),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Internal comment"}),(0,a.jsx)(n.uFc.TextArea,{value:m,onChange:e=>x(e.target.value),placeholder:"Add any additional comments...",rows:3,"data-testid":"complete-modal-comment-input"})]})]})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),p(!1),x(""),v([]),s()},disabled:r,"data-testid":"complete-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:y,loading:r,disabled:!(()=>{switch(i.input_type){case b.PF.TEXT:return d.trim().length>0;case b.PF.CHECKBOX:return u;default:return h.length>0}})(),"data-testid":"complete-modal-save-button",children:"Save"})]})})]})]})},T=e=>{let{isOpen:t,onClose:s,task:i}=e,[l,{isLoading:r}]=(0,k.DA)(),[d,o]=(0,c.useState)(""),u=async()=>{try{await l({privacy_request_id:i.privacy_request.id,manual_field_id:i.manual_field_id,skip_reason:d}).unwrap(),o(""),s()}catch(e){n.Pg3.error("Failed to skip task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"skip-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Skip Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(R,{task:i})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Reason for skipping (Required)"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Please provide a reason for skipping this task...",rows:4,"data-testid":"skip-modal-comment-input"})]})})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),s()},disabled:r,"data-testid":"skip-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:u,loading:r,disabled:!d.trim(),danger:!0,"data-testid":"skip-modal-skip-button",children:"Skip Task"})]})})]})]})},I=e=>{let{task:t}=e,s=(0,h.useRouter)(),{isOpen:i,onOpen:l,onClose:r}=(0,n.qY0)(),{isOpen:d,onOpen:o,onClose:c}=(0,n.qY0)(),u=(0,p.Tg)([b.Sh.PRIVACY_REQUEST_READ]);if(t.status!==b.OS.NEW)return null;let m=[{key:"skip",label:"Skip task",onClick:o}];return u&&m.push({key:"go-to-request",label:"Go to request",onClick:()=>{s.push({pathname:g.ld,query:{id:t.privacy_request.id}})}}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.vyj,{size:"small",children:[(0,a.jsx)(n.wpx,{type:"default",onClick:l,size:"small",children:"Complete"}),(0,a.jsx)(n.S0p,{menu:{items:m},trigger:["click"],placement:"bottomRight",overlayStyle:{minWidth:120},children:(0,a.jsx)(n.wpx,{size:"small",icon:(0,a.jsx)(n.PJP.r43,{}),"aria-label":"More actions"})})]}),(0,a.jsx)(w,{isOpen:i,onClose:r,task:t}),(0,a.jsx)(T,{isOpen:d,onClose:c,task:t})]})},A={[b.OS.NEW]:{color:"info",label:"New"},[b.OS.COMPLETED]:{color:"success",label:"Completed"},[b.OS.SKIPPED]:{color:"marble",label:"Skipped"}},N=[{text:"New",value:b.OS.NEW},{text:"Completed",value:b.OS.COMPLETED},{text:"Skipped",value:b.OS.SKIPPED}],P=[{text:"Access",value:b.k6.ACCESS},{text:"Erasure",value:b.k6.ERASURE}],O=e=>{let{systemFilters:t,userFilters:s,onUserClick:i,currentFilters:l,hasAccessToAllTasks:r}=e,d=[{title:"Task name",dataIndex:"name",key:"name",minWidth:100,render:e=>(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:e},children:e})},{title:"Status",dataIndex:"status",key:"status",width:110,render:e=>(0,a.jsx)(n.j8w,{color:A[e].color,"data-testid":"manual-task-status-tag",children:A[e].label}),filters:N,filterMultiple:!1},{title:"System",dataIndex:["system","name"],key:"system_name",minWidth:100,render:e=>(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:e},children:e}),filters:t,filterMultiple:!1},{title:"Type",dataIndex:"request_type",key:"request_type",width:80,render:e=>{let t=e===b.k6.ACCESS?b.Us.ACCESS:b.Us.ERASURE,s=S.rE.get(t)||e;return(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:s},children:s})},filters:P,filterMultiple:!1},{title:"Assigned to",dataIndex:"assigned_users",key:"assigned_users",minWidth:100,render:e=>{if(!e||0===e.length)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.map(e=>({label:(0,f.gJ)(e),value:e.id})),s=e.map(e=>e.id);return(0,a.jsx)(n.d3V,{value:s,options:t,readonly:!0,onTagClick:e=>i(String(e))})},filters:s,filterMultiple:!1,defaultFilteredValue:l.assignedUsers?[l.assignedUsers]:void 0},{title:"Days left",dataIndex:["privacy_request","days_left"],key:"days_left",width:90,render:e=>(0,a.jsx)(C.Z,{daysLeft:e||0,includeText:!1,status:b.q2.PENDING})},{title:"Subject identity",dataIndex:["privacy_request","subject_identities"],key:"subject_identities",minWidth:120,render:e=>{if(!e)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.email||e.phone_number||"";return(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:t},children:t})}},{title:"Actions",key:"actions",width:145,render:(e,t)=>(0,a.jsx)(I,{task:t})}];return r?d:d.filter(e=>"assigned_users"!==e.key)},U=()=>{let e=(0,h.useRouter)(),t=(0,v.C)(y.dy),[s,i]=(0,c.useState)(1),[l,r]=(0,c.useState)(25),d=(0,p.Tg)([b.Sh.MANUAL_FIELD_READ_ALL]),o=e.query.privacy_request_id||void 0,u=(0,c.useMemo)(()=>{let e={};return(null==t?void 0:t.id)&&!o&&(e.assignedUsers=t.id),o&&"string"==typeof o&&(e.privacyRequestId=o),e},[null==t?void 0:t.id,o]),[m,C]=(0,c.useState)(u),{data:S,isLoading:E,isFetching:R}=(0,k.Ym)({page:s,size:l,status:m.status,systemName:m.systemName,requestType:m.requestType,assignedUserId:m.assignedUsers,privacyRequestId:m.privacyRequestId}),{data:w}=(0,k.Ym)({page:1,size:1}),{items:T,total:I}=(0,c.useMemo)(()=>S||{items:[],total:0,pages:0,filter_options:{assigned_users:[],systems:[]}},[S]),A=(0,c.useMemo)(()=>(null==w?void 0:w.filter_options)||{assigned_users:[],systems:[]},[w]),N=O({systemFilters:(0,c.useMemo)(()=>{var e;return(null==A?void 0:null===(e=A.systems)||void 0===e?void 0:e.map(e=>({text:e.name,value:e.name})))||[]},[null==A?void 0:A.systems]),userFilters:(0,c.useMemo)(()=>{var e;let s=(null==A?void 0:null===(e=A.assigned_users)||void 0===e?void 0:e.map(e=>({text:(0,f.gJ)(e),value:e.id})))||[];return(null==t?void 0:t.id)&&!s.some(e=>e.value===t.id)&&s.push({text:(0,f.gJ)(t,{fallbackToId:!0}),value:t.id}),s},[null==A?void 0:A.assigned_users,t]),onUserClick:t=>{e.push({pathname:g.fw,query:{id:t}})},currentFilters:m,hasAccessToAllTasks:d}),P=(0,c.useMemo)(()=>x()(m,u),[m,u]);return E?(0,a.jsx)(j.Z,{}):(0,a.jsxs)("div",{className:"mt-2 space-y-4",children:[(0,a.jsx)(n.kCb,{gap:3,align:"center",className:"mb-4",children:(0,a.jsx)(_.H,{globalFilter:m.privacyRequestId||"",setGlobalFilter:e=>{let t={...m};e&&e.trim()?t.privacyRequestId=e.trim():delete t.privacyRequestId,C(t),i(1)},placeholder:"Search by privacy request ID",testid:"privacy-request-id-filter"})}),(0,a.jsx)(n.V5H,{columns:N,dataSource:T,rowKey:e=>"".concat(e.privacy_request.id,"-").concat(e.manual_field_id),pagination:{current:s,pageSize:l,pageSizeOptions:q.VZ,total:I||0,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),onChange:(e,t)=>{i(e),t!==l&&(r(t),i(1))}},onChange:(e,t)=>{let s={privacyRequestId:m.privacyRequestId};t.status&&([s.status]=t.status),t.system_name&&([s.systemName]=t.system_name),t.request_type&&([s.requestType]=t.request_type),t.assigned_users&&([s.assignedUsers]=t.assigned_users),C(s),i(1)},locale:{emptyText:P?(0,a.jsx)("div",{"data-testid":"empty-state-current-user",className:"my-4",children:(0,a.jsxs)(n.AntTypography.Paragraph,{children:["You have no tasks assigned."," ",d&&(0,a.jsx)("span",{children:'You can modify the "Assigned to" column filter to view tasks assigned to other users.'})]})}):(0,a.jsx)("div",{"data-testid":"empty-state",className:"my-4",children:"No results found."})},loading:E||R,scroll:{scrollToFirstRowOnChange:!0},tableLayout:"fixed",className:"[&_th]:!break-normal"})]})};var z=s(59003),F=s(92222),D=s(40431),M=s(16125),Z=s(14048),L=s(47935),W=s(90867);let Y={approved:{colorScheme:"success",label:"Approved"},complete:{label:"Completed",colorScheme:"success"},awaiting_email_send:{label:"Awaiting Email Send",colorScheme:"marble"},denied:{label:"Denied",colorScheme:"warning"},canceled:{label:"Canceled",colorScheme:"marble"},error:{label:"Error",colorScheme:"error"},in_processing:{label:"In Progress",colorScheme:"caution"},paused:{label:"Paused",colorScheme:"marble"},pending:{label:"New",colorScheme:"info"},identity_unverified:{label:"Unverified",colorScheme:"marble"},requires_input:{colorScheme:"minos",label:"Requires Input"},requires_manual_finalization:{colorScheme:"minos",label:"Requires Finalization"}},B=e=>{let{value:t}=e;return(0,a.jsx)(L.A4,{color:Y[t].colorScheme,value:Y[t].label,"data-testid":"request-status-badge"})},V=e=>{let t,{daysLeft:s,timeframe:i=45,status:l,includeText:r=!1}=e;if(null==s||l===b.q2.COMPLETE||l===b.q2.CANCELED||l===b.q2.DENIED||l===b.q2.IDENTITY_UNVERIFIED)return null;let n=100*s/i;return n<25?t="error":n>=75?t="success":n>=25&&(t="warning"),(0,a.jsx)(L.A4,{value:r?"".concat(s," days left"):s.toString(),color:t})},K=e=>Array.from(new Set(e.filter(e=>Object.values(b.Us).includes(e.action_type)).map(e=>e.action_type))),G=e=>{let{value:t}=e,s=K(t).map(e=>S.rE.get(e));return(0,a.jsx)(L.WP,{value:s,cellState:{isExpanded:!0}})};var Q=s(58452),X=s(7426),J=s(57526),H=s(66548),$=s(45489),ee=s(42478);let et=e=>{var t;let{subjectRequest:s,...i}=e,l=(0,n.qY0)(),r=(0,n.qY0)(),d=(0,n.qY0)(),o=(0,n.qY0)(),{handleApproveRequest:c,handleDenyRequest:u,handleDeleteRequest:m,handleFinalizeRequest:x,isLoading:h}=(0,$.Z)({subjectRequest:s}),{data:v}=(0,X.tB)({api_set:!1}),{data:y}=(0,ee.JE)(),j=null==v?void 0:null===(t=v.notifications)||void 0===t?void 0:t.send_request_completion_notification;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.Ugi,{...i,children:["pending"!==s.status?null:(0,a.jsx)(n.wpx,{title:"Approve","aria-label":"Approve",icon:(0,a.jsx)(n.PJP.MCw,{}),onClick:l.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-approve-btn",size:"small"}),"pending"!==s.status?null:(0,a.jsx)(n.wpx,{title:"Deny","aria-label":"Deny",icon:(0,a.jsx)(n.PJP.x8P,{}),onClick:r.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-deny-btn",size:"small"}),s.status!==b.q2.REQUIRES_MANUAL_FINALIZATION?null:(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_REVIEW],children:(0,a.jsx)(n.wpx,{title:"Finalize","aria-label":"Finalize",icon:(0,a.jsx)(n.PJP.Ok8,{}),onClick:o.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-finalize-btn",size:"small"})}),(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_DELETE],children:(0,a.jsx)(n.wpx,{title:"Delete","aria-label":"Delete",icon:(0,a.jsx)(n.PJP.ZNm,{size:14}),onClick:d.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-delete-btn",size:"small"})})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(J.Z,{isOpen:l.isOpen,isLoading:h,onClose:l.onClose,onApproveRequest:c,subjectRequest:s})}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(H.Z,{isOpen:r.isOpen,onClose:r.onClose,onDenyRequest:u})}),(0,a.jsx)(Q.Z,{isOpen:d.isOpen,onClose:d.onClose,onConfirm:m,message:(0,a.jsx)(n.xvT,{children:"You are about to permanently delete the privacy request. Are you sure you would like to continue?"})}),(0,a.jsx)(Q.Z,{isOpen:o.isOpen,onClose:o.onClose,onConfirm:()=>{x(),o.onClose()},title:"Finalize privacy request",message:(0,a.jsxs)(n.xvT,{children:['You are about to finalize this privacy request. The status will be updated to "Complete"',j&&(null==y?void 0:y.service_type)?" and the requesting user will be notified":"",". Would you like to continue?"]})})]})};(i=l||(l={})).STATUS="status",i.DAYS_LEFT="due_date",i.SOURCE="source",i.REQUEST_TYPE="request_type",i.SUBJECT_IDENTITY="subject_identity",i.TIME_RECEIVED="created_at",i.CREATED_BY="created_by",i.REVIEWER="reviewer",i.ID="id",i.LOCATION="location",i.ACTIONS="actions";let es=(0,F.Cl)(),ei=()=>[es.accessor(e=>e.status,{id:"status",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(B,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Status",...e}),size:120}),es.accessor(e=>e.days_left,{id:"due_date",cell:e=>{let{row:t,getValue:s}=e;return(0,a.jsx)(V,{daysLeft:s(),timeframe:t.original.policy.execution_timeframe,status:t.original.status})},header:e=>(0,a.jsx)(L.Rr,{value:"Days left",...e}),size:80}),es.accessor(e=>e.source,{id:"source",cell:e=>e.getValue()?(0,a.jsx)(L.A4,{value:e.getValue()}):(0,a.jsx)(L.G3,{value:void 0}),header:e=>(0,a.jsx)(L.Rr,{value:"Source",...e}),enableSorting:!1}),es.accessor(e=>e.policy.rules,{id:"request_type",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(G,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Request type",...e}),enableSorting:!1,size:100}),es.accessor(e=>{var t,s;return(null===(t=e.identity)||void 0===t?void 0:t.email.value)||(null===(s=e.identity)||void 0===s?void 0:s.phone_number.value)||""},{id:"subject_identity",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Subject identity",...e}),enableSorting:!1}),es.accessor(e=>e.created_at,{id:"created_at",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:(0,f.p6)(t())})},header:e=>(0,a.jsx)(L.Rr,{value:"Time received",...e}),size:120}),es.accessor(e=>{var t;return(null===(t=e.reviewer)||void 0===t?void 0:t.username)||""},{id:"reviewer",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Reviewed by",...e}),enableSorting:!1}),es.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Request ID",...e}),enableSorting:!1}),es.accessor(e=>e.location,{id:"location",cell:e=>{let{getValue:t}=e,s=t(),i=s?(0,n.QCN)(s):void 0,l=i?(0,n.c1K)({isoEntry:i,showFlag:!0}):s;return(0,a.jsx)(L.G3,{value:l})},header:e=>(0,a.jsx)(L.Rr,{value:"Location",...e}),enableSorting:!1}),es.display({id:"actions",cell:e=>{let{row:t}=e;return(0,a.jsx)(et,{subjectRequest:t.original})},header:e=>(0,a.jsx)(L.Rr,{value:"Actions",...e}),meta:{disableRowClick:!0}})],el=e=>{let t=(0,M.v9)(W.dp),s=(0,M.I0)();return{handleStatusChange:t=>{s((0,W.CI)(t)),e()},handleActionTypeChange:t=>{s((0,W.aM)(t)),e()},handleFromChange:t=>{s((0,W.su)(null==t?void 0:t.target.value)),e()},handleToChange:t=>{s((0,W.Ue)(null==t?void 0:t.target.value)),e()},handleClearAllFilters:()=>{s((0,W.Mk)()),e()},...t}};var ea=s(96718);let er=e=>{let{onClose:t,onFilterChange:s,...i}=e,{handleStatusChange:l,handleActionTypeChange:r,handleFromChange:d,handleToChange:o,handleClearAllFilters:c,from:u,to:p,status:m,action_type:x}=el(s);return(0,a.jsxs)(n.u_l,{onClose:t,size:"xl",...i,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{children:[(0,a.jsx)(n.xBx,{borderBottomWidth:1,borderBottomColor:"gray.200",children:"All Filters"}),(0,a.jsx)(n.olH,{}),(0,a.jsx)(n.fef,{py:4,sx:{"& label":{mb:0}},children:(0,a.jsxs)(n.Kqy,{gap:4,children:[(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",id:"request-date-range-label",children:"Date range"}),(0,a.jsxs)(n.Ugi,{gap:3,children:[(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"from-date",borderRadius:"md",children:"From"}),(0,a.jsx)(n.IIB,{type:"date",name:"From",value:u,max:p||void 0,onChange:d,borderRadius:"md",id:"from-date","aria-describedby":"request-date-range-label"})]}),(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"to-date",borderRadius:"md",children:"To"}),(0,a.jsx)(n.IIB,{type:"date",borderRadius:"md",name:"To",value:p,min:u||void 0,onChange:o,id:"to-date","aria-describedby":"request-date-range-label"})]})]})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-status",children:"Status"}),(0,a.jsx)(ea.z,{id:"request-status",mode:"multiple",options:S.I3,value:m,onChange:l,"data-testid":"request-status-filter"})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-action-type",children:"Request Type"}),(0,a.jsx)(ea.z,{id:"request-action-type",mode:"multiple",options:S.kN,value:x,onChange:r,"data-testid":"request-action-type-filter"})]})]})}),(0,a.jsxs)(n.mzw,{justifyContent:"space-between",children:[(0,a.jsx)(n.wpx,{type:"text",onClick:c,children:"Clear all"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:t,children:"Done"})]})]})]})};var en=s(36866);let ed=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,en.h)(e),{pageIndex:s,pageSize:i,updatePageIndex:l,updatePageSize:a,pageSizeOptions:r,showSizeChanger:n}=t,d=(0,c.useMemo)(()=>({current:s,pageSize:i,showSizeChanger:n,pageSizeOptions:r.map(String),onChange:l,onShowSizeChange:(e,t)=>{a(t)}}),[s,i,n,r,l,a]);return{...t,paginationProps:d}};var eo=s(812),ec=()=>{let e=(0,n.pmc)(),[t,{isFetching:s}]=(0,W.ZU)();return{downloadReport:async s=>{let i=await t(s);if(i.isError)e({status:"error",description:(0,eo.e$)(i.error,"A problem occurred while generating your privacy request report. Please try again.")});else{let t=document.createElement("a"),s=new Blob([i.data],{type:"text/csv"}),l=window.URL.createObjectURL(s);t.href=l,t.download="privacy-request-report.csv",t.click(),t.remove(),window.URL.revokeObjectURL(l),e({status:"success",description:"Successfully downloaded Privacy Request report."})}},isDownloadingReport:s}};let eu=e=>{let{...t}=e,[s,i]=(0,D.v1)("search",D.Oi.withDefault("").withOptions({throttleMs:100})),l=(0,M.v9)(W.dp),r=(0,n.pmc)(),d=(0,h.useRouter)(),o=(0,M.I0)(),u=ed(),{pageIndex:p,pageSize:m,resetPagination:x}=u,{isOpen:v,onOpen:y,onClose:j}=(0,n.qY0)(),{data:g,isLoading:_,isFetching:f}=(0,W.QA)({...l,page:p,size:m,fuzzy_search_str:s}),{items:b,total:q}=(0,c.useMemo)(()=>g||{items:[],total:0,pages:0},[g]),{downloadReport:C}=ec(),S=(0,c.useCallback)(e=>{i(null!=e?e:""),x()},[x,i]),k=async()=>{let e;try{await C(l)}catch(t){e=t instanceof Error?t.message:"Unknown error occurred"}e&&r({description:"".concat(e),duration:5e3,status:"error"})},E=e=>{d.push("/privacy-requests/".concat(e))},R=(0,z.b7)({getCoreRowModel:(0,F.sC)(),data:b,columns:(0,c.useMemo)(()=>ei(),[]),getRowId:e=>"".concat(e.status,"-").concat(e.id),manualPagination:!0,columnResizeMode:"onChange"});return(0,a.jsxs)(n.xuv,{...t,children:[(0,a.jsxs)(L.Q$,{children:[(0,a.jsx)(L.HO,{globalFilter:s,setGlobalFilter:S,placeholder:"Search by request ID or identity value"}),(0,a.jsxs)(n.Ugi,{alignItems:"center",spacing:2,children:[(0,a.jsx)(n.wpx,{"data-testid":"filter-btn",onClick:y,children:"Filter"}),(0,a.jsx)(n.wpx,{"aria-label":"Export report","data-testid":"export-btn",icon:(0,a.jsx)(Z.nM,{ml:"1.5px"}),onClick:k})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(er,{isOpen:v,onClose:j,onFilterChange:x})})]}),_?(0,a.jsx)(n.xuv,{p:2,borderWidth:1,children:(0,a.jsx)(L.I4,{rowHeight:26,numRows:10})}):(0,a.jsxs)(n.jqI,{vertical:!0,gap:"middle",children:[(0,a.jsx)(L.ZK,{tableInstance:R,onRowClick:e=>E(e.id),onSort:e=>{if(!e){o((0,W.PS)());return}let{id:t,desc:s}=e;o((0,W.WR)(t)),o((0,W.iX)(s?"desc":"asc")),x()},loading:f}),(0,a.jsx)(n.B7X,{...u.paginationProps,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),total:null!=q?q:0,align:"end"})]})]})};var ep=s(87361),em=s(46628),ex=s(32885),eh=s(34090),ev=s(55484),ey=s(40324);let ej=(e,t)=>null==t?void 0:t.find(t=>t.policy_key===e),eg=e=>{var t,s;if(!e)return ev.Ry().shape({policy_key:ev.Z_().required().label("Request type")});let i=e.custom_privacy_request_fields?Object.entries(e.custom_privacy_request_fields).filter(e=>{let[,t]=e;return"field_type"in t&&"location"!==t.field_type}).map(e=>{let[t,s]=e;return{[t]:ev.Ry().shape({value:s.required&&!s.hidden?ev.Z_().required().label(s.label):ev.Z_().nullable()})}}).reduce((e,t)=>({...e,...t}),{}):{};return ev.Ry().shape({policy_key:ev.Z_().required().label("Request type"),identity:ev.Ry().shape({email:(null===(t=e.identity_inputs)||void 0===t?void 0:t.email)==="required"?ev.Z_().email().required().label("Email address"):ev.Z_().nullable(),phone_number:(null===(s=e.identity_inputs)||void 0===s?void 0:s.phone)==="required"?ev.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").required().label("Phone number"):ev.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").nullable()}),custom_privacy_request_fields:ev.Ry().shape(i)})};var e_=s(97181);let ef={is_verified:!1,policy_key:"",identity:{}},eb=e=>{let{identityInputs:t}=e;return t?(0,a.jsxs)(a.Fragment,{children:[t.email?(0,a.jsx)(ey.j0,{name:"identity.email",label:"User email address",isRequired:"required"===t.email,variant:"stacked"}):null,t.phone?(0,a.jsx)(ey.j0,{name:"identity.phone_number",label:"User phone number",isRequired:"required"===t.phone,variant:"stacked"}):null]}):null},eq=e=>{var t;let{label:s,required:i,name:l}=e,[r,d,o]=(0,eh.U$)(e),c=!!(d.touched&&d.error),{setValue:u}=o,{value:p}={...r,value:null!==(t=r.value)&&void 0!==t?t:""};return(0,a.jsx)(n.PPS.Item,{label:s,name:l,required:null!=i?i:void 0,layout:"vertical",validateStatus:c?"error":void 0,children:(0,a.jsx)(n.AOh,{value:p,onChange:e=>{e&&u(e)}},l)})},eC=e=>{let{customFieldInputs:t}=e;if(!t)return null;let s=Object.entries(t);return(0,a.jsx)(a.Fragment,{children:s.map(e=>{let[t,s]=e;return"field_type"in s&&"location"===s.field_type?(0,a.jsx)(eq,{name:t,label:s.label,required:!!s.required},t):(0,a.jsx)(ey.j0,{name:"custom_privacy_request_fields.".concat(t,".value"),label:s.label,isRequired:!!s.required,variant:"stacked"},t)})})},eS=e=>{let{onSubmit:t,onCancel:s,privacyCenterUrl:i}=e,{onCopy:l}=(0,n.VPI)(""),r=(0,n.pmc)();return(0,a.jsx)(eh.J9,{initialValues:{identity:{email:""}},onSubmit:e=>{l("".concat(i,"?email=").concat(encodeURIComponent(e.identity.email))),t(e),r({status:"success",description:"DSR Link Copied!"})},validationSchema:()=>ev.Ry().shape({identity:ev.Ry().shape({email:ev.Z_().email().required().label("Email Address")})}),children:e=>{let{dirty:t,isValid:i}=e;return(0,a.jsx)(eh.l0,{children:(0,a.jsxs)(n.Kqy,{spacing:6,mb:2,children:[(0,a.jsx)(eb,{identityInputs:{email:"required"}}),(0,a.jsxs)("div",{className:"flex gap-4 self-end",children:[(0,a.jsx)(n.wpx,{onClick:s,children:"Cancel"}),(0,a.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!t||!i,"data-testid":"submit-btn",icon:(0,a.jsx)(n.xPt,{}),children:"Copy"})]})]})})}})};var ek=e=>{let{onSubmit:t,onCancel:s}=e,{data:i}=(0,W.xv)();return(0,a.jsx)(eh.J9,{initialValues:ef,onSubmit:t,validationSchema:()=>(0,ev.Vo)(e=>eg(ej(e.policy_key,null==i?void 0:i.actions))),children:e=>{var t;let{values:l,dirty:r,isValid:d,isSubmitting:o,setFieldValue:c}=e,u=ej(l.policy_key,null==i?void 0:i.actions);return(0,a.jsx)(eh.l0,{children:(0,a.jsxs)(n.Kqy,{spacing:6,mb:2,children:[(0,a.jsx)(e_.d,{name:"policy_key",label:"Request type",options:null!==(t=null==i?void 0:i.actions.map(e=>({label:e.title,value:e.policy_key})))&&void 0!==t?t:[],onChange:e=>{let t=ej(e,null==i?void 0:i.actions);if(!(null==t?void 0:t.custom_privacy_request_fields)){c("custom_privacy_request_fields",void 0);return}c("custom_privacy_request_fields",Object.entries(t.custom_privacy_request_fields).map(e=>{let[t,s]=e;return{[t]:{label:s.label,value:s.default_value}}}).reduce((e,t)=>({...e,...t}),{}))},layout:"stacked",isRequired:!0}),(0,a.jsx)(eb,{identityInputs:null==u?void 0:u.identity_inputs}),(0,a.jsx)(eC,{customFieldInputs:null==u?void 0:u.custom_privacy_request_fields}),(0,a.jsx)(ey.Xl,{name:"is_verified",label:"I confirm that I have verified this user information"}),(0,a.jsxs)("div",{className:"flex gap-4 self-end",children:[(0,a.jsx)(n.wpx,{onClick:s,children:"Cancel"}),(0,a.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!l.is_verified||!r||!d,loading:o,"data-testid":"submit-btn",children:"Create"})]})]})})}})},eE=s(31883);let eR=e=>{let{isOpen:t,onClose:s}=e,[i]=(0,W.M6)(),l=(0,n.pmc)(),r=async e=>{let{is_verified:t,...a}=e,r=a.custom_privacy_request_fields?Object.entries(a.custom_privacy_request_fields).map(e=>{let[t,s]=e;return s.value?{[t]:s}:{}}).reduce((e,t)=>({...e,...t}),{}):void 0,n={...a,custom_privacy_request_fields:r},d=await i([n]);(0,eE.D4)(d)?l((0,em.Vo)((0,eo.e$)(d.error,"An error occurred while creating this privacy request. Please try again"))):l((0,em.t5)("Privacy request created")),s()};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"2xl",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{"data-testid":"submit-request-modal",maxHeight:"80%",overflowY:"auto",children:[(0,a.jsx)(n.xBx,{children:"Create privacy request"}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)(n.Kqy,{spacing:4,children:[(0,a.jsx)(ep.Z,{title:"Warning: You are bypassing identity verification",text:"You are bypassing Fides' built-in identity verification step. Please ensure that you are only entering information on behalf of a verified and approved user's privacy request."}),(0,a.jsx)(ek,{onSubmit:r,onCancel:()=>s()})]})})]})]})},ew=e=>{let{isOpen:t,onClose:s,privacyCenterUrl:i}=e;return(0,a.jsxs)(n.u_l,{size:"md",isOpen:t,onClose:s,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{children:[(0,a.jsx)(n.xBx,{children:"Create a Privacy Request Link"}),(0,a.jsxs)(n.fef,{children:[(0,a.jsx)(n.Kqy,{spacing:4}),(0,a.jsx)(eS,{privacyCenterUrl:i,onSubmit:s,onCancel:s})]})]})]})};var eT=()=>{var e;let[t,s]=(0,c.useState)("closed"),i=()=>s("closed"),{data:l}=(0,ex.Vh)(),r=(null!==(e=null==l?void 0:l.privacy_center_url)&&void 0!==e?e:"").trim(),d=r.length>0;return(0,a.jsxs)(a.Fragment,{children:[d?(0,a.jsx)(ew,{isOpen:"create-link"===t,onClose:i,privacyCenterUrl:r}):null,(0,a.jsx)(eR,{isOpen:"submit-request"===t,onClose:i}),(0,a.jsx)(n.S0p.Button,{type:"primary",onClick:()=>s("submit-request"),"data-testid":"submit-request-btn",menu:{items:[{label:"Create request link",key:"create-request-link",icon:(0,a.jsx)(n.xPt,{}),onClick:()=>s("create-link"),disabled:!d}]},icon:(0,a.jsx)(n.v4q,{}),children:"Create request"})]})},eI=s(58754),eA=s(17245);let eN=()=>{let{errorAlert:e}=(0,eA.VY)(),[t,s]=(0,c.useState)(!1),[i,l]=(0,c.useState)({count:0,total:0}),[r,d]=(0,c.useState)(!0),o=b.q2.ERROR,{data:u}=(0,W.tE)(),{data:p}=(0,W.QA)({status:[o]},{pollingInterval:15e3,skip:r});return(0,c.useEffect)(()=>{d(!(u&&u.notify_after_failures>0))},[u]),(0,c.useEffect)(()=>{let e=(null==p?void 0:p.total)||0;e>=((null==u?void 0:u.notify_after_failures)||0)&&e>i.total?(l({count:e-i.total,total:e}),s(!0)):s(!1)},[null==p?void 0:p.total,null==u?void 0:u.notify_after_failures,i.total]),{processing:()=>{t&&e((0,a.jsxs)(n.xuv,{children:["DSR automation has failed for"," ",(0,a.jsx)(n.xvT,{as:"span",fontWeight:"semibold",children:i.count})," ","privacy request(s). Please review the event log for further details."]}),void 0,{containerStyle:{maxWidth:"max-content"},duration:null,id:"dsrErrorAlert"})}}};var eP=s(72281);let eO=o()(()=>s.e(9676).then(s.bind(s,59676)),{loadableGenerated:{webpack:()=>[59676]},loading:()=>(0,a.jsx)("div",{children:"Loading..."})});var eU=()=>{let{processing:e}=eN(),{plus:t}=(0,u.hz)(),{activeTab:s,handleTabChange:i,availableTabs:l}=(0,eP.d)();(0,c.useEffect)(()=>{e()},[e]);let r=(0,c.useMemo)(()=>{let e=[];return l.request&&e.push({key:eP.G.REQUEST,label:"Request",children:(0,a.jsx)(eu,{})}),l.manualTask&&e.push({key:eP.G.MANUAL_TASK,label:"Manual tasks",children:(0,a.jsx)(U,{})}),e},[l.manualTask,l.request]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eI.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests"}],rightContent:(0,a.jsxs)(n.vyj,{children:[t&&(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_CREATE],children:(0,a.jsx)(eT,{})}),(0,a.jsx)(eO,{})]}),"data-testid":"privacy-requests"}),(0,a.jsx)(n.A5g,{activeKey:s,onChange:i,items:r})]})},ez=()=>(0,a.jsx)(r.Z,{title:"Privacy Requests",children:(0,a.jsx)(eU,{})})},31883:function(e,t,s){"use strict";s.d(t,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=s(19043)}},function(e){e.O(0,[431,8765,3550,4558,2888,9774,179],function(){return e(e.s=1565)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2369],{1565:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests",function(){return s(19509)}])},35287:function(e,t,s){"use strict";var i=s(24246),l=s(96306),a=s(88038),r=s.n(a);s(27378),t.Z=e=>{let{children:t,title:s,mainProps:a}=e;return(0,i.jsxs)(l.kCb,{"data-testid":s,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,i.jsxs)(r(),{children:[(0,i.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,i.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,i.jsx)(l.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...a,children:t})]})}},87361:function(e,t,s){"use strict";var i=s(24246),l=s(96306);t.Z=e=>{let{title:t,text:s,onClose:a}=e;return(0,i.jsxs)(l.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[a&&(0,i.jsx)(l.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:a}),(0,i.jsx)(l.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,i.jsxs)(l.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,i.jsx)(l.X6q,{fontSize:"md",children:t}),(0,i.jsx)(l.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:s})]})]})}},96718:function(e,t,s){"use strict";s.d(t,{z:function(){return a}});var i=s(24246),l=s(96306);let a=e=>{let{...t}=e;return(0,i.jsx)(l.WPr,{defaultActiveFirstOption:!1,maxTagCount:"responsive",allowClear:!0,styles:t.mode?void 0:{popup:{root:{width:"auto",minWidth:"200px"}}},className:"w-auto","data-testid":"filter-select",...t})}},97181:function(e,t,s){"use strict";s.d(t,{d:function(){return o}});var i=s(24246),l=s(96306),a=s(34090),r=s(27378),n=s(46238),d=s(40324);let o=e=>{let{name:t,label:s,labelProps:o,tooltip:c,isRequired:u,layout:p="inline",helperText:m,...x}=e,[h,v,{setValue:y}]=(0,a.U$)(t),j=!!(v.touched&&v.error),[g,_]=(0,r.useState)("");h.value||"tags"!==x.mode&&"multiple"!==x.mode||(h.value=[]),"tags"===x.mode&&"string"==typeof h.value&&(h.value=[h.value]);let f="tags"===x.mode?(e,t)=>e?e.value!==g||h.value.includes(g)?x.optionRender?x.optionRender(e,t):e.label:'Create "'.concat(g,'"'):void 0:x.optionRender||void 0,b=e=>{_(e),x.onSearch&&x.onSearch(e)},q=(e,t)=>{y(e),x.onChange&&x.onChange(e,t)};return"inline"===p?(0,i.jsx)(l.NIc,{isInvalid:j,isRequired:u,children:(0,i.jsxs)(l.rjZ,{templateColumns:s?"1fr 3fr":"1fr",children:[s?(0,i.jsx)(d.__,{htmlFor:x.id||t,...o,children:s}):null,(0,i.jsxs)(l.jqI,{align:"center",children:[(0,i.jsxs)(l.jqI,{vertical:!0,flex:1,className:"mr-2",children:[(0,i.jsx)(l.WPr,{...h,id:x.id||t,"data-testid":"controlled-select-".concat(h.name),...x,optionRender:f,onSearch:"tags"===x.mode?b:void 0,onChange:q,value:h.value||void 0,status:j?"error":void 0}),m&&(0,i.jsx)(l.Q6r,{children:m}),(0,i.jsx)(d.Bc,{isInvalid:j,message:v.error,fieldName:h.name})]}),(0,i.jsx)(n.b,{label:c,className:j?"mt-2 self-start":void 0})]})]})}):(0,i.jsx)(l.NIc,{isInvalid:j,isRequired:u,children:(0,i.jsxs)(l.gCW,{alignItems:"start",children:[(0,i.jsxs)(l.jqI,{align:"center",children:[s?(0,i.jsx)(d.__,{htmlFor:x.id||t,fontSize:"xs",my:0,mr:1,...o,children:s}):null,(0,i.jsx)(n.b,{label:c})]}),(0,i.jsx)(l.WPr,{...h,id:x.id||t,"data-testid":"controlled-select-".concat(h.name),...x,optionRender:f,onSearch:"tags"===x.mode?b:void 0,onChange:q,value:h.value||void 0,status:j?"error":void 0}),m&&(0,i.jsx)(l.Q6r,{style:{marginTop:0},children:m}),(0,i.jsx)(d.Bc,{isInvalid:j,message:v.error,fieldName:h.name})]})})}},71784:function(e,t,s){"use strict";s.d(t,{DE:function(){return n},I3:function(){return l},kN:function(){return r},rE:function(){return a}});var i=s(21910);let l=[...new Map([[i.q2.APPROVED,"Approved"],[i.q2.AWAITING_EMAIL_SEND,"Awaiting email send"],[i.q2.CANCELED,"Canceled"],[i.q2.COMPLETE,"Completed"],[i.q2.DENIED,"Denied"],[i.q2.ERROR,"Error"],[i.q2.IN_PROCESSING,"In progress"],[i.q2.PENDING,"New"],[i.q2.PAUSED,"Paused"],[i.q2.IDENTITY_UNVERIFIED,"Unverified"],[i.q2.REQUIRES_INPUT,"Requires input"],[i.q2.REQUIRES_MANUAL_FINALIZATION,"Requires finalization"]])].map(e=>{let[t,s]=e;return{label:s,value:t}}),a=new Map([[i.Us.ACCESS,"Access"],[i.Us.ERASURE,"Erasure"],[i.Us.CONSENT,"Consent"],[i.Us.UPDATE,"Update"]]),r=[...a].map(e=>{let[t,s]=e;return{label:s,value:t}}),n={local:"local",s3:"s3",gcs:"gcs"}},19509:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ez}});var i,l,a=s(24246),r=s(35287),n=s(96306),d=s(65218),o=s.n(d),c=s(27378),u=s(25980),p=s(19904),m=s(56141),x=s.n(m),h=s(86677),v=s(16134),y=s(91317),j=s(18225),g=s(77830),_=s(28407),f=s(16394),b=s(21910),q=s(32735),C=s(59969),S=s(71784),k=s(45116);let E=e=>{let{label:t,children:s}=e;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"shrink-0 grow-0 basis-1/3 pr-2",children:(0,a.jsxs)(n.AntTypography.Text,{className:"text-gray-700",children:[t,":"]})}),(0,a.jsx)("div",{className:"min-w-0 shrink grow text-gray-600",children:s})]})},R=e=>{let{task:t}=e,s=t.request_type===b.k6.ACCESS?b.Us.ACCESS:b.Us.ERASURE,i=S.rE.get(s)||t.request_type;return(0,a.jsxs)("div",{className:"flex flex-col space-y-3","data-testid":"task-details-container",children:[(0,a.jsx)(E,{label:"Name",children:(0,a.jsx)(n.AntTypography.Text,{children:t.name})}),(0,a.jsx)(E,{label:"Description",children:(0,a.jsx)(n.AntTypography.Text,{children:t.description||"-"})}),(0,a.jsx)(E,{label:"Request Type",children:(0,a.jsx)(n.AntTypography.Text,{children:i})}),(0,a.jsx)(E,{label:"Assigned To",children:t.assigned_users&&t.assigned_users.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1","data-testid":"assigned-users-tags",children:t.assigned_users.map(e=>(0,a.jsx)(n.j8w,{"data-testid":"assigned-user-tag-".concat(e.id),children:"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.email_address||"Unknown User"},e.id))}):(0,a.jsx)(n.AntTypography.Text,{children:"No one assigned"})}),t.privacy_request.subject_identities&&Object.keys(t.privacy_request.subject_identities).length>0?(0,a.jsx)(E,{label:"Subject identities",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.subject_identities).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",String(s)]},t)})})}):null,t.privacy_request.custom_fields&&Object.keys(t.privacy_request.custom_fields).length>0?(0,a.jsx)(E,{label:"Custom fields",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.custom_fields).filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",String(s)]},t)})})}):null]})},w=e=>{let{isOpen:t,onClose:s,task:i}=e,[l,{isLoading:r}]=(0,k.HP)(),[d,o]=(0,c.useState)(""),[u,p]=(0,c.useState)(!1),[m,x]=(0,c.useState)(""),[h,v]=(0,c.useState)([]),y=async()=>{try{await l({privacy_request_id:i.privacy_request.id,manual_field_id:i.manual_field_id,field_value:i.input_type===b.PF.TEXT?d:i.input_type===b.PF.CHECKBOX?u.toString():void 0,comment_text:m||void 0,attachments:h.length>0?h.map(e=>e.originFileObj).filter(Boolean):void 0}).unwrap(),o(""),p(!1),x(""),v([]),s()}catch(e){n.Pg3.error("Failed to complete task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"complete-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Complete Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(R,{task:i})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(()=>{switch(i.input_type){case b.PF.TEXT:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Subject data"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Enter your response...",rows:4,"data-testid":"complete-modal-text-input"})]});case b.PF.CHECKBOX:return(0,a.jsx)("div",{className:"space-y-2",children:(0,a.jsx)(n.E_O,{checked:u,onChange:e=>p(e.target.checked),"data-testid":"complete-modal-checkbox",children:"The task has been completed"})});default:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Upload Files"}),(0,a.jsx)("div",{children:(0,a.jsx)(n.pMK,{fileList:h,onChange:e=>{let{fileList:t}=e;return v(t)},beforeUpload:()=>!1,"data-testid":"complete-modal-file-upload",multiple:!0,children:(0,a.jsx)(n.wpx,{"data-testid":"complete-modal-upload-button",children:"Click to Upload"})})})]})}})(),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Internal comment"}),(0,a.jsx)(n.uFc.TextArea,{value:m,onChange:e=>x(e.target.value),placeholder:"Add any additional comments...",rows:3,"data-testid":"complete-modal-comment-input"})]})]})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),p(!1),x(""),v([]),s()},disabled:r,"data-testid":"complete-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:y,loading:r,disabled:!(()=>{switch(i.input_type){case b.PF.TEXT:return d.trim().length>0;case b.PF.CHECKBOX:return u;default:return h.length>0}})(),"data-testid":"complete-modal-save-button",children:"Save"})]})})]})]})},T=e=>{let{isOpen:t,onClose:s,task:i}=e,[l,{isLoading:r}]=(0,k.DA)(),[d,o]=(0,c.useState)(""),u=async()=>{try{await l({privacy_request_id:i.privacy_request.id,manual_field_id:i.manual_field_id,skip_reason:d}).unwrap(),o(""),s()}catch(e){n.Pg3.error("Failed to skip task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"skip-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Skip Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(R,{task:i})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Reason for skipping (Required)"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Please provide a reason for skipping this task...",rows:4,"data-testid":"skip-modal-comment-input"})]})})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),s()},disabled:r,"data-testid":"skip-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:u,loading:r,disabled:!d.trim(),danger:!0,"data-testid":"skip-modal-skip-button",children:"Skip Task"})]})})]})]})},I=e=>{let{task:t}=e,s=(0,h.useRouter)(),{isOpen:i,onOpen:l,onClose:r}=(0,n.qY0)(),{isOpen:d,onOpen:o,onClose:c}=(0,n.qY0)(),u=(0,p.Tg)([b.Sh.PRIVACY_REQUEST_READ]);if(t.status!==b.OS.NEW)return null;let m=[{key:"skip",label:"Skip task",onClick:o}];return u&&m.push({key:"go-to-request",label:"Go to request",onClick:()=>{s.push({pathname:g.ld,query:{id:t.privacy_request.id}})}}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.vyj,{size:"small",children:[(0,a.jsx)(n.wpx,{type:"default",onClick:l,size:"small",children:"Complete"}),(0,a.jsx)(n.S0p,{menu:{items:m},trigger:["click"],placement:"bottomRight",overlayStyle:{minWidth:120},children:(0,a.jsx)(n.wpx,{size:"small",icon:(0,a.jsx)(n.PJP.r43,{}),"aria-label":"More actions"})})]}),(0,a.jsx)(w,{isOpen:i,onClose:r,task:t}),(0,a.jsx)(T,{isOpen:d,onClose:c,task:t})]})},A={[b.OS.NEW]:{color:"info",label:"New"},[b.OS.COMPLETED]:{color:"success",label:"Completed"},[b.OS.SKIPPED]:{color:"marble",label:"Skipped"}},N=[{text:"New",value:b.OS.NEW},{text:"Completed",value:b.OS.COMPLETED},{text:"Skipped",value:b.OS.SKIPPED}],P=[{text:"Access",value:b.k6.ACCESS},{text:"Erasure",value:b.k6.ERASURE}],O=e=>{let{systemFilters:t,userFilters:s,onUserClick:i,currentFilters:l,hasAccessToAllTasks:r}=e,d=[{title:"Task name",dataIndex:"name",key:"name",minWidth:100,render:e=>(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:e},children:e})},{title:"Status",dataIndex:"status",key:"status",width:110,render:e=>(0,a.jsx)(n.j8w,{color:A[e].color,"data-testid":"manual-task-status-tag",children:A[e].label}),filters:N,filterMultiple:!1},{title:"System",dataIndex:["system","name"],key:"system_name",minWidth:100,render:e=>(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:e},children:e}),filters:t,filterMultiple:!1},{title:"Type",dataIndex:"request_type",key:"request_type",width:80,render:e=>{let t=e===b.k6.ACCESS?b.Us.ACCESS:b.Us.ERASURE,s=S.rE.get(t)||e;return(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:s},children:s})},filters:P,filterMultiple:!1},{title:"Assigned to",dataIndex:"assigned_users",key:"assigned_users",minWidth:100,render:e=>{if(!e||0===e.length)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.map(e=>({label:(0,f.gJ)(e),value:e.id})),s=e.map(e=>e.id);return(0,a.jsx)(n.d3V,{value:s,options:t,readonly:!0,onTagClick:e=>i(String(e))})},filters:s,filterMultiple:!1,defaultFilteredValue:l.assignedUsers?[l.assignedUsers]:void 0},{title:"Days left",dataIndex:["privacy_request","days_left"],key:"days_left",width:90,render:e=>(0,a.jsx)(C.Z,{daysLeft:e||0,includeText:!1,status:b.q2.PENDING})},{title:"Subject identity",dataIndex:["privacy_request","subject_identities"],key:"subject_identities",minWidth:120,render:e=>{if(!e)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.email||e.phone_number||"";return(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:t},children:t})}},{title:"Actions",key:"actions",width:145,render:(e,t)=>(0,a.jsx)(I,{task:t})}];return r?d:d.filter(e=>"assigned_users"!==e.key)},U=()=>{let e=(0,h.useRouter)(),t=(0,v.C)(y.dy),[s,i]=(0,c.useState)(1),[l,r]=(0,c.useState)(25),d=(0,p.Tg)([b.Sh.MANUAL_FIELD_READ_ALL]),o=e.query.privacy_request_id||void 0,u=(0,c.useMemo)(()=>{let e={};return(null==t?void 0:t.id)&&!o&&(e.assignedUsers=t.id),o&&"string"==typeof o&&(e.privacyRequestId=o),e},[null==t?void 0:t.id,o]),[m,C]=(0,c.useState)(u),{data:S,isLoading:E,isFetching:R}=(0,k.Ym)({page:s,size:l,status:m.status,systemName:m.systemName,requestType:m.requestType,assignedUserId:m.assignedUsers,privacyRequestId:m.privacyRequestId}),{data:w}=(0,k.Ym)({page:1,size:1}),{items:T,total:I}=(0,c.useMemo)(()=>S||{items:[],total:0,pages:0,filter_options:{assigned_users:[],systems:[]}},[S]),A=(0,c.useMemo)(()=>(null==w?void 0:w.filter_options)||{assigned_users:[],systems:[]},[w]),N=O({systemFilters:(0,c.useMemo)(()=>{var e;return(null==A?void 0:null===(e=A.systems)||void 0===e?void 0:e.map(e=>({text:e.name,value:e.name})))||[]},[null==A?void 0:A.systems]),userFilters:(0,c.useMemo)(()=>{var e;let s=(null==A?void 0:null===(e=A.assigned_users)||void 0===e?void 0:e.map(e=>({text:(0,f.gJ)(e),value:e.id})))||[];return(null==t?void 0:t.id)&&!s.some(e=>e.value===t.id)&&s.push({text:(0,f.gJ)(t,{fallbackToId:!0}),value:t.id}),s},[null==A?void 0:A.assigned_users,t]),onUserClick:t=>{e.push({pathname:g.fw,query:{id:t}})},currentFilters:m,hasAccessToAllTasks:d}),P=(0,c.useMemo)(()=>x()(m,u),[m,u]);return E?(0,a.jsx)(j.Z,{}):(0,a.jsxs)("div",{className:"mt-2 space-y-4",children:[(0,a.jsx)(n.kCb,{gap:3,align:"center",className:"mb-4",children:(0,a.jsx)(_.H,{globalFilter:m.privacyRequestId||"",setGlobalFilter:e=>{let t={...m};e&&e.trim()?t.privacyRequestId=e.trim():delete t.privacyRequestId,C(t),i(1)},placeholder:"Search by privacy request ID",testid:"privacy-request-id-filter"})}),(0,a.jsx)(n.V5H,{columns:N,dataSource:T,rowKey:e=>"".concat(e.privacy_request.id,"-").concat(e.manual_field_id),pagination:{current:s,pageSize:l,pageSizeOptions:q.VZ,total:I||0,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),onChange:(e,t)=>{i(e),t!==l&&(r(t),i(1))}},onChange:(e,t)=>{let s={privacyRequestId:m.privacyRequestId};t.status&&([s.status]=t.status),t.system_name&&([s.systemName]=t.system_name),t.request_type&&([s.requestType]=t.request_type),t.assigned_users&&([s.assignedUsers]=t.assigned_users),C(s),i(1)},locale:{emptyText:P?(0,a.jsx)("div",{"data-testid":"empty-state-current-user",className:"my-4",children:(0,a.jsxs)(n.AntTypography.Paragraph,{children:["You have no tasks assigned."," ",d&&(0,a.jsx)("span",{children:'You can modify the "Assigned to" column filter to view tasks assigned to other users.'})]})}):(0,a.jsx)("div",{"data-testid":"empty-state",className:"my-4",children:"No results found."})},loading:E||R,scroll:{scrollToFirstRowOnChange:!0},tableLayout:"fixed",className:"[&_th]:!break-normal"})]})};var z=s(59003),F=s(92222),D=s(40431),M=s(16125),Z=s(14048),L=s(47935),W=s(90867);let Y={approved:{colorScheme:"success",label:"Approved"},complete:{label:"Completed",colorScheme:"success"},awaiting_email_send:{label:"Awaiting Email Send",colorScheme:"marble"},denied:{label:"Denied",colorScheme:"warning"},canceled:{label:"Canceled",colorScheme:"marble"},error:{label:"Error",colorScheme:"error"},in_processing:{label:"In Progress",colorScheme:"caution"},paused:{label:"Paused",colorScheme:"marble"},pending:{label:"New",colorScheme:"info"},identity_unverified:{label:"Unverified",colorScheme:"marble"},requires_input:{colorScheme:"minos",label:"Requires Input"},requires_manual_finalization:{colorScheme:"minos",label:"Requires Finalization"}},B=e=>{let{value:t}=e;return(0,a.jsx)(L.A4,{color:Y[t].colorScheme,value:Y[t].label,"data-testid":"request-status-badge"})},V=e=>{let t,{daysLeft:s,timeframe:i=45,status:l,includeText:r=!1}=e;if(null==s||l===b.q2.COMPLETE||l===b.q2.CANCELED||l===b.q2.DENIED||l===b.q2.IDENTITY_UNVERIFIED)return null;let n=100*s/i;return n<25?t="error":n>=75?t="success":n>=25&&(t="warning"),(0,a.jsx)(L.A4,{value:r?"".concat(s," days left"):s.toString(),color:t})},K=e=>Array.from(new Set(e.filter(e=>Object.values(b.Us).includes(e.action_type)).map(e=>e.action_type))),G=e=>{let{value:t}=e,s=K(t).map(e=>S.rE.get(e));return(0,a.jsx)(L.WP,{value:s,cellState:{isExpanded:!0}})};var Q=s(58452),X=s(7426),J=s(57526),H=s(66548),$=s(45489),ee=s(42478);let et=e=>{var t;let{subjectRequest:s,...i}=e,l=(0,n.qY0)(),r=(0,n.qY0)(),d=(0,n.qY0)(),o=(0,n.qY0)(),{handleApproveRequest:c,handleDenyRequest:u,handleDeleteRequest:m,handleFinalizeRequest:x,isLoading:h}=(0,$.Z)({subjectRequest:s}),{data:v}=(0,X.tB)({api_set:!1}),{data:y}=(0,ee.JE)(),j=null==v?void 0:null===(t=v.notifications)||void 0===t?void 0:t.send_request_completion_notification;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.Ugi,{...i,children:["pending"!==s.status?null:(0,a.jsx)(n.wpx,{title:"Approve","aria-label":"Approve",icon:(0,a.jsx)(n.PJP.MCw,{}),onClick:l.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-approve-btn",size:"small"}),"pending"!==s.status?null:(0,a.jsx)(n.wpx,{title:"Deny","aria-label":"Deny",icon:(0,a.jsx)(n.PJP.x8P,{}),onClick:r.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-deny-btn",size:"small"}),s.status!==b.q2.REQUIRES_MANUAL_FINALIZATION?null:(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_REVIEW],children:(0,a.jsx)(n.wpx,{title:"Finalize","aria-label":"Finalize",icon:(0,a.jsx)(n.PJP.Ok8,{}),onClick:o.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-finalize-btn",size:"small"})}),(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_DELETE],children:(0,a.jsx)(n.wpx,{title:"Delete","aria-label":"Delete",icon:(0,a.jsx)(n.PJP.ZNm,{size:14}),onClick:d.onOpen,loading:h,disabled:h,"data-testid":"privacy-request-delete-btn",size:"small"})})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(J.Z,{isOpen:l.isOpen,isLoading:h,onClose:l.onClose,onApproveRequest:c,subjectRequest:s})}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(H.Z,{isOpen:r.isOpen,onClose:r.onClose,onDenyRequest:u})}),(0,a.jsx)(Q.Z,{isOpen:d.isOpen,onClose:d.onClose,onConfirm:m,message:(0,a.jsx)(n.xvT,{children:"You are about to permanently delete the privacy request. Are you sure you would like to continue?"})}),(0,a.jsx)(Q.Z,{isOpen:o.isOpen,onClose:o.onClose,onConfirm:()=>{x(),o.onClose()},title:"Finalize privacy request",message:(0,a.jsxs)(n.xvT,{children:['You are about to finalize this privacy request. The status will be updated to "Complete"',j&&(null==y?void 0:y.service_type)?" and the requesting user will be notified":"",". Would you like to continue?"]})})]})};(i=l||(l={})).STATUS="status",i.DAYS_LEFT="due_date",i.SOURCE="source",i.REQUEST_TYPE="request_type",i.SUBJECT_IDENTITY="subject_identity",i.TIME_RECEIVED="created_at",i.CREATED_BY="created_by",i.REVIEWER="reviewer",i.ID="id",i.LOCATION="location",i.ACTIONS="actions";let es=(0,F.Cl)(),ei=()=>[es.accessor(e=>e.status,{id:"status",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(B,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Status",...e}),size:120}),es.accessor(e=>e.days_left,{id:"due_date",cell:e=>{let{row:t,getValue:s}=e;return(0,a.jsx)(V,{daysLeft:s(),timeframe:t.original.policy.execution_timeframe,status:t.original.status})},header:e=>(0,a.jsx)(L.Rr,{value:"Days left",...e}),size:80}),es.accessor(e=>e.source,{id:"source",cell:e=>e.getValue()?(0,a.jsx)(L.A4,{value:e.getValue()}):(0,a.jsx)(L.G3,{value:void 0}),header:e=>(0,a.jsx)(L.Rr,{value:"Source",...e}),enableSorting:!1}),es.accessor(e=>e.policy.rules,{id:"request_type",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(G,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Request type",...e}),enableSorting:!1,size:100}),es.accessor(e=>{var t,s;return(null===(t=e.identity)||void 0===t?void 0:t.email.value)||(null===(s=e.identity)||void 0===s?void 0:s.phone_number.value)||""},{id:"subject_identity",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Subject identity",...e}),enableSorting:!1}),es.accessor(e=>e.created_at,{id:"created_at",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:(0,f.p6)(t())})},header:e=>(0,a.jsx)(L.Rr,{value:"Time received",...e}),size:120}),es.accessor(e=>{var t;return(null===(t=e.reviewer)||void 0===t?void 0:t.username)||""},{id:"reviewer",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Reviewed by",...e}),enableSorting:!1}),es.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(L.G3,{value:t()})},header:e=>(0,a.jsx)(L.Rr,{value:"Request ID",...e}),enableSorting:!1}),es.accessor(e=>e.location,{id:"location",cell:e=>{let{getValue:t}=e,s=t(),i=s?(0,n.QCN)(s):void 0,l=i?(0,n.c1K)({isoEntry:i,showFlag:!0}):s;return(0,a.jsx)(L.G3,{value:l})},header:e=>(0,a.jsx)(L.Rr,{value:"Location",...e}),enableSorting:!1}),es.display({id:"actions",cell:e=>{let{row:t}=e;return(0,a.jsx)(et,{subjectRequest:t.original})},header:e=>(0,a.jsx)(L.Rr,{value:"Actions",...e}),meta:{disableRowClick:!0}})],el=e=>{let t=(0,M.v9)(W.dp),s=(0,M.I0)();return{handleStatusChange:t=>{s((0,W.CI)(t)),e()},handleActionTypeChange:t=>{s((0,W.aM)(t)),e()},handleFromChange:t=>{s((0,W.su)(null==t?void 0:t.target.value)),e()},handleToChange:t=>{s((0,W.Ue)(null==t?void 0:t.target.value)),e()},handleClearAllFilters:()=>{s((0,W.Mk)()),e()},...t}};var ea=s(96718);let er=e=>{let{onClose:t,onFilterChange:s,...i}=e,{handleStatusChange:l,handleActionTypeChange:r,handleFromChange:d,handleToChange:o,handleClearAllFilters:c,from:u,to:p,status:m,action_type:x}=el(s);return(0,a.jsxs)(n.u_l,{onClose:t,size:"xl",...i,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{children:[(0,a.jsx)(n.xBx,{borderBottomWidth:1,borderBottomColor:"gray.200",children:"All Filters"}),(0,a.jsx)(n.olH,{}),(0,a.jsx)(n.fef,{py:4,sx:{"& label":{mb:0}},children:(0,a.jsxs)(n.Kqy,{gap:4,children:[(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",id:"request-date-range-label",children:"Date range"}),(0,a.jsxs)(n.Ugi,{gap:3,children:[(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"from-date",borderRadius:"md",children:"From"}),(0,a.jsx)(n.IIB,{type:"date",name:"From",value:u,max:p||void 0,onChange:d,borderRadius:"md",id:"from-date","aria-describedby":"request-date-range-label"})]}),(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"to-date",borderRadius:"md",children:"To"}),(0,a.jsx)(n.IIB,{type:"date",borderRadius:"md",name:"To",value:p,min:u||void 0,onChange:o,id:"to-date","aria-describedby":"request-date-range-label"})]})]})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-status",children:"Status"}),(0,a.jsx)(ea.z,{id:"request-status",mode:"multiple",options:S.I3,value:m,onChange:l,"data-testid":"request-status-filter"})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-action-type",children:"Request Type"}),(0,a.jsx)(ea.z,{id:"request-action-type",mode:"multiple",options:S.kN,value:x,onChange:r,"data-testid":"request-action-type-filter"})]})]})}),(0,a.jsxs)(n.mzw,{justifyContent:"space-between",children:[(0,a.jsx)(n.wpx,{type:"text",onClick:c,children:"Clear all"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:t,children:"Done"})]})]})]})};var en=s(36866);let ed=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,en.h)(e),{pageIndex:s,pageSize:i,updatePageIndex:l,updatePageSize:a,pageSizeOptions:r,showSizeChanger:n}=t,d=(0,c.useMemo)(()=>({current:s,pageSize:i,showSizeChanger:n,pageSizeOptions:r.map(String),onChange:l,onShowSizeChange:(e,t)=>{a(t)}}),[s,i,n,r,l,a]);return{...t,paginationProps:d}};var eo=s(812),ec=()=>{let e=(0,n.pmc)(),[t,{isFetching:s}]=(0,W.ZU)();return{downloadReport:async s=>{let i=await t(s);if(i.isError)e({status:"error",description:(0,eo.e$)(i.error,"A problem occurred while generating your privacy request report. Please try again.")});else{let t=document.createElement("a"),s=new Blob([i.data],{type:"text/csv"}),l=window.URL.createObjectURL(s);t.href=l,t.download="privacy-request-report.csv",t.click(),t.remove(),window.URL.revokeObjectURL(l),e({status:"success",description:"Successfully downloaded Privacy Request report."})}},isDownloadingReport:s}};let eu=e=>{let{...t}=e,[s,i]=(0,D.v1)("search",D.Oi.withDefault("").withOptions({throttleMs:100})),l=(0,M.v9)(W.dp),r=(0,n.pmc)(),d=(0,h.useRouter)(),o=(0,M.I0)(),u=ed(),{pageIndex:p,pageSize:m,resetPagination:x}=u,{isOpen:v,onOpen:y,onClose:j}=(0,n.qY0)(),{data:g,isLoading:_,isFetching:f}=(0,W.QA)({...l,page:p,size:m,fuzzy_search_str:s}),{items:b,total:q}=(0,c.useMemo)(()=>g||{items:[],total:0,pages:0},[g]),{downloadReport:C}=ec(),S=(0,c.useCallback)(e=>{i(null!=e?e:""),x()},[x,i]),k=async()=>{let e;try{await C(l)}catch(t){e=t instanceof Error?t.message:"Unknown error occurred"}e&&r({description:"".concat(e),duration:5e3,status:"error"})},E=e=>{d.push("/privacy-requests/".concat(e))},R=(0,z.b7)({getCoreRowModel:(0,F.sC)(),data:b,columns:(0,c.useMemo)(()=>ei(),[]),getRowId:e=>"".concat(e.status,"-").concat(e.id),manualPagination:!0,columnResizeMode:"onChange"});return(0,a.jsxs)(n.xuv,{...t,children:[(0,a.jsxs)(L.Q$,{children:[(0,a.jsx)(L.HO,{globalFilter:s,setGlobalFilter:S,placeholder:"Search by request ID or identity value"}),(0,a.jsxs)(n.Ugi,{alignItems:"center",spacing:2,children:[(0,a.jsx)(n.wpx,{"data-testid":"filter-btn",onClick:y,children:"Filter"}),(0,a.jsx)(n.wpx,{"aria-label":"Export report","data-testid":"export-btn",icon:(0,a.jsx)(Z.nM,{ml:"1.5px"}),onClick:k})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(er,{isOpen:v,onClose:j,onFilterChange:x})})]}),_?(0,a.jsx)(n.xuv,{p:2,borderWidth:1,children:(0,a.jsx)(L.I4,{rowHeight:26,numRows:10})}):(0,a.jsxs)(n.jqI,{vertical:!0,gap:"middle",children:[(0,a.jsx)(L.ZK,{tableInstance:R,onRowClick:e=>E(e.id),onSort:e=>{if(!e){o((0,W.PS)());return}let{id:t,desc:s}=e;o((0,W.WR)(t)),o((0,W.iX)(s?"desc":"asc")),x()},loading:f}),(0,a.jsx)(n.B7X,{...u.paginationProps,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),total:null!=q?q:0,align:"end"})]})]})};var ep=s(87361),em=s(46628),ex=s(32885),eh=s(34090),ev=s(55484),ey=s(40324);let ej=(e,t)=>null==t?void 0:t.find(t=>t.policy_key===e),eg=e=>{var t,s;if(!e)return ev.Ry().shape({policy_key:ev.Z_().required().label("Request type")});let i=e.custom_privacy_request_fields?Object.entries(e.custom_privacy_request_fields).filter(e=>{let[,t]=e;return"field_type"in t&&"location"!==t.field_type}).map(e=>{let[t,s]=e;return{[t]:ev.Ry().shape({value:s.required&&!s.hidden?ev.Z_().required().label(s.label):ev.Z_().nullable()})}}).reduce((e,t)=>({...e,...t}),{}):{};return ev.Ry().shape({policy_key:ev.Z_().required().label("Request type"),identity:ev.Ry().shape({email:(null===(t=e.identity_inputs)||void 0===t?void 0:t.email)==="required"?ev.Z_().email().required().label("Email address"):ev.Z_().nullable(),phone_number:(null===(s=e.identity_inputs)||void 0===s?void 0:s.phone)==="required"?ev.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").required().label("Phone number"):ev.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").nullable()}),custom_privacy_request_fields:ev.Ry().shape(i)})};var e_=s(97181);let ef={is_verified:!1,policy_key:"",identity:{}},eb=e=>{let{identityInputs:t}=e;return t?(0,a.jsxs)(a.Fragment,{children:[t.email?(0,a.jsx)(ey.j0,{name:"identity.email",label:"User email address",isRequired:"required"===t.email,variant:"stacked"}):null,t.phone?(0,a.jsx)(ey.j0,{name:"identity.phone_number",label:"User phone number",isRequired:"required"===t.phone,variant:"stacked"}):null]}):null},eq=e=>{var t;let{label:s,required:i,name:l}=e,[r,d,o]=(0,eh.U$)(e),c=!!(d.touched&&d.error),{setValue:u}=o,{value:p}={...r,value:null!==(t=r.value)&&void 0!==t?t:""};return(0,a.jsx)(n.PPS.Item,{label:s,name:l,required:null!=i?i:void 0,layout:"vertical",validateStatus:c?"error":void 0,children:(0,a.jsx)(n.AOh,{value:p,onChange:e=>{e&&u(e)}},l)})},eC=e=>{let{customFieldInputs:t}=e;if(!t)return null;let s=Object.entries(t);return(0,a.jsx)(a.Fragment,{children:s.map(e=>{let[t,s]=e;return"field_type"in s&&"location"===s.field_type?(0,a.jsx)(eq,{name:t,label:s.label,required:!!s.required},t):(0,a.jsx)(ey.j0,{name:"custom_privacy_request_fields.".concat(t,".value"),label:s.label,isRequired:!!s.required,variant:"stacked"},t)})})},eS=e=>{let{onSubmit:t,onCancel:s,privacyCenterUrl:i}=e,{onCopy:l}=(0,n.VPI)(""),r=(0,n.pmc)();return(0,a.jsx)(eh.J9,{initialValues:{identity:{email:""}},onSubmit:e=>{l("".concat(i,"?email=").concat(encodeURIComponent(e.identity.email))),t(e),r({status:"success",description:"DSR Link Copied!"})},validationSchema:()=>ev.Ry().shape({identity:ev.Ry().shape({email:ev.Z_().email().required().label("Email Address")})}),children:e=>{let{dirty:t,isValid:i}=e;return(0,a.jsx)(eh.l0,{children:(0,a.jsxs)(n.Kqy,{spacing:6,mb:2,children:[(0,a.jsx)(eb,{identityInputs:{email:"required"}}),(0,a.jsxs)("div",{className:"flex gap-4 self-end",children:[(0,a.jsx)(n.wpx,{onClick:s,children:"Cancel"}),(0,a.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!t||!i,"data-testid":"submit-btn",icon:(0,a.jsx)(n.xPt,{}),children:"Copy"})]})]})})}})};var ek=e=>{let{onSubmit:t,onCancel:s}=e,{data:i}=(0,W.xv)();return(0,a.jsx)(eh.J9,{initialValues:ef,onSubmit:t,validationSchema:()=>(0,ev.Vo)(e=>eg(ej(e.policy_key,null==i?void 0:i.actions))),children:e=>{var t;let{values:l,dirty:r,isValid:d,isSubmitting:o,setFieldValue:c}=e,u=ej(l.policy_key,null==i?void 0:i.actions);return(0,a.jsx)(eh.l0,{children:(0,a.jsxs)(n.Kqy,{spacing:6,mb:2,children:[(0,a.jsx)(e_.d,{name:"policy_key",label:"Request type",options:null!==(t=null==i?void 0:i.actions.map(e=>({label:e.title,value:e.policy_key})))&&void 0!==t?t:[],onChange:e=>{let t=ej(e,null==i?void 0:i.actions);if(!(null==t?void 0:t.custom_privacy_request_fields)){c("custom_privacy_request_fields",void 0);return}c("custom_privacy_request_fields",Object.entries(t.custom_privacy_request_fields).map(e=>{let[t,s]=e;return{[t]:{label:s.label,value:s.default_value}}}).reduce((e,t)=>({...e,...t}),{}))},layout:"stacked",isRequired:!0}),(0,a.jsx)(eb,{identityInputs:null==u?void 0:u.identity_inputs}),(0,a.jsx)(eC,{customFieldInputs:null==u?void 0:u.custom_privacy_request_fields}),(0,a.jsx)(ey.Xl,{name:"is_verified",label:"I confirm that I have verified this user information"}),(0,a.jsxs)("div",{className:"flex gap-4 self-end",children:[(0,a.jsx)(n.wpx,{onClick:s,children:"Cancel"}),(0,a.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!l.is_verified||!r||!d,loading:o,"data-testid":"submit-btn",children:"Create"})]})]})})}})},eE=s(31883);let eR=e=>{let{isOpen:t,onClose:s}=e,[i]=(0,W.M6)(),l=(0,n.pmc)(),r=async e=>{let{is_verified:t,...a}=e,r=a.custom_privacy_request_fields?Object.entries(a.custom_privacy_request_fields).map(e=>{let[t,s]=e;return s.value?{[t]:s}:{}}).reduce((e,t)=>({...e,...t}),{}):void 0,n={...a,custom_privacy_request_fields:r},d=await i([n]);(0,eE.D4)(d)?l((0,em.Vo)((0,eo.e$)(d.error,"An error occurred while creating this privacy request. Please try again"))):l((0,em.t5)("Privacy request created")),s()};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"2xl",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{"data-testid":"submit-request-modal",maxHeight:"80%",overflowY:"auto",children:[(0,a.jsx)(n.xBx,{children:"Create privacy request"}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)(n.Kqy,{spacing:4,children:[(0,a.jsx)(ep.Z,{title:"Warning: You are bypassing identity verification",text:"You are bypassing Fides' built-in identity verification step. Please ensure that you are only entering information on behalf of a verified and approved user's privacy request."}),(0,a.jsx)(ek,{onSubmit:r,onCancel:()=>s()})]})})]})]})},ew=e=>{let{isOpen:t,onClose:s,privacyCenterUrl:i}=e;return(0,a.jsxs)(n.u_l,{size:"md",isOpen:t,onClose:s,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{children:[(0,a.jsx)(n.xBx,{children:"Create a Privacy Request Link"}),(0,a.jsxs)(n.fef,{children:[(0,a.jsx)(n.Kqy,{spacing:4}),(0,a.jsx)(eS,{privacyCenterUrl:i,onSubmit:s,onCancel:s})]})]})]})};var eT=()=>{var e;let[t,s]=(0,c.useState)("closed"),i=()=>s("closed"),{data:l}=(0,ex.Vh)(),r=(null!==(e=null==l?void 0:l.privacy_center_url)&&void 0!==e?e:"").trim(),d=r.length>0;return(0,a.jsxs)(a.Fragment,{children:[d?(0,a.jsx)(ew,{isOpen:"create-link"===t,onClose:i,privacyCenterUrl:r}):null,(0,a.jsx)(eR,{isOpen:"submit-request"===t,onClose:i}),(0,a.jsx)(n.S0p.Button,{type:"primary",onClick:()=>s("submit-request"),"data-testid":"submit-request-btn",menu:{items:[{label:"Create request link",key:"create-request-link",icon:(0,a.jsx)(n.xPt,{}),onClick:()=>s("create-link"),disabled:!d}]},icon:(0,a.jsx)(n.v4q,{}),children:"Create request"})]})},eI=s(58754),eA=s(17245);let eN=()=>{let{errorAlert:e}=(0,eA.VY)(),[t,s]=(0,c.useState)(!1),[i,l]=(0,c.useState)({count:0,total:0}),[r,d]=(0,c.useState)(!0),o=b.q2.ERROR,{data:u}=(0,W.tE)(),{data:p}=(0,W.QA)({status:[o]},{pollingInterval:15e3,skip:r});return(0,c.useEffect)(()=>{d(!(u&&u.notify_after_failures>0))},[u]),(0,c.useEffect)(()=>{let e=(null==p?void 0:p.total)||0;e>=((null==u?void 0:u.notify_after_failures)||0)&&e>i.total?(l({count:e-i.total,total:e}),s(!0)):s(!1)},[null==p?void 0:p.total,null==u?void 0:u.notify_after_failures,i.total]),{processing:()=>{t&&e((0,a.jsxs)(n.xuv,{children:["DSR automation has failed for"," ",(0,a.jsx)(n.xvT,{as:"span",fontWeight:"semibold",children:i.count})," ","privacy request(s). Please review the event log for further details."]}),void 0,{containerStyle:{maxWidth:"max-content"},duration:null,id:"dsrErrorAlert"})}}};var eP=s(72281);let eO=o()(()=>s.e(9676).then(s.bind(s,59676)),{loadableGenerated:{webpack:()=>[59676]},loading:()=>(0,a.jsx)("div",{children:"Loading..."})});var eU=()=>{let{processing:e}=eN(),{plus:t}=(0,u.hz)(),{activeTab:s,handleTabChange:i,availableTabs:l}=(0,eP.d)();(0,c.useEffect)(()=>{e()},[e]);let r=(0,c.useMemo)(()=>{let e=[];return l.request&&e.push({key:eP.G.REQUEST,label:"Request",children:(0,a.jsx)(eu,{})}),l.manualTask&&e.push({key:eP.G.MANUAL_TASK,label:"Manual tasks",children:(0,a.jsx)(U,{})}),e},[l.manualTask,l.request]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eI.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests"}],rightContent:(0,a.jsxs)(n.vyj,{children:[t&&(0,a.jsx)(p.ZP,{scopes:[b.Sh.PRIVACY_REQUEST_CREATE],children:(0,a.jsx)(eT,{})}),(0,a.jsx)(eO,{})]}),"data-testid":"privacy-requests"}),(0,a.jsx)(n.A5g,{activeKey:s,onChange:i,items:r})]})},ez=()=>(0,a.jsx)(r.Z,{title:"Privacy Requests",children:(0,a.jsx)(eU,{})})},31883:function(e,t,s){"use strict";s.d(t,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=s(19043)}},function(e){e.O(0,[8765,431,3550,4558,2888,9774,179],function(){return e(e.s=1565)}),_N_E=e.O()}]);
|