1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8973],{88612:function(e){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getClientBySlug"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientBySlugV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:114}};n.loc.source={body:"query getClientBySlug($slug: ID!) {\n clientBySlugV2(slug: $slug) {\n id\n user {\n firstName\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function i(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach(function(e){if(e.name){var n=new Set;(function e(n,t){if("FragmentSpread"===n.kind)t.add(n.name.value);else if("VariableDefinition"===n.kind){var i=n.type;"NamedType"===i.kind&&t.add(i.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,t)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,t)}),n.definitions&&n.definitions.forEach(function(n){e(n,t)})})(e,n),t[e.name.value]=n}}),e.exports=n,e.exports.getClientBySlug=function(e,n){var r={kind:e.kind,definitions:[i(e,n)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var u=t[n]||new Set,s=new Set,a=new Set;for(u.forEach(function(e){a.add(e)});a.size>0;){var c=a;a=new Set,c.forEach(function(e){s.has(e)||(s.add(e),(t[e]||new Set).forEach(function(e){a.add(e)}))})}return s.forEach(function(n){var t=i(e,n);t&&r.definitions.push(t)}),r}(n,"getClientBySlug")},33436:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/client-sign-up",function(){return t(65098)}])},8609:function(e,n,t){"use strict";var i=t(78685),r=t(18740),u=t(5176),s=t(60615),a=t(13946),c=(0,i.Z)(function(e){return(0,r.Z)((0,a.Z)(u.Z,0,(0,s.Z)("length",e)),function(){for(var n=0,t=e.length;n<t;){if(!e[n].apply(this,arguments))return!1;n+=1}return!0})});n.Z=c},56697:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var i=t(65957),r=t(16436),u=t(30768),s=t(69358),a=t(43208),c=t(87397),o=function(e){var n={"@@transducer/init":c.Z.init,"@@transducer/result":function(n){return e["@@transducer/result"](n)},"@@transducer/step":function(n,t){var i=e["@@transducer/step"](n,t);return i["@@transducer/reduced"]?{"@@transducer/value":i,"@@transducer/reduced":!0}:i}};return{"@@transducer/init":c.Z.init,"@@transducer/result":function(e){return n["@@transducer/result"](e)},"@@transducer/step":function(e,t){return(0,s.Z)(t)?(0,a.Z)(n,e,t):(0,a.Z)(n,e,[t])}}},l=t(71689),d=(0,i.Z)(function(e,n){return(0,l.Z)(e,o(n))}),f=(0,i.Z)((0,r.Z)(["fantasy-land/chain","chain"],d,function(e,n){return"function"==typeof n?function(t){return e(n(t))(t)}:(0,u.Z)(!1)((0,l.Z)(e,n))}))},66698:function(e,n,t){"use strict";var i=t(99627),r=(0,t(65957).Z)(i.Z);n.Z=r},77631:function(e,n,t){"use strict";var i=t(65957),r=t(72322),u=(0,i.Z)(function(e,n){for(var t=[],i=0,u=e.length,s=n.length,a=new r.Z,c=0;c<s;c+=1)a.add(n[c]);for(;i<u;)a.add(e[i])&&(t[t.length]=e[i]),i+=1;return t});n.Z=u},17094:function(e,n,t){"use strict";var i=t(78685),r=t(18740),u=(0,i.Z)(function(e){return(0,r.Z)(e.length,function(n,t){var i=Array.prototype.slice.call(arguments,0);return i[0]=t,i[1]=n,e.apply(this,i)})});n.Z=u},65098:function(e,n,t){"use strict";t.r(n),t.d(n,{INSURANCE_COVERED_SURVEY_ID:function(){return ei},KICKOFF_FREE_SURVEY_ID:function(){return ee},SURVEY_ID_INTER:function(){return z},SURVEY_ID_SKIP_COACH:function(){return J},SURVEY_ID_V1:function(){return $},SURVEY_ID_V2:function(){return W},SURVEY_ID_V3:function(){return X},SURVEY_ID_V4:function(){return et},SURVEY_ID_WEIGHT_LOSS:function(){return en}});var i,r=t(30137),u=t(76341),s=t(67462),a=t(93128),c=t(97582),o=t(85893),l=t(20726),d=t.n(l),f=t(26836),v=t
1(44603),m=t(50194),p=t(30470),Z=t(37977),I=t(26203),g=t(51436),_=t(78947),y=t(60248),S=t(47915),h=t(43783),E=t(39737),k=t(89007),C=t(89613),N=t(79799),P=t(82572),V=t(29254),b=t(79930),D=t.n(b),U=t(88612),R=t(15889),q=t(10504),x=t(81021),w=t(72568),B=t(83397),O=t(12390),T=t(16401),F=t(62286),A=t(67502),L=t(73568),Q=t(55801),Y=t(23897),j=t(47136),G=t(63953),H=t(53103),M=t(18637),K=t(13664);_.vI.add(I.NBC,g.A35);var $=7,W=8,X=9,z=12,J=15,ee=23,en=45,et=13,ei=48,er=function(e){var n=e.survey,t=e.signUpVariant,i=e.coachProfileVariant,r=e.clientId,u=e.user,s=e.query,a=e.banner,c=e.clientFirstName,l=e.experimentKitData,v=e.leadId;return(0,w.Xk)(l),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.Z.Provider,{value:s,children:(0,o.jsx)(Y.t,{children:(0,o.jsx)(Z.Z,{noIndex:!0,title:P.PH[f.Z("questionId",s)],children:(0,o.jsx)(R.Z,{referrer:{clientFirstName:c},children:(0,o.jsx)(S.Z,{shouldIdentifyUser:!1,children:(0,o.jsx)(K.Z,{children:(0,o.jsx)(N.Z,{survey:n,signUpVariant:t,coachProfileVariant:i,clientId:r,user:u,banner:a,leadId:v})})})})})})}),V.fC,(0,o.jsx)(d(),{id:"36eb46aa3261f965",dynamic:[D().SILVER],children:"body{overflow:hidden;background-color:".concat(D().SILVER,"}")})]})};er.getInitialProps=(0,k.Z)((i=(0,r._)(function(e){var n,t,i,r,o,l,d,f,p,Z,I,g,_,y,S,k,N,V,b,D,R,w,Y,K,$,W,et,er,eu,es,ea,ec,eo,el,ed,ef,ev,em,ep,eZ,eI,eg,e_,ey,eS,eh,eE,ek,eC,eN;return(0,c.Jh)(this,function(c){switch(c.label){case 0:if(n=e.apolloClient,t=e.ctx,r=(i=e.ctx).query,l=(o=i.query).slug,d=o.clientId,f=o.insuranceCovered,p=o.surveyId,Z=e.currentUserPayload.data.me,N=(0,Q.Iu)(r.ref),V=v.Z(["user","client"],Z),D=(b=(0,a._)(((null==V?void 0:V.isGuestPass)?null==V?void 0:null===(I=V.source)||void 0===I?void 0:I.split("_"):null==N?void 0:N.split("_"))||[],3))[0],R=b[2],w=null==N?void 0:N.includes("app guest"),!("gp"===D&&R))return[3,2];return[4,n.query({query:U.getClientBySlug,variables:{slug:R},fetchPolicy:"cache-first"})];case 1:K=c.sent(),Y=m.Z(void 0,["data","clientBySlug","user","firstName"],K),c.label=2;case 2:if($=v.Z(["user","client","id"],Z),W=m.Z(!1,["user","coach","isAdmin"],Z)&&!!d,et=!!$,er=d||$,eu=v.Z(["user","client","lead","id"],Z),es=(null==Z?void 0:null===(g=Z.user)||void 0===g?void 0:g.client)&&(null==Z?void 0:null===(y=Z.user)||void 0===y?void 0:null===(_=y.client)||void 0===_?void 0:_.isInsuranceClient)===!1,!((!er||es&&f)&&!W&&!(0,M.Q0)(null===(S=t.req)||void 0===S?void 0:S.headers["user-agent"])))return[3,6];c.label=3;case 3:return c.trys.push([3,5,,6]),ec=null===(ea=t.req)||void 0===ea?void 0:ea.headers.referer,eo=(0,A.fS)((0,F.parseCookies)(t)),[4,n.mutate({mutation:j.submitClientSignUpSurvey,variables:{ref:N,gclid:(0,Q.Iu)(r.gclid)||eo.gclid,msclkid:(0,Q.Iu)(r.msclkid)||eo.msclkid,fbclid:(0,Q.Iu)(r.fbclid)||eo.fbclid,ttclid:(0,Q.Iu)(r.ttclid)||eo.ttclid,couponCode:(0,Q.Iu)(r.couponCode),utmCampaignId:(0,Q.Iu)(r.utm_campaign_id)||eo.utm_campaign_id,utmCampaign:(0,Q.Iu)(r.utm_campaign)||eo.utm_campaign,utmContent:(0,Q.Iu)(r.utm_content)||eo.utm_content,utmMedium:(0,Q.Iu)(r.utm_medium)||eo.utm_medium,utmSource:(0,Q.Iu)(r.utm_source)||eo.utm_source,utmTerm:(0,Q.Iu)(r.utm_term)||eo.utm_term,landingPageUrl:ec,utcOffset:-1*new Date().getTimezoneOffset(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,responses:[],isInsuranceClient:!!f}})];case 4:return ed=(el=c.sent().data.submitClientSignUpSurvey).sessionToken,ef=el.paymentToken,ev=el.clientId,em=el.leadId,er=ev,eu=em,t.res.setHeader("Set-Cookie",["".concat(G.I,"=").concat(ed,"; Path=/; Max-Age=").concat(30*H.x4),"".concat(G.R,"=").concat(ef,"; Path=/; Max-Age=").concat(30*H.x4)]),[3,6];case 5:return console.error("Failed to create client:",c.sent()),[3,6];case 6:return!W&&et&&er&&$!==er&&(0,h.Z)(E.ZP.clientSignUp().as,t),(null===(k=Z.user)||void 0===k?void 0:k.coach)&&!er&&(0,h.Z)(E.ZP.signOut({redirectUrl:t.asPath}),t),[4,(0,x.C)(t,{url:t.asPath,attributes:{projectId:q.ZP.WEB,url:t.asPath},disabledExperiments:w?[]:["coachSkip"],user:Z.user,devMode:!1})];case 7:return eZ=(ep=c.sent()).ek,eI=ep.data,eg=eZ.split("coachSkip"),e_=eZ.split("sufInter"),eZ.split("55plus"),[4,C.Z.getEntries({content_type:"landingPage","fields.slug[in]":"_reskin",include:10,select:["fields.sections"]})];case 8:return ey=c.sent().items[0].fields.sections.find(function(e){return"Banner"===e.fields.component}),[4,C.Z.getEntries({content_type:"survey","fields.id[in]":p||(f?ei:w&&"B"===eg?J:l===L.$?ee:l===P.we||l===P.tt||l===P.o$?en:"B"===e_?z:X),include:10})];case 9:return eS=c.sent(),eh=v.Z(["items",0,"fields","sections",0,"fields","questions",0,"fields","i
1d"],eS),ek=(null==(eE=m.Z(null,["user","client","latestClientEligibilityStatus"],Z))?void 0:eE.currentStep)==="POLICY_PENDING"||(null==eE?void 0:eE.currentStep)==="SERVICE_ELIGIBILITY_PENDING",eC=(0,B.s)({userSurveyQuestionResponses:m.Z([],["user","client","cmsSurveyQuestionResponses"],Z||{}),contentfulSurveyQuestions:eS&&eS.items?eS.items[0]:[],specialQuestionsIds:"gp"===D&&R?[]:[P.U8.SAME_COACH],useLastQuestionId:w&&"B"===eg,isInsuranceClient:!!f&&!ek}),eN=v.Z(["user","client","selectedCoach","id"],Z),w&&"B"===eg&&"matches"===r.questionId&&(0,h.Z)(E.ZP.clientSignUp((0,s._)((0,u._)({},r),{questionId:eC,ref:N})).as,t),"reengage"!==N||r.questionId||219!==eC||eN||(0,h.Z)(E.ZP.homePage().as,t),!r.questionId&&eC!==eh&&(eN||eC)&&(0,h.Z)(E.ZP.clientSignUp((0,s._)((0,u._)({},r),{questionId:eN?O.s0:eC,paymentToken:eN?(0,T.W)(t):void 0})).as,t),((null==eE?void 0:eE.currentStep)==="POLICY_INVALID"||(null==eE?void 0:eE.currentStep)==="PROVIDER_ELIGIBILITY_ELIGIBLE")&&"schedule"!==r.redirect&&"merge-clients"!==r.redirect&&r.token&&(0,h.Z)(E.ZP.clientSignUp((0,s._)((0,u._)({},r),{questionId:"insurance-coverage",redirect:"schedule"})).as,t),[2,{clientId:er,user:Z.user,survey:eS.items[0],query:r,banner:ey,clientFirstName:Y,experimentKitData:eI,leadId:eu}]}})}),function(e){return i.apply(this,arguments)})),n.default=(0,p.C)(er)},83397:function(e,n,t){"use strict";t.d(n,{s:function(){return E}});var i=t(53353),r=t(91642),u=t(17094),s=t(66698),a=t(86177),c=t(74178),o=t(77631),l=t(57903),d=t(56697),f=t(8609),v=t(17113),m=t(31885),p=t(7778),Z=t(5782),I=t(32791),g=t(71689),_=t(44603),y=t(43973),S=t(65275),h=t(82572),E=function(e){var n=e.userSurveyQuestionResponses,t=e.contentfulSurveyQuestions,l=e.specialQuestionsIds,d=void 0===l?[]:l,f=e.useLastQuestionId,v=e.surveyType;try{var m=k(void 0===n?[]:n),p=C(void 0===t?[]:t),Z=N(p,m,d.map(function(e){return parseInt(e,10)})),I=r.Z(u.Z(s.Z)(Z),(0,i._)(m).concat((0,i._)(d)));return a.Z(void 0!==f&&f?Z[Z.length-1]:"client"===(void 0===v?"client":v)?"matches":"marketplace-survey",c.Z(o.Z(Z,I)))}catch(e){return S.Z.notify(Error("Failed to fetch next questionId: ".concat(e))),null}},k=function(e){return l.Z(d.Z(function(e){return f.Z([v.Z("surveyQuestionId","219"),v.Z("surveyQuestionResponseId","4")])(e)?[e.surveyQuestionId]:[e.surveyQuestionId,h.U8.EVENT]}),m.Z(p.Z),Z.Z,I.Z,g.Z(parseInt))(e)},C=function(e){var n=Array.isArray(e)?e[0]:e;return n?l.Z(_.Z(["fields","sections"]),P,g.Z(_.Z(["fields","questions"])),V,m.Z(p.Z),Z.Z,g.Z(function(e){return{id:_.Z(["fields","id"],e),type:_.Z(["fields","type"],e)}}))(n):[]},N=function(e,n,t){var r=new Set((0,i._)(n).concat((0,i._)(t)));return e.map(function(n,t){return"freeFormSkip"!==n.type?n.id:e.slice(t+1).some(function(e){var n=e.id;return n!==h.U8.EVENT&&n!==h.U8.SAME_COACH&&r.has(n)})?null:n.id}).filter(function(e){return null!==e})},P=function(e){return!e||y.Z(e)?(S.Z.notify(Error("survey sections mapped to null or undefined")),[]):e},V=function(e){return!e||y.Z(e)?(S.Z.notify(Error("survey questions mapped to null or undefined")),[]):e}}},function(e){e.O(0,[9468,8523,2315,6664,1601,8051,296,5880,4853,8407,6025,984,546,7362,7844,8909,5675,945,2279,5121,5026,882,1182,8310,7536,6449,5351,6606,4551,8510,6024,2201,2964,9405,1137,3520,4658,9464,4765,344,7209,6483,453,6736,2888,9774,179],function(){return e(e.s=33436)}),_N_E=e.O()}]); 2//# sourceMappingURL=client-sign-up-51c7aec69c0a15e7.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.