(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7262],{81575:function(e,a,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/consent/privacy-notices",function(){return i(63466)}])},63466:function(e,a,i){"use strict";i.r(a),i.d(a,{default:function(){return y}});var s=i(24246),t=i(69746),n=i(27378),o=i(65464),l=i(92222),r=i(59003),c=i(8540),d=i(86677),u=i(11032),h=i(38615),g=i(96878),x=i(45095),m=i(69236),v=i(40793),p=i(10284);let f={items:[],total:0,page:1,size:25,pages:1},j=()=>(0,s.jsxs)(t.gCW,{mt:6,p:10,spacing:4,borderRadius:"base",maxW:"70%","data-testid":"no-results-notice",alignSelf:"center",margin:"auto",children:[(0,s.jsxs)(t.gCW,{children:[(0,s.jsx)(t.xvT,{fontSize:"md",fontWeight:"600",children:"No privacy notices found."}),(0,s.jsx)(t.xvT,{fontSize:"sm",children:'Click "Add a privacy notice" to add your first privacy notice to Fides.'})]}),(0,s.jsx)(t.wpx,{href:"".concat(u.IT,"/new"),role:"link",size:"small",type:"primary","data-testid":"add-privacy-notice-btn",children:"Add a privacy notice +"})]}),w=(0,l.Cl)(),b=()=>{let{isLoading:e}=(0,g.x8)(),a=(0,d.useRouter)(),i=(0,h.Tg)([p.Sh.PRIVACY_NOTICE_UPDATE]),{PAGE_SIZES:o,pageSize:b,setPageSize:y,onPreviousPageClick:R,isPreviousPageDisabled:C,onNextPageClick:P,isNextPageDisabled:_,startRange:k,endRange:M,pageIndex:T,setTotalPages:z}=(0,c.oi)(),{isFetching:E,isLoading:N,data:S}=(0,v.J6)({page:T,size:b}),{items:V,total:I,pages:A}=(0,n.useMemo)(()=>S||f,[S]);(0,n.useEffect)(()=>{z(A)},[A,z]);let W=(0,n.useMemo)(()=>[w.accessor(e=>e.name,{id:"name",cell:e=>(0,s.jsx)(c.G3,{value:e.getValue()}),header:e=>(0,s.jsx)(c.Rr,{value:"Title",...e})}),w.accessor(e=>e.consent_mechanism,{id:"consent_mechanism",cell:e=>(0,x.JA)(e.getValue()),header:e=>(0,s.jsx)(c.Rr,{value:"Mechanism",...e})}),w.accessor(e=>e.configured_regions,{id:"regions",cell:e=>{var a;return(null===(a=(0,x.JL)(e.getValue()))||void 0===a?void 0:a.length)?(0,s.jsx)(c.WP,{suffix:"Locations",value:(0,x.JL)(e.getValue()),...e}):(0,s.jsx)(c.G3,{value:"Unassigned"})},header:e=>(0,s.jsx)(c.Rr,{value:"Locations",...e}),meta:{showHeaderMenu:!0}}),w.accessor(e=>e.disabled,{id:"status",cell:e=>(0,x.jN)(e),header:e=>(0,s.jsx)(c.Rr,{value:"Status",...e})}),w.accessor(e=>e.framework,{id:"framework",cell:e=>e.getValue()?(0,s.jsx)(c.A4,{value:m.Ep.get(e.getValue())}):null,header:e=>(0,s.jsx)(c.Rr,{value:"Framework",...e})}),w.accessor(e=>e.children,{id:"children",cell:e=>{var a;return(null===(a=(0,x.Mq)(e.getValue()))||void 0===a?void 0:a.length)?(0,s.jsx)(c.WP,{suffix:"Children",value:(0,x.Mq)(e.getValue()),...e}):(0,s.jsx)(c.G3,{value:"Unassigned"})},header:e=>(0,s.jsx)(c.Rr,{value:"Children",...e}),meta:{showHeaderMenu:!0}}),i&&w.accessor(e=>e.disabled,{id:"enable",cell:x.PS,header:e=>(0,s.jsx)(c.Rr,{value:"Enable",...e}),meta:{disableRowClick:!0}})].filter(Boolean),[i]),L=(0,r.b7)({getCoreRowModel:(0,l.sC)(),getGroupedRowModel:(0,l.qe)(),getExpandedRowModel:(0,l.rV)(),columns:W,manualPagination:!0,data:V,state:{expanded:!0},columnResizeMode:"onChange"});return N||e?(0,s.jsx)(c.I4,{rowHeight:36,numRows:15}):(0,s.jsx)("div",{children:(0,s.jsxs)(t.kCb,{flex:1,direction:"column",overflow:"auto",children:[i&&(0,s.jsx)(c.Q$,{children:(0,s.jsx)(t.Ugi,{alignItems:"center",spacing:4,marginLeft:"auto",children:(0,s.jsx)(t.wpx,{href:"".concat(u.IT,"/new"),role:"link",size:"small",type:"primary","data-testid":"add-privacy-notice-btn",children:"Add a privacy notice +"})})}),(0,s.jsx)(c.ZK,{tableInstance:L,onRowClick:i?e=>{let{id:s}=e;i&&a.push("".concat(u.IT,"/").concat(s))}:void 0,emptyTableNotice:(0,s.jsx)(j,{})}),(0,s.jsx)(c.s8,{totalRows:I||0,pageSizes:o,setPageSize:y,onPreviousPageClick:R,isPreviousPageDisabled:C||E,onNextPageClick:P,isNextPageDisabled:_||E,startRange:k,endRange:M})]})})};var y=()=>(0,s.jsxs)(o.Z,{title:"Privacy notices",mainProps:{padding:"24px 40px"},children:[(0,s.jsx)(t.xuv,{mb:4,children:(0,s.jsx)(t.X6q,{fontSize:"2xl",fontWeight:"semibold",mb:2,"data-testid":"header",children:"Manage privacy notices"})}),(0,s.jsx)(t.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,s.jsx)(t.xuv,{"data-testid":"privacy-notices-page",children:(0,s.jsx)(b,{})})]})}},function(e){e.O(0,[8033,6451,8540,3163,2888,9774,179],function(){return e(e.s=81575)}),_N_E=e.O()}]);