1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[784],{8377:(e,t,s)=>{s.d(t,{Z:()=>u});var i=s(9668),n=s(6128),o=s(4467),r=s(8157),a=s(6446);const l=n.ZP.div.withConfig({displayName:"BackButton__JunoBackButtonWrapper",componentId:"sc-nka27f-0"})(["background-color:var(--juno-color-white);position:relative;left:0;top:0;padding-top:15px;padding-left:20px;margin-bottom:-15px;","{position:absolute;padding-top:30px;padding-left:30px;background-color:transparent;}"],o.w.md),d=n.ZP.button.withConfig({displayName:"BackButton__JunoBackButton",componentId:"sc-nka27f-1"})(["background-color:transparent;border:none;cursor:pointer;margin:0;text-align:left;padding:0;color:var(--juno-color-pink);font-size:var(--juno-font-size-body-sm);line-height:normal;font-family:var(--juno-font-family-secondary);font-weight:var(--juno-font-weight-bold);","{font-size:var(--juno-font-size-body-md);}&:focus-visible{outline:var(--juno-focus-outline-width) solid var(--juno-color-focus);outline-offset:var(--juno-focus-outline-offset);}display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;"],o.w.md),h=(0,n.ZP)(r.u).withConfig({displayName:"BackButton__BackButtonIcon",componentId:"sc-nka27f-2"})(["width:var(--juno-icon-size-sm);","{width:var(--juno-icon-size-md);}"],o.w.md);const c=function(e){return(0,a.jsx)(l,{children:(0,a.jsxs)(d,{...e,type:"button",children:[(0,a.jsx)(h,{}),"Back"]})})};class p extends i.Component{constructor(e){super(e),this.onStepComplete=e=>{this.setState((t=>{const s={...t,...e},i=this.nextStepDelta(s);return{...e,...i}}))},this.showFirst=e=>(this.setState((t=>({...this.props.initialFlowState,...e,displayIndex:t.initialIndex,maxIndex:t.initialIndex}))),!1),this.showPrevious=()=>(this.setState((e=>this.prevStepDelta(e))),!1),this.showIndex=e=>(this.setState({displayIndex:e}),!1),this.isStepValid=(e,t)=>!e.valid||e.valid(t||this.state),this.nextStepDelta=e=>{let t=e.displayIndex+1,s=this.props.steps[t];for(;!this.isStepValid(s,e);){if(t++,t>=this.props.steps.length)return console.log("reached end of list, aborting"),null;s=this.props.steps[t]}let i=e.maxIndex;return t>e.maxIndex&&(i=t),{displayIndex:t,maxIndex:i}},this.prevStepDelta=e=>{let t=e.displayIndex-1,s=this.props.steps[t];for(;!this.isStepValid(s,e);){if(t--,t<0)return console.log("reached end of list, aborting"),null;s=this.props.steps[t]}return{displayIndex:t}},this.buildNav=()=>{if(!this.props.steps[this.state.displayIndex].terminal)if("prev"===this.props.navMode){if(this.state.displayIndex>0&&this.state.displayIndex>this.state.initialIndex)return(0,a.jsx)(c,{onClick:this.showPrevious,children:"Back"})}else if("breadcrumb"===this.props.navMode){let e=[];for(let t=0;t<=this.state.maxIndex;t++){const s=this.props.steps[t];this.isStepValid(s,this.state)&&e.push({name:s.name,index:t,active:t===this.state.displayIndex})}return(0,a.jsx)("div",{children:(0,a.jsx)("ul",{children:e.map((e=>e.active?(0,a.jsx)("li",{children:e.name},e.index):(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),this.showIndex(e.index)},children:e.name})},e.index)))})})}};let t=0;for(let s=0;s<this.props.steps.length;s++)if(this.props.steps[s].isFirstPage&&this.props.steps[s].isFirstPage(this.props.initialFlowState)){t=s;break}this.state={...this.props.initialFlowState,initialIndex:t,displayIndex:t,maxIndex:t}}render(){const e=this.props.steps[this.state.displayIndex].component(this.state),t={onStepComplete:this.onStepComplete,showPrevious:this.showPrevious,showFirst:this.showFirst,showIndex:this.showIndex},s=i.cloneElement(e,t),n=this.buildNav();return(0,a.jsxs)(a.Fragment,{children:[n,s]})}}const u=p},8784:(e,t,s)=>{s.r(t),s.d(t,{default:()=>T});var i=s(9668),n=s(9006),o=s(8915),r=s(8917),a=s(6153),l=s(8377),d=s(2868),h=s(3147),c=s(429),p=s(3244),u=s(5996),m=s(6446);class g extends i.Component{render(){const e=this.props.flowState.title,t=this.props.flowState.description,s=this.props.flowState.witnessedSignature;if(s){const n="".concat(s.first_name," ").concat(s.last_name,"\u2019s signature");return(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsxs)(r.Z,{title:e,removeTopPadding:!0,headingSize:"1",children:[(0,m.jsxs)("p",{children:["Thanks for witnessing ",n,"."]}),this.props.flowState.smsVerificationRequired&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("p",{children:"We\u2019ll verify your identity by sending you a text message with a 6-digit code."}),(0,m.jsx)("p",{children:"Once you\u2019ve entered the code, you can sign the document."})]}),t&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,u.L)(t)}}),(0,m.jsx)(d.Z,{onClick:()=>this.props.onStepComplete({}),children:"Get started"})]}),(0,m.jsx)(c.Z,{src:p,fullWidth:!0})]})}return(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsxs)(r.Z,{title:e,removeTopPadding:!0,headingSize:"1",children:[(0,m.jsx)("p",{children:"We need you to:"}),(0,m.jsxs)(h.Z,{bullet:!0,children:[this.props.flowState.smsVerificationRequired&&(0,m.jsx)(h.H,{children:"verify your identity (we\u2019ll send you a code by text message)"}),(0,m.jsx)(h.H,{children:"check the document"}),(0,m.jsx)(h.H,{children:"follow the on-screen instructions to sign it"})]}),t&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,u.L)(t)}}),(0,m.jsx)(d.Z,{onClick:()=>this.props.onStepComplete({}),children:"Get started"})]}),(0,m.jsx)(c.Z,{src:p,fullWidth:!0})]})}}const x=g;var f=s(8778);class w extends i.Component{constructor(e){super(e),this.smsCodeSet=e=>{this.setState({smsCode:e})},this.submitSMSCode=e=>{e.preventDefault(),this.handleValidation()&&this.props.onStepComplete({smsCode:this.state.smsCode})},this.state={loading:!0,error:null}}componentDidMount(){this.hasInitiated||(this.hasInitiated=!0,fetch("/api/signature_request/"+this.props.flowState.formRequestId+"/send_sms_code",{method:"POST"}).then((e=>{e.ok?this.setState({loading:!1}):this.setState({error:"Error sending SMS code",loading:!1})}),(()=>{this.setState({error:"Error sending SMS code",loading:!1})}
1)))}handleValidation(){return this.state.smsCode?!!this.state.smsCode.match(/^\d{6}$/)||(this.setState({smsCodeError:"Must be a 6 digit code"}),!1):(this.setState({smsCodeError:"Please enter the code"}),!1)}render(){return this.state.loading?null:this.state.error?(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsx)(r.Z,{title:"Sorry, that didn\u2019t work",removeTopPadding:!0,children:this.state.error})]}):(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsxs)(r.Z,{title:"Enter your 6-digit code from your text message",removeTopPadding:!0,children:[(0,m.jsx)(f.ZP,{name:"sms_code",question:"SMS code",valueEntered:this.smsCodeSet,validationError:this.state.smsCodeError?this.state.smsCodeError:null}),(0,m.jsx)(d.Z,{onClick:this.submitSMSCode,children:"Submit code"})]}),(0,m.jsx)(c.Z,{src:p,fullWidth:!0})]})}}const S=w;var j=s(6128),v=s(7477),y=s.n(v),I=s(4467),k=s(6906);const C=j.ZP.div.withConfig({displayName:"PerformHellosignSignature__HellosignWrapper",componentId:"sc-144su1p-0"})(["min-height:500px;"]),b=j.ZP.div.withConfig({displayName:"PerformHellosignSignature__ImageWrapper",componentId:"sc-144su1p-1"})(["img{display:none;}","{img{display:block;}}"],I.w.md);class Z extends i.Component{constructor(e){super(e),this.state={loading:!0,error:null,signingUrl:null,viewportContent:null}}setViewportForHellosign(){const e=document.getElementById("meta-viewport"),t=e.getAttribute("content");this.setState({viewportContent:t}),e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0")}resetViewportForHellosign(){const e=document.getElementById("meta-viewport");this.state.viewportContent&&e.setAttribute("content",this.state.viewportContent)}componentDidMount(){if(this.hasInitiated)return;this.hasInitiated=!0;let e="/api/signature_request/"+this.props.flowState.formRequestId+"/sign_url";this.props.flowState.smsCode&&(e=e+"?sms_code="+encodeURIComponent(this.props.flowState.smsCode)),fetch(e).then((e=>{if(!e.ok)throw e;return e.json()})).then((e=>{(0,k.D)(),this.setViewportForHellosign(),this.setState({loading:!1,signatureUrl:e.signatureUrl});const t=new(y());t.on("finish",(()=>{this.resetViewportForHellosign(),this.props.onStepComplete()})),t.open(e.signatureUrl,{clientId:window.appConfig.hellosign_client_id,allowCancel:!1})}),(e=>{const t=()=>{this.setState({loading:!1,error:"Failed to load signature details"})};e.json?e.json().then((e=>{"invalid_sms_code"===e.error?this.setState({loading:!1,error:"That code wasn\u2019t right. To get a new code, go back to your email and use the link again."}):t()}),t):t()}))}render(){if(this.state.loading)return null;let e=null;return e=!1===this.state.loading&&this.state.error?(0,m.jsx)(r.Z,{title:"Sorry, that didn\u2019t work",removeTopPadding:!0,children:this.state.error}):(0,m.jsx)(C,{children:(0,m.jsx)("div",{id:"hellosign-mount","data-testid":"hellosign-mount"})}),(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),e,(0,m.jsx)(b,{children:(0,m.jsx)(c.Z,{src:p,fullWidth:!0})})]})}}const _=Z;var P=s(3873);class F extends i.Component{constructor(e){super(e),this.state={loading:!0,error:null}}componentDidMount(){this.hasInitiated||(this.hasInitiated=!0,fetch("/api/signature_request/"+this.props.flowState.formRequestId+"/complete",{method:"POST"}).then((e=>{e.ok?this.setState({loading:!1}):this.setState({error:"Unable to process your signature",loading:!1})}),(()=>{this.setState({error:"Unable to process your signature",loading:!1})})))}render(){if(this.state.loading)return null;if(this.state.error)return(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsx)(r.Z,{title:"Sorry, that didn\u2019t work",removeTopPadding:!0,children:this.state.error})]});const e=this.props.flowState.witnessSignature,t=this.props.flowState.witnessedSignature;let s="That\u2019s it, thanks!";return t&&(s="Thanks for witnessing ".concat(t.first_name," ").concat(t.last_name,"\u2019s signature")),(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsxs)(r.Z,{title:s,removeTopPadding:!0,children:[!!e&&(0,m.jsxs)("p",{children:["The document is ready for ",e.first_name," ",e.last_name," to complete too - please tell them to follow the instructions we\u2019ve sent them by email."]}),(0,m.jsx)("p",{children:"Once everyone\u2019s signed the document, we\u2019ll send you a copy."}),(0,m.jsx)("p",{children:"If we need anything else, we\u2019ll let you know."}),this.props.fromDashboard&&(0,m.jsx)(d.Z,{to:"/dashboard",as:P.rU,children:"Take me back to my dashboard"})]}),(0,m.jsx)(c.Z,{src:p,fullWidth:!0})]})}}const q=F,T=e=>{const t=(0,n.TH)(),{fromDashboard:s}=t.state||{},{requestId:d}=(0,n.UO)(),[h,c]=(0,i.useState)({loading:!0,error:null,title:null,requestDetails:null}),p=(0,i.useRef)(!1);return(0,i.useEffect)((()=>{p.current||(p.current=!0,fetch("/api/esignature/"+d).then((e=>e.json())).then((e=>{e.isValid?c({loading:!1,title:e.title||"Please sign this document",description:e.description,requestDetails:e.config}):"expired"===e.error?c({loading:!1,error:"This request has expired"}):"submitted"===e.error?c({loading:!1,error:"It looks like you've already signed this document"}):c({loading:!1,error:"Failed to load request details"})}),(e=>{console.error("Failed to load e-signature request",e),c({loading:!1,error:"Failed to load request details"})})))}),[d]),h.loading?null:h.error?(0,m.jsxs)(o.Z,{children:[(0,m.jsx)(a.Z,{}),(0,m.jsx)(r.Z,{title:"Sorry, that didn't work",removeTopPadding:!0,children:h.error})]}):(0,m.jsx)(o.Z,{children:(0,m.jsx)(l.Z,{initialFlowState:{formRequestId:d,title:h.title,de
1scription:h.description,smsVerificationRequired:h.requestDetails.sms_verification_required,witnessSignature:h.requestDetails.witness_signature,witnessedSignature:h.requestDetails.witnessed_signature,fromDashboard:s},steps:[{name:"Intro",component:e=>(0,m.jsx)(x,{flowState:e})},{name:"Verify SMS code",component:e=>(0,m.jsx)(S,{flowState:e}),valid:e=>e.smsVerificationRequired},{name:"Perform identity check",component:e=>(0,m.jsx)(_,{flowState:e})},{name:"Thanks",component:e=>(0,m.jsx)(q,{flowState:e,fromDashboard:e.fromDashboard}),terminal:!0}]})})}}}]); 2//# sourceMappingURL=784.9985a421.chunk.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.