1var A=Object.defineProperty;var D=(s,r,e)=>r in s?A(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var c=(s,r,e)=>D(s,typeof r!="symbol"?r+"":r,e);import{j as t}from"./styledComponents-n4UW4kpA.js";import{a as h}from"./react-C3MRYTMn.js";import{q as L,r as E,t as f,P as u,v as I}from"./index-Dbx1gyta.js";import{b as U}from"./FormHelpText-4ln6uI_r.js";import{j as O}from"./redux-DEt5ekS8.js";import{F as w,W as x}from"./FormWizard-D8LvthqE.js";import{F}from"./FormGroup-BOm6V0xO.js";import{F as B}from"./FormCheckbox-CakGujzw.js";import{C as P,a as N,b as G}from"./CampaignCard-CS2CUSnt.js";import{a as H,b as M,F as R}from"./FilterCheckbox-eQal7YUW.js";import"./brandTextCheck-BtVFi4-W.js";import"./index-g6qz2-ej.js";import"./Text-DGc87esK.js";import"./urlHelpers-szXc1bAB.js";import"./buttons.styles-ClYbUcfj.js";import"./polished.esm-CYsXSD1d.js";import"./Icon-CkZJfHnP.js";import"./SsrLink-B3K7paPT.js";class S extends h.Component{constructor(){super(...arguments);c(this,"state",{formSubmitted:!1,formSubmittedData:{},formError:{},campaignFilters:[],selectedFilters:[]});c(this,"submitForm",(e,a)=>{const{form:{endpoint:i},siteName:m}=this.props;L.post(i,{...e},{headers:E("U0pQOlBhcnRuZXI=","application/json")}).then(o=>{this.setState({formSubmitted:!0,formSubmittedData:o.data})}).catch(o=>{o.response&&this.setState({formError:o.response.data})})});c(this,"updateActiveStep",e=>{const{dispatchUpdateActiveStep:a}=this.props;a(e)});c(this,"getFilters",e=>[...new Set(e.map(a=>a.category))]);c(this,"onChangeHandle",e=>{const{selectedFilters:a}=this.state,i=[...a];if(i.some(m=>m===e)){const m=i.findIndex(o=>o===e);i.splice(m,1)}else i.push(e);this.setState({selectedFilters:i})});c(this,"checkIfApplied",(e,a)=>a&&a.some(i=>i===e));c(this,"getCampaigns",()=>this.props.form.campaigns.map(e=>({campaignId:e.campaignId,subscribed:e.subscribed})))}componentDidMount(){const{campaigns:e}=this.props.form,a=this.getFilters(e);this.setState({campaignFilters:a})}render(){const{formSubmitted:e,formSubmittedData:a,formError:i,campaignFilters:m,selectedFilters:o}=this.state,{stepOne:n,stepTwo:j,form:p,toggleModal:C,hostname:v,requestUri:y,siteName:T}=this.props,{email:k}=p;return e?t.jsx(w,{stepThree:j,onClickCallback:C}):t.jsx(h.Fragment,{children:t.jsx(x,{initialValues:{campaigns:this.getCampaigns(),email:k,siteUrl:`${v}${y}`,siteName:T},onSubmit:(l,d)=>this.submitForm(l,d),updateActiveStep:this.updateActiveStep,children:t.jsx(x.Page,{title:n.title,subtitle:n.subtitle,buttonNext:n.buttonNextLabel,buttonPrev:n.buttonPrevLabel,nextStepText:n.nextStepText,nextStepError:n.nextStepError,formError:i,formSubmitted:e,children:l=>
1t.jsxs(h.Fragment,{children:[t.jsx(F,{children:t.jsxs(H,{children:[t.jsx(M,{children:"Filters"}),m&&m.map((d,b)=>t.jsx(R,{id:d,value:d,label:d,selected:this.checkIfApplied(d,o),onChangeHandle:this.onChangeHandle,isGrey:!0,onBlur:()=>f("checkBoxClick","filterCheckbox","eBriefingOverlay/step2")}))]})}),t.jsx(F,{children:(p==null?void 0:p.campaigns)&&t.jsx(U,{name:"campaigns",render:d=>t.jsx(B,{error:l.errors.subscriptions,value:l.values.subscriptions,touched:l.touched.subscriptions,id:"subscriptions",label:p.campaigns.label,helpText:p.campaigns.helpText,isStacked:!0,children:t.jsx(P,{children:p.campaigns&&t.jsx(N,{children:p.campaigns.filter(b=>o.length>0?o.includes(b.category):!0).map((b,g)=>t.jsx(G,{...b,subscribeLabel:n.subscribeLabel,subscribedLabel:n.subscribedLabel,unsubscribeLabel:n.unsubscribeLabel,values:l.values.campaigns,index:g,form:l.form,fieldName:"campaigns",onBlur:()=>f("checkBoxClick",`CampaignCard-${g} ${b.title}`,"eBriefingOverlay/step2")}))})})})})})]})})})})}}const q=s=>({siteId:s.page.pageData.context.content.hostMapping.siteId,siteName:s.page.pageData.context.content.partner,hostname:s.page.pageData.context.content.hostMapping.hostname,requestUri:s.page.pageData.context.request.uri}),$=s=>({dispatchUpdateActiveStep:r=>s(I(r))}),ce=O(q,$)(S);S.propTypes={dispatchUpdateActiveStep:u.func,toggleModal:u.func,form:u.object,stepOne:u.object,stepTwo:u.object,stepThree:u.object};export{ce as default}; 2//# sourceMappingURL=EbriefingSignupUpdateFormOverlay-Bi8Qd2YX.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.