ethyca-fides 2.70.0rc5__py2.py3-none-any.whl → 2.70.1__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.

Files changed (117) hide show
  1. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/METADATA +2 -2
  2. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/RECORD +109 -109
  3. fides/_version.py +3 -3
  4. fides/api/api/v1/endpoints/system.py +5 -1
  5. fides/api/schemas/connection_configuration/connection_secrets_mongodb.py +14 -2
  6. fides/api/service/connectors/mongodb_connector.py +74 -9
  7. fides/service/system/system_service.py +17 -2
  8. fides/ui-build/static/admin/404.html +1 -1
  9. fides/ui-build/static/admin/_next/static/chunks/3700-dc3f05d21e2a5ff6.js +1 -0
  10. fides/ui-build/static/admin/_next/static/chunks/7929-0fd0d4948bc8d70e.js +1 -0
  11. fides/ui-build/static/admin/_next/static/chunks/pages/{_app-e08a732e348aa667.js → _app-a4e3c999afb28ee7.js} +1 -1
  12. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-59a8aff5935482ec.js +1 -0
  13. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{reporting-09be5455ba85db39.js → reporting-ae4909cad9b67822.js} +1 -1
  14. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-b0e3f1886de28d66.js +1 -0
  15. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/{[monitorId]-0e4d9ff89c63793c.js → [monitorId]-e8ec4080d9a3e22f.js} +1 -1
  16. fides/ui-build/static/admin/_next/static/chunks/pages/{privacy-requests-65f0d5672041a202.js → privacy-requests-2c82cf73d20416f2.js} +1 -1
  17. fides/ui-build/static/admin/_next/static/chunks/pages/reporting/datamap-5b423687e227ad4d.js +1 -0
  18. fides/ui-build/static/admin/_next/static/chunks/pages/systems-d266cc062b56beb2.js +1 -0
  19. fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-07848c232d960f6a.js +1 -0
  20. fides/ui-build/static/admin/_next/static/css/1866822702989bb3.css +1 -0
  21. fides/ui-build/static/admin/_next/static/{YDIHw7NCpEulNqL5G--Yh → vyzRh-jDx4p6pVullfros}/_buildManifest.js +1 -1
  22. fides/ui-build/static/admin/add-systems/manual.html +1 -1
  23. fides/ui-build/static/admin/add-systems/multiple.html +1 -1
  24. fides/ui-build/static/admin/add-systems.html +1 -1
  25. fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
  26. fides/ui-build/static/admin/consent/configure.html +1 -1
  27. fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
  28. fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
  29. fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
  30. fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
  31. fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
  32. fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
  33. fides/ui-build/static/admin/consent/properties.html +1 -1
  34. fides/ui-build/static/admin/consent/reporting.html +1 -1
  35. fides/ui-build/static/admin/consent.html +1 -1
  36. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
  37. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
  38. fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
  39. fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
  40. fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
  41. fides/ui-build/static/admin/data-catalog.html +1 -1
  42. fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
  43. fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
  44. fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
  45. fides/ui-build/static/admin/data-discovery/activity.html +1 -1
  46. fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
  47. fides/ui-build/static/admin/data-discovery/detection.html +1 -1
  48. fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
  49. fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
  50. fides/ui-build/static/admin/datamap.html +1 -1
  51. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
  52. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
  53. fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
  54. fides/ui-build/static/admin/dataset/new.html +1 -1
  55. fides/ui-build/static/admin/dataset.html +1 -1
  56. fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
  57. fides/ui-build/static/admin/datastore-connection/new.html +1 -1
  58. fides/ui-build/static/admin/datastore-connection.html +1 -1
  59. fides/ui-build/static/admin/index.html +1 -1
  60. fides/ui-build/static/admin/integrations/[id].html +1 -1
  61. fides/ui-build/static/admin/integrations.html +1 -1
  62. fides/ui-build/static/admin/login/[provider].html +1 -1
  63. fides/ui-build/static/admin/login.html +1 -1
  64. fides/ui-build/static/admin/messaging/[id].html +1 -1
  65. fides/ui-build/static/admin/messaging/add-template.html +1 -1
  66. fides/ui-build/static/admin/messaging.html +1 -1
  67. fides/ui-build/static/admin/poc/ant-components.html +1 -1
  68. fides/ui-build/static/admin/poc/form-experiments/AntForm.html +1 -1
  69. fides/ui-build/static/admin/poc/form-experiments/FormikAntFormItem.html +1 -1
  70. fides/ui-build/static/admin/poc/form-experiments/FormikControlled.html +1 -1
  71. fides/ui-build/static/admin/poc/form-experiments/FormikField.html +1 -1
  72. fides/ui-build/static/admin/poc/form-experiments/FormikSpreadField.html +1 -1
  73. fides/ui-build/static/admin/poc/forms.html +1 -1
  74. fides/ui-build/static/admin/poc/table-migration.html +1 -1
  75. fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
  76. fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
  77. fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
  78. fides/ui-build/static/admin/privacy-requests.html +1 -1
  79. fides/ui-build/static/admin/properties/[id].html +1 -1
  80. fides/ui-build/static/admin/properties/add-property.html +1 -1
  81. fides/ui-build/static/admin/properties.html +1 -1
  82. fides/ui-build/static/admin/reporting/datamap.html +1 -1
  83. fides/ui-build/static/admin/settings/about/alpha.html +1 -1
  84. fides/ui-build/static/admin/settings/about.html +1 -1
  85. fides/ui-build/static/admin/settings/consent/[configuration_id]/[purpose_id].html +1 -1
  86. fides/ui-build/static/admin/settings/consent.html +1 -1
  87. fides/ui-build/static/admin/settings/custom-fields.html +1 -1
  88. fides/ui-build/static/admin/settings/domain-records.html +1 -1
  89. fides/ui-build/static/admin/settings/domains.html +1 -1
  90. fides/ui-build/static/admin/settings/email-templates.html +1 -1
  91. fides/ui-build/static/admin/settings/locations.html +1 -1
  92. fides/ui-build/static/admin/settings/messaging-providers/[key].html +1 -1
  93. fides/ui-build/static/admin/settings/messaging-providers/new.html +1 -1
  94. fides/ui-build/static/admin/settings/messaging-providers.html +1 -1
  95. fides/ui-build/static/admin/settings/organization.html +1 -1
  96. fides/ui-build/static/admin/settings/privacy-requests.html +1 -1
  97. fides/ui-build/static/admin/settings/regulations.html +1 -1
  98. fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
  99. fides/ui-build/static/admin/systems/configure/[id].html +1 -1
  100. fides/ui-build/static/admin/systems.html +1 -1
  101. fides/ui-build/static/admin/taxonomy.html +1 -1
  102. fides/ui-build/static/admin/user-management/new.html +1 -1
  103. fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
  104. fides/ui-build/static/admin/user-management.html +1 -1
  105. fides/ui-build/static/admin/_next/static/chunks/3700-2a7094f112a1608a.js +0 -1
  106. fides/ui-build/static/admin/_next/static/chunks/7929-919e2dff24e40397.js +0 -1
  107. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-8fb92df30e8d496a.js +0 -1
  108. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-758d51b4d37dbd09.js +0 -1
  109. fides/ui-build/static/admin/_next/static/chunks/pages/reporting/datamap-0afb12096a35ab78.js +0 -1
  110. fides/ui-build/static/admin/_next/static/chunks/pages/systems-ae3f3470e2734933.js +0 -1
  111. fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-1b9c4b2749e3ece4.js +0 -1
  112. fides/ui-build/static/admin/_next/static/css/018c12b58ee7f861.css +0 -1
  113. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/WHEEL +0 -0
  114. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/entry_points.txt +0 -0
  115. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/licenses/LICENSE +0 -0
  116. {ethyca_fides-2.70.0rc5.dist-info → ethyca_fides-2.70.1.dist-info}/top_level.txt +0 -0
  117. /fides/ui-build/static/admin/_next/static/{YDIHw7NCpEulNqL5G--Yh → vyzRh-jDx4p6pVullfros}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7262],{81575:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/consent/privacy-notices",function(){return a(13089)}])},58754:function(e,t,a){"use strict";var l=a(24246),i=a(96306),n=a(70788);t.Z=e=>{let{heading:t,breadcrumbItems:a,isSticky:s=!0,children:r,rightContent:o,style:c,...d}=e;return(0,l.jsxs)("div",{...d,style:s?{position:"sticky",top:"-24px",paddingTop:"24px",paddingBottom:"24px",paddingLeft:"40px",marginLeft:"-40px",paddingRight:"40px",marginRight:"-40px",marginTop:"-24px",left:0,zIndex:20,backgroundColor:"white",...c}:{paddingBottom:"24px",...c},children:[(0,l.jsxs)(i.jqI,{justify:"space-between",children:["string"==typeof t?(0,l.jsx)(i.lQT,{className:a||r?"pb-4":void 0,level:1,"data-testid":"page-heading",children:t}):t,o&&(0,l.jsx)("div",{"data-testid":"page-header-right-content",children:o})]}),!!a&&(0,l.jsx)(n.m,{className:r?"pb-4":void 0,items:a,"data-testid":"page-breadcrumb"}),r]})}},70788:function(e,t,a){"use strict";a.d(t,{m:function(){return c}});var l=a(24246),i=a(96306),n=a(79894),s=a.n(n),r=a(27378);let{Text:o}=i.AntTypography,c=e=>{let{items:t,...a}=e,n=(0,r.useMemo)(()=>null==t?void 0:t.map((e,a)=>{let n=a===t.length-1,r={...e},c=r.onClick&&!r.href;return("string"==typeof r.title&&(r.title=(0,l.jsx)(o,{style:{color:"inherit",maxWidth:n?void 0:400},ellipsis:!n,id:n?"breadcrumb-current-page":void 0,children:r.title})),c)?r.title=(0,l.jsx)(i.wpx,{type:"text",size:"small",icon:r.icon,onClick:r.onClick,className:"ant-breadcrumb-link -mt-px px-1 text-inherit",children:r.title}):(r.icon&&(r.title=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"anticon align-text-bottom",children:r.icon}),r.title]})),r.href&&r.title&&(r.title=(0,l.jsx)(s(),{href:r.href,className:"ant-breadcrumb-link",children:r.title}),delete r.href)),r}),[t]);return(0,l.jsx)(i.zrq,{items:n,...a})}},2525:function(e,t,a){"use strict";a.d(t,{Q:function(){return r}});var l=a(24246),i=a(96306),n=a(27378),s=a(3110);let r=e=>{let{values:t,columnState:a,tagProps:r,onTagClose:o,...c}=e,{isExpanded:d,isWrapped:u,version:p}=a||{},[h,x]=(0,n.useState)(!d),[g,m]=(0,n.useState)(!!u),[v,f]=(0,n.useState)(d?t:null==t?void 0:t.slice(0,2));(0,n.useEffect)(()=>{x(!d)},[d,p]),(0,n.useEffect)(()=>{m(!!u)},[u]),(0,n.useEffect)(()=>{(null==t?void 0:t.length)?f(h?t.slice(0,2):t):f(t)},[h,t]);let j=(0,n.useCallback)(()=>{f(null==t?void 0:t.slice(0,2)),x(!0)},[t]),b=(0,n.useCallback)(()=>{x(!1)},[]),y=(0,n.useCallback)(()=>{h?b():j()},[h,b,j]);return(0,n.useMemo)(()=>(null==v?void 0:v.length)?(0,l.jsxs)(i.jqI,{align:h?"center":"start",wrap:g?"wrap":"nowrap",vertical:!h,gap:"small","data-testid":"tag-expandable-cell",style:{overflowX:"auto",...c.style},...c,children:[v.map(e=>(0,l.jsx)(i.j8w,{color:"white","data-testid":e.key,onClose:o?()=>o(e.key):void 0,...r,...e.tagProps,children:(0,l.jsx)(i.lKn,{ellipsis:!!h&&{tooltip:!0},style:{color:"inherit",maxWidth:h?s.TD:void 0},children:e.label})},e.key)),t&&t.length>2&&(0,l.jsx)(i.wpx,{type:"link",size:"small",onClick:e=>{e.stopPropagation(),y()},className:"h-auto p-0",style:{fontSize:"var(--ant-font-size)"},children:h?"+".concat(t.length-2," more"):s.T5})]}):(0,l.jsx)("span",{"data-testid":"tag-expandable-cell-empty"}),[v,h,g,c,t,r,o,y])}},3110:function(e,t,a){"use strict";a.d(t,{DI:function(){return r},T5:function(){return n},TD:function(){return s}});var l=a(24246),i=a(96306);let n="show less",s=150,r=[{key:"expand-all",label:"Expand all",icon:(0,l.jsx)(i.PJP.jbG,{})},{key:"collapse-all",label:"Collapse all",icon:(0,l.jsx)(i.PJP.MVB,{})}]},26070:function(e,t,a){"use strict";a.d(t,{v:function(){return o},Q:function(){return c.Q}});var l=a(24246),i=a(96306),n=a(27378),s=a(3110);let{Text:r}=i.AntTypography,o=e=>{let{values:t,valueSuffix:a,columnState:o}=e,{isExpanded:c,version:d}=o||{},[u,p]=(0,n.useState)(!c);(0,n.useEffect)(()=>{p(!c)},[c,d]);let h=(0,n.useCallback)(()=>{p(!0)},[]),x=(0,n.useCallback)(()=>{p(!1)},[]),g=(0,n.useCallback)(()=>{u?x():h()},[u,x,h]);return(0,n.useMemo)(()=>(null==t?void 0:t.length)?1===t.length?(0,l.jsx)(r,{ellipsis:!0,"data-testid":"list-expandable-cell-single",children:t[0]}):(0,l.jsxs)(i.jqI,{align:u?"center":"flex-start",vertical:!u,gap:u?"small":"none","data-testid":"list-expandable-cell",children:[u?(0,l.jsxs)(r,{ellipsis:!0,children:[t.length," ",a]}):(0,l.jsx)(i.krs,{dataSource:t,renderItem:e=>(0,l.jsx)("li",{children:e})}),(0,l.jsx)(i.wpx,{type:"link",size:"small",onClick:e=>{e.stopPropagation(),g()},className:"h-auto p-0",style:{fontSize:"var(--ant-font-size)"},children:u?"view":s.T5})]}):null,[u,t,a,g])};var c=a(2525)},13089:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return T}});var l=a(24246),i=a(96306),n=a(27378),s=a(35287),r=a(58754),o=a(92222),c=a(59003),d=a(47935),u=a(79894),p=a.n(u),h=a(86677),x=a(77830),g=a(8411),m=a(19904),v=a(32885),f=a(22286),j=a(65063),b=a(71922),y=a(21910),w=a(26070);let k={items:[],total:0,page:1,size:25,pages:1},C=()=>(0,l.jsxs)(i.gCW,{mt:6,p:10,spacing:4,borderRadius:"base",maxW:"70%","data-testid":"no-results-notice",alignSelf:"center",margin:"auto",children:[(0,l.jsxs)(i.gCW,{children:[(0,l.jsx)(i.xvT,{fontSize:"md",fontWeight:"600",children:"No privacy notices found."}),(0,l.jsx)(i.xvT,{fontSize:"sm",children:'Click "Add a privacy notice" to add your first privacy notice to Fides.'})]}),(0,l.jsx)(i.wpx,{href:"".concat(x.IT,"/new"),role:"link",size:"small",type:"primary","data-testid":"add-privacy-notice-btn",children:"Add a privacy notice +"})]}),P=(0,o.Cl)(),R=()=>{let{isLoading:e}=(0,v.x8)(),t=(0,h.useRouter)(),a=(0,m.Tg)([y.Sh.PRIVACY_NOTICE_UPDATE]),{PAGE_SIZES:s,pageSize:r,setPageSize:u,onPreviousPageClick:R,isPreviousPageDisabled:T,onNextPageClick:N,isNextPageDisabled:z,startRange:_,endRange:E,pageIndex:S,setTotalPages:M}=(0,d.oi)(),{isFetching:I,isLoading:V,data:A}=(0,b.J6)({page:S,size:r}),{items:q,total:Q,pages:W}=(0,n.useMemo)(()=>A||k,[A]);(0,n.useEffect)(()=>{M(W)},[W,M]);let D=(0,n.useMemo)(()=>[P.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Title",...e})}),P.accessor(e=>e.consent_mechanism,{id:"consent_mechanism",cell:e=>(0,f.JA)(e.getValue()),header:e=>(0,l.jsx)(d.Rr,{value:"Mechanism",...e})}),P.accessor(e=>e.configured_regions,{id:"regions",cell:e=>{var t,a;return(0,l.jsx)(w.Q,{values:null!==(a=null===(t=e.getValue())||void 0===t?void 0:t.map(e=>{var t;let a=(0,i.QCN)(e);return{label:a?(0,i.c1K)({isoEntry:a,showFlag:!0}):null!==(t=g.Z8[e])&&void 0!==t?t:e,key:e}}))&&void 0!==a?a:[]})},header:e=>(0,l.jsx)(d.Rr,{value:"Locations",...e}),meta:{disableRowClick:!0}}),P.accessor(e=>e.disabled,{id:"status",cell:e=>(0,f.jN)(e),header:e=>(0,l.jsx)(d.Rr,{value:"Status",...e})}),P.accessor(e=>e.framework,{id:"framework",cell:e=>e.getValue()?(0,l.jsx)(d.A4,{value:j.Ep.get(e.getValue())}):null,header:e=>(0,l.jsx)(d.Rr,{value:"Framework",...e})}),P.accessor(e=>e.children,{id:"children",cell:e=>{var t;return(null===(t=(0,f.Mq)(e.getValue()))||void 0===t?void 0:t.length)?(0,l.jsx)(d.WP,{suffix:"Children",value:(0,f.Mq)(e.getValue()),...e}):(0,l.jsx)(d.G3,{value:"Unassigned"})},header:e=>(0,l.jsx)(d.Rr,{value:"Children",...e}),meta:{showHeaderMenu:!0}}),a&&P.accessor(e=>e.disabled,{id:"enable",cell:f.PS,header:e=>(0,l.jsx)(d.Rr,{value:"Enable",...e}),meta:{disableRowClick:!0}})].filter(Boolean),[a]),B=(0,c.b7)({getCoreRowModel:(0,o.sC)(),getGroupedRowModel:(0,o.qe)(),getExpandedRowModel:(0,o.rV)(),columns:D,manualPagination:!0,data:q,state:{expanded:!0},columnResizeMode:"onChange"});return V||e?(0,l.jsx)(d.I4,{rowHeight:36,numRows:15}):(0,l.jsx)("div",{children:(0,l.jsxs)(i.kCb,{flex:1,direction:"column",overflow:"auto",children:[a&&(0,l.jsx)(d.Q$,{children:(0,l.jsx)(i.Ugi,{alignItems:"center",spacing:4,marginLeft:"auto",children:(0,l.jsx)(p(),{href:"".concat(x.IT,"/new"),passHref:!0,legacyBehavior:!0,children:(0,l.jsx)(i.wpx,{type:"primary","data-testid":"add-privacy-notice-btn",children:"Add a privacy notice +"})})})}),(0,l.jsx)(d.ZK,{tableInstance:B,onRowClick:a?e=>{let{id:l}=e;a&&t.push("".concat(x.IT,"/").concat(l))}:void 0,emptyTableNotice:(0,l.jsx)(C,{})}),(0,l.jsx)(d.s8,{totalRows:Q||0,pageSizes:s,setPageSize:u,onPreviousPageClick:R,isPreviousPageDisabled:T||I,onNextPageClick:N,isNextPageDisabled:z||I,startRange:_,endRange:E})]})})};var T=()=>(0,l.jsxs)(s.Z,{title:"Privacy notices",children:[(0,l.jsx)(r.Z,{heading:"Privacy Notices",children:(0,l.jsx)(i.xvT,{fontSize:"sm",mb:8,width:{base:"100%",lg:"50%"},children:"Manage the privacy notices and mechanisms that are displayed to your users based on their location, what information you collect about them, and how you use that data."})}),(0,l.jsx)(i.xuv,{"data-testid":"privacy-notices-page",children:(0,l.jsx)(R,{})})]})}},function(e){e.O(0,[6853,2888,9774,179],function(){return e(e.s=81575)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3422],{15806:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/consent/reporting",function(){return n(45113)}])},35287:function(e,a,n){"use strict";var r=n(24246),t=n(96306),i=n(88038),s=n.n(i);n(27378),a.Z=e=>{let{children:a,title:n,mainProps:i}=e;return(0,r.jsxs)(t.kCb,{"data-testid":n,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,r.jsxs)(s(),{children:[(0,r.jsxs)("title",{children:["Fides Admin UI - ",n]}),(0,r.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,r.jsx)(t.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...i,children:a})]})}},58754:function(e,a,n){"use strict";var r=n(24246),t=n(96306),i=n(70788);a.Z=e=>{let{heading:a,breadcrumbItems:n,isSticky:s=!0,children:o,rightContent:l,style:d,...c}=e;return(0,r.jsxs)("div",{...c,style:s?{position:"sticky",top:"-24px",paddingTop:"24px",paddingBottom:"24px",paddingLeft:"40px",marginLeft:"-40px",paddingRight:"40px",marginRight:"-40px",marginTop:"-24px",left:0,zIndex:20,backgroundColor:"white",...d}:{paddingBottom:"24px",...d},children:[(0,r.jsxs)(t.jqI,{justify:"space-between",children:["string"==typeof a?(0,r.jsx)(t.lQT,{className:n||o?"pb-4":void 0,level:1,"data-testid":"page-heading",children:a}):a,l&&(0,r.jsx)("div",{"data-testid":"page-header-right-content",children:l})]}),!!n&&(0,r.jsx)(i.m,{className:o?"pb-4":void 0,items:n,"data-testid":"page-breadcrumb"}),o]})}},17245:function(e,a,n){"use strict";n.d(a,{HK:function(){return s},VY:function(){return t.V},pI:function(){return c},h0:function(){return r.h},Rx:function(){return F},rK:function(){return h}});var r=n(36866),t=n(84306),i=n(812);let s=()=>{let{errorAlert:e}=(0,t.V)();return{handleError:a=>{let n="An unexpected error occurred. Please try again.";(0,i.Ot)(a)?n=a.data.detail:(0,i.tB)(a)&&(n=a.data.detail[0].msg),e(n)}}};var o=n(27378),l=n(20682),d=n(21910);let c=e=>{let{data:a}=(0,l.$I)({}),n=(0,o.useMemo)(()=>(null==a?void 0:a.items)||[],[a]);return(0,o.useMemo)(()=>{var a;if(!e)return"";if(e.connection_type===d.Rj.SAAS&&(null===(a=e.saas_config)||void 0===a?void 0:a.type)){let a=n.find(a=>{var n;return a.identifier===(null===(n=e.saas_config)||void 0===n?void 0:n.type)});if(a)return a}return e},[e,n])};var _=n(40431);let u=()=>({search:_.Oi.withDefault("")}),F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultSearchQuery:a,onSearchChange:n}=e,r=(0,o.useMemo)(()=>u(),[]),[t,i]=(0,_.XI)(r,{history:"push"}),s=(0,o.useMemo)(()=>({searchQuery:t.search||a||void 0}),[t,a]),l=(0,o.useCallback)(e=>{i({search:e||null})},[i]),d=(0,o.useCallback)(()=>{i({search:null})},[i]);return(0,o.useEffect)(()=>{n&&n(s)},[s,n]),{...s,updateSearch:l,resetSearch:d,searchProps:{value:s.searchQuery||"",onChange:l,onClear:()=>l("")}}},p=e=>({sortKey:e?(0,_.jx)([...e]):_.Oi.withDefault(""),sortOrder:(0,_.km)(["ascend","descend"])}),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultSortKey:a,defaultSortOrder:n,onSortingChange:r,validColumns:t}=e,i=(0,o.useMemo)(()=>p(t),[t]),[s,l]=(0,_.XI)(i,{history:"push"}),d=(0,o.useMemo)(()=>{var e;return{sortKey:s.sortKey||a,sortOrder:null!==(e=s.sortOrder)&&void 0!==e?e:n}},[s,a,n]),c=(0,o.useCallback)((e,a)=>{l({sortKey:e?String(e):null,sortOrder:null!=a?a:null})},[l]),u=(0,o.useCallback)(()=>{l({sortKey:null,sortOrder:null})},[l]);return(0,o.useEffect)(()=>{r&&r(d)},[d,r]),{...d,updateSorting:c,resetSorting:u,sortingProps:{sortDirections:["ascend","descend"],defaultSortOrder:d.sortOrder,sortedInfo:d.sortKey?{field:d.sortKey,order:d.sortOrder}:void 0}}}},84306:function(e,a,n){"use strict";n.d(a,{V:function(){return i}});var r=n(24246),t=n(96306);let i=()=>{let e=(0,t.pmc)();return{errorAlert:(a,n,i)=>{let s={...i,position:(null==i?void 0:i.position)||"top",render:e=>{let{onClose:i}=e;return(0,r.jsxs)(t.bZj,{alignItems:"normal",status:"error","data-testid":"error-alert",children:[(0,r.jsx)(t.zMQ,{}),(0,r.jsxs)(t.xuv,{children:[n&&(0,r.jsx)(t.CdC,{children:n}),(0,r.jsx)(t.XaZ,{children:a})]}),(0,r.jsx)(t.PZ7,{onClick:i,position:"relative",right:0,size:"sm",top:-1})]})}};(null==i?void 0:i.id)&&e.isActive(i.id)?e.update(i.id,s):e(s)},successAlert:(a,n,i)=>{let s={...i,position:(null==i?void 0:i.position)||"top",render:e=>{let{onClose:i}=e;return(0,r.jsxs)(t.bZj,{alignItems:"normal",status:"success",variant:"subtle","data-testid":"success-alert",children:[(0,r.jsx)(t.zMQ,{}),(0,r.jsxs)(t.xuv,{children:[n&&(0,r.jsx)(t.CdC,{children:n}),(0,r.jsx)(t.XaZ,{children:a})]}),(0,r.jsx)(t.PZ7,{onClick:i,position:"relative",right:0,size:"sm",top:-1})]})}};(null==i?void 0:i.id)&&e.isActive(i.id)?e.update(i.id,s):e(s)}}}},70788:function(e,a,n){"use strict";n.d(a,{m:function(){return d}});var r=n(24246),t=n(96306),i=n(79894),s=n.n(i),o=n(27378);let{Text:l}=t.AntTypography,d=e=>{let{items:a,...n}=e,i=(0,o.useMemo)(()=>null==a?void 0:a.map((e,n)=>{let i=n===a.length-1,o={...e},d=o.onClick&&!o.href;return("string"==typeof o.title&&(o.title=(0,r.jsx)(l,{style:{color:"inherit",maxWidth:i?void 0:400},ellipsis:!i,id:i?"breadcrumb-current-page":void 0,children:o.title})),d)?o.title=(0,r.jsx)(t.wpx,{type:"text",size:"small",icon:o.icon,onClick:o.onClick,className:"ant-breadcrumb-link -mt-px px-1 text-inherit",children:o.title}):(o.icon&&(o.title=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"anticon align-text-bottom",children:o.icon}),o.title]})),o.href&&o.title&&(o.title=(0,r.jsx)(s(),{href:o.href,className:"ant-breadcrumb-link",children:o.title}),delete o.href)),o}),[a]);return(0,r.jsx)(t.zrq,{items:i,...n})}},36866:function(e,a,n){"use strict";n.d(a,{h:function(){return d}});var r=n(40431),t=n(27378),i=n(55484);let s=(0,r.jo)({parse(e){let a=parseInt(e,10);try{return i.Rx().integer().positive().validateSync(a),a}catch(e){return null}},serialize:e=>e.toString()});var o=n(32735);let l=function(){var e,a;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{page:s.withDefault(o.Ej),size:n.pageSizeOptions?(0,r.bJ)(n.pageSizeOptions).withDefault(null!==(e=n.pageSize)&&void 0!==e?e:o.L8):s.withDefault(null!==(a=n.pageSize)&&void 0!==a?a:o.L8)}},d=function(){var e,a;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultPageSize:i=o.L8,pageSizeOptions:s,showSizeChanger:d=!0}=n,c=null!=s?s:o.VZ,_=(0,t.useMemo)(()=>l({pageSize:i,pageSizeOptions:s}),[i,s]),[u,F]=(0,r.XI)(_,{history:"push"}),p={pageIndex:null!==(e=u.page)&&void 0!==e?e:o.Ej,pageSize:null!==(a=u.size)&&void 0!==a?a:i};return{...p,updatePageIndex:e=>{F({page:e})},updatePageSize:e=>{F({page:e!==p.pageSize?o.Ej:p.pageIndex,size:e})},resetPagination:()=>{F({page:o.Ej,size:i})},nextPage:()=>{F(e=>{let{page:a,size:n}=e;return{page:a+1,size:n}})},previousPage:()=>{F(e=>{let{page:a,size:n}=e;return{page:a-1,size:n}})},pageSizeOptions:c,showSizeChanger:d}}},8411:function(e,a,n){"use strict";n.d(a,{NA:function(){return i},Z8:function(){return t}});var r=n(21910);let t={[r._F.ER]:"Eritrea",[r._F.DJ]:"Djibouti",[r._F.MR]:"Mauritania",[r._F.NA]:"Namibia",[r._F.GH]:"Ghana",[r._F.SS]:"South Sudan",[r._F.SC]:"Seychelles",[r._F.IO]:"British Indian Ocean Territory",[r._F.GQ]:"Equatorial Guinea",[r._F.AO]:"Angola",[r._F.CG]:"Republic of the Congo",[r._F.BW]:"Botswana",[r._F.BI]:"Burundi",[r._F.DZ]:"Algeria",[r._F.TD]:"Chad",[r._F.NG]:"Nigeria",[r._F.TZ]:"Tanzania",[r._F.EH]:"Western Sahara",[r._F.SN]:"Senegal",[r._F.LR]:"Liberia",[r._F.ZA]:"South Africa",[r._F.CV]:"Cape Verde",[r._F.GM]:"Gambia",[r._F.SD]:"Sudan",[r._F.KM]:"Comoros",[r._F.SZ]:"Eswatini",[r._F.UG]:"Uganda",[r._F.MG]:"Madagascar",[r._F.RW]:"Rwanda",[r._F.CD]:"DR Congo",[r._F.CM]:"Cameroon",[r._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[r._F.TG]:"Togo",[r._F.MU]:"Mauritius",[r._F.NE]:"Niger",[r._F.BJ]:"Benin",[r._F.EG]:"Egypt",[r._F.LS]:"Lesotho",[r._F.ET]:"Ethiopia",[r._F.MA]:"Morocco",[r._F.YT]:"Mayotte",[r._F.BF]:"Burkina Faso",[r._F.RE]:"R\xe9union",[r._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[r._F.CF]:"Central African Republic",[r._F.MZ]:"Mozambique",[r._F.MW]:"Malawi",[r._F.ML]:"Mali",[r._F.ZM]:"Zambia",[r._F.LY]:"Libya",[r._F.GW]:"Guinea-Bissau",[r._F.SO]:"Somalia",[r._F.KE]:"Kenya",[r._F.GN]:"Guinea",[r._F.ZW]:"Zimbabwe",[r._F.TN]:"Tunisia",[r._F.SL]:"Sierra Leone",[r._F.GA]:"Gabon",[r._F.CI]:"Ivory Coast",[r._F.JO]:"Jordan",[r._F.PK]:"Pakistan",[r._F.KP]:"North Korea",[r._F.MO]:"Macau",[r._F.AM]:"Armenia",[r._F.SY]:"Syria",[r._F.TJ]:"Tajikistan",[r._F.SA]:"Saudi Arabia",[r._F.KR]:"South Korea",[r._F.NP]:"Nepal",[r._F.PH]:"Philippines",[r._F.IQ]:"Iraq",[r._F.LB]:"Lebanon",[r._F.MN]:"Mongolia",[r._F.PS]:"Palestine",[r._F.YE]:"Yemen",[r._F.JP]:"Japan",[r._F.KZ]:"Kazakhstan",[r._F.LK]:"Sri Lanka",[r._F.MM]:"Myanmar",[r._F.KG]:"Kyrgyzstan",[r._F.CN]:"China",[r._F.AF]:"Afghanistan",[r._F.OM]:"Oman",[r._F.IN]:"India",[r._F.LA]:"Laos",[r._F.UZ]:"Uzbekistan",[r._F.MV]:"Maldives",[r._F.ID]:"Indonesia",[r._F.VN]:"Vietnam",[r._F.MY]:"Malaysia",[r._F.TW]:"Taiwan",[r._F.KH]:"Cambodia",[r._F.AE]:"United Arab Emirates",[r._F.HK]:"Hong Kong",[r._F.GE]:"Georgia (Country)",[r._F.BD]:"Bangladesh",[r._F.KW]:"Kuwait",[r._F.TM]:"Turkmenistan",[r._F.QA]:"Qatar",[r._F.BH]:"Bahrain",[r._F.BN]:"Brunei",[r._F.TH]:"Thailand",[r._F.BT]:"Bhutan",[r._F.SG]:"Singapore",[r._F.IL]:"Israel",[r._F.AZ]:"Azerbaijan",[r._F.TL]:"Timor-Leste",[r._F.IR]:"Iran",[r._F.TR]:"Turkey",[r._F.MK]:"North Macedonia",[r._F.IE]:"Ireland",[r._F.DK]:"Denmark",[r._F.SK]:"Slovakia",[r._F.MD]:"Moldova",[r._F.AX]:"\xc5land Islands",[r._F.PL]:"Poland",[r._F.BA]:"Bosnia and Herzegovina",[r._F.SM]:"San Marino",[r._F.CZ]:"Czechia",[r._F.EE]:"Estonia",[r._F.XK]:"Kosovo",[r._F.FO]:"Faroe Islands",[r._F.SJ]:"Svalbard and Jan Mayen",[r._F.GG]:"Guernsey",[r._F.FR]:"France",[r._F.NL]:"Netherlands",[r._F.FI]:"Finland",[r._F.PT]:"Portugal",[r._F.DE]:"Germany",[r._F.MT]:"Malta",[r._F.JE]:"Jersey",[r._F.IS]:"Iceland",[r._F.ES]:"Spain",[r._F.GI]:"Gibraltar",[r._F.NO]:"Norway",[r._F.CY]:"Cyprus",[r._F.RS]:"Serbia",[r._F.LT]:"Lithuania",[r._F.MC]:"Monaco",[r._F.LU]:"Luxembourg",[r._F.UA]:"Ukraine",[r._F.IM]:"Isle of Man",[r._F.RO]:"Romania",[r._F.BE]:"Belgium",[r._F.SE]:"Sweden",[r._F.ME]:"Montenegro",[r._F.LV]:"Latvia",[r._F.VA]:"Vatican City",[r._F.AT]:"Austria",[r._F.AL]:"Albania",[r._F.LI]:"Liechtenstein",[r._F.GR]:"Greece",[r._F.IT]:"Italy",[r._F.AD]:"Andorra",[r._F.GB]:"United Kingdom",[r._F.RU]:"Russia",[r._F.SI]:"Slovenia",[r._F.BY]:"Belarus",[r._F.CH]:"Switzerland",[r._F.HU]:"Hungary",[r._F.BG]:"Bulgaria",[r._F.HR]:"Croatia",[r._F.TC]:"Turks and Caicos Islands",[r._F.CW]:"Cura\xe7ao",[r._F.GP]:"Guadeloupe",[r._F.UM]:"United States Minor Outlying Islands",[r._F.GT]:"Guatemala",[r._F.PM]:"Saint Pierre and Miquelon",[r._F.BQ]:"Caribbean Netherlands",[r._F.GL]:"Greenland",[r._F.SX]:"Sint Maarten",[r._F.PA]:"Panama",[r._F.AW]:"Aruba",[r._F.MQ]:"Martinique",[r._F.AG]:"Antigua and Barbuda",[r._F.BM]:"Bermuda",[r._F.CU]:"Cuba",[r._F.GD]:"Grenada",[r._F.NI]:"Nicaragua",[r._F.LC]:"Saint Lucia",[r._F.KN]:"Saint Kitts and Nevis",[r._F.DO]:"Dominican Republic",[r._F.VC]:"Saint Vincent and the Grenadines",[r._F.BZ]:"Belize",[r._F.HT]:"Haiti",[r._F.JM]:"Jamaica",[r._F.BS]:"Bahamas",[r._F.MX]:"Mexico",[r._F.MF]:"Saint Martin",[r._F.SV]:"El Salvador",[r._F.BL]:"Saint Barth\xe9lemy",[r._F.AI]:"Anguilla",[r._F.MS]:"Montserrat",[r._F.VG]:"British Virgin Islands",[r._F.BB]:"Barbados",[r._F.HN]:"Honduras",[r._F.KY]:"Cayman Islands",[r._F.DM]:"Dominica",[r._F.TT]:"Trinidad and Tobago",[r._F.CR]:"Costa Rica",[r._F.SR]:"Suriname",[r._F.CX]:"Christmas Island",[r._F.WS]:"Samoa",[r._F.PF]:"French Polynesia",[r._F.AS]:"American Samoa",[r._F.NC]:"New Caledonia",[r._F.TK]:"Tokelau",[r._F.PW]:"Palau",[r._F.KI]:"Kiribati",[r._F.VU]:"Vanuatu",[r._F.PN]:"Pitcairn Islands",[r._F.CK]:"Cook Islands",[r._F.FJ]:"Fiji",[r._F.PG]:"Papua New Guinea",[r._F.MP]:"Northern Mariana Islands",[r._F.NU]:"Niue",[r._F.TV]:"Tuvalu",[r._F.NF]:"Norfolk Island",[r._F.TO]:"Tonga",[r._F.FM]:"Micronesia",[r._F.SB]:"Solomon Islands",[r._F.NR]:"Nauru",[r._F.WF]:"Wallis and Futuna",[r._F.GU]:"Guam",[r._F.AU]:"Australia",[r._F.NZ]:"New Zealand",[r._F.MH]:"Marshall Islands",[r._F.CC]:"Cocos (Keeling) Islands",[r._F.VE]:"Venezuela",[r._F.PY]:"Paraguay",[r._F.BR]:"Brazil",[r._F.CO]:"Colombia",[r._F.PE]:"Peru",[r._F.CL]:"Chile",[r._F.UY]:"Uruguay",[r._F.AR]:"Argentina",[r._F.GY]:"Guyana",[r._F.BO]:"Bolivia",[r._F.GF]:"French Guiana",[r._F.EC]:"Ecuador",[r._F.FK]:"Falkland Islands",[r._F.US_AL]:"Alabama",[r._F.US_AK]:"Alaska",[r._F.US_AZ]:"Arizona",[r._F.US_AR]:"Arkansas",[r._F.US_CA]:"California",[r._F.US_CO]:"Colorado",[r._F.US_CT]:"Connecticut",[r._F.US_DE]:"Delaware",[r._F.US_DC]:"District of Columbia (DC)",[r._F.US_FL]:"Florida",[r._F.US_GA]:"Georgia",[r._F.US_HI]:"Hawaii",[r._F.US_ID]:"Idaho",[r._F.US_IL]:"Illinois",[r._F.US_IN]:"Indiana",[r._F.US_IA]:"Iowa",[r._F.US_KS]:"Kansas",[r._F.US_KY]:"Kentucky",[r._F.US_LA]:"Louisiana",[r._F.US_ME]:"Maine",[r._F.US_MD]:"Maryland",[r._F.US_MA]:"Massachusetts",[r._F.US_MI]:"Michigan",[r._F.US_MN]:"Minnesota",[r._F.US_MS]:"Mississippi",[r._F.US_MO]:"Missouri",[r._F.US_MT]:"Montana",[r._F.US_NE]:"Nebraska",[r._F.US_NV]:"Nevada",[r._F.US_NH]:"New Hampshire",[r._F.US_NJ]:"New Jersey",[r._F.US_NM]:"New Mexico",[r._F.US_NY]:"New York",[r._F.US_NC]:"North Carolina",[r._F.US_ND]:"North Dakota",[r._F.US_OH]:"Ohio",[r._F.US_OK]:"Oklahoma",[r._F.US_OR]:"Oregon",[r._F.US_PA]:"Pennsylvania",[r._F.US_PR]:"Puerto Rico",[r._F.US_RI]:"Rhode Island",[r._F.US_SC]:"South Carolina",[r._F.US_SD]:"South Dakota",[r._F.US_TN]:"Tennessee",[r._F.US_TX]:"Texas",[r._F.US_UT]:"Utah",[r._F.US_VA]:"Virginia",[r._F.US_VI]:"United States Virgin Islands",[r._F.US_VT]:"Vermont",[r._F.US_WA]:"Washington",[r._F.US_WV]:"West Virginia",[r._F.US_WI]:"Wisconsin",[r._F.US_WY]:"Wyoming",[r._F.CA_AB]:"Alberta",[r._F.CA_BC]:"British Columbia",[r._F.CA_MB]:"Manitoba",[r._F.CA_NB]:"New Brunswick",[r._F.CA_NL]:"Newfoundland and Labrador",[r._F.CA_NS]:"Nova Scotia",[r._F.CA_ON]:"Ontario",[r._F.CA_PE]:"Prince Edward Island",[r._F.CA_QC]:"Quebec",[r._F.CA_SK]:"Saskatchewan",[r._F.CA_NT]:"Northwest Territories",[r._F.CA_NU]:"Nunavut",[r._F.CA_YT]:"Yukon",[r._F.CA]:"Canada",[r._F.US]:"United States",[r._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[r._F.CARIBBEAN]:"Caribbean",[r._F.EEA]:"European Economic Area (EEA)",[r._F.NON_EEA]:"Non European Economic Area",[r._F.GLOBAL]:"Global"},i=new Map(Object.entries(t));Object.entries(t).map(e=>({value:e[0],label:e[1]}))},45113:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return V}});var r=n(24246),t=n(59003),i=n(92222),s=n(27693),o=n.n(s),l=n(96306),d=n(27378),c=n(35287),_=n(17245),u=n(58754);let F=e=>{let{disableNext:a,pagination:n}=e;return(0,r.jsxs)(l.jqI,{gap:"middle",align:"center",justify:"right",children:[(0,r.jsx)(l.wpx,{onClick:n.previousPage,disabled:1===n.pageIndex,icon:(0,r.jsx)(l.PJP.s$$,{"aria-hidden":!0}),"aria-label":"Previous"}),(0,r.jsx)("span",{"aria-label":"Page ".concat(n.pageIndex),children:n.pageIndex}),(0,r.jsx)(l.wpx,{onClick:n.nextPage,disabled:a,icon:(0,r.jsx)(l.PJP._Qn,{"aria-hidden":!0}),"aria-label":"Next"}),(0,r.jsx)(l.WPr,{className:"w-auto",value:n.pageSize,onChange:n.updatePageSize,options:n.pageSizeOptions.map(e=>({label:e,value:e})),labelRender:e=>{let{value:a}=e;return(0,r.jsxs)("span",{children:[a," / page"]})}})]})};var p=n(47935),h=n(46628),g=n(78780);let m=e=>{var a,n;return null==e?void 0:null===(n=e.startOf("day"))||void 0===n?void 0:null===(a=n.utc())||void 0===a?void 0:a.toISOString()},x=e=>{var a,n;return null==e?void 0:null===(n=e.endOf("day"))||void 0===n?void 0:null===(a=n.utc())||void 0===a?void 0:a.toISOString()},{useLazyDownloadReportQuery:S,useGetAllHistoricalPrivacyPreferencesQuery:v,useLazyGetCurrentPrivacyPreferencesQuery:C}=g.u.injectEndpoints({endpoints:e=>({getCurrentPrivacyPreferences:e.query({query:e=>{let{search:a}=e;return{url:"current-privacy-preferences",params:{email:a,phone_number:a,fides_user_device_id:a,external_id:a}}},providesTags:["Current Privacy Preferences"]}),downloadReport:e.query({query:e=>{let{startDate:a,endDate:n}=e;return{url:"plus/consent_reporting",params:{created_gt:m(a),created_lt:x(n),download_csv:"true"},responseHandler:"content-type"}},providesTags:["Consent Reporting Export"]}),getAllHistoricalPrivacyPreferences:e.query({query:e=>{let{page:a,size:n,startDate:r,endDate:t,includeTotal:i=!0}=e;return{url:"historical-privacy-preferences",params:{page:a,size:n,request_timestamp_gt:m(r),request_timestamp_lt:x(t),include_total:i}}},providesTags:["Consent Reporting"]})})});var j=n(90104),f=n.n(j),y=n(812),b=n(21910);let A={[b.pq.OPT_IN]:"Opt in",[b.pq.OPT_OUT]:"Opt out",[b.pq.ACKNOWLEDGE]:"Acknowledge",[b.pq.TCF]:"TCF"},I={[b.pq.OPT_IN]:"success",[b.pq.OPT_OUT]:"error",[b.pq.ACKNOWLEDGE]:"default",[b.pq.TCF]:"sandstone"},M={[b.jP.ACCEPT]:"Accept",[b.jP.BUTTON]:"Button",[b.jP.DISMISS]:"Dismiss",[b.jP.GPC]:"GPC",[b.jP.REJECT]:"Reject",[b.jP.SAVE]:"Save",[b.jP.SCRIPT]:"Script",[b.jP.INDIVIDUAL_NOTICE]:"Individual Notice",[b.jP.ACKNOWLEDGE]:"Acknowledge"},N={[b.Tz.API]:"API",[b.Tz.BANNER_AND_MODAL]:"Banner and Modal",[b.Tz.MODAL]:"Modal",[b.Tz.OVERLAY]:"Overlay",[b.Tz.PRIVACY_CENTER]:"Privacy Center",[b.Tz.TCF_OVERLAY]:"TCF Overlay"},P=(0,i.Cl)();var T=()=>(0,d.useMemo)(()=>[P.accessor(e=>e.notice_name,{id:"notice_name",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy notice",...e}),enableSorting:!1}),P.accessor(e=>e.notice_key,{id:"notice_key",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Notice Key",...e}),enableSorting:!1}),P.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:a}=e,n=a(),t=n&&A[n]||n,i=n&&I[n]||"";return(0,r.jsx)(p.A4,{color:i,value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100}),P.accessor(e=>e.privacy_notice_history_id,{id:"privacy_notice_history_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy Notice History Id",...e}),enableSorting:!1})],[]),E=n(47003),w=n.n(E);let R=(0,i.Cl)();var U=()=>{let e=(0,d.useCallback)(e=>{let a=[];if(e){let{preferences:n,...r}=e;w()(r,(e,n)=>{e&&e.forEach(e=>{a.push({key:n,id:e.id,preference:e.preference})})})}return a},[]),a=(0,d.useCallback)(e=>e.filter(e=>!(e.key.startsWith("system_")||e.key.startsWith("vendor_"))),[]);return{tcfColumns:(0,d.useMemo)(()=>[R.accessor(e=>e.key,{id:"key",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Type",...e}),enableSorting:!1}),R.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"ID",...e}),enableSorting:!1}),R.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:a}=e,n=a(),t=n&&A[n]||n,i=n&&I[n]||"";return(0,r.jsx)(p.A4,{color:i,value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100})],[]),mapTcfPreferencesToRowColumns:e,filterTcfConsentPreferences:a}},k=e=>{let{isOpen:a,onClose:n}=e,[s,o]=(0,d.useState)(!1),[c,_]=(0,d.useState)(),[u]=C(),F=(0,l.pmc)();(0,d.useEffect)(()=>{a||(_(void 0),o(!1))},[a]);let h=async e=>{o(!0);let{data:a,isError:n,error:r}=await u({search:e}),t=r&&"status"in r&&(null==r?void 0:r.status);n&&404!==t?F({status:"error",description:(0,y.e$)(r,"A problem occurred while looking up the preferences.")}):_(a||null),o(!1)},g=T(),m=(null==c?void 0:c.preferences)||[],x=!f()(m),S=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:m,columns:g,getRowId:e=>"".concat(e.privacy_notice_history_id),manualPagination:!0}),{tcfColumns:v,mapTcfPreferencesToRowColumns:j,filterTcfConsentPreferences:b}=U(),A=b(j(c)),I=!f()(A),M=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:A,columns:v,getRowId:e=>"".concat(e.key,"-").concat(e.id),manualPagination:!0});return(0,r.jsxs)(l.u_l,{id:"consent-lookup-modal",isOpen:a,onClose:n,size:"6xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"Consent preference lookup"}),(0,r.jsxs)(l.fef,{children:[(0,r.jsx)(l.AntTypography.Paragraph,{children:"Use this search to look up an individual's latest consent record. You can search by phone number, email, external ID or device ID to retrieve the most recent consent preference associated with that exact identifier."}),(0,r.jsxs)(l.AntTypography.Paragraph,{children:[(0,r.jsx)("strong",{children:"Note:"})," This is an exact match search—partial entries or similar results will not be returned. This lookup retrieves only the most recent consent preference, not the full consent history."]}),(0,r.jsx)(l.PPS,{layout:"vertical",className:"w-1/2",children:(0,r.jsx)(l.PPS.Item,{label:"Subject search",className:"mb-4 mt-6",children:(0,r.jsx)(l.uFc.Search,{"data-testid":"subject-search-input",placeholder:"Enter email, phone number, external ID or device ID",enterButton:"Search",onSearch:h,loading:s})})}),(0,r.jsxs)("div",{className:"mb-4",children:[(!I||x)&&(0,r.jsx)(p.ZK,{tableInstance:S,emptyTableNotice:(0,r.jsx)(l.oj8,{description:void 0===c?"Search for an email, phone number, or device ID.":"No results found.",image:l.oj8.PRESENTED_IMAGE_SIMPLE,imageStyle:{marginBottom:15}})}),I&&(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(p.ZK,{tableInstance:M})})]})]})]})]})},O=()=>{let e=(0,l.pmc)(),[a,{isFetching:n}]=S();return{downloadReport:async n=>{let{startDate:r,endDate:t}=n,i=await a({startDate:r,endDate:t});if(i.isError)e({status:"error",description:(0,y.e$)(i.error,"A problem occurred while generating your consent report. Please try again.")});else{let e=document.createElement("a"),a=new Blob([i.data],{type:"text/csv"}),n=window.URL.createObjectURL(a);e.href=n,e.download="consent-reports.csv",e.click(),window.URL.revokeObjectURL(n)}},isDownloadingReport:n}},G=e=>{let{isOpen:a,onClose:n,startDate:t,endDate:i}=e,{downloadReport:s,isDownloadingReport:o}=O(),d=async()=>{await s({startDate:t,endDate:i}),n()};return(0,r.jsxs)(l.u_l,{id:"consent-report-download-modal",isOpen:a,onClose:n,size:"xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"Download consent report"}),(0,r.jsxs)(l.fef,{children:[(0,r.jsx)(l.AntTypography.Paragraph,{children:"The downloaded CSV may differ from the UI in Fides, including column order and naming."}),(0,r.jsx)(l.AntTypography.Paragraph,{children:'For large datasets, file generation may take a few minutes after selecting "Download".'}),(0,r.jsx)(l.jqI,{justify:"flex-end",children:(0,r.jsx)(l.wpx,{loading:o,onClick:d,"data-testid":"download-report-btn",type:"primary",className:"mb-2",children:"Download"})})]})]})]})},B=e=>{let{isOpen:a,onClose:n,tcfPreferences:s}=e,{tcfColumns:o,mapTcfPreferencesToRowColumns:d,filterTcfConsentPreferences:c}=U(),_=c(d(s)),u=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:_||[],columns:o,getRowId:e=>"".concat(e.key,"-").concat(e.id),manualPagination:!0});return(0,r.jsxs)(l.u_l,{id:"consent-lookup-modal",isOpen:a,onClose:n,size:"4xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{"data-testid":"consent-tcf-detail-modal",children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"TCF Consent Details"}),(0,r.jsx)(l.fef,{children:(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(p.ZK,{tableInstance:u,emptyTableNotice:(0,r.jsx)(l.oj8,{description:" No data found",image:l.oj8.PRESENTED_IMAGE_SIMPLE,imageStyle:{marginBottom:15}})})})})]})]})},D=n(8411),L=n(72625);let K=(0,i.Cl)();var z=e=>{let{onTcfDetailViewClick:a}=e;return(0,d.useMemo)(()=>[K.accessor(e=>e.fides_user_device_id,{id:"fides_user_device_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"User device ID",...e}),enableSorting:!1}),K.accessor(e=>e.user_geography,{id:"user_geography",cell:e=>{let{getValue:a}=e,n=a(),t=n&&D.Z8[n]||n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"User geography",...e}),enableSorting:!1}),K.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:n,row:t}=e,i=n(),s=i&&A[i]||i,o=i&&I[i]||"";return"tcf"===i&&t.original.tcf_preferences?(0,r.jsx)(l.j8w,{color:o,closeIcon:(0,r.jsx)(l.PJP.daM,{}),closeButtonLabel:"View details",onClose:()=>a(t.original.tcf_preferences),children:s}):(0,r.jsx)(p.A4,{color:o,value:s})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100}),K.accessor(e=>e.notice_name,{id:"notice_name",cell:e=>{let{getValue:a}=e,n=a(),t="tcf"===n?n.toUpperCase():n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy notice",...e}),enableSorting:!1}),K.accessor(e=>e.method,{id:"method",cell:e=>{let{getValue:a}=e,n=a(),t=n&&M[n]||n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Method",...e}),enableSorting:!1,size:100}),K.accessor(e=>e.request_origin,{id:"request_origin",cell:e=>{let{getValue:a}=e,n=a(),t=n&&N[n]||n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Request origin",...e}),enableSorting:!1,size:120}),K.accessor(e=>e.request_timestamp,{id:"request_timestamp",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(L.Cy,{time:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Request timestamp",...e}),size:120}),K.accessor(e=>e.url_recorded,{id:"url_recorded",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Recorded URL",...e})}),K.accessor(e=>e.external_id,{id:"external_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"External ID",...e}),enableSorting:!1}),K.accessor(e=>e.email,{id:"email",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:(0,r.jsx)(l.AntTypography.Link,{href:"mailto:".concat(a()),children:a()})})},header:e=>(0,r.jsx)(p.Rr,{value:"Email",...e}),enableSorting:!1}),K.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference ID",...e}),enableSorting:!1})],[a])},V=()=>{var e,a;let n=(0,_.h0)(),{pageIndex:s,pageSize:g,updatePageIndex:m}=n,x=(0,d.useMemo)(()=>o()(),[]),[S,C]=(0,d.useState)(null),[j,f]=(0,d.useState)(null),[y,b]=(0,d.useState)(!1),[A,I]=(0,d.useState)(!1),[M,N]=(0,d.useState)(!1),[P,T]=(0,d.useState)(),E=(0,l.pmc)(),{data:w,isLoading:R,isFetching:U,refetch:O}=v({page:s,size:g,startDate:S,endDate:j,includeTotal:!1}),{items:D}=(0,d.useMemo)(()=>w||{items:[],total:0,pages:0},[w]),L=z({onTcfDetailViewClick:e=>{N(!0),T(e)}}),K=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:D,columns:L,getRowId:e=>"".concat(e.id),manualPagination:!0}),V=async()=>{m(1),await O(),E((0,h.t5)("Consent report refreshed successfully.","Report Refreshed"))};return(0,r.jsxs)(c.Z,{title:"Consent reporting",children:[(0,r.jsx)(u.Z,{heading:"Consent reporting",rightContent:(0,r.jsx)(l.wpx,{type:"primary",onClick:V,loading:U,children:"Refresh"})}),(0,r.jsx)("div",{"data-testid":"consent-reporting",className:"overflow-auto",children:(0,r.jsxs)(l.jqI,{vertical:!0,gap:"middle",children:[R?(0,r.jsx)("div",{className:"border p-2",children:(0,r.jsx)(p.I4,{rowHeight:26,numRows:10})}):(0,r.jsxs)("div",{children:[(0,r.jsxs)(p.Q$,{children:[(0,r.jsx)(l.gwi,{placeholder:["From","To"],maxDate:x,"data-testid":"input-date-range",onChange:e=>{C(e&&e[0]),f(e&&e[1])}}),(0,r.jsxs)(l.jqI,{gap:12,children:[(0,r.jsx)(l.wpx,{icon:(0,r.jsx)(l.PJP.UWx,{}),"data-testid":"download-btn",onClick:()=>I(!0),"aria-label":"Download Consent Report"}),(0,r.jsx)(l.S0p,{menu:{items:[{key:"1",label:(0,r.jsx)("span",{"data-testid":"consent-preference-lookup-btn",children:"Consent preference lookup"}),onClick:()=>b(!0)}]},overlayStyle:{width:"220px"},trigger:["click"],children:(0,r.jsx)(l.wpx,{icon:(0,r.jsx)(l.PJP.r43,{}),"data-testid":"consent-reporting-dropdown-btn"})})]})]}),(0,r.jsx)(p.ZK,{tableInstance:K,emptyTableNotice:(0,r.jsx)(l.oj8,{description:"No results.",image:l.oj8.PRESENTED_IMAGE_SIMPLE,styles:{image:{marginBottom:15}}})})]}),(0,r.jsx)(F,{disableNext:(null!==(a=null==w?void 0:null===(e=w.items)||void 0===e?void 0:e.length)&&void 0!==a?a:0)<g,pagination:n})]})}),(0,r.jsx)(k,{isOpen:y,onClose:()=>b(!1)}),(0,r.jsx)(G,{isOpen:A,onClose:()=>I(!1),startDate:S,endDate:j}),(0,r.jsx)(B,{isOpen:M,onClose:()=>{N(!1),T(void 0)},tcfPreferences:P})]})}}},function(e){e.O(0,[431,2150,2888,9774,179],function(){return e(e.s=15806)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3422],{15806:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/consent/reporting",function(){return n(45113)}])},35287:function(e,a,n){"use strict";var r=n(24246),t=n(96306),i=n(88038),s=n.n(i);n(27378),a.Z=e=>{let{children:a,title:n,mainProps:i}=e;return(0,r.jsxs)(t.kCb,{"data-testid":n,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,r.jsxs)(s(),{children:[(0,r.jsxs)("title",{children:["Fides Admin UI - ",n]}),(0,r.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,r.jsx)(t.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...i,children:a})]})}},58754:function(e,a,n){"use strict";var r=n(24246),t=n(96306),i=n(70788);a.Z=e=>{let{heading:a,breadcrumbItems:n,isSticky:s=!0,children:o,rightContent:l,style:d,...c}=e;return(0,r.jsxs)("div",{...c,style:s?{position:"sticky",top:"-24px",paddingTop:"24px",paddingBottom:"24px",paddingLeft:"40px",marginLeft:"-40px",paddingRight:"40px",marginRight:"-40px",marginTop:"-24px",left:0,zIndex:20,backgroundColor:"white",...d}:{paddingBottom:"24px",...d},children:[(0,r.jsxs)(t.jqI,{justify:"space-between",children:["string"==typeof a?(0,r.jsx)(t.lQT,{className:n||o?"pb-4":void 0,level:1,"data-testid":"page-heading",children:a}):a,l&&(0,r.jsx)("div",{"data-testid":"page-header-right-content",children:l})]}),!!n&&(0,r.jsx)(i.m,{className:o?"pb-4":void 0,items:n,"data-testid":"page-breadcrumb"}),o]})}},17245:function(e,a,n){"use strict";n.d(a,{HK:function(){return s},VY:function(){return t.V},pI:function(){return c},h0:function(){return r.h},Rx:function(){return F},rK:function(){return h}});var r=n(36866),t=n(84306),i=n(812);let s=()=>{let{errorAlert:e}=(0,t.V)();return{handleError:a=>{let n="An unexpected error occurred. Please try again.";(0,i.Ot)(a)?n=a.data.detail:(0,i.tB)(a)&&(n=a.data.detail[0].msg),e(n)}}};var o=n(27378),l=n(20682),d=n(21910);let c=e=>{let{data:a}=(0,l.$I)({}),n=(0,o.useMemo)(()=>(null==a?void 0:a.items)||[],[a]);return(0,o.useMemo)(()=>{var a;if(!e)return"";if(e.connection_type===d.Rj.SAAS&&(null===(a=e.saas_config)||void 0===a?void 0:a.type)){let a=n.find(a=>{var n;return a.identifier===(null===(n=e.saas_config)||void 0===n?void 0:n.type)});if(a)return a}return e},[e,n])};var _=n(40431);let u=()=>({search:_.Oi.withDefault("")}),F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultSearchQuery:a,onSearchChange:n}=e,r=(0,o.useMemo)(()=>u(),[]),[t,i]=(0,_.XI)(r,{history:"push"}),s=(0,o.useMemo)(()=>({searchQuery:t.search||a||void 0}),[t,a]),l=(0,o.useCallback)(e=>{i({search:e||null})},[i]),d=(0,o.useCallback)(()=>{i({search:null})},[i]);return(0,o.useEffect)(()=>{n&&n(s)},[s,n]),{...s,updateSearch:l,resetSearch:d,searchProps:{value:s.searchQuery||"",onChange:l,onClear:()=>l("")}}},p=e=>({sortKey:e?(0,_.jx)([...e]):_.Oi.withDefault(""),sortOrder:(0,_.km)(["ascend","descend"])}),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultSortKey:a,defaultSortOrder:n,onSortingChange:r,validColumns:t}=e,i=(0,o.useMemo)(()=>p(t),[t]),[s,l]=(0,_.XI)(i,{history:"push"}),d=(0,o.useMemo)(()=>{var e;return{sortKey:s.sortKey||a,sortOrder:null!==(e=s.sortOrder)&&void 0!==e?e:n}},[s,a,n]),c=(0,o.useCallback)((e,a)=>{l({sortKey:e?String(e):null,sortOrder:null!=a?a:null})},[l]),u=(0,o.useCallback)(()=>{l({sortKey:null,sortOrder:null})},[l]);return(0,o.useEffect)(()=>{r&&r(d)},[d,r]),{...d,updateSorting:c,resetSorting:u,sortingProps:{sortDirections:["ascend","descend"],defaultSortOrder:d.sortOrder,sortedInfo:d.sortKey?{field:d.sortKey,order:d.sortOrder}:void 0}}}},84306:function(e,a,n){"use strict";n.d(a,{V:function(){return i}});var r=n(24246),t=n(96306);let i=()=>{let e=(0,t.pmc)();return{errorAlert:(a,n,i)=>{let s={...i,position:(null==i?void 0:i.position)||"top",render:e=>{let{onClose:i}=e;return(0,r.jsxs)(t.bZj,{alignItems:"normal",status:"error","data-testid":"error-alert",children:[(0,r.jsx)(t.zMQ,{}),(0,r.jsxs)(t.xuv,{children:[n&&(0,r.jsx)(t.CdC,{children:n}),(0,r.jsx)(t.XaZ,{children:a})]}),(0,r.jsx)(t.PZ7,{onClick:i,position:"relative",right:0,size:"sm",top:-1})]})}};(null==i?void 0:i.id)&&e.isActive(i.id)?e.update(i.id,s):e(s)},successAlert:(a,n,i)=>{let s={...i,position:(null==i?void 0:i.position)||"top",render:e=>{let{onClose:i}=e;return(0,r.jsxs)(t.bZj,{alignItems:"normal",status:"success",variant:"subtle","data-testid":"success-alert",children:[(0,r.jsx)(t.zMQ,{}),(0,r.jsxs)(t.xuv,{children:[n&&(0,r.jsx)(t.CdC,{children:n}),(0,r.jsx)(t.XaZ,{children:a})]}),(0,r.jsx)(t.PZ7,{onClick:i,position:"relative",right:0,size:"sm",top:-1})]})}};(null==i?void 0:i.id)&&e.isActive(i.id)?e.update(i.id,s):e(s)}}}},70788:function(e,a,n){"use strict";n.d(a,{m:function(){return d}});var r=n(24246),t=n(96306),i=n(79894),s=n.n(i),o=n(27378);let{Text:l}=t.AntTypography,d=e=>{let{items:a,...n}=e,i=(0,o.useMemo)(()=>null==a?void 0:a.map((e,n)=>{let i=n===a.length-1,o={...e},d=o.onClick&&!o.href;return("string"==typeof o.title&&(o.title=(0,r.jsx)(l,{style:{color:"inherit",maxWidth:i?void 0:400},ellipsis:!i,id:i?"breadcrumb-current-page":void 0,children:o.title})),d)?o.title=(0,r.jsx)(t.wpx,{type:"text",size:"small",icon:o.icon,onClick:o.onClick,className:"ant-breadcrumb-link -mt-px px-1 text-inherit",children:o.title}):(o.icon&&(o.title=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"anticon align-text-bottom",children:o.icon}),o.title]})),o.href&&o.title&&(o.title=(0,r.jsx)(s(),{href:o.href,className:"ant-breadcrumb-link",children:o.title}),delete o.href)),o}),[a]);return(0,r.jsx)(t.zrq,{items:i,...n})}},36866:function(e,a,n){"use strict";n.d(a,{h:function(){return d}});var r=n(40431),t=n(27378),i=n(55484);let s=(0,r.jo)({parse(e){let a=parseInt(e,10);try{return i.Rx().integer().positive().validateSync(a),a}catch(e){return null}},serialize:e=>e.toString()});var o=n(32735);let l=function(){var e,a;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{page:s.withDefault(o.Ej),size:n.pageSizeOptions?(0,r.bJ)(n.pageSizeOptions).withDefault(null!==(e=n.pageSize)&&void 0!==e?e:o.L8):s.withDefault(null!==(a=n.pageSize)&&void 0!==a?a:o.L8)}},d=function(){var e,a;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{defaultPageSize:i=o.L8,pageSizeOptions:s,showSizeChanger:d=!0}=n,c=null!=s?s:o.VZ,_=(0,t.useMemo)(()=>l({pageSize:i,pageSizeOptions:s}),[i,s]),[u,F]=(0,r.XI)(_,{history:"push"}),p={pageIndex:null!==(e=u.page)&&void 0!==e?e:o.Ej,pageSize:null!==(a=u.size)&&void 0!==a?a:i};return{...p,updatePageIndex:e=>{F({page:e})},updatePageSize:e=>{F({page:e!==p.pageSize?o.Ej:p.pageIndex,size:e})},resetPagination:()=>{F({page:o.Ej,size:i})},nextPage:()=>{F(e=>{let{page:a,size:n}=e;return{page:a+1,size:n}})},previousPage:()=>{F(e=>{let{page:a,size:n}=e;return{page:a-1,size:n}})},pageSizeOptions:c,showSizeChanger:d}}},8411:function(e,a,n){"use strict";n.d(a,{NA:function(){return i},Z8:function(){return t}});var r=n(21910);let t={[r._F.ER]:"Eritrea",[r._F.DJ]:"Djibouti",[r._F.MR]:"Mauritania",[r._F.NA]:"Namibia",[r._F.GH]:"Ghana",[r._F.SS]:"South Sudan",[r._F.SC]:"Seychelles",[r._F.IO]:"British Indian Ocean Territory",[r._F.GQ]:"Equatorial Guinea",[r._F.AO]:"Angola",[r._F.CG]:"Republic of the Congo",[r._F.BW]:"Botswana",[r._F.BI]:"Burundi",[r._F.DZ]:"Algeria",[r._F.TD]:"Chad",[r._F.NG]:"Nigeria",[r._F.TZ]:"Tanzania",[r._F.EH]:"Western Sahara",[r._F.SN]:"Senegal",[r._F.LR]:"Liberia",[r._F.ZA]:"South Africa",[r._F.CV]:"Cape Verde",[r._F.GM]:"Gambia",[r._F.SD]:"Sudan",[r._F.KM]:"Comoros",[r._F.SZ]:"Eswatini",[r._F.UG]:"Uganda",[r._F.MG]:"Madagascar",[r._F.RW]:"Rwanda",[r._F.CD]:"DR Congo",[r._F.CM]:"Cameroon",[r._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[r._F.TG]:"Togo",[r._F.MU]:"Mauritius",[r._F.NE]:"Niger",[r._F.BJ]:"Benin",[r._F.EG]:"Egypt",[r._F.LS]:"Lesotho",[r._F.ET]:"Ethiopia",[r._F.MA]:"Morocco",[r._F.YT]:"Mayotte",[r._F.BF]:"Burkina Faso",[r._F.RE]:"R\xe9union",[r._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[r._F.CF]:"Central African Republic",[r._F.MZ]:"Mozambique",[r._F.MW]:"Malawi",[r._F.ML]:"Mali",[r._F.ZM]:"Zambia",[r._F.LY]:"Libya",[r._F.GW]:"Guinea-Bissau",[r._F.SO]:"Somalia",[r._F.KE]:"Kenya",[r._F.GN]:"Guinea",[r._F.ZW]:"Zimbabwe",[r._F.TN]:"Tunisia",[r._F.SL]:"Sierra Leone",[r._F.GA]:"Gabon",[r._F.CI]:"Ivory Coast",[r._F.JO]:"Jordan",[r._F.PK]:"Pakistan",[r._F.KP]:"North Korea",[r._F.MO]:"Macau",[r._F.AM]:"Armenia",[r._F.SY]:"Syria",[r._F.TJ]:"Tajikistan",[r._F.SA]:"Saudi Arabia",[r._F.KR]:"South Korea",[r._F.NP]:"Nepal",[r._F.PH]:"Philippines",[r._F.IQ]:"Iraq",[r._F.LB]:"Lebanon",[r._F.MN]:"Mongolia",[r._F.PS]:"Palestine",[r._F.YE]:"Yemen",[r._F.JP]:"Japan",[r._F.KZ]:"Kazakhstan",[r._F.LK]:"Sri Lanka",[r._F.MM]:"Myanmar",[r._F.KG]:"Kyrgyzstan",[r._F.CN]:"China",[r._F.AF]:"Afghanistan",[r._F.OM]:"Oman",[r._F.IN]:"India",[r._F.LA]:"Laos",[r._F.UZ]:"Uzbekistan",[r._F.MV]:"Maldives",[r._F.ID]:"Indonesia",[r._F.VN]:"Vietnam",[r._F.MY]:"Malaysia",[r._F.TW]:"Taiwan",[r._F.KH]:"Cambodia",[r._F.AE]:"United Arab Emirates",[r._F.HK]:"Hong Kong",[r._F.GE]:"Georgia (Country)",[r._F.BD]:"Bangladesh",[r._F.KW]:"Kuwait",[r._F.TM]:"Turkmenistan",[r._F.QA]:"Qatar",[r._F.BH]:"Bahrain",[r._F.BN]:"Brunei",[r._F.TH]:"Thailand",[r._F.BT]:"Bhutan",[r._F.SG]:"Singapore",[r._F.IL]:"Israel",[r._F.AZ]:"Azerbaijan",[r._F.TL]:"Timor-Leste",[r._F.IR]:"Iran",[r._F.TR]:"Turkey",[r._F.MK]:"North Macedonia",[r._F.IE]:"Ireland",[r._F.DK]:"Denmark",[r._F.SK]:"Slovakia",[r._F.MD]:"Moldova",[r._F.AX]:"\xc5land Islands",[r._F.PL]:"Poland",[r._F.BA]:"Bosnia and Herzegovina",[r._F.SM]:"San Marino",[r._F.CZ]:"Czechia",[r._F.EE]:"Estonia",[r._F.XK]:"Kosovo",[r._F.FO]:"Faroe Islands",[r._F.SJ]:"Svalbard and Jan Mayen",[r._F.GG]:"Guernsey",[r._F.FR]:"France",[r._F.NL]:"Netherlands",[r._F.FI]:"Finland",[r._F.PT]:"Portugal",[r._F.DE]:"Germany",[r._F.MT]:"Malta",[r._F.JE]:"Jersey",[r._F.IS]:"Iceland",[r._F.ES]:"Spain",[r._F.GI]:"Gibraltar",[r._F.NO]:"Norway",[r._F.CY]:"Cyprus",[r._F.RS]:"Serbia",[r._F.LT]:"Lithuania",[r._F.MC]:"Monaco",[r._F.LU]:"Luxembourg",[r._F.UA]:"Ukraine",[r._F.IM]:"Isle of Man",[r._F.RO]:"Romania",[r._F.BE]:"Belgium",[r._F.SE]:"Sweden",[r._F.ME]:"Montenegro",[r._F.LV]:"Latvia",[r._F.VA]:"Vatican City",[r._F.AT]:"Austria",[r._F.AL]:"Albania",[r._F.LI]:"Liechtenstein",[r._F.GR]:"Greece",[r._F.IT]:"Italy",[r._F.AD]:"Andorra",[r._F.GB]:"United Kingdom",[r._F.RU]:"Russia",[r._F.SI]:"Slovenia",[r._F.BY]:"Belarus",[r._F.CH]:"Switzerland",[r._F.HU]:"Hungary",[r._F.BG]:"Bulgaria",[r._F.HR]:"Croatia",[r._F.TC]:"Turks and Caicos Islands",[r._F.CW]:"Cura\xe7ao",[r._F.GP]:"Guadeloupe",[r._F.UM]:"United States Minor Outlying Islands",[r._F.GT]:"Guatemala",[r._F.PM]:"Saint Pierre and Miquelon",[r._F.BQ]:"Caribbean Netherlands",[r._F.GL]:"Greenland",[r._F.SX]:"Sint Maarten",[r._F.PA]:"Panama",[r._F.AW]:"Aruba",[r._F.MQ]:"Martinique",[r._F.AG]:"Antigua and Barbuda",[r._F.BM]:"Bermuda",[r._F.CU]:"Cuba",[r._F.GD]:"Grenada",[r._F.NI]:"Nicaragua",[r._F.LC]:"Saint Lucia",[r._F.KN]:"Saint Kitts and Nevis",[r._F.DO]:"Dominican Republic",[r._F.VC]:"Saint Vincent and the Grenadines",[r._F.BZ]:"Belize",[r._F.HT]:"Haiti",[r._F.JM]:"Jamaica",[r._F.BS]:"Bahamas",[r._F.MX]:"Mexico",[r._F.MF]:"Saint Martin",[r._F.SV]:"El Salvador",[r._F.BL]:"Saint Barth\xe9lemy",[r._F.AI]:"Anguilla",[r._F.MS]:"Montserrat",[r._F.VG]:"British Virgin Islands",[r._F.BB]:"Barbados",[r._F.HN]:"Honduras",[r._F.KY]:"Cayman Islands",[r._F.DM]:"Dominica",[r._F.TT]:"Trinidad and Tobago",[r._F.CR]:"Costa Rica",[r._F.SR]:"Suriname",[r._F.CX]:"Christmas Island",[r._F.WS]:"Samoa",[r._F.PF]:"French Polynesia",[r._F.AS]:"American Samoa",[r._F.NC]:"New Caledonia",[r._F.TK]:"Tokelau",[r._F.PW]:"Palau",[r._F.KI]:"Kiribati",[r._F.VU]:"Vanuatu",[r._F.PN]:"Pitcairn Islands",[r._F.CK]:"Cook Islands",[r._F.FJ]:"Fiji",[r._F.PG]:"Papua New Guinea",[r._F.MP]:"Northern Mariana Islands",[r._F.NU]:"Niue",[r._F.TV]:"Tuvalu",[r._F.NF]:"Norfolk Island",[r._F.TO]:"Tonga",[r._F.FM]:"Micronesia",[r._F.SB]:"Solomon Islands",[r._F.NR]:"Nauru",[r._F.WF]:"Wallis and Futuna",[r._F.GU]:"Guam",[r._F.AU]:"Australia",[r._F.NZ]:"New Zealand",[r._F.MH]:"Marshall Islands",[r._F.CC]:"Cocos (Keeling) Islands",[r._F.VE]:"Venezuela",[r._F.PY]:"Paraguay",[r._F.BR]:"Brazil",[r._F.CO]:"Colombia",[r._F.PE]:"Peru",[r._F.CL]:"Chile",[r._F.UY]:"Uruguay",[r._F.AR]:"Argentina",[r._F.GY]:"Guyana",[r._F.BO]:"Bolivia",[r._F.GF]:"French Guiana",[r._F.EC]:"Ecuador",[r._F.FK]:"Falkland Islands",[r._F.US_AL]:"Alabama",[r._F.US_AK]:"Alaska",[r._F.US_AZ]:"Arizona",[r._F.US_AR]:"Arkansas",[r._F.US_CA]:"California",[r._F.US_CO]:"Colorado",[r._F.US_CT]:"Connecticut",[r._F.US_DE]:"Delaware",[r._F.US_DC]:"District of Columbia (DC)",[r._F.US_FL]:"Florida",[r._F.US_GA]:"Georgia",[r._F.US_HI]:"Hawaii",[r._F.US_ID]:"Idaho",[r._F.US_IL]:"Illinois",[r._F.US_IN]:"Indiana",[r._F.US_IA]:"Iowa",[r._F.US_KS]:"Kansas",[r._F.US_KY]:"Kentucky",[r._F.US_LA]:"Louisiana",[r._F.US_ME]:"Maine",[r._F.US_MD]:"Maryland",[r._F.US_MA]:"Massachusetts",[r._F.US_MI]:"Michigan",[r._F.US_MN]:"Minnesota",[r._F.US_MS]:"Mississippi",[r._F.US_MO]:"Missouri",[r._F.US_MT]:"Montana",[r._F.US_NE]:"Nebraska",[r._F.US_NV]:"Nevada",[r._F.US_NH]:"New Hampshire",[r._F.US_NJ]:"New Jersey",[r._F.US_NM]:"New Mexico",[r._F.US_NY]:"New York",[r._F.US_NC]:"North Carolina",[r._F.US_ND]:"North Dakota",[r._F.US_OH]:"Ohio",[r._F.US_OK]:"Oklahoma",[r._F.US_OR]:"Oregon",[r._F.US_PA]:"Pennsylvania",[r._F.US_PR]:"Puerto Rico",[r._F.US_RI]:"Rhode Island",[r._F.US_SC]:"South Carolina",[r._F.US_SD]:"South Dakota",[r._F.US_TN]:"Tennessee",[r._F.US_TX]:"Texas",[r._F.US_UT]:"Utah",[r._F.US_VA]:"Virginia",[r._F.US_VI]:"United States Virgin Islands",[r._F.US_VT]:"Vermont",[r._F.US_WA]:"Washington",[r._F.US_WV]:"West Virginia",[r._F.US_WI]:"Wisconsin",[r._F.US_WY]:"Wyoming",[r._F.CA_AB]:"Alberta",[r._F.CA_BC]:"British Columbia",[r._F.CA_MB]:"Manitoba",[r._F.CA_NB]:"New Brunswick",[r._F.CA_NL]:"Newfoundland and Labrador",[r._F.CA_NS]:"Nova Scotia",[r._F.CA_ON]:"Ontario",[r._F.CA_PE]:"Prince Edward Island",[r._F.CA_QC]:"Quebec",[r._F.CA_SK]:"Saskatchewan",[r._F.CA_NT]:"Northwest Territories",[r._F.CA_NU]:"Nunavut",[r._F.CA_YT]:"Yukon",[r._F.CA]:"Canada",[r._F.US]:"United States",[r._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[r._F.CARIBBEAN]:"Caribbean",[r._F.EEA]:"European Economic Area (EEA)",[r._F.NON_EEA]:"Non European Economic Area",[r._F.GLOBAL]:"Global"},i=new Map(Object.entries(t));Object.entries(t).map(e=>({value:e[0],label:e[1]}))},45113:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return V}});var r=n(24246),t=n(59003),i=n(92222),s=n(27693),o=n.n(s),l=n(96306),d=n(27378),c=n(35287),_=n(17245),u=n(58754);let F=e=>{let{disableNext:a,pagination:n}=e;return(0,r.jsxs)(l.jqI,{gap:"middle",align:"center",justify:"right",children:[(0,r.jsx)(l.wpx,{onClick:n.previousPage,disabled:1===n.pageIndex,icon:(0,r.jsx)(l.PJP.s$$,{"aria-hidden":!0}),"aria-label":"Previous"}),(0,r.jsx)("span",{"aria-label":"Page ".concat(n.pageIndex),children:n.pageIndex}),(0,r.jsx)(l.wpx,{onClick:n.nextPage,disabled:a,icon:(0,r.jsx)(l.PJP._Qn,{"aria-hidden":!0}),"aria-label":"Next"}),(0,r.jsx)(l.WPr,{className:"w-auto",value:n.pageSize,onChange:n.updatePageSize,options:n.pageSizeOptions.map(e=>({label:e,value:e})),labelRender:e=>{let{value:a}=e;return(0,r.jsxs)("span",{children:[a," / page"]})}})]})};var p=n(47935),h=n(46628),g=n(78780);let m=e=>{var a,n;return null==e?void 0:null===(n=e.startOf("day"))||void 0===n?void 0:null===(a=n.utc())||void 0===a?void 0:a.toISOString()},x=e=>{var a,n;return null==e?void 0:null===(n=e.endOf("day"))||void 0===n?void 0:null===(a=n.utc())||void 0===a?void 0:a.toISOString()},{useLazyDownloadReportQuery:S,useGetAllHistoricalPrivacyPreferencesQuery:v,useLazyGetCurrentPrivacyPreferencesQuery:C}=g.u.injectEndpoints({endpoints:e=>({getCurrentPrivacyPreferences:e.query({query:e=>{let{search:a}=e;return{url:"current-privacy-preferences",params:{email:a,phone_number:a,fides_user_device_id:a,external_id:a}}},providesTags:["Current Privacy Preferences"]}),downloadReport:e.query({query:e=>{let{startDate:a,endDate:n}=e;return{url:"plus/consent_reporting",params:{created_gt:m(a),created_lt:x(n),download_csv:"true"},responseHandler:"content-type"}},providesTags:["Consent Reporting Export"]}),getAllHistoricalPrivacyPreferences:e.query({query:e=>{let{page:a,size:n,startDate:r,endDate:t,includeTotal:i=!0}=e;return{url:"historical-privacy-preferences",params:{page:a,size:n,request_timestamp_gt:m(r),request_timestamp_lt:x(t),include_total:i}}},providesTags:["Consent Reporting"]})})});var j=n(90104),f=n.n(j),y=n(812),b=n(21910);let A={[b.pq.OPT_IN]:"Opt in",[b.pq.OPT_OUT]:"Opt out",[b.pq.ACKNOWLEDGE]:"Acknowledge",[b.pq.TCF]:"TCF"},I={[b.pq.OPT_IN]:"success",[b.pq.OPT_OUT]:"error",[b.pq.ACKNOWLEDGE]:"default",[b.pq.TCF]:"sandstone"},M={[b.jP.ACCEPT]:"Accept",[b.jP.BUTTON]:"Button",[b.jP.DISMISS]:"Dismiss",[b.jP.GPC]:"GPC",[b.jP.REJECT]:"Reject",[b.jP.SAVE]:"Save",[b.jP.SCRIPT]:"Script",[b.jP.INDIVIDUAL_NOTICE]:"Individual Notice",[b.jP.ACKNOWLEDGE]:"Acknowledge"},N={[b.Tz.API]:"API",[b.Tz.BANNER_AND_MODAL]:"Banner and Modal",[b.Tz.MODAL]:"Modal",[b.Tz.OVERLAY]:"Overlay",[b.Tz.PRIVACY_CENTER]:"Privacy Center",[b.Tz.TCF_OVERLAY]:"TCF Overlay"},P=(0,i.Cl)();var T=()=>(0,d.useMemo)(()=>[P.accessor(e=>e.notice_name,{id:"notice_name",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy notice",...e}),enableSorting:!1}),P.accessor(e=>e.notice_key,{id:"notice_key",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Notice Key",...e}),enableSorting:!1}),P.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:a}=e,n=a(),t=n&&A[n]||n,i=n&&I[n]||"";return(0,r.jsx)(p.A4,{color:i,value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100}),P.accessor(e=>e.privacy_notice_history_id,{id:"privacy_notice_history_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy Notice History Id",...e}),enableSorting:!1})],[]),E=n(47003),w=n.n(E);let R=(0,i.Cl)();var U=()=>{let e=(0,d.useCallback)(e=>{let a=[];if(e){let{preferences:n,...r}=e;w()(r,(e,n)=>{e&&e.forEach(e=>{a.push({key:n,id:e.id,preference:e.preference})})})}return a},[]),a=(0,d.useCallback)(e=>e.filter(e=>!(e.key.startsWith("system_")||e.key.startsWith("vendor_"))),[]);return{tcfColumns:(0,d.useMemo)(()=>[R.accessor(e=>e.key,{id:"key",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Type",...e}),enableSorting:!1}),R.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"ID",...e}),enableSorting:!1}),R.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:a}=e,n=a(),t=n&&A[n]||n,i=n&&I[n]||"";return(0,r.jsx)(p.A4,{color:i,value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100})],[]),mapTcfPreferencesToRowColumns:e,filterTcfConsentPreferences:a}},k=e=>{let{isOpen:a,onClose:n}=e,[s,o]=(0,d.useState)(!1),[c,_]=(0,d.useState)(),[u]=C(),F=(0,l.pmc)();(0,d.useEffect)(()=>{a||(_(void 0),o(!1))},[a]);let h=async e=>{o(!0);let{data:a,isError:n,error:r}=await u({search:e}),t=r&&"status"in r&&(null==r?void 0:r.status);n&&404!==t?F({status:"error",description:(0,y.e$)(r,"A problem occurred while looking up the preferences.")}):_(a||null),o(!1)},g=T(),m=(null==c?void 0:c.preferences)||[],x=!f()(m),S=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:m,columns:g,getRowId:e=>"".concat(e.privacy_notice_history_id),manualPagination:!0}),{tcfColumns:v,mapTcfPreferencesToRowColumns:j,filterTcfConsentPreferences:b}=U(),A=b(j(c)),I=!f()(A),M=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:A,columns:v,getRowId:e=>"".concat(e.key,"-").concat(e.id),manualPagination:!0});return(0,r.jsxs)(l.u_l,{id:"consent-lookup-modal",isOpen:a,onClose:n,size:"6xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"Consent preference lookup"}),(0,r.jsxs)(l.fef,{children:[(0,r.jsx)(l.AntTypography.Paragraph,{children:"Use this search to look up an individual's latest consent record. You can search by phone number, email, external ID or device ID to retrieve the most recent consent preference associated with that exact identifier."}),(0,r.jsxs)(l.AntTypography.Paragraph,{children:[(0,r.jsx)("strong",{children:"Note:"})," This is an exact match search—partial entries or similar results will not be returned. This lookup retrieves only the most recent consent preference, not the full consent history."]}),(0,r.jsx)(l.PPS,{layout:"vertical",className:"w-1/2",children:(0,r.jsx)(l.PPS.Item,{label:"Subject search",className:"mb-4 mt-6",children:(0,r.jsx)(l.uFc.Search,{"data-testid":"subject-search-input",placeholder:"Enter email, phone number, external ID or device ID",enterButton:"Search",onSearch:h,loading:s})})}),(0,r.jsxs)("div",{className:"mb-4",children:[(!I||x)&&(0,r.jsx)(p.ZK,{tableInstance:S,emptyTableNotice:(0,r.jsx)(l.oj8,{description:void 0===c?"Search for an email, phone number, or device ID.":"No results found.",image:l.oj8.PRESENTED_IMAGE_SIMPLE,imageStyle:{marginBottom:15}})}),I&&(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(p.ZK,{tableInstance:M})})]})]})]})]})},O=()=>{let e=(0,l.pmc)(),[a,{isFetching:n}]=S();return{downloadReport:async n=>{let{startDate:r,endDate:t}=n,i=await a({startDate:r,endDate:t});if(i.isError)e({status:"error",description:(0,y.e$)(i.error,"A problem occurred while generating your consent report. Please try again.")});else{let e=document.createElement("a"),a=new Blob([i.data],{type:"text/csv"}),n=window.URL.createObjectURL(a);e.href=n,e.download="consent-reports.csv",e.click(),window.URL.revokeObjectURL(n)}},isDownloadingReport:n}},G=e=>{let{isOpen:a,onClose:n,startDate:t,endDate:i}=e,{downloadReport:s,isDownloadingReport:o}=O(),d=async()=>{await s({startDate:t,endDate:i}),n()};return(0,r.jsxs)(l.u_l,{id:"consent-report-download-modal",isOpen:a,onClose:n,size:"xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"Download consent report"}),(0,r.jsxs)(l.fef,{children:[(0,r.jsx)(l.AntTypography.Paragraph,{children:"The downloaded CSV may differ from the UI in Fides, including column order and naming."}),(0,r.jsx)(l.AntTypography.Paragraph,{children:'For large datasets, file generation may take a few minutes after selecting "Download".'}),(0,r.jsx)(l.jqI,{justify:"flex-end",children:(0,r.jsx)(l.wpx,{loading:o,onClick:d,"data-testid":"download-report-btn",type:"primary",className:"mb-2",children:"Download"})})]})]})]})},B=e=>{let{isOpen:a,onClose:n,tcfPreferences:s}=e,{tcfColumns:o,mapTcfPreferencesToRowColumns:d,filterTcfConsentPreferences:c}=U(),_=c(d(s)),u=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:_||[],columns:o,getRowId:e=>"".concat(e.key,"-").concat(e.id),manualPagination:!0});return(0,r.jsxs)(l.u_l,{id:"consent-lookup-modal",isOpen:a,onClose:n,size:"4xl",returnFocusOnClose:!1,isCentered:!0,children:[(0,r.jsx)(l.ZAr,{}),(0,r.jsxs)(l.hzk,{"data-testid":"consent-tcf-detail-modal",children:[(0,r.jsx)(l.olH,{}),(0,r.jsx)(l.xBx,{pb:2,children:"TCF Consent Details"}),(0,r.jsx)(l.fef,{children:(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(p.ZK,{tableInstance:u,emptyTableNotice:(0,r.jsx)(l.oj8,{description:" No data found",image:l.oj8.PRESENTED_IMAGE_SIMPLE,imageStyle:{marginBottom:15}})})})})]})]})},D=n(8411),L=n(72625);let K=(0,i.Cl)();var z=e=>{let{onTcfDetailViewClick:a}=e;return(0,d.useMemo)(()=>[K.accessor(e=>e.fides_user_device_id,{id:"fides_user_device_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"User device ID",...e}),enableSorting:!1}),K.accessor(e=>e.user_geography,{id:"user_geography",cell:e=>{let{getValue:a}=e,n=a(),t=n&&(0,l.QCN)(n),i=n&&D.Z8[n]||n,s=t?(0,l.c1K)({isoEntry:t}):i;return(0,r.jsx)(p.G3,{value:s})},header:e=>(0,r.jsx)(p.Rr,{value:"User geography",...e}),enableSorting:!1}),K.accessor(e=>e.preference,{id:"preference",cell:e=>{let{getValue:n,row:t}=e,i=n(),s=i&&A[i]||i,o=i&&I[i]||"";return"tcf"===i&&t.original.tcf_preferences?(0,r.jsx)(l.j8w,{color:o,closeIcon:(0,r.jsx)(l.PJP.daM,{}),closeButtonLabel:"View details",onClose:()=>a(t.original.tcf_preferences),children:s}):(0,r.jsx)(p.A4,{color:o,value:s})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference",...e}),enableSorting:!1,size:100}),K.accessor(e=>e.notice_name,{id:"notice_name",cell:e=>{let{getValue:a}=e,n=a(),t="tcf"===n?n.toUpperCase():n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Privacy notice",...e}),enableSorting:!1}),K.accessor(e=>e.method,{id:"method",cell:e=>{let{getValue:a}=e,n=a(),t=n&&M[n]||n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Method",...e}),enableSorting:!1,size:100}),K.accessor(e=>e.request_origin,{id:"request_origin",cell:e=>{let{getValue:a}=e,n=a(),t=n&&N[n]||n;return(0,r.jsx)(p.G3,{value:t})},header:e=>(0,r.jsx)(p.Rr,{value:"Request origin",...e}),enableSorting:!1,size:120}),K.accessor(e=>e.request_timestamp,{id:"request_timestamp",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(L.Cy,{time:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Request timestamp",...e}),size:120}),K.accessor(e=>e.url_recorded,{id:"url_recorded",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Recorded URL",...e})}),K.accessor(e=>e.external_id,{id:"external_id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"External ID",...e}),enableSorting:!1}),K.accessor(e=>e.email,{id:"email",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:(0,r.jsx)(l.AntTypography.Link,{href:"mailto:".concat(a()),children:a()})})},header:e=>(0,r.jsx)(p.Rr,{value:"Email",...e}),enableSorting:!1}),K.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:a}=e;return(0,r.jsx)(p.G3,{value:a()})},header:e=>(0,r.jsx)(p.Rr,{value:"Preference ID",...e}),enableSorting:!1})],[a])},V=()=>{var e,a;let n=(0,_.h0)(),{pageIndex:s,pageSize:g,updatePageIndex:m}=n,x=(0,d.useMemo)(()=>o()(),[]),[S,C]=(0,d.useState)(null),[j,f]=(0,d.useState)(null),[y,b]=(0,d.useState)(!1),[A,I]=(0,d.useState)(!1),[M,N]=(0,d.useState)(!1),[P,T]=(0,d.useState)(),E=(0,l.pmc)(),{data:w,isLoading:R,isFetching:U,refetch:O}=v({page:s,size:g,startDate:S,endDate:j,includeTotal:!1}),{items:D}=(0,d.useMemo)(()=>w||{items:[],total:0,pages:0},[w]),L=z({onTcfDetailViewClick:e=>{N(!0),T(e)}}),K=(0,t.b7)({getCoreRowModel:(0,i.sC)(),data:D,columns:L,getRowId:e=>"".concat(e.id),manualPagination:!0}),V=async()=>{m(1),await O(),E((0,h.t5)("Consent report refreshed successfully.","Report Refreshed"))};return(0,r.jsxs)(c.Z,{title:"Consent reporting",children:[(0,r.jsx)(u.Z,{heading:"Consent reporting",rightContent:(0,r.jsx)(l.wpx,{type:"primary",onClick:V,loading:U,children:"Refresh"})}),(0,r.jsx)("div",{"data-testid":"consent-reporting",className:"overflow-auto",children:(0,r.jsxs)(l.jqI,{vertical:!0,gap:"middle",children:[R?(0,r.jsx)("div",{className:"border p-2",children:(0,r.jsx)(p.I4,{rowHeight:26,numRows:10})}):(0,r.jsxs)("div",{children:[(0,r.jsxs)(p.Q$,{children:[(0,r.jsx)(l.gwi,{placeholder:["From","To"],maxDate:x,"data-testid":"input-date-range",onChange:e=>{C(e&&e[0]),f(e&&e[1])}}),(0,r.jsxs)(l.jqI,{gap:12,children:[(0,r.jsx)(l.wpx,{icon:(0,r.jsx)(l.PJP.UWx,{}),"data-testid":"download-btn",onClick:()=>I(!0),"aria-label":"Download Consent Report"}),(0,r.jsx)(l.S0p,{menu:{items:[{key:"1",label:(0,r.jsx)("span",{"data-testid":"consent-preference-lookup-btn",children:"Consent preference lookup"}),onClick:()=>b(!0)}]},overlayStyle:{width:"220px"},trigger:["click"],children:(0,r.jsx)(l.wpx,{icon:(0,r.jsx)(l.PJP.r43,{}),"data-testid":"consent-reporting-dropdown-btn"})})]})]}),(0,r.jsx)(p.ZK,{tableInstance:K,emptyTableNotice:(0,r.jsx)(l.oj8,{description:"No results.",image:l.oj8.PRESENTED_IMAGE_SIMPLE,styles:{image:{marginBottom:15}}})})]}),(0,r.jsx)(F,{disableNext:(null!==(a=null==w?void 0:null===(e=w.items)||void 0===e?void 0:e.length)&&void 0!==a?a:0)<g,pagination:n})]})}),(0,r.jsx)(k,{isOpen:y,onClose:()=>b(!1)}),(0,r.jsx)(G,{isOpen:A,onClose:()=>I(!1),startDate:S,endDate:j}),(0,r.jsx)(B,{isOpen:M,onClose:()=>{N(!1),T(void 0)},tcfPreferences:P})]})}}},function(e){e.O(0,[431,2150,2888,9774,179],function(){return e(e.s=15806)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4154],{58095:function(e,t,s){var n=s(8817);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},21796:function(e){e.exports=function(e,t,s){for(var n=-1,a=null==e?0:e.length;++n<a;)if(s(t,e[n]))return!0;return!1}},8817:function(e,t,s){var n=s(95372),a=s(1129),o=s(58263);e.exports=function(e,t,s){return t==t?o(e,t,s):n(e,a,s)}},1129:function(e){e.exports=function(e){return e!=e}},92198:function(e,t,s){var n=s(52485),a=s(58095),o=s(21796),l=s(65581),r=s(47111),i=s(43735);e.exports=function(e,t,s){var d=-1,c=a,u=e.length,m=!0,g=[],h=g;if(s)m=!1,c=o;else if(u>=200){var y=t?null:r(e);if(y)return i(y);m=!1,c=l,h=new n}else h=t?[]:g;e:for(;++d<u;){var v=e[d],p=t?t(v):v;if(v=s||0!==v?v:0,m&&p==p){for(var f=h.length;f--;)if(h[f]===p)continue e;t&&h.push(p),g.push(v)}else c(h,p,s)||(h!==g&&h.push(p),g.push(v))}return g}},47111:function(e,t,s){var n=s(46151),a=s(50344),o=s(43735),l=n&&1/o(new n([,-0]))[1]==1/0?function(e){return new n(e)}:a;e.exports=l},58263:function(e){e.exports=function(e,t,s){for(var n=s-1,a=e.length;++n<a;)if(e[n]===t)return n;return -1}},50344:function(e){e.exports=function(){}},83766:function(e,t,s){var n=s(92198);e.exports=function(e){return e&&e.length?n(e):[]}},25654:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-discovery/action-center/[monitorId]/[systemId]",function(){return s(74473)}])},79283:function(e,t,s){"use strict";s.d(t,{l:function(){return i}});var n=s(24246),a=s(96306),o=s(72707),l=s.n(o);let r=e=>{let{data:{formattedTitle:t,description:s,name:o,primaryName:l}}=e;return(0,n.jsxs)(a.jqI,{gap:12,title:"".concat(t," - ").concat(s),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:l||o}),l&&": ".concat(o)]}),(0,n.jsx)("em",{children:s})]})},i=e=>{let{options:t,...s}=e,o=null==t?void 0:t.map(e=>({...e,className:l().option,formattedTitle:[e.primaryName,e.name].filter(e=>e).join(": ")}));return(0,n.jsx)(a.WPr,{options:o,filterOption:(e,t)=>(null==t?void 0:t.formattedTitle.toLowerCase().includes(e.toLowerCase()))||(null==t?void 0:t.value.toLowerCase().includes(e.toLowerCase()))||!1,optionFilterProp:"label",autoFocus:!0,variant:"borderless",optionRender:r,styles:{popup:{root:{minWidth:"500px"}}},className:"w-full p-0","data-testid":"taxonomy-select",...s})}},45938:function(e,t,s){"use strict";s.d(t,{Gt:function(){return m},eB:function(){return g},oI:function(){return u}});var n=s(24246),a=s(34090),o=s(27378),l=s(16134),r=s(38602),i=s(58452);let d=(0,o.createRef)(),c=(0,o.createRef)(),u=()=>{let e=(0,l.T)(),t=(0,l.C)(r.DB),s=(0,o.useCallback)(()=>{c.current=void 0,d.current=void 0},[]),n=(0,o.useCallback)(()=>{e((0,r.Mr)()),c.current&&(c.current(!0),s())},[e,s]),a=(0,o.useCallback)(()=>{e((0,r.Mr)()),c.current&&(c.current(!1),s())},[e,s]);return{attemptAction:(0,o.useCallback)(()=>t?(e((0,r.h7)()),d.current||(d.current=new Promise(e=>{c.current=e})),d.current):Promise.resolve(!0),[t,e]),onConfirm:n,onClose:a}},m=e=>{let{id:t,name:s}=e,{dirty:n}=(0,a.u6)(),i=(0,l.T)();return(0,o.useEffect)(()=>(i((0,r.Zu)({id:t,name:s})),()=>{i((0,r.dz)({id:t}))}),[i,t,s]),(0,o.useEffect)(()=>{i((0,r.$p)({id:t,isDirty:n}))},[n,i,t]),null},g=()=>{let{onConfirm:e,onClose:t}=u(),s=(0,l.C)(r.uv);return(0,n.jsx)(i.Z,{isOpen:s,onClose:t,onConfirm:e,isCentered:!0,title:"Unsaved Changes",message:"You have unsaved changes"})}},74473:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return en}});var n=s(24246),a=s(86677),o=s(27378),l=s(35287),r=s(77830),i=s(58754),d=s(96306),c=s(25415),u=s(21910),m=s(30952),g=s(8133),h=s(79283),y=s(34929),v=s(78238),p=e=>{let{selectedTaxonomies:t,...s}=e,{getDataUseDisplayNameProps:a,getDataUses:o}=(0,y.Z)(),l=o().filter(e=>e.active&&v.g.includes(e.fides_key)).map(e=>{let{name:t,primaryName:s}=a(e.fides_key);return{value:e.fides_key,name:t,primaryName:s,description:e.description||""}});return(0,n.jsx)(h.l,{options:l,...s})};let{Text:f}=d.AntTypography;var x=e=>{let{onSave:t,isSaving:s,onClose:a,...l}=e,[r,i]=(0,o.useState)([]),c=()=>{i([]),a()};return(0,n.jsxs)(g.Z,{title:"Add consent category",...l,onClose:c,children:[(0,n.jsxs)(d.jqI,{vertical:!0,gap:20,className:"pb-6 pt-4",children:[(0,n.jsx)(f,{children:"Assign consent categories to selected assets. This configures the system for consent management. Consent categories apply to both individual assets and the system."}),(0,n.jsx)(p,{mode:"tags",selectedTaxonomies:r,onSelect:(e,t)=>i([...r,t.value]),variant:"outlined"})]}),(0,n.jsxs)(d.jqI,{justify:"space-between",children:[(0,n.jsx)(d.wpx,{htmlType:"reset",onClick:c,"data-testid":"cancel-btn",children:"Cancel"}),(0,n.jsx)(d.wpx,{htmlType:"submit",type:"primary",disabled:!r.length,loading:s,onClick:()=>{t(r),c()},"data-testid":"save-btn",children:"Save"})]})]})},j=s(29850),_=s(77685);let{Text:b}=d.AntTypography,C=e=>{let{onSave:t,isSaving:s,...a}=e,[l,r]=(0,o.useState)(),[i,c]=(0,o.useState)(!1),u=(0,o.useCallback)(e=>{e.preventDefault(),c(!0)},[]),m=()=>{c(!1)},h=()=>{r(void 0),a.onClose()};return(0,n.jsxs)(g.Z,{title:"Assign system",...a,onClose:h,children:[(0,n.jsxs)(d.jqI,{vertical:!0,gap:20,className:"pb-6 pt-4",children:[(0,n.jsx)(b,{children:"Assign a system to the selected assets. If no system exists, select 'Add new system' to create one."}),(0,n.jsx)(j.R,{placeholder:"Search or select...",onSelect:(e,t)=>{r(t)},onAddSystem:u,value:l})]})," ",(0,n.jsxs)(d.jqI,{justify:"space-between",children:[(0,n.jsx)(d.wpx,{htmlType:"reset",onClick:h,"data-testid":"cancel-btn",children:"Cancel"}),(0,n.jsx)(d.wpx,{htmlType:"submit",type:"primary",disabled:!l,loading:s,onClick:()=>{t(l),h()},"data-testid":"save-btn",children:"Save"})]}),i&&(0,n.jsx)(_.i,{isOpen:!0,onClose:m,onSuccessfulSubmit:(e,t)=>{m(),r({label:t,value:e})},toastOnSuccess:!0})]})};var w=s(8411),k=s(32735),S=s(8125),E=s(37059),T=s(98145);let{Link:N}=d.AntTypography,A=e=>{let{stagedResource:t,status:s}=e,a=(0,S.o)({pagination:{defaultPageSize:10,pageSizeOptions:[10,...k.VZ]}}),{pageIndex:l,pageSize:r}=a,{data:i,isFetching:c,isError:u}=(0,E.mi)({stagedResourceUrn:t.urn,status:s,page:l,size:r}),{items:m,total:g}=(0,o.useMemo)(()=>i||{items:[],total:0,pages:0,filterOptions:{assigned_users:[],systems:[]}},[i]),h=(0,o.useMemo)(()=>({enableSelection:!1,getRowKey:e=>e.location,isLoading:c,dataSource:m,totalRows:null!=g?g:0}),[c,m,g]),y=(0,S.V)(a,h);return{columns:(0,o.useMemo)(()=>[{title:"Location",dataIndex:T.EI.LOCATION,key:T.EI.LOCATION,render:e=>{var t;let s=(0,d.QCN)(e);return s?(0,d.c1K)({isoEntry:s,showFlag:!0}):null!==(t=null===w.Z8||void 0===w.Z8?void 0:w.Z8[e])&&void 0!==t?t:e}},{title:"Page",dataIndex:T.EI.PAGE,key:T.EI.PAGE,render:e=>(0,n.jsx)(N,{href:e,target:"_blank",rel:"noopener noreferrer",children:e})}],[]),data:i,isLoading:c,isError:u,totalRows:g,tableProps:y.tableProps,hasData:m.length>0}},{Paragraph:I,Text:O}=d.AntTypography,D=e=>{var t,s,a;let{isOpen:o,stagedResource:l,status:r,onCancel:i,onDownload:c}=e,{columns:u,tableProps:m,isError:g}=A({stagedResource:l,status:r});return(0,n.jsx)(d.$zI,{title:"Consent discovery",width:768,open:o,onCancel:i,footer:[(0,n.jsx)(d.wpx,{onClick:i,children:"Cancel"},"cancel"),!!c&&(0,n.jsx)(d.wpx,{type:"primary",onClick:c,children:"Download"},"download")],"data-testid":"consent-breakdown-modal",children:(0,n.jsxs)(d.jqI,{vertical:!0,className:"gap-6","data-testid":"consent-breakdown-modal-content",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(I,{children:"View all instances where this asset was detected without consent, organized by location and page. Use this to investigate potential compliance issues."}),(0,n.jsxs)(I,{children:[(0,n.jsx)(O,{strong:!0,children:"Asset name:"})," ",null!==(t=l.name)&&void 0!==t?t:(0,n.jsx)(O,{italic:!0,children:"Unknown"}),","," ",(0,n.jsx)(O,{strong:!0,children:"System:"})," ",null!==(s=l.system)&&void 0!==s?s:(0,n.jsx)(O,{italic:!0,children:"Unassigned"}),","," ",(0,n.jsx)(O,{strong:!0,children:"Domain:"})," ",null!==(a=l.domain)&&void 0!==a?a:(0,n.jsx)(O,{italic:!0,children:"Unknown"})]})]}),g?(0,n.jsx)(d.DUx,{type:"error",message:"Error fetching data",description:"Please try again later.",showIcon:!0}):(0,n.jsx)(d.V5H,{...m,columns:u,"data-testid":"consent-breakdown-modal-table"})]})})};var P=s(83766),L=s.n(P),R=s(62165),U=s(812),G=s(26070),Z=s(3110),M=s(46628),V=s(16394),z=s(54762),K=s(9320),W=s(88708);let B=e=>{let{asset:t,onTabChange:s}=e,[o,{isLoading:l}]=(0,E.EY)(),[i,{isLoading:c}]=(0,E.nS)(),[m,{isLoading:g}]=(0,E.Tj)(),h=(0,d.pmc)(),y=(0,a.useRouter)(),v=l||c||g,{urn:p,name:f,resource_type:x,diff_status:j,system_key:_,user_assigned_system_key:b}=t,C=async()=>{let e=await o({urnList:[p]});if((0,U.D4)(e))h((0,M.Vo)((0,U.e$)(e.error)));else{let e=b||_,t="".concat(r.So,"/configure/").concat(e,"#assets");h((0,M.t5)((0,K._)("".concat(x,' "').concat(f,'" has been added to the system inventory.'),e?()=>y.push(t):void 0)))}},w=async()=>{let e=await i({urnList:[p]});(0,U.D4)(e)?h((0,M.Vo)((0,U.e$)(e.error))):h((0,M.t5)((0,K._)("".concat(x,' "').concat(f,'" has been ignored and will not appear in future scans.'),async()=>{await s(W.A.IGNORED)})))},k=async()=>{let e=await m({urnList:[p]});(0,U.D4)(e)?h((0,M.Vo)((0,U.e$)(e.error))):h((0,M.t5)("".concat(x,' "').concat(f,'" is no longer ignored and will appear in future scans.')))};return(0,n.jsxs)(d.vyj,{children:[j!==u.LL.MUTED&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.esZ,{title:t.system?void 0:"This asset requires a system before you can add it to the inventory.",children:(0,n.jsx)(d.wpx,{"data-testid":"add-btn",size:"small",onClick:C,disabled:!t.system||v,loading:l,children:"Add"})}),(0,n.jsx)(d.wpx,{"data-testid":"ignore-btn",size:"small",onClick:w,disabled:v,loading:c,children:"Ignore"})]}),j===u.LL.MUTED&&(0,n.jsx)(d.wpx,{"data-testid":"restore-btn",size:"small",onClick:k,disabled:v,loading:g,children:"Restore"})]})};var X=s(17245),$=s(18992),Y=s.n($),q=s(2525),F=s(31883),H=e=>{var t,s,a;let{asset:l,readonly:r,columnState:i}=e,[c,u]=(0,o.useState)(!1),[m]=(0,E.Ak)(),{successAlert:g,errorAlert:h}=(0,X.VY)(),{getDataUseDisplayName:f}=(0,y.Z)(),x=(null===(t=l.user_assigned_data_uses)||void 0===t?void 0:t.length)?l.user_assigned_data_uses:(null===(s=l.data_uses)||void 0===s?void 0:s.length)?l.data_uses:[],j=async e=>{let t=await m({monitorId:l.monitor_config_id,urnList:[l.urn],dataUses:[...x,e]});(0,F.D4)(t)?h((0,U.e$)(t.error)):g("Consent category added to ".concat(l.resource_type,' "').concat(l.name,'" .'),"Confirmed"),u(!1)},_=async e=>{let t=await m({monitorId:l.monitor_config_id,urnList:[l.urn],dataUses:x.filter(t=>t!==e)});(0,F.D4)(t)?h((0,U.e$)(t.error)):g("Consent category removed from ".concat(l.resource_type,' "').concat(l.name,'".'),"Confirmed")},b=(null===(a=l.user_assigned_data_uses)||void 0===a?void 0:a.length)?l.user_assigned_data_uses:l.data_uses,C=null==b?void 0:b.filter(e=>(0,v.Z)(e));return r?(0,n.jsx)(q.Q,{values:null==C?void 0:C.map(e=>({label:f(e),key:e})),columnState:i}):(0,n.jsxs)(n.Fragment,{children:[!c&&(0,n.jsxs)(d.vyj,{align:"start",children:[(0,n.jsx)(d.j8w,{onClick:()=>u(!0),"data-testid":"taxonomy-add-btn",addable:!0,"aria-label":"Add data use"}),(0,n.jsx)(q.Q,{values:null==C?void 0:C.map(e=>({label:f(e),key:e})),columnState:i,tagProps:{closable:!0,closeButtonLabel:"Remove data use"},onTagClose:_})]}),c&&(0,n.jsx)("div",{className:Y().cellBleed,style:{backgroundColor:"var(--fides-color-white)"},children:(0,n.jsx)(p,{selectedTaxonomies:C||[],onSelect:j,onBlur:()=>u(!1),open:!0})})]})};let Q=e=>{let{consentAggregated:t,stagedResource:s,onShowBreakdown:a}=e;return(0,n.jsxs)(n.Fragment,{children:[t===u.lg.WITHOUT_CONSENT&&(0,n.jsx)(d.esZ,{title:"Asset was detected before the user gave consent or without any consent. Click the info icon for more details.",children:(0,n.jsx)(d.j8w,{color:"error",closeIcon:(0,n.jsx)(d.PJP.daM,{style:{width:12,height:12}}),closeButtonLabel:"View details",onClose:()=>{null==a||a(s,t)},"data-testid":"status-badge_without-consent",children:T.X1.WITHOUT_CONSENT})}),t===u.lg.WITH_CONSENT&&(0,n.jsx)(d.esZ,{title:"Asset was detected after the user gave consent",children:(0,n.jsx)(d.j8w,{color:"success","data-testid":"status-badge_with-consent",children:T.X1.WITH_CONSENT})}),t===u.lg.EXEMPT&&(0,n.jsx)(d.esZ,{title:"Asset is valid regardless of consent",children:(0,n.jsx)(d.j8w,{"data-testid":"status-badge_consent-exempt",children:T.X1.EXEMPT})}),t===u.lg.UNKNOWN&&(0,n.jsx)(d.esZ,{title:"Did not find consent information for this asset. You may need to re-run the monitor.",children:(0,n.jsx)(d.j8w,{"data-testid":"status-badge_unknown",children:T.X1.UNKNOWN})})]})};var J=s(70675);let ee=e=>{let{aggregateSystem:t,monitorConfigId:s,readonly:a}=e,{resource_type:l,name:r,urn:i,system:c,user_assigned_system_key:u,system_key:m}=t,[g,h]=(0,o.useState)(!1),[y,v]=(0,o.useState)(!1),[p,{isLoading:f}]=(0,J.NA)(),{successAlert:x,errorAlert:b}=(0,X.VY)(),C=(0,o.useCallback)(e=>{e.preventDefault(),v(!0)},[]),w=async(e,t,n)=>{let a=await p({staged_resource_urn:i,monitor_config_id:s,user_assigned_system_key:e});(0,U.D4)(a)?b((0,U.e$)(a.error)):x(n?"".concat(t," has been added to your system inventory and the ").concat(l,' "').concat(r,'" has been assigned to that system.'):"".concat(l,' "').concat(r,'" has been assigned to ').concat(t,"."),"Confirmed"),h(!1)};return a?c?(0,n.jsx)(d.j8w,{"data-testid":"system-badge",color:"white",children:c}):null:(0,n.jsxs)(n.Fragment,{children:[!g&&(c?(0,n.jsxs)(d.j8w,{onClick:()=>h(!0),"data-testid":"system-badge",children:[c,(0,n.jsx)(d.PJP.I8b,{})]}):(0,n.jsx)(d.j8w,{onClick:()=>h(!0),"data-testid":"add-system-btn",addable:!0})),!!g&&(0,n.jsx)("div",{className:Y().cellBleed,children:(0,n.jsx)(j.R,{variant:"borderless",autoFocus:!0,defaultOpen:!0,defaultValue:u||m,onBlur:e=>{var t;(null===(t=e.relatedTarget)||void 0===t?void 0:t.getAttribute("id"))!=="add-new-system"&&h(!1)},onAddSystem:C,onSelect:(e,t)=>w(e,t.label),loading:f})}),y&&(0,n.jsx)(_.i,{isOpen:!0,onClose:()=>{v(!1)},onSuccessfulSubmit:(e,t)=>w(e,t,!0)})]})},et=e=>{let{monitorId:t,systemId:s,onSystemName:l,onShowBreakdown:i}=e,c=(0,a.useRouter)(),m=(0,d.pmc)(),[g,h]=(0,o.useState)(s),[y,p]=(0,o.useState)(),[f,x]=(0,o.useState)(!1),[j,_]=(0,o.useState)(!1),[b,C]=(0,o.useState)(!1),[k,N]=(0,o.useState)(0),[A,I]=(0,o.useState)(0),[O,D]=(0,o.useState)(0),{flags:P}=(0,R.hz)(),{assetConsentStatusLabels:X}=P,{filterTabs:$,activeTab:Y,onTabChange:q,activeParams:F,actionsDisabled:J}=(0,W.Z)(s),et=(0,S.o)({sorting:{validColumns:Object.values(T.r6)}}),{columnFilters:es,pageIndex:en,pageSize:ea,resetState:eo,sortKey:el,sortOrder:er,searchQuery:ei,updateSearch:ed,updateFilters:ec,updateSorting:eu,updatePageIndex:em,updatePageSize:eg}=et,{data:eh,isLoading:ey,isFetching:ev}=(0,E.WJ)({key:t,page:en,size:ea,search:ei,sort_by:el?[el]:[T.r6.CONSENT_AGGREGATED,"urn"],sort_asc:"descend"!==er,...F,...es}),[ep,{isLoading:ef}]=(0,E.EY)(),[ex,{isLoading:ej}]=(0,E.nS)(),[e_,{isLoading:eb}]=(0,E.rs)(),[eC,{isLoading:ew}]=(0,E.sX)(),[ek,{isLoading:eS}]=(0,E.Vr)(),[eE,{isLoading:eT}]=(0,E.Tj)(),eN=ef||ej||eb||ew||eT||eS,eA=eN||s===r.Kl,{data:eI}=(0,E.ut)({monitor_config_id:t,resolved_system_id:s,diff_status:null==F?void 0:F.diff_status,search:ei,...es}),eO=(0,o.useMemo)(()=>({enableSelection:Y!==W.A.ADDED,getRowKey:e=>e.urn,isLoading:ey,isFetching:ev,dataSource:(null==eh?void 0:eh.items)||[],totalRows:(null==eh?void 0:eh.total)||0,customTableProps:{locale:{emptyText:(0,n.jsx)("div",{children:(0,n.jsx)("div",{children:"All caught up!"})})}}}),[Y,ey,ev,null==eh?void 0:eh.items,null==eh?void 0:eh.total]),eD=(0,S.V)(et,eO),eP=(0,o.useMemo)(()=>{var e;let t=[{title:"Asset",dataIndex:T.r6.NAME,key:T.r6.NAME,sorter:!0,sortOrder:el===T.r6.NAME?er:null,render:e=>(0,n.jsx)(d.lKn,{ellipsis:{tooltip:!0},style:{maxWidth:300},children:e}),fixed:"left"},{title:"Type",dataIndex:T.r6.RESOURCE_TYPE,key:T.r6.RESOURCE_TYPE,sorter:!0,sortOrder:el===T.r6.RESOURCE_TYPE?er:null,filters:(0,V.nZ)(null==eI?void 0:eI.resource_type),filteredValue:(null==es?void 0:es.resource_type)||null},{title:"System",dataIndex:T.r6.SYSTEM,key:T.r6.SYSTEM,render:(e,t)=>!!t.monitor_config_id&&(0,n.jsx)(ee,{aggregateSystem:t,monitorConfigId:t.monitor_config_id,readonly:J||Y===W.A.IGNORED})},{title:"Categories of consent",key:T.r6.DATA_USES,menu:{items:Z.DI,onClick:e=>{e.domEvent.stopPropagation(),"expand-all"===e.key?(C(!0),D(e=>e+1)):"collapse-all"===e.key&&(C(!1),D(e=>e+1))}},filters:(0,V.nZ)(null==eI?void 0:null===(e=eI.data_uses)||void 0===e?void 0:e.filter(e=>(0,v.Z)(e))),filteredValue:(null==es?void 0:es.data_uses)||null,render:(e,t)=>(0,n.jsx)(H,{asset:t,readonly:J||Y===W.A.IGNORED,columnState:{isExpanded:b,version:O}})},{title:"Locations",dataIndex:T.r6.LOCATIONS,key:T.r6.LOCATIONS,menu:{items:Z.DI,onClick:e=>{e.domEvent.stopPropagation(),"expand-all"===e.key?(x(!0),N(e=>e+1)):"collapse-all"===e.key&&(x(!1),N(e=>e+1))}},filters:(0,V.nZ)(null==eI?void 0:eI.locations,e=>{var t;let s=(0,d.QCN)(e);return s?(0,d.c1K)({isoEntry:s}):null!==(t=w.Z8[e])&&void 0!==t?t:e}),filteredValue:(null==es?void 0:es.locations)||null,render:e=>{var t;return(0,n.jsx)(G.Q,{values:null!==(t=null==e?void 0:e.map(e=>{var t;let s=(0,d.QCN)(e);return{label:s?(0,d.c1K)({isoEntry:s}):null!==(t=w.Z8[e])&&void 0!==t?t:e,key:e}}))&&void 0!==t?t:[],columnState:{isExpanded:f,version:k}})}},{title:"Domain",dataIndex:T.r6.DOMAIN,key:T.r6.DOMAIN},{title:"Detected on",dataIndex:T.r6.PAGE,menu:{items:Z.DI,onClick:e=>{e.domEvent.stopPropagation(),"expand-all"===e.key?(_(!0),I(e=>e+1)):"collapse-all"===e.key&&(_(!1),I(e=>e+1))}},key:T.r6.PAGE,render:e=>(0,n.jsx)(G.v,{values:e,valueSuffix:"pages",columnState:{isExpanded:j,version:A}})}];return X&&t.push({title:()=>(0,n.jsxs)(d.vyj,{children:[(0,n.jsx)("div",{children:"Compliance"}),y===u.lg.WITHOUT_CONSENT&&(0,n.jsx)(z.l,{consentStatus:{status:u.pF.ALERT,message:"One or more assets were detected without consent"}})]}),dataIndex:T.r6.CONSENT_AGGREGATED,key:T.r6.CONSENT_AGGREGATED,sorter:!0,sortOrder:el===T.r6.CONSENT_AGGREGATED?er:null,filters:(0,V.nZ)(null==eI?void 0:eI[T.r6.CONSENT_AGGREGATED],e=>{var t;return null!==(t=({with_consent:T.X1.WITH_CONSENT,without_consent:T.X1.WITHOUT_CONSENT,exempt:T.X1.EXEMPT,unknown:T.X1.UNKNOWN})[e])&&void 0!==t?t:e}),filteredValue:(null==es?void 0:es[T.r6.CONSENT_AGGREGATED])||null,render:(e,t)=>(0,n.jsx)(Q,{consentAggregated:null!=e?e:u.lg.UNKNOWN,stagedResource:t,onShowBreakdown:i})}),J||t.push({title:"Actions",key:T.r6.ACTIONS,fixed:"right",render:(e,t)=>(0,n.jsx)(B,{asset:t,onTabChange:q})}),t},[el,er,eI,es,X,J,Y,b,f,j,O,k,A,y,i,q]);(0,o.useEffect)(()=>{if(eh){var e;let t=(null===(e=eh.items[0])||void 0===e?void 0:e.system)||g||s||"";h(t),null==l||l(t)}},[eh,s,l,g]),(0,o.useEffect)(()=>{if((null==eh?void 0:eh.items)&&!y){var e;p(null===(e=eh.items.find(e=>e.consent_aggregated===u.lg.WITHOUT_CONSENT))||void 0===e?void 0:e.consent_aggregated)}},[eh,y]);let{selectedKeys:eL,selectedRows:eR,resetSelections:eU}=eD,eG=(0,o.useCallback)(async()=>{var e,t;let s=await ep({urnList:eL}),n=(null===(e=eR[0])||void 0===e?void 0:e.user_assigned_system_key)||(null===(t=eR[0])||void 0===t?void 0:t.system_key),a=eR.every(e=>(e.user_assigned_system_key||e.system_key)===n)?n:void 0;(0,U.D4)(s)?m((0,M.Vo)((0,U.e$)(s.error))):(m((0,M.t5)((0,K._)("".concat(eL.length," assets from ").concat(g," have been added to the system inventory."),a?()=>c.push("".concat(r.So,"/configure/").concat(a,"#assets")):()=>c.push(r.So)))),eU())},[ep,eL,eR,g,m,c,eU]),eZ=(0,o.useCallback)(async e=>{if("string"==typeof(null==e?void 0:e.value)){let s=await eC({monitorId:t,urnList:eL,systemKey:e.value});(0,U.D4)(s)?m((0,M.Vo)((0,U.e$)(s.error))):m((0,M.t5)("".concat(eL.length," assets have been assigned to ").concat(e.label,"."),"Confirmed"))}},[eC,t,eL,m]),eM=(0,o.useCallback)(async e=>{if(!eR.length)return;let s=eR.map(t=>{let s=L()([...t.user_assigned_data_uses||t.data_uses||[],...e]);return{urn:t.urn,user_assigned_data_uses:s}}),n=await ek({monitorId:t,assets:s});(0,U.D4)(n)?m((0,M.Vo)((0,U.e$)(n.error))):m((0,M.t5)("Consent categories added to ".concat(eL.length," assets").concat(g?" from ".concat(g):"","."),"Confirmed"))},[eR,ek,t,eL,g,m]),eV=(0,o.useCallback)(async()=>{let e=await ex({urnList:eL});(0,U.D4)(e)?m((0,M.Vo)((0,U.e$)(e.error))):(m((0,M.t5)(g===r.Kl?"".concat(eL.length," uncategorized assets have been ignored and will not appear in future scans."):"".concat(eL.length," assets from ").concat(g," have been ignored and will not appear in future scans."),"Confirmed")),eU())},[ex,eL,g,m,eU]),ez=(0,o.useCallback)(async()=>{let e=await eE({urnList:eL});(0,U.D4)(e)?m((0,M.Vo)((0,U.e$)(e.error))):(m((0,M.t5)("".concat(eL.length," assets have been restored and will appear in future scans."),"Confirmed")),eU())},[eE,eL,m,eU]),eK=(0,o.useCallback)(async()=>{let e=(null==eh?void 0:eh.items.length)||0,n=await e_({monitor_config_key:t,resolved_system_ids:[s]});(0,U.D4)(n)?m((0,M.Vo)((0,U.e$)(n.error))):(c.push("".concat(r.vi,"/").concat(t)),m((0,M.t5)("".concat(e," assets from ").concat(g," have been added to the system inventory."),"Confirmed")),eU())},[null==eh?void 0:eh.items.length,e_,t,s,c,m,g,eU]),eW=(0,o.useCallback)(async e=>{await q(e),eo(),eU()},[q,eo,eU]);return{columns:eP,data:eh,isLoading:ey,isFetching:ev,tableState:et,searchQuery:ei,updateSearch:ed,updateFilters:ec,updateSorting:eu,updatePageIndex:em,updatePageSize:eg,resetState:eo,tableProps:eD.tableProps,selectionProps:eD.selectionProps,filterTabs:$,activeTab:Y,handleTabChange:eW,activeParams:F,actionsDisabled:J,selectedRows:eR,selectedUrns:eL,hasSelectedRows:eD.hasSelectedRows,resetSelections:eU,systemName:g,firstItemConsentStatus:y,handleBulkAdd:eG,handleBulkAssignSystem:eZ,handleBulkAddDataUse:eM,handleBulkIgnore:eV,handleBulkRestore:ez,handleAddAll:eK,anyBulkActionIsLoading:eN,isAddingResults:ef,isIgnoringResults:ej,isAddingAllResults:eb,isBulkUpdatingSystem:ew,isBulkAddingDataUses:eS,isRestoringResults:eT,disableAddAll:eA}},es=e=>{var t;let{monitorId:s,systemId:a,onSystemName:l}=e,[r,i]=(0,o.useState)(!1),[g,h]=(0,o.useState)(!1),[y,v]=(0,o.useState)(null),{columns:p,searchQuery:f,updateSearch:j,resetState:_,tableProps:b,selectionProps:w,filterTabs:k,activeTab:S,handleTabChange:E,activeParams:T,actionsDisabled:N,selectedUrns:A,hasSelectedRows:I,resetSelections:O,handleBulkAdd:P,handleBulkAssignSystem:L,handleBulkAddDataUse:R,handleBulkIgnore:U,handleBulkRestore:G,handleAddAll:Z,anyBulkActionIsLoading:M,isAddingAllResults:V,isBulkUpdatingSystem:z,isBulkAddingDataUses:K,disableAddAll:W}=et({monitorId:s,systemId:a,onSystemName:l,onShowBreakdown:(e,t)=>{v({stagedResource:e,status:t})}}),B=async e=>{await L(e),i(!1)},X=async e=>{await R(e),h(!1)};return s&&a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Niu,{"aria-label":"Asset state filter",mode:"horizontal",items:k.map(e=>({key:e.hash,label:e.label})),selectedKeys:[S],onClick:async e=>{await E(e.key)},className:"mb-4","data-testid":"asset-state-filter"}),(0,n.jsxs)(d.jqI,{justify:"space-between",align:"center",className:"mb-4",children:[(0,n.jsx)(m.f,{value:f,onChange:j,placeholder:"Search by asset name..."}),(0,n.jsxs)(d.vyj,{size:"large",children:[I&&(0,n.jsx)(c.a,{count:A.length}),(0,n.jsxs)(d.vyj,{size:"small",children:[(0,n.jsx)(d.wpx,{onClick:()=>{_(),O()},"data-testid":"clear-filters",children:"Clear filters"}),(0,n.jsx)(d.S0p,{overlayClassName:"bulk-actions-menu-dropdown",menu:{items:[...(null==T?void 0:null===(t=T.diff_status)||void 0===t?void 0:t.includes(u.LL.MUTED))?[{key:"restore",label:"Restore",onClick:G}]:[{key:"add",label:"Add",onClick:P},{key:"add-data-use",label:"Add consent category",onClick:()=>h(!0)},{key:"assign-system",label:"Assign system",onClick:()=>i(!0)},{type:"divider"},{key:"ignore",label:"Ignore",onClick:U}]]},trigger:["click"],children:(0,n.jsx)(d.wpx,{icon:(0,n.jsx)(d.PJP._ME,{}),iconPosition:"end",loading:M,"data-testid":"bulk-actions-menu",disabled:!I||M||N,type:"primary",children:"Actions"})}),(0,n.jsx)(d.esZ,{title:W?"These assets require a system before you can add them to the inventory.":void 0,children:(0,n.jsx)(d.wpx,{onClick:Z,disabled:W,loading:V,type:"primary",icon:(0,n.jsx)(d.PJP.MCw,{}),iconPosition:"end","data-testid":"add-all",children:"Add all"})})]})]})]}),(0,n.jsx)(d.V5H,{...b,columns:p,rowSelection:w,locale:{emptyText:(0,n.jsx)(d.oj8,{image:d.oj8.PRESENTED_IMAGE_SIMPLE,description:"All caught up!"})},"aria-labelledby":"breadcrumb-current-page"}),(0,n.jsx)(C,{isOpen:r,onClose:()=>{i(!1)},onSave:B,isSaving:z}),(0,n.jsx)(x,{isOpen:g,onClose:()=>{h(!1)},onSave:X,isSaving:K}),y&&(0,n.jsx)(D,{isOpen:!!y,stagedResource:y.stagedResource,status:y.status,onCancel:()=>{v(null)}})]}):null};var en=()=>{let e=(0,a.useRouter)(),t=decodeURIComponent(e.query.monitorId),s=decodeURIComponent(e.query.systemId),[d,c]=(0,o.useState)(s===r.Kl?"Uncategorized assets":s);return(0,n.jsxs)(l.Z,{title:"Action center - Discovered assets",children:[(0,n.jsx)(i.Z,{heading:"Action center",breadcrumbItems:[{title:"All activity",href:r.vi},{title:t,href:"".concat(r.vi,"/").concat(t)},{title:s===r.Kl?"Uncategorized assets":d}]}),(0,n.jsx)(es,{monitorId:t,systemId:s,onSystemName:c})]})}},31883:function(e,t,s){"use strict";s.d(t,{Bw:function(){return n.Bw},D4:function(){return n.D4}});var n=s(19043)},72707:function(e){e.exports={option:"TaxonomySelect_option__vY6v2"}},18992:function(e){e.exports={cellBleed:"Cells_cellBleed__dik43"}}},function(e){e.O(0,[431,8765,9278,5163,7045,401,3585,7725,7929,2888,9774,179],function(){return e(e.s=25654)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2423],{66726:function(a,e,n){var t=n(11611),i=n(82846),s=n(91936),o=Math.max,r=Math.min;a.exports=function(a,e,n){var _,l,F,d,u,c,S=0,m=!1,C=!1,v=!0;if("function"!=typeof a)throw TypeError("Expected a function");function h(e){var n=_,t=l;return _=l=void 0,S=e,d=a.apply(t,n)}function A(a){var n=a-c,t=a-S;return void 0===c||n>=e||n<0||C&&t>=F}function I(){var a,n,t,s=i();if(A(s))return y(s);u=setTimeout(I,(a=s-c,n=s-S,t=e-a,C?r(t,F-n):t))}function y(a){return(u=void 0,v&&_)?h(a):(_=l=void 0,d)}function N(){var a,n=i(),t=A(n);if(_=arguments,l=this,c=n,t){if(void 0===u)return S=a=c,u=setTimeout(I,e),m?h(a):d;if(C)return clearTimeout(u),u=setTimeout(I,e),h(c)}return void 0===u&&(u=setTimeout(I,e)),d}return e=s(e)||0,t(n)&&(m=!!n.leading,F=(C="maxWait"in n)?o(s(n.maxWait)||0,e):F,v="trailing"in n?!!n.trailing:v),N.cancel=function(){void 0!==u&&clearTimeout(u),S=0,_=c=l=u=void 0},N.flush=function(){return void 0===u?d:y(i())},N}},82846:function(a,e,n){var t=n(77400);a.exports=function(){return t.Date.now()}},86850:function(a,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-discovery/action-center/[monitorId]",function(){return n(12109)}])},30952:function(a,e,n){"use strict";n.d(e,{f:function(){return _}});var t=n(24246),i=n(66726),s=n.n(i),o=n(27378),r=n(26917);let _=a=>{let{value:e,onChange:n,placeholder:i,..._}=a,[l,F]=(0,o.useState)(e);(0,o.useEffect)(()=>{F(e||"")},[e]);let d=s()(n,500),u=(0,o.useCallback)(a=>{F(a),d(a)},[]);return(0,t.jsx)(r.Z,{value:l,onChange:u,onClear:()=>{F(""),n("")},placeholder:i,..._})}},26089:function(a,e,n){"use strict";var t=n(24246),i=n(96306),s=n(99830),o=n.n(s);e.Z=a=>{let{onClick:e,children:n}=a;return(0,t.jsx)(i.wpx,{onClick:e,type:"link",role:"link",size:"small",className:o().toastLink,children:n})}},8411:function(a,e,n){"use strict";n.d(e,{NA:function(){return s},Z8:function(){return i}});var t=n(21910);let i={[t._F.ER]:"Eritrea",[t._F.DJ]:"Djibouti",[t._F.MR]:"Mauritania",[t._F.NA]:"Namibia",[t._F.GH]:"Ghana",[t._F.SS]:"South Sudan",[t._F.SC]:"Seychelles",[t._F.IO]:"British Indian Ocean Territory",[t._F.GQ]:"Equatorial Guinea",[t._F.AO]:"Angola",[t._F.CG]:"Republic of the Congo",[t._F.BW]:"Botswana",[t._F.BI]:"Burundi",[t._F.DZ]:"Algeria",[t._F.TD]:"Chad",[t._F.NG]:"Nigeria",[t._F.TZ]:"Tanzania",[t._F.EH]:"Western Sahara",[t._F.SN]:"Senegal",[t._F.LR]:"Liberia",[t._F.ZA]:"South Africa",[t._F.CV]:"Cape Verde",[t._F.GM]:"Gambia",[t._F.SD]:"Sudan",[t._F.KM]:"Comoros",[t._F.SZ]:"Eswatini",[t._F.UG]:"Uganda",[t._F.MG]:"Madagascar",[t._F.RW]:"Rwanda",[t._F.CD]:"DR Congo",[t._F.CM]:"Cameroon",[t._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[t._F.TG]:"Togo",[t._F.MU]:"Mauritius",[t._F.NE]:"Niger",[t._F.BJ]:"Benin",[t._F.EG]:"Egypt",[t._F.LS]:"Lesotho",[t._F.ET]:"Ethiopia",[t._F.MA]:"Morocco",[t._F.YT]:"Mayotte",[t._F.BF]:"Burkina Faso",[t._F.RE]:"R\xe9union",[t._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[t._F.CF]:"Central African Republic",[t._F.MZ]:"Mozambique",[t._F.MW]:"Malawi",[t._F.ML]:"Mali",[t._F.ZM]:"Zambia",[t._F.LY]:"Libya",[t._F.GW]:"Guinea-Bissau",[t._F.SO]:"Somalia",[t._F.KE]:"Kenya",[t._F.GN]:"Guinea",[t._F.ZW]:"Zimbabwe",[t._F.TN]:"Tunisia",[t._F.SL]:"Sierra Leone",[t._F.GA]:"Gabon",[t._F.CI]:"Ivory Coast",[t._F.JO]:"Jordan",[t._F.PK]:"Pakistan",[t._F.KP]:"North Korea",[t._F.MO]:"Macau",[t._F.AM]:"Armenia",[t._F.SY]:"Syria",[t._F.TJ]:"Tajikistan",[t._F.SA]:"Saudi Arabia",[t._F.KR]:"South Korea",[t._F.NP]:"Nepal",[t._F.PH]:"Philippines",[t._F.IQ]:"Iraq",[t._F.LB]:"Lebanon",[t._F.MN]:"Mongolia",[t._F.PS]:"Palestine",[t._F.YE]:"Yemen",[t._F.JP]:"Japan",[t._F.KZ]:"Kazakhstan",[t._F.LK]:"Sri Lanka",[t._F.MM]:"Myanmar",[t._F.KG]:"Kyrgyzstan",[t._F.CN]:"China",[t._F.AF]:"Afghanistan",[t._F.OM]:"Oman",[t._F.IN]:"India",[t._F.LA]:"Laos",[t._F.UZ]:"Uzbekistan",[t._F.MV]:"Maldives",[t._F.ID]:"Indonesia",[t._F.VN]:"Vietnam",[t._F.MY]:"Malaysia",[t._F.TW]:"Taiwan",[t._F.KH]:"Cambodia",[t._F.AE]:"United Arab Emirates",[t._F.HK]:"Hong Kong",[t._F.GE]:"Georgia (Country)",[t._F.BD]:"Bangladesh",[t._F.KW]:"Kuwait",[t._F.TM]:"Turkmenistan",[t._F.QA]:"Qatar",[t._F.BH]:"Bahrain",[t._F.BN]:"Brunei",[t._F.TH]:"Thailand",[t._F.BT]:"Bhutan",[t._F.SG]:"Singapore",[t._F.IL]:"Israel",[t._F.AZ]:"Azerbaijan",[t._F.TL]:"Timor-Leste",[t._F.IR]:"Iran",[t._F.TR]:"Turkey",[t._F.MK]:"North Macedonia",[t._F.IE]:"Ireland",[t._F.DK]:"Denmark",[t._F.SK]:"Slovakia",[t._F.MD]:"Moldova",[t._F.AX]:"\xc5land Islands",[t._F.PL]:"Poland",[t._F.BA]:"Bosnia and Herzegovina",[t._F.SM]:"San Marino",[t._F.CZ]:"Czechia",[t._F.EE]:"Estonia",[t._F.XK]:"Kosovo",[t._F.FO]:"Faroe Islands",[t._F.SJ]:"Svalbard and Jan Mayen",[t._F.GG]:"Guernsey",[t._F.FR]:"France",[t._F.NL]:"Netherlands",[t._F.FI]:"Finland",[t._F.PT]:"Portugal",[t._F.DE]:"Germany",[t._F.MT]:"Malta",[t._F.JE]:"Jersey",[t._F.IS]:"Iceland",[t._F.ES]:"Spain",[t._F.GI]:"Gibraltar",[t._F.NO]:"Norway",[t._F.CY]:"Cyprus",[t._F.RS]:"Serbia",[t._F.LT]:"Lithuania",[t._F.MC]:"Monaco",[t._F.LU]:"Luxembourg",[t._F.UA]:"Ukraine",[t._F.IM]:"Isle of Man",[t._F.RO]:"Romania",[t._F.BE]:"Belgium",[t._F.SE]:"Sweden",[t._F.ME]:"Montenegro",[t._F.LV]:"Latvia",[t._F.VA]:"Vatican City",[t._F.AT]:"Austria",[t._F.AL]:"Albania",[t._F.LI]:"Liechtenstein",[t._F.GR]:"Greece",[t._F.IT]:"Italy",[t._F.AD]:"Andorra",[t._F.GB]:"United Kingdom",[t._F.RU]:"Russia",[t._F.SI]:"Slovenia",[t._F.BY]:"Belarus",[t._F.CH]:"Switzerland",[t._F.HU]:"Hungary",[t._F.BG]:"Bulgaria",[t._F.HR]:"Croatia",[t._F.TC]:"Turks and Caicos Islands",[t._F.CW]:"Cura\xe7ao",[t._F.GP]:"Guadeloupe",[t._F.UM]:"United States Minor Outlying Islands",[t._F.GT]:"Guatemala",[t._F.PM]:"Saint Pierre and Miquelon",[t._F.BQ]:"Caribbean Netherlands",[t._F.GL]:"Greenland",[t._F.SX]:"Sint Maarten",[t._F.PA]:"Panama",[t._F.AW]:"Aruba",[t._F.MQ]:"Martinique",[t._F.AG]:"Antigua and Barbuda",[t._F.BM]:"Bermuda",[t._F.CU]:"Cuba",[t._F.GD]:"Grenada",[t._F.NI]:"Nicaragua",[t._F.LC]:"Saint Lucia",[t._F.KN]:"Saint Kitts and Nevis",[t._F.DO]:"Dominican Republic",[t._F.VC]:"Saint Vincent and the Grenadines",[t._F.BZ]:"Belize",[t._F.HT]:"Haiti",[t._F.JM]:"Jamaica",[t._F.BS]:"Bahamas",[t._F.MX]:"Mexico",[t._F.MF]:"Saint Martin",[t._F.SV]:"El Salvador",[t._F.BL]:"Saint Barth\xe9lemy",[t._F.AI]:"Anguilla",[t._F.MS]:"Montserrat",[t._F.VG]:"British Virgin Islands",[t._F.BB]:"Barbados",[t._F.HN]:"Honduras",[t._F.KY]:"Cayman Islands",[t._F.DM]:"Dominica",[t._F.TT]:"Trinidad and Tobago",[t._F.CR]:"Costa Rica",[t._F.SR]:"Suriname",[t._F.CX]:"Christmas Island",[t._F.WS]:"Samoa",[t._F.PF]:"French Polynesia",[t._F.AS]:"American Samoa",[t._F.NC]:"New Caledonia",[t._F.TK]:"Tokelau",[t._F.PW]:"Palau",[t._F.KI]:"Kiribati",[t._F.VU]:"Vanuatu",[t._F.PN]:"Pitcairn Islands",[t._F.CK]:"Cook Islands",[t._F.FJ]:"Fiji",[t._F.PG]:"Papua New Guinea",[t._F.MP]:"Northern Mariana Islands",[t._F.NU]:"Niue",[t._F.TV]:"Tuvalu",[t._F.NF]:"Norfolk Island",[t._F.TO]:"Tonga",[t._F.FM]:"Micronesia",[t._F.SB]:"Solomon Islands",[t._F.NR]:"Nauru",[t._F.WF]:"Wallis and Futuna",[t._F.GU]:"Guam",[t._F.AU]:"Australia",[t._F.NZ]:"New Zealand",[t._F.MH]:"Marshall Islands",[t._F.CC]:"Cocos (Keeling) Islands",[t._F.VE]:"Venezuela",[t._F.PY]:"Paraguay",[t._F.BR]:"Brazil",[t._F.CO]:"Colombia",[t._F.PE]:"Peru",[t._F.CL]:"Chile",[t._F.UY]:"Uruguay",[t._F.AR]:"Argentina",[t._F.GY]:"Guyana",[t._F.BO]:"Bolivia",[t._F.GF]:"French Guiana",[t._F.EC]:"Ecuador",[t._F.FK]:"Falkland Islands",[t._F.US_AL]:"Alabama",[t._F.US_AK]:"Alaska",[t._F.US_AZ]:"Arizona",[t._F.US_AR]:"Arkansas",[t._F.US_CA]:"California",[t._F.US_CO]:"Colorado",[t._F.US_CT]:"Connecticut",[t._F.US_DE]:"Delaware",[t._F.US_DC]:"District of Columbia (DC)",[t._F.US_FL]:"Florida",[t._F.US_GA]:"Georgia",[t._F.US_HI]:"Hawaii",[t._F.US_ID]:"Idaho",[t._F.US_IL]:"Illinois",[t._F.US_IN]:"Indiana",[t._F.US_IA]:"Iowa",[t._F.US_KS]:"Kansas",[t._F.US_KY]:"Kentucky",[t._F.US_LA]:"Louisiana",[t._F.US_ME]:"Maine",[t._F.US_MD]:"Maryland",[t._F.US_MA]:"Massachusetts",[t._F.US_MI]:"Michigan",[t._F.US_MN]:"Minnesota",[t._F.US_MS]:"Mississippi",[t._F.US_MO]:"Missouri",[t._F.US_MT]:"Montana",[t._F.US_NE]:"Nebraska",[t._F.US_NV]:"Nevada",[t._F.US_NH]:"New Hampshire",[t._F.US_NJ]:"New Jersey",[t._F.US_NM]:"New Mexico",[t._F.US_NY]:"New York",[t._F.US_NC]:"North Carolina",[t._F.US_ND]:"North Dakota",[t._F.US_OH]:"Ohio",[t._F.US_OK]:"Oklahoma",[t._F.US_OR]:"Oregon",[t._F.US_PA]:"Pennsylvania",[t._F.US_PR]:"Puerto Rico",[t._F.US_RI]:"Rhode Island",[t._F.US_SC]:"South Carolina",[t._F.US_SD]:"South Dakota",[t._F.US_TN]:"Tennessee",[t._F.US_TX]:"Texas",[t._F.US_UT]:"Utah",[t._F.US_VA]:"Virginia",[t._F.US_VI]:"United States Virgin Islands",[t._F.US_VT]:"Vermont",[t._F.US_WA]:"Washington",[t._F.US_WV]:"West Virginia",[t._F.US_WI]:"Wisconsin",[t._F.US_WY]:"Wyoming",[t._F.CA_AB]:"Alberta",[t._F.CA_BC]:"British Columbia",[t._F.CA_MB]:"Manitoba",[t._F.CA_NB]:"New Brunswick",[t._F.CA_NL]:"Newfoundland and Labrador",[t._F.CA_NS]:"Nova Scotia",[t._F.CA_ON]:"Ontario",[t._F.CA_PE]:"Prince Edward Island",[t._F.CA_QC]:"Quebec",[t._F.CA_SK]:"Saskatchewan",[t._F.CA_NT]:"Northwest Territories",[t._F.CA_NU]:"Nunavut",[t._F.CA_YT]:"Yukon",[t._F.CA]:"Canada",[t._F.US]:"United States",[t._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[t._F.CARIBBEAN]:"Caribbean",[t._F.EEA]:"European Economic Area (EEA)",[t._F.NON_EEA]:"Non European Economic Area",[t._F.GLOBAL]:"Global"},s=new Map(Object.entries(i));Object.entries(i).map(a=>({value:a[0],label:a[1]}))},99640:function(a,e,n){"use strict";n.d(e,{Z:function(){return l}});var t=n(24246),i=n(96306),s=n(79894),o=n.n(s);let{Link:r,Text:_}=i.AntTypography,l=a=>{let{href:e,children:n,...i}=a;return e?(0,t.jsx)(o(),{href:e,passHref:!0,legacyBehavior:!0,children:(0,t.jsx)(r,{strong:!0,ellipsis:!0,onClick:a=>a.stopPropagation(),...i,children:n})}):(0,t.jsx)(_,{strong:!0,ellipsis:!0,...i,children:n})}},76904:function(a,e,n){"use strict";n.d(e,{dK:function(){return d},Rv:function(){return m},$P:function(){return c},zj:function(){return C},Kr:function(){return v},q1:function(){return u},QL:function(){return h}});var t=n(24246),i=n(96306),s=n(3124),o=n.n(s);let r=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 8 8",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M7.23192 8H8V7.23192V1.85539V1.08731H6.46385V1.85539V5.37654L1.62976 0.544855L1.08731 0L0 1.08731L0.542454 1.62976L5.37654 6.46385H1.85539H1.08731V8H1.85539H7.23192Z"})})},_=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 8 8",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M7.23192 0H8V0.768077V6.14461V6.91269H6.46385V6.14461V2.62346L1.62976 7.45515L1.08731 8L0 6.91269L0.542454 6.37024L5.37654 1.53615H1.85539H1.08731V0H1.85539H7.23192Z"})})},l=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 9 10",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M0 0.5V5L4.5 9.5L9 5L4.5 0.5H0ZM2.25 2.10714C2.4205 2.10714 2.58401 2.17487 2.70457 2.29543C2.82513 2.41599 2.89286 2.5795 2.89286 2.75C2.89286 2.9205 2.82513 3.08401 2.70457 3.20457C2.58401 3.32513 2.4205 3.39286 2.25 3.39286C2.0795 3.39286 1.91599 3.32513 1.79543 3.20457C1.67487 3.08401 1.60714 2.9205 1.60714 2.75C1.60714 2.5795 1.67487 2.41599 1.79543 2.29543C1.91599 2.17487 2.0795 2.10714 2.25 2.10714Z"})})};var F=n(28278);let d=()=>(0,t.jsx)(_,{style:{color:o().FIDESUI_SUCCESS},className:"size-2","data-testid":"add-icon"}),u=()=>(0,t.jsx)(r,{style:{color:o().FIDESUI_ERROR},className:"size-2","data-testid":"remove-icon"}),c=()=>(0,t.jsx)(l,{style:{color:o().FIDESUI_WARNING},className:"size-3","data-testid":"classify-icon"}),S=a=>{let{color:e,...n}=a;return(0,t.jsx)(i.PJP.fRw,{style:{color:e},className:"size-2",...n})},m=()=>(0,t.jsx)(S,{color:o().FIDESUI_INFO,"data-testid":"change-icon"}),C=()=>(0,t.jsx)(S,{color:o().FIDESUI_SUCCESS,"data-testid":"monitored-icon"}),v=()=>(0,t.jsx)(S,{color:o().FIDESUI_ERROR,"data-testid":"muted-icon"}),h={[F.E.ADDITION]:(0,t.jsx)(d,{}),[F.E.REMOVAL]:(0,t.jsx)(u,{}),[F.E.CLASSIFICATION]:(0,t.jsx)(c,{}),[F.E.CHANGE]:(0,t.jsx)(m,{}),[F.E.MONITORED]:(0,t.jsx)(C,{}),[F.E.MUTED]:(0,t.jsx)(v,{}),[F.E.IN_PROGRESS]:(0,t.jsx)(()=>(0,t.jsx)(S,{color:o().FIDESUI_WARNING,"data-testid":"in-progress-icon"}),{}),[F.E.NONE]:null}},28278:function(a,e,n){"use strict";var t,i;n.d(e,{E:function(){return t}}),(i=t||(t={})).ADDITION="Addition",i.CHANGE="Change",i.REMOVAL="Removal",i.CLASSIFICATION="Classification",i.IN_PROGRESS="Classifying",i.MONITORED="Monitoring",i.MUTED="Unmonitored",i.NONE="--"},12109:function(a,e,n){"use strict";n.r(e),n.d(e,{default:function(){return w}});var t=n(24246),i=n(86677),s=n(35287),o=n(77830),r=n(58754),_=n(96306),l=n(25415),F=n(21910),d=n(30952),u=n(27378),c=n(812),S=n(8125),m=n(46628),C=n(37059),v=n(98145),h=n(9320),A=n(88708),I=n(8411),y=n(26070),N=n(3110),M=n(54762);let f=a=>{let{monitorId:e,system:n,allowIgnore:s,onTabChange:r}=a,[l,{isLoading:F}]=(0,C.rs)(),[d,{isLoading:u}]=(0,C.nP)(),S=(0,i.useRouter)(),v=(0,_.pmc)(),I=F||u,{id:y,name:N,system_key:M,total_updates:f}=n,E=async()=>{let a=await l({monitor_config_key:e,resolved_system_ids:[y]});if((0,c.D4)(a))v((0,m.Vo)((0,c.e$)(a.error)));else{let a="".concat(o.So,"/configure/").concat(M,"#assets");v((0,m.t5)((0,h._)(M?"".concat(f," assets from ").concat(N," have been added to the system inventory."):"".concat(N," and ").concat(f," assets have been added to the system inventory. ").concat(N," is now configured for consent."),M?()=>S.push(a):void 0)))}},g=async()=>{let a=await d({monitor_config_key:e,resolved_system_ids:[y||o.Kl]});(0,c.D4)(a)?v((0,m.Vo)((0,c.e$)(a.error))):v((0,m.t5)((0,h._)(N?"".concat(f," assets from ").concat(N," have been ignored and will not appear in future scans."):"".concat(f," uncategorized assets have been ignored and will not appear in future scans."),async()=>{await r(A.A.IGNORED)})))};return(0,t.jsxs)(_.vyj,{children:[(0,t.jsx)(_.esZ,{title:n.id?void 0:"These assets must be categorized before you can add them to the inventory.",children:(0,t.jsx)(_.wpx,{"data-testid":"add-btn",size:"small",onClick:E,disabled:!n.id||I,loading:F,children:"Add"})}),s&&(0,t.jsx)(_.wpx,{"data-testid":"ignore-btn",size:"small",onClick:g,disabled:I,loading:u,children:"Ignore"})]})};var E=n(99640),g=n(76904);let p=a=>{let{system:e,rowClickUrl:n}=a,i=null==n?void 0:n(e);return(0,t.jsxs)(_.vyj,{className:"max-w-[250px] flex-nowrap",children:[!e.system_key&&(0,t.jsx)(_.esZ,{title:"New system",children:(0,t.jsx)("span",{children:g.QL.Change})}),(0,t.jsx)(E.Z,{href:i,"data-testid":i?"system-name-link":"system-name-text",children:e.name||"Uncategorized assets"}),(0,t.jsx)(M.l,{consentStatus:e.consent_status})]})};var U=n(34929),x=n(2525),b=n(78238),T=a=>{var e,n;let{system:i,columnState:s}=a,{getDataUseDisplayName:o}=(0,U.Z)(),r=(null!==(n=null===(e=i.data_uses)||void 0===e?void 0:e.filter(a=>(0,b.Z)(a)))&&void 0!==n?n:[]).map(a=>({label:o(a),key:a}));return(0,t.jsx)(x.Q,{values:r,columnState:s})};let k=a=>{let{monitorId:e,readonly:n,allowIgnore:i,onTabChange:s,consentStatus:o,rowClickUrl:r}=a,[l,F]=(0,u.useState)(!1),[d,c]=(0,u.useState)(!1),[S,m]=(0,u.useState)(!1),[C,h]=(0,u.useState)(0),[A,E]=(0,u.useState)(0),[g,U]=(0,u.useState)(0);return{columns:(0,u.useMemo)(()=>{let a=[{title:()=>(0,t.jsxs)(_.vyj,{children:[(0,t.jsx)("div",{children:"System"}),(0,t.jsx)(M.l,{consentStatus:o})]}),dataIndex:"name",key:v.vQ.SYSTEM_NAME,fixed:"left",render:(a,e)=>(0,t.jsx)(p,{system:e,rowClickUrl:r})},{title:"Assets",dataIndex:"total_updates",key:v.vQ.TOTAL_UPDATES},{title:"Categories of consent",key:v.vQ.DATA_USE,menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(m(!0),U(a=>a+1)):"collapse-all"===a.key&&(m(!1),U(a=>a+1))}},render:(a,e)=>(0,t.jsx)(T,{system:e,columnState:{isExpanded:S,version:g}})},{title:"Locations",menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(F(!0),h(a=>a+1)):"collapse-all"===a.key&&(F(!1),h(a=>a+1))}},dataIndex:"locations",key:v.vQ.LOCATIONS,render:a=>{var e;return(0,t.jsx)(y.Q,{values:null!==(e=null==a?void 0:a.map(a=>{var e;return{label:null!==(e=I.Z8[a])&&void 0!==e?e:a,key:a}}))&&void 0!==e?e:[],columnState:{isExpanded:l,isWrapped:!0,version:C}})}},{title:"Domains",menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(c(!0),E(a=>a+1)):"collapse-all"===a.key&&(c(!1),E(a=>a+1))}},dataIndex:"domains",key:v.vQ.DOMAINS,render:a=>(0,t.jsx)(y.v,{values:a,valueSuffix:"domains",columnState:{isExpanded:d,version:A}})}];return n||a.push({title:"Actions",key:v.vQ.ACTIONS,fixed:"right",render:(a,n)=>(0,t.jsx)(f,{system:n,monitorId:e,allowIgnore:i,onTabChange:s})}),a},[n,o,r,S,l,d,g,C,A,e,i,s])}},L=a=>{let{monitorId:e}=a,n=(0,i.useRouter)(),s=(0,_.pmc)(),[r,l]=(0,u.useState)(),{filterTabs:d,activeTab:I,onTabChange:y,activeParams:N,actionsDisabled:M}=(0,A.Z)(),f=(0,S.o)({sorting:{validColumns:Object.values(v.vQ)}}),{pageIndex:E,pageSize:g,searchQuery:p,updateSearch:U,resetState:x}=f,{data:b,isLoading:T,isFetching:L}=(0,C.wi)({key:e,page:E,size:g,search:p,...N}),[j,{isLoading:w}]=(0,C.rs)(),[R,{isLoading:G}]=(0,C.nP)(),D=(0,u.useCallback)(a=>{var e,n,t;return null!==(t=null!==(n=null!==(e=a.id)&&void 0!==e?e:a.vendor_id)&&void 0!==n?n:a.name)&&void 0!==t?t:o.Kl},[]),P=(0,u.useCallback)(a=>{var n;return"".concat(o.vi,"/").concat(e,"/").concat(null!==(n=a.id)&&void 0!==n?n:o.Kl).concat(I?"#".concat(I):"")},[e,I]),B=(0,u.useMemo)(()=>({enableSelection:!0,getRowKey:D,isLoading:T,isFetching:L,dataSource:(null==b?void 0:b.items)||[],totalRows:(null==b?void 0:b.total)||0,customTableProps:{locale:{emptyText:(0,t.jsx)(_.oj8,{image:_.oj8.PRESENTED_IMAGE_SIMPLE,description:"All caught up!"})}}}),[D,T,L,null==b?void 0:b.items,null==b?void 0:b.total]),O=(0,S.V)(f,B),{selectedRows:K,resetSelections:V}=O,H=(0,u.useCallback)(async a=>{l(void 0),await y(a),x(),V()},[y,x,V]),{columns:Z}=k({monitorId:e,onTabChange:H,readonly:M,allowIgnore:!N.diff_status.includes(F.LL.MUTED),consentStatus:r,rowClickUrl:P});(0,u.useEffect)(()=>{if((null==b?void 0:b.items)&&!r){var a;let e=null===(a=b.items.find(a=>{var e;return(null===(e=a.consent_status)||void 0===e?void 0:e.status)===F.pF.ALERT}))||void 0===a?void 0:a.consent_status;l(null!=e?e:void 0)}},[b,r]);let z=(0,u.useCallback)(async()=>{let a=K.reduce((a,e)=>a+e.total_updates,0),t=await j({monitor_config_key:e,resolved_system_ids:K.map(a=>a.id)});(0,c.D4)(t)?s((0,m.Vo)((0,c.e$)(t.error))):(s((0,m.t5)((0,h._)("".concat(a," assets have been added to the system inventory."),()=>n.push(o.So)))),V())},[K,j,e,s,n,V]),W=(0,u.useCallback)(async()=>{let a=K.reduce((a,e)=>a+e.total_updates,0),n=await R({monitor_config_key:e,resolved_system_ids:K.map(a=>{var e;return null!==(e=a.id)&&void 0!==e?e:o.Kl})});(0,c.D4)(n)?s((0,m.Vo)((0,c.e$)(n.error))):(s((0,m.t5)((0,h._)("".concat(a," assets have been ignored and will not appear in future scans."),async()=>{await y(A.A.IGNORED)}))),V())},[K,R,e,s,y,V]),Q=K.some(a=>null===a.id);return{columns:Z,data:b,isLoading:T,isFetching:L,searchQuery:p,updateSearch:U,resetState:x,tableProps:O.tableProps,selectionProps:O.selectionProps,filterTabs:d,activeTab:I,handleTabChange:H,activeParams:N,actionsDisabled:M,selectedRows:K,hasSelectedRows:O.hasSelectedRows,resetSelections:V,uncategorizedIsSelected:Q,handleBulkAdd:z,handleBulkIgnore:W,anyBulkActionIsLoading:w||G,isAddingResults:w,isIgnoringResults:G}},j=a=>{let{monitorId:e}=a,{columns:n,searchQuery:i,updateSearch:s,tableProps:o,selectionProps:r,filterTabs:u,activeTab:c,handleTabChange:S,activeParams:m,selectedRows:C,hasSelectedRows:v,uncategorizedIsSelected:h,handleBulkAdd:A,handleBulkIgnore:I,anyBulkActionIsLoading:y}=L({monitorId:e});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Niu,{"aria-label":"Asset state filter",mode:"horizontal",items:u.map(a=>({key:a.hash,label:a.label})),selectedKeys:[c],onClick:async a=>{await S(a.key)},className:"mb-4","data-testid":"asset-state-filter"}),(0,t.jsxs)(_.jqI,{justify:"space-between",align:"center",className:"mb-4",children:[(0,t.jsx)(d.f,{value:i,onChange:s}),(0,t.jsxs)(_.vyj,{size:"large",children:[v&&(0,t.jsx)(l.a,{count:C.length}),(0,t.jsx)(_.S0p,{menu:{items:[{key:"add",label:(0,t.jsx)(_.esZ,{title:h?"Uncategorized assets can't be added to the inventory":null,placement:"left",children:"Add"}),onClick:A,disabled:h},m.diff_status.includes(F.LL.MUTED)?null:{key:"ignore",label:"Ignore",onClick:I}]},trigger:["click"],children:(0,t.jsx)(_.wpx,{type:"primary",icon:(0,t.jsx)(_.PJP._ME,{}),iconPosition:"end",loading:y,disabled:!v,"data-testid":"bulk-actions-menu",children:"Actions"})})]})]}),(0,t.jsx)(_.V5H,{...o,columns:n,rowSelection:r})]})};var w=()=>{let a=decodeURIComponent((0,i.useRouter)().query.monitorId);return(0,t.jsxs)(s.Z,{title:"Action center - Discovered assets by system",children:[(0,t.jsx)(r.Z,{heading:"Action center",breadcrumbItems:[{title:"All activity",href:o.vi},{title:a}]}),(0,t.jsx)(j,{monitorId:a})]})}},99830:function(a){a.exports={toastLink:"ToastLink_toastLink__OLSeq"}}},function(a){a.O(0,[431,8765,9278,5163,7045,7725,7929,2888,9774,179],function(){return a(a.s=86850)}),_N_E=a.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2423],{66726:function(a,e,n){var t=n(11611),i=n(82846),s=n(91936),o=Math.max,r=Math.min;a.exports=function(a,e,n){var _,l,F,d,u,c,S=0,m=!1,C=!1,v=!0;if("function"!=typeof a)throw TypeError("Expected a function");function h(e){var n=_,t=l;return _=l=void 0,S=e,d=a.apply(t,n)}function A(a){var n=a-c,t=a-S;return void 0===c||n>=e||n<0||C&&t>=F}function I(){var a,n,t,s=i();if(A(s))return y(s);u=setTimeout(I,(a=s-c,n=s-S,t=e-a,C?r(t,F-n):t))}function y(a){return(u=void 0,v&&_)?h(a):(_=l=void 0,d)}function N(){var a,n=i(),t=A(n);if(_=arguments,l=this,c=n,t){if(void 0===u)return S=a=c,u=setTimeout(I,e),m?h(a):d;if(C)return clearTimeout(u),u=setTimeout(I,e),h(c)}return void 0===u&&(u=setTimeout(I,e)),d}return e=s(e)||0,t(n)&&(m=!!n.leading,F=(C="maxWait"in n)?o(s(n.maxWait)||0,e):F,v="trailing"in n?!!n.trailing:v),N.cancel=function(){void 0!==u&&clearTimeout(u),S=0,_=c=l=u=void 0},N.flush=function(){return void 0===u?d:y(i())},N}},82846:function(a,e,n){var t=n(77400);a.exports=function(){return t.Date.now()}},86850:function(a,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/data-discovery/action-center/[monitorId]",function(){return n(12109)}])},30952:function(a,e,n){"use strict";n.d(e,{f:function(){return _}});var t=n(24246),i=n(66726),s=n.n(i),o=n(27378),r=n(26917);let _=a=>{let{value:e,onChange:n,placeholder:i,..._}=a,[l,F]=(0,o.useState)(e);(0,o.useEffect)(()=>{F(e||"")},[e]);let d=s()(n,500),u=(0,o.useCallback)(a=>{F(a),d(a)},[]);return(0,t.jsx)(r.Z,{value:l,onChange:u,onClear:()=>{F(""),n("")},placeholder:i,..._})}},26089:function(a,e,n){"use strict";var t=n(24246),i=n(96306),s=n(99830),o=n.n(s);e.Z=a=>{let{onClick:e,children:n}=a;return(0,t.jsx)(i.wpx,{onClick:e,type:"link",role:"link",size:"small",className:o().toastLink,children:n})}},8411:function(a,e,n){"use strict";n.d(e,{NA:function(){return s},Z8:function(){return i}});var t=n(21910);let i={[t._F.ER]:"Eritrea",[t._F.DJ]:"Djibouti",[t._F.MR]:"Mauritania",[t._F.NA]:"Namibia",[t._F.GH]:"Ghana",[t._F.SS]:"South Sudan",[t._F.SC]:"Seychelles",[t._F.IO]:"British Indian Ocean Territory",[t._F.GQ]:"Equatorial Guinea",[t._F.AO]:"Angola",[t._F.CG]:"Republic of the Congo",[t._F.BW]:"Botswana",[t._F.BI]:"Burundi",[t._F.DZ]:"Algeria",[t._F.TD]:"Chad",[t._F.NG]:"Nigeria",[t._F.TZ]:"Tanzania",[t._F.EH]:"Western Sahara",[t._F.SN]:"Senegal",[t._F.LR]:"Liberia",[t._F.ZA]:"South Africa",[t._F.CV]:"Cape Verde",[t._F.GM]:"Gambia",[t._F.SD]:"Sudan",[t._F.KM]:"Comoros",[t._F.SZ]:"Eswatini",[t._F.UG]:"Uganda",[t._F.MG]:"Madagascar",[t._F.RW]:"Rwanda",[t._F.CD]:"DR Congo",[t._F.CM]:"Cameroon",[t._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[t._F.TG]:"Togo",[t._F.MU]:"Mauritius",[t._F.NE]:"Niger",[t._F.BJ]:"Benin",[t._F.EG]:"Egypt",[t._F.LS]:"Lesotho",[t._F.ET]:"Ethiopia",[t._F.MA]:"Morocco",[t._F.YT]:"Mayotte",[t._F.BF]:"Burkina Faso",[t._F.RE]:"R\xe9union",[t._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[t._F.CF]:"Central African Republic",[t._F.MZ]:"Mozambique",[t._F.MW]:"Malawi",[t._F.ML]:"Mali",[t._F.ZM]:"Zambia",[t._F.LY]:"Libya",[t._F.GW]:"Guinea-Bissau",[t._F.SO]:"Somalia",[t._F.KE]:"Kenya",[t._F.GN]:"Guinea",[t._F.ZW]:"Zimbabwe",[t._F.TN]:"Tunisia",[t._F.SL]:"Sierra Leone",[t._F.GA]:"Gabon",[t._F.CI]:"Ivory Coast",[t._F.JO]:"Jordan",[t._F.PK]:"Pakistan",[t._F.KP]:"North Korea",[t._F.MO]:"Macau",[t._F.AM]:"Armenia",[t._F.SY]:"Syria",[t._F.TJ]:"Tajikistan",[t._F.SA]:"Saudi Arabia",[t._F.KR]:"South Korea",[t._F.NP]:"Nepal",[t._F.PH]:"Philippines",[t._F.IQ]:"Iraq",[t._F.LB]:"Lebanon",[t._F.MN]:"Mongolia",[t._F.PS]:"Palestine",[t._F.YE]:"Yemen",[t._F.JP]:"Japan",[t._F.KZ]:"Kazakhstan",[t._F.LK]:"Sri Lanka",[t._F.MM]:"Myanmar",[t._F.KG]:"Kyrgyzstan",[t._F.CN]:"China",[t._F.AF]:"Afghanistan",[t._F.OM]:"Oman",[t._F.IN]:"India",[t._F.LA]:"Laos",[t._F.UZ]:"Uzbekistan",[t._F.MV]:"Maldives",[t._F.ID]:"Indonesia",[t._F.VN]:"Vietnam",[t._F.MY]:"Malaysia",[t._F.TW]:"Taiwan",[t._F.KH]:"Cambodia",[t._F.AE]:"United Arab Emirates",[t._F.HK]:"Hong Kong",[t._F.GE]:"Georgia (Country)",[t._F.BD]:"Bangladesh",[t._F.KW]:"Kuwait",[t._F.TM]:"Turkmenistan",[t._F.QA]:"Qatar",[t._F.BH]:"Bahrain",[t._F.BN]:"Brunei",[t._F.TH]:"Thailand",[t._F.BT]:"Bhutan",[t._F.SG]:"Singapore",[t._F.IL]:"Israel",[t._F.AZ]:"Azerbaijan",[t._F.TL]:"Timor-Leste",[t._F.IR]:"Iran",[t._F.TR]:"Turkey",[t._F.MK]:"North Macedonia",[t._F.IE]:"Ireland",[t._F.DK]:"Denmark",[t._F.SK]:"Slovakia",[t._F.MD]:"Moldova",[t._F.AX]:"\xc5land Islands",[t._F.PL]:"Poland",[t._F.BA]:"Bosnia and Herzegovina",[t._F.SM]:"San Marino",[t._F.CZ]:"Czechia",[t._F.EE]:"Estonia",[t._F.XK]:"Kosovo",[t._F.FO]:"Faroe Islands",[t._F.SJ]:"Svalbard and Jan Mayen",[t._F.GG]:"Guernsey",[t._F.FR]:"France",[t._F.NL]:"Netherlands",[t._F.FI]:"Finland",[t._F.PT]:"Portugal",[t._F.DE]:"Germany",[t._F.MT]:"Malta",[t._F.JE]:"Jersey",[t._F.IS]:"Iceland",[t._F.ES]:"Spain",[t._F.GI]:"Gibraltar",[t._F.NO]:"Norway",[t._F.CY]:"Cyprus",[t._F.RS]:"Serbia",[t._F.LT]:"Lithuania",[t._F.MC]:"Monaco",[t._F.LU]:"Luxembourg",[t._F.UA]:"Ukraine",[t._F.IM]:"Isle of Man",[t._F.RO]:"Romania",[t._F.BE]:"Belgium",[t._F.SE]:"Sweden",[t._F.ME]:"Montenegro",[t._F.LV]:"Latvia",[t._F.VA]:"Vatican City",[t._F.AT]:"Austria",[t._F.AL]:"Albania",[t._F.LI]:"Liechtenstein",[t._F.GR]:"Greece",[t._F.IT]:"Italy",[t._F.AD]:"Andorra",[t._F.GB]:"United Kingdom",[t._F.RU]:"Russia",[t._F.SI]:"Slovenia",[t._F.BY]:"Belarus",[t._F.CH]:"Switzerland",[t._F.HU]:"Hungary",[t._F.BG]:"Bulgaria",[t._F.HR]:"Croatia",[t._F.TC]:"Turks and Caicos Islands",[t._F.CW]:"Cura\xe7ao",[t._F.GP]:"Guadeloupe",[t._F.UM]:"United States Minor Outlying Islands",[t._F.GT]:"Guatemala",[t._F.PM]:"Saint Pierre and Miquelon",[t._F.BQ]:"Caribbean Netherlands",[t._F.GL]:"Greenland",[t._F.SX]:"Sint Maarten",[t._F.PA]:"Panama",[t._F.AW]:"Aruba",[t._F.MQ]:"Martinique",[t._F.AG]:"Antigua and Barbuda",[t._F.BM]:"Bermuda",[t._F.CU]:"Cuba",[t._F.GD]:"Grenada",[t._F.NI]:"Nicaragua",[t._F.LC]:"Saint Lucia",[t._F.KN]:"Saint Kitts and Nevis",[t._F.DO]:"Dominican Republic",[t._F.VC]:"Saint Vincent and the Grenadines",[t._F.BZ]:"Belize",[t._F.HT]:"Haiti",[t._F.JM]:"Jamaica",[t._F.BS]:"Bahamas",[t._F.MX]:"Mexico",[t._F.MF]:"Saint Martin",[t._F.SV]:"El Salvador",[t._F.BL]:"Saint Barth\xe9lemy",[t._F.AI]:"Anguilla",[t._F.MS]:"Montserrat",[t._F.VG]:"British Virgin Islands",[t._F.BB]:"Barbados",[t._F.HN]:"Honduras",[t._F.KY]:"Cayman Islands",[t._F.DM]:"Dominica",[t._F.TT]:"Trinidad and Tobago",[t._F.CR]:"Costa Rica",[t._F.SR]:"Suriname",[t._F.CX]:"Christmas Island",[t._F.WS]:"Samoa",[t._F.PF]:"French Polynesia",[t._F.AS]:"American Samoa",[t._F.NC]:"New Caledonia",[t._F.TK]:"Tokelau",[t._F.PW]:"Palau",[t._F.KI]:"Kiribati",[t._F.VU]:"Vanuatu",[t._F.PN]:"Pitcairn Islands",[t._F.CK]:"Cook Islands",[t._F.FJ]:"Fiji",[t._F.PG]:"Papua New Guinea",[t._F.MP]:"Northern Mariana Islands",[t._F.NU]:"Niue",[t._F.TV]:"Tuvalu",[t._F.NF]:"Norfolk Island",[t._F.TO]:"Tonga",[t._F.FM]:"Micronesia",[t._F.SB]:"Solomon Islands",[t._F.NR]:"Nauru",[t._F.WF]:"Wallis and Futuna",[t._F.GU]:"Guam",[t._F.AU]:"Australia",[t._F.NZ]:"New Zealand",[t._F.MH]:"Marshall Islands",[t._F.CC]:"Cocos (Keeling) Islands",[t._F.VE]:"Venezuela",[t._F.PY]:"Paraguay",[t._F.BR]:"Brazil",[t._F.CO]:"Colombia",[t._F.PE]:"Peru",[t._F.CL]:"Chile",[t._F.UY]:"Uruguay",[t._F.AR]:"Argentina",[t._F.GY]:"Guyana",[t._F.BO]:"Bolivia",[t._F.GF]:"French Guiana",[t._F.EC]:"Ecuador",[t._F.FK]:"Falkland Islands",[t._F.US_AL]:"Alabama",[t._F.US_AK]:"Alaska",[t._F.US_AZ]:"Arizona",[t._F.US_AR]:"Arkansas",[t._F.US_CA]:"California",[t._F.US_CO]:"Colorado",[t._F.US_CT]:"Connecticut",[t._F.US_DE]:"Delaware",[t._F.US_DC]:"District of Columbia (DC)",[t._F.US_FL]:"Florida",[t._F.US_GA]:"Georgia",[t._F.US_HI]:"Hawaii",[t._F.US_ID]:"Idaho",[t._F.US_IL]:"Illinois",[t._F.US_IN]:"Indiana",[t._F.US_IA]:"Iowa",[t._F.US_KS]:"Kansas",[t._F.US_KY]:"Kentucky",[t._F.US_LA]:"Louisiana",[t._F.US_ME]:"Maine",[t._F.US_MD]:"Maryland",[t._F.US_MA]:"Massachusetts",[t._F.US_MI]:"Michigan",[t._F.US_MN]:"Minnesota",[t._F.US_MS]:"Mississippi",[t._F.US_MO]:"Missouri",[t._F.US_MT]:"Montana",[t._F.US_NE]:"Nebraska",[t._F.US_NV]:"Nevada",[t._F.US_NH]:"New Hampshire",[t._F.US_NJ]:"New Jersey",[t._F.US_NM]:"New Mexico",[t._F.US_NY]:"New York",[t._F.US_NC]:"North Carolina",[t._F.US_ND]:"North Dakota",[t._F.US_OH]:"Ohio",[t._F.US_OK]:"Oklahoma",[t._F.US_OR]:"Oregon",[t._F.US_PA]:"Pennsylvania",[t._F.US_PR]:"Puerto Rico",[t._F.US_RI]:"Rhode Island",[t._F.US_SC]:"South Carolina",[t._F.US_SD]:"South Dakota",[t._F.US_TN]:"Tennessee",[t._F.US_TX]:"Texas",[t._F.US_UT]:"Utah",[t._F.US_VA]:"Virginia",[t._F.US_VI]:"United States Virgin Islands",[t._F.US_VT]:"Vermont",[t._F.US_WA]:"Washington",[t._F.US_WV]:"West Virginia",[t._F.US_WI]:"Wisconsin",[t._F.US_WY]:"Wyoming",[t._F.CA_AB]:"Alberta",[t._F.CA_BC]:"British Columbia",[t._F.CA_MB]:"Manitoba",[t._F.CA_NB]:"New Brunswick",[t._F.CA_NL]:"Newfoundland and Labrador",[t._F.CA_NS]:"Nova Scotia",[t._F.CA_ON]:"Ontario",[t._F.CA_PE]:"Prince Edward Island",[t._F.CA_QC]:"Quebec",[t._F.CA_SK]:"Saskatchewan",[t._F.CA_NT]:"Northwest Territories",[t._F.CA_NU]:"Nunavut",[t._F.CA_YT]:"Yukon",[t._F.CA]:"Canada",[t._F.US]:"United States",[t._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[t._F.CARIBBEAN]:"Caribbean",[t._F.EEA]:"European Economic Area (EEA)",[t._F.NON_EEA]:"Non European Economic Area",[t._F.GLOBAL]:"Global"},s=new Map(Object.entries(i));Object.entries(i).map(a=>({value:a[0],label:a[1]}))},99640:function(a,e,n){"use strict";n.d(e,{Z:function(){return l}});var t=n(24246),i=n(96306),s=n(79894),o=n.n(s);let{Link:r,Text:_}=i.AntTypography,l=a=>{let{href:e,children:n,...i}=a;return e?(0,t.jsx)(o(),{href:e,passHref:!0,legacyBehavior:!0,children:(0,t.jsx)(r,{strong:!0,ellipsis:!0,onClick:a=>a.stopPropagation(),...i,children:n})}):(0,t.jsx)(_,{strong:!0,ellipsis:!0,...i,children:n})}},76904:function(a,e,n){"use strict";n.d(e,{dK:function(){return d},Rv:function(){return m},$P:function(){return c},zj:function(){return C},Kr:function(){return v},q1:function(){return u},QL:function(){return h}});var t=n(24246),i=n(96306),s=n(3124),o=n.n(s);let r=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 8 8",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M7.23192 8H8V7.23192V1.85539V1.08731H6.46385V1.85539V5.37654L1.62976 0.544855L1.08731 0L0 1.08731L0.542454 1.62976L5.37654 6.46385H1.85539H1.08731V8H1.85539H7.23192Z"})})},_=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 8 8",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M7.23192 0H8V0.768077V6.14461V6.91269H6.46385V6.14461V2.62346L1.62976 7.45515L1.08731 8L0 6.91269L0.542454 6.37024L5.37654 1.53615H1.85539H1.08731V0H1.85539H7.23192Z"})})},l=a=>{let{...e}=a;return(0,t.jsx)("svg",{viewBox:"0 0 9 10",focusable:"false",...e,children:(0,t.jsx)("path",{fill:"currentColor",d:"M0 0.5V5L4.5 9.5L9 5L4.5 0.5H0ZM2.25 2.10714C2.4205 2.10714 2.58401 2.17487 2.70457 2.29543C2.82513 2.41599 2.89286 2.5795 2.89286 2.75C2.89286 2.9205 2.82513 3.08401 2.70457 3.20457C2.58401 3.32513 2.4205 3.39286 2.25 3.39286C2.0795 3.39286 1.91599 3.32513 1.79543 3.20457C1.67487 3.08401 1.60714 2.9205 1.60714 2.75C1.60714 2.5795 1.67487 2.41599 1.79543 2.29543C1.91599 2.17487 2.0795 2.10714 2.25 2.10714Z"})})};var F=n(28278);let d=()=>(0,t.jsx)(_,{style:{color:o().FIDESUI_SUCCESS},className:"size-2","data-testid":"add-icon"}),u=()=>(0,t.jsx)(r,{style:{color:o().FIDESUI_ERROR},className:"size-2","data-testid":"remove-icon"}),c=()=>(0,t.jsx)(l,{style:{color:o().FIDESUI_WARNING},className:"size-3","data-testid":"classify-icon"}),S=a=>{let{color:e,...n}=a;return(0,t.jsx)(i.PJP.fRw,{style:{color:e},className:"size-2",...n})},m=()=>(0,t.jsx)(S,{color:o().FIDESUI_INFO,"data-testid":"change-icon"}),C=()=>(0,t.jsx)(S,{color:o().FIDESUI_SUCCESS,"data-testid":"monitored-icon"}),v=()=>(0,t.jsx)(S,{color:o().FIDESUI_ERROR,"data-testid":"muted-icon"}),h={[F.E.ADDITION]:(0,t.jsx)(d,{}),[F.E.REMOVAL]:(0,t.jsx)(u,{}),[F.E.CLASSIFICATION]:(0,t.jsx)(c,{}),[F.E.CHANGE]:(0,t.jsx)(m,{}),[F.E.MONITORED]:(0,t.jsx)(C,{}),[F.E.MUTED]:(0,t.jsx)(v,{}),[F.E.IN_PROGRESS]:(0,t.jsx)(()=>(0,t.jsx)(S,{color:o().FIDESUI_WARNING,"data-testid":"in-progress-icon"}),{}),[F.E.NONE]:null}},28278:function(a,e,n){"use strict";var t,i;n.d(e,{E:function(){return t}}),(i=t||(t={})).ADDITION="Addition",i.CHANGE="Change",i.REMOVAL="Removal",i.CLASSIFICATION="Classification",i.IN_PROGRESS="Classifying",i.MONITORED="Monitoring",i.MUTED="Unmonitored",i.NONE="--"},12109:function(a,e,n){"use strict";n.r(e),n.d(e,{default:function(){return w}});var t=n(24246),i=n(86677),s=n(35287),o=n(77830),r=n(58754),_=n(96306),l=n(25415),F=n(21910),d=n(30952),u=n(27378),c=n(812),S=n(8125),m=n(46628),C=n(37059),v=n(98145),h=n(9320),A=n(88708),I=n(8411),y=n(26070),N=n(3110),M=n(54762);let f=a=>{let{monitorId:e,system:n,allowIgnore:s,onTabChange:r}=a,[l,{isLoading:F}]=(0,C.rs)(),[d,{isLoading:u}]=(0,C.nP)(),S=(0,i.useRouter)(),v=(0,_.pmc)(),I=F||u,{id:y,name:N,system_key:M,total_updates:f}=n,E=async()=>{let a=await l({monitor_config_key:e,resolved_system_ids:[y]});if((0,c.D4)(a))v((0,m.Vo)((0,c.e$)(a.error)));else{let a="".concat(o.So,"/configure/").concat(M,"#assets");v((0,m.t5)((0,h._)(M?"".concat(f," assets from ").concat(N," have been added to the system inventory."):"".concat(N," and ").concat(f," assets have been added to the system inventory. ").concat(N," is now configured for consent."),M?()=>S.push(a):void 0)))}},g=async()=>{let a=await d({monitor_config_key:e,resolved_system_ids:[y||o.Kl]});(0,c.D4)(a)?v((0,m.Vo)((0,c.e$)(a.error))):v((0,m.t5)((0,h._)(N?"".concat(f," assets from ").concat(N," have been ignored and will not appear in future scans."):"".concat(f," uncategorized assets have been ignored and will not appear in future scans."),async()=>{await r(A.A.IGNORED)})))};return(0,t.jsxs)(_.vyj,{children:[(0,t.jsx)(_.esZ,{title:n.id?void 0:"These assets must be categorized before you can add them to the inventory.",children:(0,t.jsx)(_.wpx,{"data-testid":"add-btn",size:"small",onClick:E,disabled:!n.id||I,loading:F,children:"Add"})}),s&&(0,t.jsx)(_.wpx,{"data-testid":"ignore-btn",size:"small",onClick:g,disabled:I,loading:u,children:"Ignore"})]})};var E=n(99640),g=n(76904);let p=a=>{let{system:e,rowClickUrl:n}=a,i=null==n?void 0:n(e);return(0,t.jsxs)(_.vyj,{className:"max-w-[250px] flex-nowrap",children:[!e.system_key&&(0,t.jsx)(_.esZ,{title:"New system",children:(0,t.jsx)("span",{children:g.QL.Change})}),(0,t.jsx)(E.Z,{href:i,"data-testid":i?"system-name-link":"system-name-text",children:e.name||"Uncategorized assets"}),(0,t.jsx)(M.l,{consentStatus:e.consent_status})]})};var U=n(34929),x=n(2525),b=n(78238),T=a=>{var e,n;let{system:i,columnState:s}=a,{getDataUseDisplayName:o}=(0,U.Z)(),r=(null!==(n=null===(e=i.data_uses)||void 0===e?void 0:e.filter(a=>(0,b.Z)(a)))&&void 0!==n?n:[]).map(a=>({label:o(a),key:a}));return(0,t.jsx)(x.Q,{values:r,columnState:s})};let k=a=>{let{monitorId:e,readonly:n,allowIgnore:i,onTabChange:s,consentStatus:o,rowClickUrl:r}=a,[l,F]=(0,u.useState)(!1),[d,c]=(0,u.useState)(!1),[S,m]=(0,u.useState)(!1),[C,h]=(0,u.useState)(0),[A,E]=(0,u.useState)(0),[g,U]=(0,u.useState)(0);return{columns:(0,u.useMemo)(()=>{let a=[{title:()=>(0,t.jsxs)(_.vyj,{children:[(0,t.jsx)("div",{children:"System"}),(0,t.jsx)(M.l,{consentStatus:o})]}),dataIndex:"name",key:v.vQ.SYSTEM_NAME,fixed:"left",render:(a,e)=>(0,t.jsx)(p,{system:e,rowClickUrl:r})},{title:"Assets",dataIndex:"total_updates",key:v.vQ.TOTAL_UPDATES},{title:"Categories of consent",key:v.vQ.DATA_USE,menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(m(!0),U(a=>a+1)):"collapse-all"===a.key&&(m(!1),U(a=>a+1))}},render:(a,e)=>(0,t.jsx)(T,{system:e,columnState:{isExpanded:S,version:g}})},{title:"Locations",menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(F(!0),h(a=>a+1)):"collapse-all"===a.key&&(F(!1),h(a=>a+1))}},dataIndex:"locations",key:v.vQ.LOCATIONS,render:a=>{var e;return(0,t.jsx)(y.Q,{values:null!==(e=null==a?void 0:a.map(a=>{var e;let n=(0,_.QCN)(a);return{label:n?(0,_.c1K)({isoEntry:n}):null!==(e=I.Z8[a])&&void 0!==e?e:a,key:a}}))&&void 0!==e?e:[],columnState:{isExpanded:l,isWrapped:!0,version:C}})}},{title:"Domains",menu:{items:N.DI,onClick:a=>{a.domEvent.stopPropagation(),"expand-all"===a.key?(c(!0),E(a=>a+1)):"collapse-all"===a.key&&(c(!1),E(a=>a+1))}},dataIndex:"domains",key:v.vQ.DOMAINS,render:a=>(0,t.jsx)(y.v,{values:a,valueSuffix:"domains",columnState:{isExpanded:d,version:A}})}];return n||a.push({title:"Actions",key:v.vQ.ACTIONS,fixed:"right",render:(a,n)=>(0,t.jsx)(f,{system:n,monitorId:e,allowIgnore:i,onTabChange:s})}),a},[n,o,r,S,l,d,g,C,A,e,i,s])}},L=a=>{let{monitorId:e}=a,n=(0,i.useRouter)(),s=(0,_.pmc)(),[r,l]=(0,u.useState)(),{filterTabs:d,activeTab:I,onTabChange:y,activeParams:N,actionsDisabled:M}=(0,A.Z)(),f=(0,S.o)({sorting:{validColumns:Object.values(v.vQ)}}),{pageIndex:E,pageSize:g,searchQuery:p,updateSearch:U,resetState:x}=f,{data:b,isLoading:T,isFetching:L}=(0,C.wi)({key:e,page:E,size:g,search:p,...N}),[j,{isLoading:w}]=(0,C.rs)(),[R,{isLoading:G}]=(0,C.nP)(),D=(0,u.useCallback)(a=>{var e,n,t;return null!==(t=null!==(n=null!==(e=a.id)&&void 0!==e?e:a.vendor_id)&&void 0!==n?n:a.name)&&void 0!==t?t:o.Kl},[]),P=(0,u.useCallback)(a=>{var n;return"".concat(o.vi,"/").concat(e,"/").concat(null!==(n=a.id)&&void 0!==n?n:o.Kl).concat(I?"#".concat(I):"")},[e,I]),B=(0,u.useMemo)(()=>({enableSelection:!0,getRowKey:D,isLoading:T,isFetching:L,dataSource:(null==b?void 0:b.items)||[],totalRows:(null==b?void 0:b.total)||0,customTableProps:{locale:{emptyText:(0,t.jsx)(_.oj8,{image:_.oj8.PRESENTED_IMAGE_SIMPLE,description:"All caught up!"})}}}),[D,T,L,null==b?void 0:b.items,null==b?void 0:b.total]),O=(0,S.V)(f,B),{selectedRows:K,resetSelections:V}=O,H=(0,u.useCallback)(async a=>{l(void 0),await y(a),x(),V()},[y,x,V]),{columns:Z}=k({monitorId:e,onTabChange:H,readonly:M,allowIgnore:!N.diff_status.includes(F.LL.MUTED),consentStatus:r,rowClickUrl:P});(0,u.useEffect)(()=>{if((null==b?void 0:b.items)&&!r){var a;let e=null===(a=b.items.find(a=>{var e;return(null===(e=a.consent_status)||void 0===e?void 0:e.status)===F.pF.ALERT}))||void 0===a?void 0:a.consent_status;l(null!=e?e:void 0)}},[b,r]);let z=(0,u.useCallback)(async()=>{let a=K.reduce((a,e)=>a+e.total_updates,0),t=await j({monitor_config_key:e,resolved_system_ids:K.map(a=>a.id)});(0,c.D4)(t)?s((0,m.Vo)((0,c.e$)(t.error))):(s((0,m.t5)((0,h._)("".concat(a," assets have been added to the system inventory."),()=>n.push(o.So)))),V())},[K,j,e,s,n,V]),W=(0,u.useCallback)(async()=>{let a=K.reduce((a,e)=>a+e.total_updates,0),n=await R({monitor_config_key:e,resolved_system_ids:K.map(a=>{var e;return null!==(e=a.id)&&void 0!==e?e:o.Kl})});(0,c.D4)(n)?s((0,m.Vo)((0,c.e$)(n.error))):(s((0,m.t5)((0,h._)("".concat(a," assets have been ignored and will not appear in future scans."),async()=>{await y(A.A.IGNORED)}))),V())},[K,R,e,s,y,V]),Q=K.some(a=>null===a.id);return{columns:Z,data:b,isLoading:T,isFetching:L,searchQuery:p,updateSearch:U,resetState:x,tableProps:O.tableProps,selectionProps:O.selectionProps,filterTabs:d,activeTab:I,handleTabChange:H,activeParams:N,actionsDisabled:M,selectedRows:K,hasSelectedRows:O.hasSelectedRows,resetSelections:V,uncategorizedIsSelected:Q,handleBulkAdd:z,handleBulkIgnore:W,anyBulkActionIsLoading:w||G,isAddingResults:w,isIgnoringResults:G}},j=a=>{let{monitorId:e}=a,{columns:n,searchQuery:i,updateSearch:s,tableProps:o,selectionProps:r,filterTabs:u,activeTab:c,handleTabChange:S,activeParams:m,selectedRows:C,hasSelectedRows:v,uncategorizedIsSelected:h,handleBulkAdd:A,handleBulkIgnore:I,anyBulkActionIsLoading:y}=L({monitorId:e});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Niu,{"aria-label":"Asset state filter",mode:"horizontal",items:u.map(a=>({key:a.hash,label:a.label})),selectedKeys:[c],onClick:async a=>{await S(a.key)},className:"mb-4","data-testid":"asset-state-filter"}),(0,t.jsxs)(_.jqI,{justify:"space-between",align:"center",className:"mb-4",children:[(0,t.jsx)(d.f,{value:i,onChange:s}),(0,t.jsxs)(_.vyj,{size:"large",children:[v&&(0,t.jsx)(l.a,{count:C.length}),(0,t.jsx)(_.S0p,{menu:{items:[{key:"add",label:(0,t.jsx)(_.esZ,{title:h?"Uncategorized assets can't be added to the inventory":null,placement:"left",children:"Add"}),onClick:A,disabled:h},m.diff_status.includes(F.LL.MUTED)?null:{key:"ignore",label:"Ignore",onClick:I}]},trigger:["click"],children:(0,t.jsx)(_.wpx,{type:"primary",icon:(0,t.jsx)(_.PJP._ME,{}),iconPosition:"end",loading:y,disabled:!v,"data-testid":"bulk-actions-menu",children:"Actions"})})]})]}),(0,t.jsx)(_.V5H,{...o,columns:n,rowSelection:r})]})};var w=()=>{let a=decodeURIComponent((0,i.useRouter)().query.monitorId);return(0,t.jsxs)(s.Z,{title:"Action center - Discovered assets by system",children:[(0,t.jsx)(r.Z,{heading:"Action center",breadcrumbItems:[{title:"All activity",href:o.vi},{title:a}]}),(0,t.jsx)(j,{monitorId:a})]})}},99830:function(a){a.exports={toastLink:"ToastLink_toastLink__OLSeq"}}},function(a){a.O(0,[431,8765,9278,5163,7045,7725,7929,2888,9774,179],function(){return a(a.s=86850)}),_N_E=a.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,y,{setValue:v}]=(0,a.U$)(t),j=!!(y.touched&&y.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)=>{v(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:y.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:y.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 eU}});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),y=s(16134),v=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,y]=(0,c.useState)([]),v=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(""),y([]),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 y(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(""),y([]),s()},disabled:r,"data-testid":"complete-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:v,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,y.C)(v.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 F=s(59003),z=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 X=s(58452),Q=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:y}=(0,Q.tB)({api_set:!1}),{data:v}=(0,ee.JE)(),j=null==y?void 0:null===(t=y.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)(X.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)(X.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==v?void 0:v.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.ACTIONS="actions";let es=(0,z.Cl)(),ei=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return[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})}),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})}),...e?[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}),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})}),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.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,{plus:s}=(0,u.hz)(),[i,l]=(0,D.v1)("search",D.Oi.withDefault("").withOptions({throttleMs:100})),r=(0,M.v9)(W.dp),d=(0,n.pmc)(),o=(0,h.useRouter)(),p=(0,M.I0)(),m=ed(),{pageIndex:x,pageSize:y,resetPagination:v}=m,{isOpen:j,onOpen:g,onClose:_}=(0,n.qY0)(),{data:f,isLoading:b,isFetching:q}=(0,W.QA)({...r,page:x,size:y,fuzzy_search_str:i}),{items:C,total:S}=(0,c.useMemo)(()=>f||{items:[],total:0,pages:0},[f]),{downloadReport:k}=ec(),E=(0,c.useCallback)(e=>{l(null!=e?e:""),v()},[v,l]),R=async()=>{let e;try{await k(r)}catch(t){e=t instanceof Error?t.message:"Unknown error occurred"}e&&d({description:"".concat(e),duration:5e3,status:"error"})},w=e=>{o.push("/privacy-requests/".concat(e))},T=(0,F.b7)({getCoreRowModel:(0,z.sC)(),data:C,columns:(0,c.useMemo)(()=>ei(s),[s]),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:i,setGlobalFilter:E,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:g,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:R})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(er,{isOpen:j,onClose:_,onFilterChange:v})})]}),b?(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:T,onRowClick:e=>w(e.id),onSort:e=>{if(!e){p((0,W.PS)());return}let{id:t,desc:s}=e;p((0,W.WR)(t)),p((0,W.iX)(s?"desc":"asc")),v()},loading:q}),(0,a.jsx)(n.B7X,{...m.paginationProps,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),total:null!=S?S:0,align:"end"})]})]})};var ep=s(87361),em=s(46628),ex=s(32885),eh=s(34090),ey=s(55484),ev=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 ey.Ry().shape({policy_key:ey.Z_().required().label("Request type")});let i=e.custom_privacy_request_fields?Object.entries(e.custom_privacy_request_fields).map(e=>{let[t,s]=e;return{[t]:ey.Ry().shape({value:s.required&&!s.hidden?ey.Z_().required().label(s.label):ey.Z_().nullable()})}}).reduce((e,t)=>({...e,...t}),{}):{};return ey.Ry().shape({policy_key:ey.Z_().required().label("Request type"),identity:ey.Ry().shape({email:(null===(t=e.identity_inputs)||void 0===t?void 0:t.email)==="required"?ey.Z_().email().required().label("Email address"):ey.Z_().nullable(),phone_number:(null===(s=e.identity_inputs)||void 0===s?void 0:s.phone)==="required"?ey.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").required().label("Phone number"):ey.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").nullable()}),custom_privacy_request_fields:ey.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)(ev.j0,{name:"identity.email",label:"User email address",isRequired:"required"===t.email,variant:"stacked"}):null,t.phone?(0,a.jsx)(ev.j0,{name:"identity.phone_number",label:"User phone number",isRequired:"required"===t.phone,variant:"stacked"}):null]}):null},eq=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(0,a.jsx)(ev.j0,{name:"custom_privacy_request_fields.".concat(t,".value"),label:s.label,isRequired:!!s.required,variant:"stacked"},t)})})},eC=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:()=>ey.Ry().shape({identity:ey.Ry().shape({email:ey.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 eS=e=>{let{onSubmit:t,onCancel:s}=e,{data:i}=(0,W.xv)();return(0,a.jsx)(eh.J9,{initialValues:ef,onSubmit:t,validationSchema:()=>(0,ey.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)(eq,{customFieldInputs:null==u?void 0:u.custom_privacy_request_fields}),(0,a.jsx)(ev.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"})]})]})})}})},ek=s(31883);let eE=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,ek.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)(eS,{onSubmit:r,onCancel:()=>s()})]})})]})]})},eR=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)(eC,{privacyCenterUrl:i,onSubmit:s,onCancel:s})]})]})]})};var ew=()=>{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)(eR,{isOpen:"create-link"===t,onClose:i,privacyCenterUrl:r}):null,(0,a.jsx)(eE,{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"})]})},eT=s(58754),eI=s(17245);let eA=()=>{let{errorAlert:e}=(0,eI.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 eN=s(72281);let eP=o()(()=>s.e(9676).then(s.bind(s,59676)),{loadableGenerated:{webpack:()=>[59676]},loading:()=>(0,a.jsx)("div",{children:"Loading..."})});var eO=()=>{let{processing:e}=eA(),{plus:t}=(0,u.hz)(),{activeTab:s,handleTabChange:i,availableTabs:l}=(0,eN.d)();(0,c.useEffect)(()=>{e()},[e]);let r=(0,c.useMemo)(()=>{let e=[];return l.request&&e.push({key:eN.G.REQUEST,label:"Request",children:(0,a.jsx)(eu,{})}),l.manualTask&&e.push({key:eN.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)(eT.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)(ew,{})}),(0,a.jsx)(eP,{})]}),"data-testid":"privacy-requests"}),(0,a.jsx)(n.A5g,{activeKey:s,onChange:i,items:r})]})},eU=()=>(0,a.jsx)(r.Z,{title:"Privacy Requests",children:(0,a.jsx)(eO,{})})},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,[431,8765,3550,4558,2888,9774,179],function(){return e(e.s=1565)}),_N_E=e.O()}]);