_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[53,83],{"4oQp":function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r("cpVT"),i=r("pZLH"),a=r("zfCl"),o=r("7lAM");function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={kind:"Document",definitions:function(e){var t={};return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var r=e.name.value;return!t[r]&&(t[r]=!0,!0)}))}([{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateCurrentUserMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NamedType",name:{kind:"Name",value:"UserInput"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCurrentUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"CurrentUser"},directives:[]}]}}]}}].concat(a.a.definitions)),loc:{start:0,end:149,source:{body:"\n  \n  mutation updateCurrentUserMutation($input: UserInput) {\n    updateCurrentUser(input: $input) {\n      __typename\n      ...CurrentUser\n    }\n  }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},l=function(e){return Object(i.a)(d,s(s({},e),{},{update:function(e,t){var r=t.data;if(r){var n=r.updateCurrentUser,i=e.readQuery({query:o.a});i&&e.writeQuery({query:o.a,data:s(s({},i),{},{currentUser:i.currentUser?s(s({},i.currentUser),n):n})})}}}))}},IsQD:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/onboarding",function(){return r("tOeG")}])},MwRc:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r("hG6G");function i(e){var t=Object(n.b)(e).data;if(!t||!t.system)throw new Error("System not found");return t.system}},XL4X:function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return P}));var n=r("nKUr"),i=r("cpVT"),a=r("q1tI"),o=r("CmqY"),c=r("8PNI"),s=r("ATyU"),d=r("bgFo"),l=r("B+GD"),u=r("dhJC");function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){var t=e.currentStepIndex,r=e.numberOfSteps,i=Object(u.a)(e,["currentStepIndex","numberOfSteps"]);if(r<=1)return null;var a=Array.from(Array(r).keys());return Object(n.jsx)(d.t,j(j({justifyContent:"center","aria-label":"Step ".concat(t+1," of ").concat(r)},i),{},{children:a.map((function(e){var r=t>=e;return Object(n.jsx)(d.e,{size:{_:"8px",lg:"10px"},bg:r?"primaryIcon":"neutral.4",borderRadius:1e3,m:1},e)}))}))}var p=r("vOnD"),O=r("Y5dS"),h=r("kriW"),f=Object(p.f)(d.c).withConfig({displayName:"BackButton___StyledAnchorButton",componentId:"u7t54j-0"})(["line-height:1;background:none;border:none;"]);function g(e){var t=e.variant,r=e.onClick,i=e.disabled,a=e.iconSize,c=Object(o.a)();return Object(n.jsx)(s.a.div,{animate:t,variants:{visible:{opacity:1,y:0},hidden:{opacity:0,y:c?0:-100}},initial:"hidden",style:{position:"absolute",left:0,top:0},children:Object(n.jsx)(f,{onClick:r,textDecoration:"none",disabled:i,color:"link",p:0,m:0,mute:i,typoStyle:"xxs",children:Object(n.jsxs)(d.t,{as:"span",justifyContent:"center",alignItems:"center",children:[Object(n.jsx)(O.a,{size:a,color:"primaryIcon"}),Object(n.jsx)(d.C,{xs:!0,sm:!0,srOnly:!0,children:Object(n.jsx)(h.a,{id:"WizardLayout.back",defaultMessage:"Back"})})]})})})}var v=r("fCU7");function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(){}var k=Object(a.createContext)({goNext:x,goPrev:x,state:{isLast:!1,isFirst:!1,finished:!1}}),S={enter:function(e){var t,r=e.direction;return e.shouldReduceMotion||(t=r>0?1e3:-1e3),{x:t,opacity:0}},center:{zIndex:1,x:0,opacity:1},exit:function(e){var t,r=e.direction;return e.shouldReduceMotion||(t=r<0?1e3:-1e3),{x:t,zIndex:0,opacity:0}}};function w(){var e=a.useContext(k);if(void 0===e)throw new Error("useWizardState must be used within a Wizard");return e}function P(e){var t=e.stepIndex,r=e.stepCount,u=e.onStepChange,b=e.children,j=e.showBackOnFirst,p=void 0!==j&&j,O=Object(v.a)(t),h=Object(o.a)(),f=r-1,x=t>(O||-1)?1:-1,w=Object(a.useCallback)((function(e){return{finished:e>f,isLast:e===f,isFirst:0===e}}),[t]);function P(e){var t,r,n,a=w(e);u(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({nextStepIndex:(t=0,r=f,n=e,Math.max(t,Math.min(r,n)))},a))}var C=Object(a.useCallback)((function(){P(t+1)}),[t]),_=Object(a.useCallback)((function(){P(t-1)}),[t]),M=w(t),E={_:"24px",lg:"32px"};return Object(n.jsx)(k.Provider,{value:{state:M,goNext:C,goPrev:_},children:Object(n.jsxs)(d.t,{minHeight:"100vh",position:"relative",flexDirection:"column",overflow:"hidden",children:[Object(n.jsxs)(d.t,{justifyContent:"center",alignItems:"center",m:"xs",position:"relative",height:E,children:[Object(n.jsx)(g,{variant:!p&&M.isFirst?"hidden":"visible",iconSize:E,onClick:function(){window.history.back()}}),Object(n.jsx)(d.e,{flex:1,children:Object(n.jsx)(m,{numberOfSteps:r,currentStepIndex:t})})]}),Object(n.jsx)(d.t,{width:"100vw",height:"100vh",position:"relative",alignItems:"center",justifyContent:"center",flex:1,mx:"auto",children:Object(n.jsx)(c.a,{initial:!1,custom:{shouldReduceMotion:h,direction:x},exitBeforeEnter:!1,children:Object(n.jsx)(s.a.div,{"data-testid":"WizardStep",custom:{shouldReduceMotion:h,direction:x},variants:S,initial:"enter",animate:"center",exit:"exit",style:{position:"absolute",maxWidth:"100vw"},transition:{x:{type:"spring",stiffness:300,damping:40},opacity:{duration:.2}},children:Object(n.jsx)(l.a,{width:1,px:"xs",children:b})},t)})})]})})}},Y5dS:function(e,t,r){"use strict";var n=r("k54j"),i=r("q1tI"),a=r.n(i),o=r("ReSq");t.a=function(e){var t=e.size,r=void 0===t?24:t,i=Object(n.c)(e,["size"]);return a.a.createElement(o.a,Object(n.a)({fill:"currentColor",viewBox:"0 0 24 24",size:r},i),a.a.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.882 2.415a1.333 1.333 0 01-.048 1.885L8.624 12l8.21 7.7a1.333 1.333 0 11-1.837 1.933L4.751 12l10.246-9.633a1.333 1.333 0 011.885.048z",clipRule:"evenodd"}))}},YTra:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r("/Tr7"),i=r("jIYg");function a(e,t){Object(i.a)(2,arguments);var r=t||{},a=Object(n.a)(e).getTime(),o=Object(n.a)(r.start).getTime(),c=Object(n.a)(r.end).getTime();if(!(o<=c))throw new RangeError("Invalid interval");return a>=o&&a<=c}},epvp:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r("z0dQ"),i=r("hG6G"),a=r("YTra");function o(e,t,r){var o,c,s,d=Object(i.b)(),l=null===d||void 0===d||null===(o=d.data)||void 0===o?void 0:o.system,u=Object(n.a)({skip:!e}),b=(null===u||void 0===u||null===(c=u.data)||void 0===c||null===(s=c.requiredUserInputFields)||void 0===s?void 0:s.email)||!1,j=d.loading||u.loading,m=d.error||u.error;return!j&&l&&e?("bergen-city-bike"===l.id&&(b=!!(!e.email&&e.currentSubscription&&e.currentSubscription.createdAt&&e.currentSubscription.product&&0===e.currentSubscription.product.price&&Object(a.a)(new Date(e.currentSubscription.createdAt),{start:new Date(2020,5,12),end:new Date(2020,5,23)}))),{steps:[{id:"agreedToTerms",required:!0},{id:"paymentMethod",required:!1},{id:"name",required:!1},{id:"birthYear",required:!1},{id:"gender",required:!1},{id:"postalCode",required:!1},{id:"email",required:!1},{id:"obos",required:!1}].reduce((function(t,r){if("obos"===r.id&&"obos"!==l.sponsor)return t;if("email"===r.id&&b)r.required=!0;else if("paymentMethod"===r.id){var n,i;(e.requiresAddingPaymentCard||"Card"===(null===(n=e.paymentMethod)||void 0===n?void 0:n.__typename)&&null!==(i=e.paymentMethod)&&void 0!==i&&i.expired)&&(r.required=!0)}return t.push(r),t}),[]).filter((function(n){if(null!==r&&void 0!==r&&r.includes(n.id))return!0;var i,a,o=!1;"paymentMethod"===n.id?(o=Boolean(e.requiresAddingPaymentCard),e.currentSubscription&&"Card"===(null===(i=e.paymentMethod)||void 0===i?void 0:i.__typename)&&null!==(a=e.paymentMethod)&&void 0!==a&&a.expired&&(o=!0)):o="email"===n.id&&(null===e.agreedToReceiveEmail||null===e.agreedToReceiveExternalPromotions)||!e[n.id];return t?o&&n.required:o})),loading:j,error:m}):{loading:j,error:m}}function c(e,t,r){var n=o(e,t,r);return{loading:n.loading,userRequiresOnboarding:!!(n.steps&&n.steps.length>0)}}},j9Cu:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"e",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"g",(function(){return s})),r.d(t,"b",(function(){return d})),r.d(t,"f",(function(){return l}));var n=r("7++0"),i=Object(n.e)({personalInformation:{id:"Onboarding.personalInformation",defaultMessage:"Our privacy policy"},skip:{id:"Onboarding.skip",defaultMessage:"Skip step"}}),a=Object(n.e)({heading:{id:"Onboarding.NameForm.heading",defaultMessage:"What is your name?"},label:{id:"Onboarding.NameForm.label",defaultMessage:"First name"},description:{id:"Onboarding.NameForm.description",defaultMessage:"This lets us know who we are talking to when we communicate with you. This is optional."}}),o=Object(n.e)({heading:{id:"Onboarding.BirthYearForm.heading",defaultMessage:"Your year of birth"},description:{id:"Onboarding.BirthYearForm.description",defaultMessage:"Your age helps us understand who are using the service, and why. This is optional."}}),c=Object(n.e)({heading:{id:"Onboarding.GenderForm.heading",defaultMessage:"I'm a"},description:{id:"Onboarding.GenderForm.description",defaultMessage:"Your gender helps us understand who are using the service, and why. This is optional."}}),s=Object(n.e)({heading:{id:"Onboarding.PostalCodeForm.heading",defaultMessage:"What is your postal code?"},label:{id:"postal_code",defaultMessage:"Postal code"},description:{id:"Onboarding.PostalCodeForm.description",defaultMessage:"Your location helps us understand who are using the service, and why. This is optional."}}),d=Object(n.e)({heading:{id:"Onboarding.EmailForm.heading",defaultMessage:"Stay updated by e-mail"},label:{id:"Onboarding.EmailForm.label",defaultMessage:"Your e-mail"},description:{id:"Onboarding.EmailForm.description",defaultMessage:"Enter your email to get receipts."},emailNotRequired:{id:"Onboarding.EmailForm.emailNotRequired",defaultMessage:"You can unsubscribe whenever you want."},emailRequired:{id:"Onboarding.EmailForm.emailRequired",defaultMessage:"A valid email is required."},required:{id:"Onboarding.EmailForm.required",defaultMessage:"Please enter a valid email address."}}),l=Object(n.e)({noObos:{id:"Onboarding.ObosStep.noObos",defaultMessage:"We did not find your phone number at OBOS. You can add it on {obosLink}"}})},n9xi:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return a}));var n=r("+TN3"),i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"onboardingQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buyProductPage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"termsOfConditionItems"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"_key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:149,source:{body:"\n  query onboardingQuery {\n    buyProductPage {\n      termsOfConditionItems {\n        _key\n        title\n        body\n        type\n      }\n    }\n  }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},a=function(e){return Object(n.b)(i,e)}},tOeG:function(e,t,r){"use strict";r.r(t);var n=r("nKUr"),i=r("cpVT"),a=r("7++0"),o=r("dDsW"),c=r("dhJC"),s=r("q1tI"),d=r.n(s),l=r("kriW"),u=r("j9Cu"),b=r("xvhg"),j=r("KYPV"),m=r("bgFo"),p=r("j/2v"),O=r("CmqY"),h=r("8PNI"),f=r("ATyU"),g=r("vOnD"),v=r("k54j"),y=r("ReSq"),x=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 24 24",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M12 0C5.39 0 0 5.39 0 12s5.39 12 12 12 12-5.39 12-12S18.61 0 12 0zm6.703 12.703l-3.984 3.985a1.034 1.034 0 01-.703.28c-.235 0-.516-.093-.704-.28a1.02 1.02 0 010-1.407l2.297-2.297H6.047A.99.99 0 015.063 12c0-.516.468-.984.984-.984h9.562l-2.296-2.297a1.02 1.02 0 010-1.406 1.02 1.02 0 011.406 0l3.984 3.984a1.02 1.02 0 010 1.406z"}))},k=r("auP5");function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e){var t=e.state,r={size:"".concat(28,"px"),color:"primaryIcon"},i="loading"===t,a=Object(O.a)();return Object(n.jsxs)(h.a,{children:[!i&&Object(n.jsx)(f.a.div,{initial:{x:a?void 0:100},animate:{x:0},exit:{x:a?void 0:100,opacity:a?0:void 0},style:{position:"absolute"},transition:{ease:"easeOut",duration:.3},children:Object(n.jsx)(x,w(w({},r),{},{display:"block"}))},"arrow"),i&&Object(n.jsx)(f.a.div,{style:{position:"absolute"},initial:{x:a?void 0:-100},animate:{x:0},exit:{x:a?void 0:-100,opacity:a?0:void 0},transition:{ease:"easeOut",duration:.3},children:Object(n.jsx)(k.O,{display:"block"})},"loading")]})}var C=Object(g.f)(k.u).withConfig({displayName:"InputInlineButton__IconButton",componentId:"v5e5s6-0"})(["background:none;user-select:none;outline:0;display:flex;align-items:center;justify-content:center;height:","px;width:","px;overflow:hidden;border:0;position:absolute;top:50%;right:1em;transform:translateY(-50%);&:hover,&:focus{cursor:pointer;color:",";}"],28,28,(function(e){return e.theme.colors.primaryDark}));function _(e){var t=e.inputProps,r=e.buttonProps,i=e.state;return Object(n.jsxs)(k.f,{position:"relative",children:[Object(n.jsx)(k.E,w({pr:"".concat(28,"px"),bg:"neutral.2",borderColor:"transparent"},t)),Object(n.jsx)(C,w(w({as:"button",color:"primaryIcon",p:0,disabled:"loading"===i},r),{},{children:Object(n.jsx)(P,{state:i})}))]})}var M=r("Nd01"),E=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 68 68",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M53.1 12.8H14.9c-4.7 0-8.5 3.8-8.5 8.5v21.3c0 4.7 3.8 8.5 8.5 8.5h25.5l9.1 9.1c1.3 1.3 3.6.4 3.6-1.5V51c4.7 0 8.5-3.8 8.5-8.5V21.3c.1-4.7-3.8-8.5-8.5-8.5zm-34 23.3c-2.3 0-4.3-1.9-4.3-4.3 0-2.3 1.9-4.3 4.3-4.3 2.3 0 4.3 1.9 4.3 4.3s-1.9 4.3-4.3 4.3zm14.9 0c-2.3 0-4.3-1.9-4.3-4.3 0-2.3 1.9-4.3 4.3-4.3 2.3 0 4.3 1.9 4.3 4.3s-1.9 4.3-4.3 4.3zm14.9 0c-2.3 0-4.3-1.9-4.3-4.3 0-2.3 1.9-4.3 4.3-4.3 2.3 0 4.3 1.9 4.3 4.3-.1 2.4-2 4.3-4.3 4.3z"}))},z=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 69 69",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M51.68 12.81H51v8.46a6.38 6.38 0 11-12.76 0v-8.46h-8.5v8.46a6.38 6.38 0 11-12.76 0v-8.46h-.65c-4.34 0-7.85 3.81-7.85 8.5v31.85c0 4.7 3.51 8.5 7.85 8.5h35.35c4.34 0 7.85-3.81 7.85-8.5V21.31c0-4.69-3.53-8.5-7.85-8.5zM22.32 51a3.19 3.19 0 110-6.38 3.19 3.19 0 010 6.38zm0-11.69a3.19 3.19 0 113.19-3.19 3.19 3.19 0 01-3.19 3.22v-.03zM34 51a3.19 3.19 0 110-6.38A3.19 3.19 0 0134 51zm0-11.69a3.19 3.19 0 113.19-3.19A3.19 3.19 0 0134 39.34v-.03zM45.71 51a3.19 3.19 0 110-6.38 3.19 3.19 0 010 6.38zm0-11.69a3.19 3.19 0 113.19-3.19 3.19 3.19 0 01-3.19 3.22v-.03z"}),d.a.createElement("path",{fill:"currentColor",d:"M23.39 23.4a2.13 2.13 0 002.13-2.13V8.51a2.13 2.13 0 00-4.25 0v12.76a2.13 2.13 0 002.12 2.13zM44.65 23.4a2.13 2.13 0 002.13-2.13V8.51a2.129 2.129 0 10-4.25 0v12.76a2.13 2.13 0 002.12 2.13z"}))},N=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 68 68",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M34 34a8.5 8.5 0 100-17 8.5 8.5 0 000 17z"}),d.a.createElement("path",{fill:"currentColor",d:"M34 12.8c11.7 0 21.3 9.5 21.3 21.3 0 11.7-9.5 21.3-21.3 21.3S12.8 45.7 12.8 34 22.3 12.8 34 12.8zm0-4.3C19.9 8.5 8.5 19.9 8.5 34S19.9 59.5 34 59.5 59.5 48.1 59.5 34 48.1 8.5 34 8.5z"}),d.a.createElement("path",{fill:"currentColor",d:"M34 38.3c-7.9 0-14.6 5.4-16.5 12.8L34 58.3 50.5 51c-1.9-7.3-8.6-12.7-16.5-12.7z"}))},T=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 68 68",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M55.3 41.3v16.1c0 2.3-1.9 4.3-4.3 4.3h-8.5c-1.2 0-2.1-1-2.1-2.1V46.8c0-3.5-2.9-6.4-6.4-6.4-3.5 0-6.4 2.9-6.4 6.4v12.8c0 1.2-1 2.1-2.1 2.1H17c-2.3 0-4.3-1.9-4.3-4.3V41.2c0-.6.2-1.1.6-1.5l19.1-19.1c.8-.8 2.2-.8 3 0l19.1 19.2c.6.4.8.9.8 1.5z"}),d.a.createElement("path",{fill:"currentColor",d:"M59.6 37.9c-.5 0-1.1-.2-1.5-.6L34 13.3l-24 24c-.8.8-2.2.8-3 0-.8-.8-.8-2.2 0-3L32.5 8.7c.4-.4.9-.6 1.5-.6s1.1.2 1.5.6l25.6 25.6c.8.8.8 2.2 0 3-.4.4-1 .6-1.5.6z"}))},D=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 68 68",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M53.1 14.9H14.9c-4.7 0-8.5 3.8-8.5 8.5v23.4c0 4.7 3.8 8.5 8.5 8.5h38.3c4.7 0 8.5-3.8 8.5-8.5V23.4c0-4.7-3.9-8.5-8.6-8.5zm4.3 31.9c0 2.3-1.9 4.3-4.3 4.3H14.9c-2.3 0-4.3-1.9-4.3-4.3V23.4c0-1.2.5-2.2 1.2-3L28 36.5c3.3 3.3 8.7 3.3 12 0l16.1-16.1c.8.8 1.2 1.8 1.2 3v23.4h.1z"}))},I=r("PR7B"),F=function(e){var t=e.size,r=void 0===t?24:t,n=Object(v.c)(e,["size"]);return d.a.createElement(y.a,Object(v.a)({fill:"currentColor",viewBox:"0 0 24 24",size:r},n),d.a.createElement("path",{fill:"currentColor",d:"M19.93 2.531H4.023A3.981 3.981 0 00.04 6.516v10.968a3.981 3.981 0 003.984 3.985h15.954a3.981 3.981 0 003.984-3.985V6.516c0-2.204-1.828-3.985-4.031-3.985zm-.985 3c1.078 0 2.016.89 2.016 2.016 0 1.078-.89 2.016-2.016 2.016a2 2 0 01-2.015-2.016c.047-1.125.937-2.016 2.015-2.016zm3 11.953H2.008V13.5h19.937v3.984z"}))},q=r("OUWn"),U=r("4oQp"),B=r("z0dQ"),R=r("XL4X"),Y=r("pZLH"),A=r("n9xi"),L=r("7lAM"),Q=r("MwRc"),V=r("gq1t"),W=r("+TN3"),G=r("Py9V"),H=r("hG6G"),X=r("Be4i"),K=r("YO1g"),J=r("LZSR");function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ee(){var e=Object(V.d)().addToast,t=Object(L.b)().currentUser,r=Object(U.a)({onError:function(){e({text:Object(n.jsx)(l.a,$({},M.b.genericError)),type:"error"})}}),i=Object(b.a)(r,2),a=i[0],o=i[1].loading;return t?Object(n.jsx)(m.mb,{textAlign:"left",children:Object(n.jsx)(m.k,{name:"agreedToSendDataToThirdParties",onChange:function(e){a({variables:{input:{agreedToSendDataToThirdParties:e.target.checked}}})},checked:t.agreedToSendDataToThirdParties||!1,label:Object(n.jsx)(l.a,{id:"acceptTerms.showAgreedToSendDataToThirdPartiesLabel",defaultMessage:"Share contact data with our partners for statistical and profiling purposes"}),disabled:o})}):null}var te=function(e){var t,r,a,o,c,d,u=e.goNext,j=Object(Q.a)(),p=Object(A.b)(),O=Object(s.useState)({terms_of_use_and_privacy_policy:!1,registration_agreement_withdrawal:!1,subscription_agreement_withdrawal:!1,send_data_to_third_parties:!1}),h=O[0],f=O[1],g=Object(W.b)(H.a).data,v=function(e){f($($({},h),{},Object(i.a)({},e.target.name,e.target.checked)))},y=h.terms_of_use_and_privacy_policy,x=h.registration_agreement_withdrawal,k=h.subscription_agreement_withdrawal,S=h.send_data_to_third_parties,w=Object(s.useState)(!1),P=w[0],C=w[1],_=Object(Y.a)(X.a,{variables:{consents:(null===g||void 0===g||null===(t=g.system)||void 0===t||null===(r=t.legalConsents)||void 0===r?void 0:r.map((function(e){return{type:e.type,enforcement:e.enforcement,accepted:h[e.type]}})))||[]},onCompleted:function(){u()},update:function(e,t){if(t.data){var r=e.readQuery({query:L.a});r&&r.currentUser&&e.writeQuery({query:L.a,data:$($({},r),{},{currentUser:r.currentUser?$($({},r.currentUser),{},{agreedToTerms:y,agreedToSendDataToThirdParties:S,agreedToRegistrationAgreementWithdrawal:x,agreedToSubscriptionAgreementWithdrawal:k}):null})})}}}),E=Object(b.a)(_,2),z=E[0],N=E[1],T=N.loading,D=N.error,I=null===p||void 0===p||null===(a=p.data)||void 0===a||null===(o=a.buyProductPage)||void 0===o?void 0:o.termsOfConditionItems;return Object(n.jsxs)(m.l,{variant:"narrow",textAlign:"center",children:[Object(n.jsxs)(m.e,{children:[Object(n.jsx)(m.y,{typoStyle:"lg",children:Object(n.jsx)(l.a,{id:"terms_have_changed",defaultMessage:"Terms have changed"})}),Object(n.jsx)(m.mb,{mb:"xs",children:Object(n.jsx)(l.a,{id:"terms_have_changed_description",defaultMessage:"Our Terms of Use have changed, and we require you to accept these updated agreements in order to continue using the service."})})]}),p.loading&&Object(n.jsx)(m.Y,{}),p.error&&Object(n.jsx)(m.a,{variant:"error",children:Object(n.jsx)(l.a,$({},M.b.genericError))}),I&&Object(n.jsx)(m.W,{"data-testid":"TermsList",children:I.map((function(e){return e&&e.title&&e.body?Object(n.jsxs)(m.U,{mb:"xs",children:[Object(n.jsx)(m.mb,{bold:!0,mb:1,children:e.title}),Object(n.jsx)(m.mb,{children:e.body})]},e._key):null}))}),j.configuration.showAgreedToSendDataToThirdPartiesCheckbox&&Object(n.jsx)(ee,{}),Object(n.jsx)(m.e,{mb:5,children:null===g||void 0===g||null===(c=g.system)||void 0===c||null===(d=c.legalConsents)||void 0===d?void 0:d.map((function(e){return Object(n.jsx)(m.e,{mb:4,textAlign:"left",children:Object(n.jsx)(G.a,{consentType:e.type,settingsData:g,terms_of_use_and_privacy_policy:y,registration_agreement_withdrawal:x,subscription_agreement_withdrawal:k,send_data_to_third_parties:S,handleCheckBoxChange:v})},e.type)}))}),D&&Object(n.jsx)(m.a,{variant:"error",children:Object(n.jsx)(l.a,{id:"acceptTerms.error",defaultMessage:"Could not update terms, please try again"})}),P&&Object(n.jsx)(m.a,{variant:"error",children:Object(n.jsx)(l.a,$({},J.a.termsNotAccepted))}),Object(n.jsx)(m.X,{variant:"primary",shape:"cool",onClick:function(){if(g&&g.system&&g.system.legalConsents){var e=g.system.legalConsents;if(!Object(K.b)(e,h))return void C(!0)}z()},disabled:!I,loading:T,responseState:D?"error":"success","data-testid":"Terms__Accept",mb:"xs",mt:"xs",children:Object(n.jsx)(l.a,{id:"modules.BuyProduct.TermsStep.button",defaultMessage:"Accept terms of use"})}),Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(m.V,{route:"terms-of-use",passHref:!0,children:Object(n.jsx)(m.b,{target:"blank",children:Object(n.jsx)(l.a,{id:"modules.BuyProduct.TermsStep.link",defaultMessage:"See complete terms of use"})})})})]})},re=r("jgSC"),ne=r("bu3G"),ie=r("UGp+"),ae=r("YyUk");function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function se(e){var t={};return e.birthYear&&4!==e.birthYear.length&&(t.birthYear="Enter a valid birth year"),t}var de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"connectObosMembershipMutation"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"connectObosMembership"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:91,source:{body:"\n  mutation connectObosMembershipMutation {\n    connectObosMembership {\n      id\n    }\n  }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},le=function(e){return Object(n.jsx)(m.T,ce({style:{lineHeight:"inherit",fontSize:"inherit",color:"inherit"}},e))};function ue(e){var t=e.heading,r=e.icon,i=e.children,a=e.graphQLError,o=e.error,c=e.canSkip,s=e.onSubmit,d=Object(R.b)().goNext;return Object(n.jsx)("form",{onSubmit:s,children:Object(n.jsxs)(m.t,{mx:"auto",flexDirection:"column",alignItems:"center",textAlign:"center",children:[Object(n.jsx)(m.e,{mb:"xs",children:r||Object(n.jsx)(m.Z,{color:"primary"})}),Object(n.jsx)(m.y,{typoStyle:"lg",children:t}),a&&Object(n.jsx)(p.a,{error:a}),o&&Object(n.jsx)(m.a,{variant:"error",children:o}),i,c&&Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(m.c,{onClick:function(){return d()},children:Object(n.jsx)(l.a,ce({},u.d.skip))})})]})})}function be(e){var t=e.systemName,r=e.paymentMethod,i=e.goNext;return Object(n.jsxs)(n.Fragment,{children:[r&&"Card"===r.__typename&&!r.expired&&Object(n.jsx)(m.mb,{as:"p",children:Object(n.jsx)(l.a,{id:"PaymentMethodForm.paymentCardDescription",defaultMessage:"We now have your {displayBrand} ending with {last4} saved to your {systemName} account.",values:{displayBrand:r.displayBrand,last4:r.last4,systemName:t}})}),r&&"Card"===r.__typename&&!r.expired&&Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(m.mb,{as:"p",children:Object(n.jsx)(l.a,{id:"PaymentMethodForm.paymentCardProfileInfo",defaultMessage:"You can remove and add cards at any time in your profile."})}),Object(n.jsx)(m.g,{shape:"cool",variant:"primary",onClick:i,children:Object(n.jsx)(m.F,{})})]})]})}var je=r("epvp"),me=r("g0fa");function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={agreedToTerms:function(){var e=Object(R.b)().goNext;return Object(n.jsx)(te,{goNext:e})},paymentMethod:function(e){var t,r=e.currentUser,i=e.required,a=Object(R.b)().goNext,o=Object(Q.a)({onCompleted:function(e){var t;null!==(t=e.system)&&void 0!==t&&t.paymentProvider||a()}}),c=Object(n.jsx)(re.a,{children:function(e){var t=e.addOrReplacePaymentMethodUI;if(e.paymentMethodSuccess){var i=null===r||void 0===r?void 0:r.paymentMethod;return Object(n.jsx)(be,{systemName:o.name,paymentMethod:i,goNext:a})}return t}}),s=o.paymentProvider;if(!s)return null;var d=r.paymentMethod,u=Boolean(r.paymentMethod),b=r.paymentMethod&&"Card"===r.paymentMethod.__typename&&r.paymentMethod.expired;switch(s.__typename){case"PaymentProviderPayex":t="PayEx";break;case"PaymentProviderStripe":t="Stripe"}var j=!u||b;return Object(n.jsxs)(ue,{heading:j?Object(n.jsx)(l.a,{id:"PaymentMethodForm.addPaymentCard",defaultMessage:"Add payment card"}):Object(n.jsx)(l.a,{id:"PaymentMethodForm.paymentCardAdded",defaultMessage:"Card added successfully!"}),icon:Object(n.jsx)(F,{size:ae.c,color:"primaryIcon"}),canSkip:!i&&!j,children:[j&&Object(n.jsxs)(n.Fragment,{children:[b&&d&&"Card"===d.__typename&&Object(n.jsx)(m.mb,{as:"p",children:Object(n.jsx)(l.a,{id:"PaymentMethodForm.cardExpired",defaultMessage:"Your card ending with {last4} is expired. Please add a new card.",values:{last4:d.last4}})}),Object(n.jsx)(m.mb,{as:"p",children:Object(n.jsx)(l.a,{id:"PaymentMethodForm.description",defaultMessage:"To be able to unlock our bikes, you need to add a valid payment card. Adding the card will not charge your card. You can add and remove cards at any time in your profile."})}),Object(n.jsx)(m.mb,{as:"p",children:Object(n.jsx)(l.a,{id:"PaymentMethodForm.paymentMethodDescription",defaultMessage:"Selecting {addCard} will take you to our payment provider {paymentProviderName}",values:{paymentProviderName:t,addCard:Object(n.jsx)(l.a,ce({},M.b.addCard))}})})]}),Object(n.jsx)(m.e,{mb:"sm","data-testid":"PaymentMethodStep",children:c})]})},name:function(e){var t=e.currentUser,r=e.required,i=Object(o.a)(),a=Object(R.b)().goNext,c=Object(U.a)({onCompleted:function(){a()}}),s=Object(b.a)(c,2),d=s[0],p=s[1],O=p.error,h=p.loading,f="name";return Object(n.jsx)(j.d,{initialValues:{name:t.name||""},onSubmit:function(e){d({variables:{input:{name:e.name}}})},children:function(e){var t=e.handleSubmit;return Object(n.jsxs)(ue,{heading:Object(n.jsx)(le,{htmlFor:f,children:Object(n.jsx)(l.a,ce({},u.e.heading))}),graphQLError:O,onSubmit:t,icon:Object(n.jsx)(E,{size:ae.c,color:"primaryIcon"}),canSkip:!r,children:[Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(j.a,{name:f,children:function(e){var t=e.field,r=i.formatMessage(u.e.label);return Object(n.jsx)(_,{inputProps:ce(ce({id:t.name,placeholder:r},t),{},{"data-testid":"Onboarding_Name_Input"}),buttonProps:{type:"submit","data-testid":"Onboarding_Name_Button","aria-label":i.formatMessage(M.b.save)},state:h?"loading":"default"})}})}),Object(n.jsx)(m.mb,{as:"p",mute:!0,children:Object(n.jsx)(l.a,ce({},u.e.description))})]})}})},birthYear:function(e){var t=e.currentUser,r=e.required,i=Object(R.b)().goNext,a=Object(U.a)({onCompleted:function(){i()}}),o=Object(b.a)(a,2),c=o[0],s=o[1],d=s.error,p=s.loading;return Object(n.jsx)(j.d,{initialValues:{birthYear:t.birthYear||""},validate:se,onSubmit:function(e){c({variables:{input:{birthYear:e.birthYear||null}}})},children:function(e){var t=e.handleSubmit,i=e.errors,a=e.touched,o="birthYear",c=e.submitCount>0&&a.birthYear&&i.birthYear?i.birthYear:void 0;return Object(n.jsxs)(ue,{heading:Object(n.jsx)(le,{htmlFor:o,children:Object(n.jsx)(l.a,ce({},u.a.heading))}),error:c,graphQLError:d,onSubmit:t,icon:Object(n.jsx)(z,{size:ae.c,color:"primaryIcon"}),canSkip:!r,children:[Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(j.a,{name:o,children:function(e){var t=e.field;return Object(n.jsx)(_,{inputProps:ce(ce({},t),{},{id:t.name,type:"tel",placeholder:"1900",maxLength:4,width:"8rem","data-testid":"Onboarding_Birth_Input"}),buttonProps:{type:"submit","data-testid":"Onboarding_Birth_Button"},state:p?"loading":"default"})}})}),Object(n.jsx)(m.e,{children:Object(n.jsx)(m.mb,{as:"p",mute:!0,children:Object(n.jsx)(l.a,ce({},u.a.description))})})]})}})},gender:function(e){var t=e.currentUser,r=e.required,i=Object(R.b)().goNext,a=Object(U.a)({onCompleted:function(){i()}}),o=Object(b.a)(a,2),c=o[0],s=o[1],d=s.error,p=s.loading;return Object(n.jsx)(j.d,{initialValues:{gender:t.gender||null},onSubmit:function(e){c({variables:{input:{gender:e.gender}}})},children:function(e){var t=e.handleSubmit,i=e.setFieldValue,a=e.submitForm,o=e.values;function c(e){i("gender",e),setTimeout(a,0)}return Object(n.jsxs)(ue,{heading:Object(n.jsx)(le,{htmlFor:"gender",children:Object(n.jsx)(l.a,ce({},u.c.heading))}),graphQLError:d,onSubmit:t,icon:Object(n.jsx)(N,{size:ae.c,color:"primaryIcon"}),canSkip:!r,children:[Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsxs)(m.i,{segment:!0,children:[Object(n.jsx)(m.g,{shape:"cool",variant:o.gender===q.c.female?"primary":void 0,disabled:p,onClick:function(){return c(q.c.female)},children:Object(n.jsx)(l.a,ce({},M.a.female))}),Object(n.jsx)(m.g,{shape:"cool",variant:o.gender===q.c.male?"primary":void 0,disabled:p,onClick:function(){return c(q.c.male)},"data-testid":"Onboarding_Gender_Male",children:Object(n.jsx)(l.a,ce({},M.a.male))}),Object(n.jsx)(m.g,{shape:"cool",variant:o.gender===q.c.other?"primary":void 0,disabled:p,onClick:function(){return c(q.c.other)},children:Object(n.jsx)(l.a,ce({},M.a.other))})]})}),Object(n.jsx)(m.e,{children:Object(n.jsx)(m.mb,{as:"p",mute:!0,children:Object(n.jsx)(l.a,ce({},u.c.description))})})]})}})},postalCode:function(e){var t=e.currentUser,r=e.required,i=Object(o.a)(),a=Object(R.b)().goNext,c=Object(U.a)({onCompleted:function(){a()}}),s=Object(b.a)(c,2),d=s[0],p=s[1],O=p.error,h=p.loading;return Object(n.jsx)(j.d,{initialValues:{postalCode:t.postalCode||""},onSubmit:function(e){d({variables:{input:{postalCode:e.postalCode}}})},children:function(e){var t=e.handleSubmit,a="postalCode";return Object(n.jsxs)(ue,{heading:Object(n.jsx)(le,{htmlFor:a,children:Object(n.jsx)(l.a,ce({},u.g.heading))}),graphQLError:O,onSubmit:t,icon:Object(n.jsx)(T,{size:ae.c,color:"primaryIcon"}),canSkip:!r,children:[Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(j.a,{name:a,children:function(e){var t=e.field,r=i.formatMessage(u.g.label);return Object(n.jsx)(_,{inputProps:ce(ce({id:a,placeholder:r},t),{},{"data-testid":"Onboarding_Postal_Input"}),buttonProps:{type:"submit","data-testid":"Onboarding_Postal_Button"},state:h?"loading":"default"})}})}),Object(n.jsx)(m.e,{children:Object(n.jsx)(m.mb,{as:"p",mute:!0,children:Object(n.jsx)(l.a,ce({},u.g.description))})})]})}})},email:function(e){var t,r,i=e.currentUser,a=e.required,c=Object(o.a)(),s=Object(R.b)().goNext,d=Object(B.a)(),p=null===d||void 0===d||null===(t=d.data)||void 0===t||null===(r=t.requiredUserInputFields)||void 0===r?void 0:r.email,O=Object(U.a)({onCompleted:function(){s()}}),h=Object(b.a)(O,2),f=h[0],g=h[1],v=g.error,y=g.loading,x=ie.a().shape({email:ie.b().email()});return Object(n.jsx)(j.d,{initialValues:{email:i.email||"",agreedToReceiveEmail:Boolean(i.agreedToReceiveEmail),agreedToReceiveExternalPromotions:Boolean(i.agreedToReceiveExternalPromotions)},validationSchema:x,validate:function(){return{}},onSubmit:function(e){f({variables:{input:{email:e.email}}})},children:function(e){var t=e.values,r=e.handleSubmit,i=e.errors,o=e.touched,s="email";return Object(n.jsxs)(ue,{heading:Object(n.jsx)(l.a,ce({},u.b.heading)),graphQLError:v,onSubmit:r,icon:Object(n.jsx)(D,{size:ae.c,color:"primaryIcon"}),canSkip:!a,children:[o.email&&i.email&&Object(n.jsx)(m.a,{variant:"error",children:Object(n.jsx)(l.a,ce({},u.b.emailRequired))}),Object(n.jsx)(m.e,{mb:"sm",children:Object(n.jsx)(j.a,{name:"email",children:function(e){var t=e.field,r=c.formatMessage(u.b.label);return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(m.C,{all:!0,srOnly:!0,children:Object(n.jsx)(m.T,{htmlFor:s,children:r})}),Object(n.jsx)(m.Q,ce(ce({},t),{},{id:s,"data-testid":"Onboarding_Email_Input",required:p,placeholder:r,autoComplete:"email",type:"email"}))]})}})}),Object(n.jsx)(m.e,{children:Object(n.jsxs)(m.mb,{as:"p",mute:!0,children:[Object(n.jsx)(l.a,ce({},u.b.description))," ",p&&Object(n.jsx)(l.a,ce({},u.b.emailRequired)),!p&&Object(n.jsx)(l.a,ce({},u.b.emailNotRequired))]})}),Object(n.jsx)(m.e,{mb:"xs",children:Object(n.jsx)(j.a,{name:"agreedToReceiveEmail",children:function(e){var t=e.field;return Object(n.jsx)(m.k,{name:t.name,onChange:t.onChange,checked:t.value,label:Object(n.jsx)(l.a,ce({},ne.f.agreedToReceiveEmail)),disabled:y})}})}),Object(n.jsx)(m.e,{mb:"xs",children:Object(n.jsx)(j.a,{name:"agreedToReceiveExternalPromotions",children:function(e){var t=e.field;return Object(n.jsx)(m.k,{name:t.name,onChange:t.onChange,checked:t.value,label:Object(n.jsx)(l.a,ce({},ne.f.agreedToReceiveExternalPromotions)),disabled:y})}})}),Object(n.jsx)(m.X,{"data-testid":"Onboarding_Email_Button",shape:"cool",variant:"primary",mb:"xs",responseState:v?"error":"success",loading:y,disabled:!!i.email,onClick:function(){f({variables:{input:t}})},children:Object(n.jsx)(l.a,ce({},M.b.save))})]})}})},obos:function(e){var t,r,i=e.required,a=Object(R.b)().goNext,o=Object(Y.a)(de,{onCompleted:function(e){e.connectObosMembership&&a()},onError:function(){}}),c=Object(b.a)(o,2),s=c[0],d=c[1],j=null===(t=d.error)||void 0===t||null===(r=t.graphQLErrors)||void 0===r?void 0:r[0],p="ERR_OBOS_MEMBERSHIP_PHONE_NUMBER_UNKNOWN"===(null===j||void 0===j?void 0:j.code);return Object(n.jsxs)(ue,{heading:"Som OBOS-medlem f\xe5r du egne fordeler i appen",graphQLError:d.error,onSubmit:function(e){e.preventDefault(),s()},icon:Object(n.jsx)(m.e,{size:ae.c,children:Object(n.jsx)(m.P,{src:"".concat("../../static/assets/sponsors","/obos-default.svg"),width:"100%"})}),canSkip:!i,children:[Object(n.jsx)(m.mb,{as:"p",mute:!0,children:"For \xe5 sjekke om du er medlem sendes ditt mobilnummer til OBOS. Nummeret blir ikke brukt til noe annet form\xe5l enn verifisering. OBOS er bysykkelpartner i Oslo."}),Object(n.jsx)(m.X,{type:"submit",variant:"primary",shape:"cool",mb:"sm",mt:"xs",loading:d.loading,responseState:d.error?"error":"success",children:"Koble ditt OBOS-medlemskap"}),p&&Object(n.jsxs)(m.e,{mb:"sm",children:[Object(n.jsx)(I.a,{color:"primaryIcon",size:30,display:"block",ml:"auto",mr:"auto"}),Object(n.jsx)(m.mb,{mt:"xs",children:Object(n.jsx)(l.a,ce(ce({},u.f.noObos),{},{values:{obosLink:Object(n.jsx)(m.b,{href:"https://minside.obos.no",children:"minside.obos.no"})}}))})]})]})}};function fe(e){var t=e.stepId,r=e.onFinished,i=e.setStepId,a=e.onStepFound,o=Object(L.b)(),d=o.currentUser,b=Object(c.a)(o,["currentUser"]),j=Object(A.b)(),p=Object(je.a)(d,void 0,t?[t]:void 0),O=Object(s.useState)(),h=O[0],f=O[1],g=Object(H.b)().data,v=null===g||void 0===g?void 0:g.settings.privacyPageSlug;Object(s.useEffect)((function(){p.steps&&!h&&f(p.steps)}),[h,p.steps]);var y=0;t&&(y=Math.max(h?h.findIndex((function(e){return e.id===t})):-1,0));var x=h&&h[y];if(x||(x=h&&h[0]),Object(s.useEffect)((function(){x&&a&&a(x.id)}),[x]),p.loading||b.loading||j.loading)return Object(n.jsx)(m.t,{alignItems:"center",justifyContent:"center",minHeight:"100vh",children:Object(n.jsx)(m.Y,{"aria-label":"Loading"})});if(!d||!h)return null;if(!x)return me.a.captureMessage("User got to onboarding without any steps to fill in.",me.b.Warning),r(),null;var k=he[x.id];return Object(n.jsx)("div",{"data-testid":"OnboardingWizard",children:Object(n.jsx)(R.a,{stepIndex:y,stepCount:h.length,onStepChange:function(e){if(e.finished)r();else if(null!==e.nextStepIndex){var n=h[e.nextStepIndex];if(!n)return void Object(me.c)(new Error("Next step not found"),{});if(t===n.id)return;i(n.id)}},children:Object(n.jsxs)(m.e,{maxWidth:{_:"400px",lg:"600px"},children:[Object(n.jsx)(k,{currentUser:d,required:x.required}),v&&Object(n.jsx)(m.e,{mb:"sm",textAlign:"center",children:Object(n.jsx)(m.b,{href:"/".concat(v.current),target:"blank",mute:!0,children:Object(n.jsx)(l.a,Oe({},u.d.personalInformation))})})]})})})}var ge=r("lGJd"),ve=r("oIFK"),ye=r("n8X0"),xe=r("C9V0");function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we=Object(a.e)({title:{id:"pages.onboarding.title",defaultMessage:"Onboarding"}}),Pe="onboarding";t.default=Object(ye.a)((function(e){var t=e.url,r=Object(o.a)(),i=Object(ve.b)(t.query.step);return Object(n.jsx)(ge.a,{title:r.formatMessage(we.title),url:t,loading:!1,hideChrome:!0,requiresAuth:!0,hideIntercomLauncher:!0,contentProps:{py:0,mx:0,mb:0},render:function(){return Object(n.jsx)(fe,{stepId:i,setStepId:function(e){Object(xe.c)({route:Pe,params:{step:e},options:{shallow:!0},intl:r})},onStepFound:function(e){i||i===e||Object(xe.c)({route:Pe,params:Se(Se({},t.query),{},{step:e}),options:{shallow:!0},intl:r})},onFinished:function(){Object(xe.c)({route:"how-it-works",params:{from:"post-checkout"},intl:r})}})}})}))},z0dQ:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r("+TN3"),i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"requiredUserInputFieldsQuery"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"requiredUserInputFields"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:92,source:{body:"\n  query requiredUserInputFieldsQuery {\n    requiredUserInputFields {\n      email\n    }\n  }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},a=function(e){return Object(n.b)(i,e)}}},[["IsQD",1,2,3,0,4,5,6,7,9,10,13,14,30]]]);
//# sourceMappingURL=onboarding-eeadfa3a945f1eb7735e.js.map