"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[1439],{41439:(s,t,a)=>{a.r(t),a.d(t,{default:()=>r});var e=a(86087),i=a(27723),l=a(9588),d=a(45111),o=a(10790);class n extends e.Component{constructor(){super(...arguments),this.state={data:[],buttonsDisabled:!1}}dismissModal(s){this.props.handleModal(!1,null,s)}componentDidMount(){this.setState({data:this.props.data,buttonsDisabled:!1})}handleFix(s){let t=this.props.data.action;this.setState({buttonsDisabled:!0}),l.doAction(t,"refresh",this.props.data).then(s=>{this.props.data;let{data:t}=this.state;t.description=s.msg,t.subtitle="",this.setState({data:t}),this.props.data,s.success&&this.dismissModal(this.props.data)})}render(){const{data:s,buttonsDisabled:t}=this.state;let a=t?"disabled":"",e=s.description;return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"cmplz-modal-backdrop",onClick:s=>this.dismissModal(s),children:" "}),(0,o.jsxs)("div",{className:"cmplz-modal",id:"{id}",children:[(0,o.jsxs)("div",{className:"cmplz-modal-header",children:[(0,o.jsx)("h2",{className:"modal-title",children:s.title}),(0,o.jsx)("button",{type:"button",className:"cmplz-modal-close","data-dismiss":"modal","aria-label":"Close",onClick:s=>this.dismissModal(s),children:(0,o.jsx)(d.default,{name:"times"})})]}),(0,o.jsxs)("div",{className:"cmplz-modal-content",children:[s.subtitle&&(0,o.jsx)("div",{className:"cmplz-modal-subtitle",children:s.subtitle}),Array.isArray(e)&&e.map((s,t)=>(0,o.jsx)("div",{className:"cmplz-modal-description",children:s},t))]}),(0,o.jsxs)("div",{className:"cmplz-modal-footer",children:[s.edit&&(0,o.jsx)("a",{href:s.edit,target:"_blank",rel:"noopener noreferrer",className:"button button-secondary",children:(0,i.__)("Edit","complianz-gdpr")}),s.help&&(0,o.jsx)("a",{href:s.help,target:"_blank",rel:"noopener noreferrer",className:"button cmplz-button-help",children:(0,i.__)("Help","complianz-gdpr")}),!s.ignored&&"ignore_url"===s.action&&(0,o.jsx)("button",{disabled:a,className:"button button-primary",onClick:s=>this.handleFix(s),children:(0,i.__)("Ignore","complianz-gdpr")}),"ignore_url"!==s.action&&(0,o.jsx)("button",{disabled:a,className:"button button-primary",onClick:s=>this.handleFix(s),children:(0,i.__)("Fix","complianz-gdpr")})]})]})]})}}const r=n}}]);