PageSourceSearch

https://sfstandard.com/_next/static/chunks/pages/payment-b91774902ddc2ad2.js

js sfstandard.com collected 2026-10-02 02:15:38 UTC 17,896 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ec09f973-16da-4cfd-a2d0-be43fc0e732d",e._sentryDebugIdIdentifier="sentry-dbid-ec09f973-16da-4cfd-a2d0-be43fc0e732d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6826],{85176:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment",function(){return s(99671)}])},99671:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>en,default:()=>er});var l=s(6029),n=s(2083),r=s(52616),a=s(71393),o=s(72159),i=s(17369),c=s(81943);let u=e=>{var t,s;let{status:n,view:r}=e;return(0,l.jsxs)("div",{className:"w-full max-w-[1016px] px-lg flex flex-col gap-md",children:[(0,l.jsx)("p",{className:"text-[24px] md:text-[32px] font-semibold leading-[1.1] text-red-500",children:null!=(s=null==(t=J[n])?void 0:t.text)?s:"Something went wrong, please try again."}),(0,l.jsx)(a.d,{event:o.T.CLICK,href:r===Z.GROUP_MEMBERSHIP?"/subscribe/checkout/group":"/subscribe/checkout",className:"button button-blue button-lg w-fit text-center text-lg",trackData:{action_name:c.B.CLICK,element_category:i.D.CHECKOUT_FUNCTIONS,element_sub_category:"return_to_checkout",link_section:"membership",placement_position:null,element_label:"return_to_checkout",element_id:""},children:"Return to checkout"})]})};var d=s(24444),m=s(53664),p=s(88445);let h=e=>{var t;let{title:s,view:r}=e,u=(0,n.TW)(),h=r===Z.ANNUAL_MEMBERSHIP?"Set up your profile":"Sign up for newsletters",f=r===Z.GROUP_MEMBERSHIP?"Manage your account":"Return to your article",x=r===Z.GROUP_MEMBERSHIP?"/account/profile/subscription/":null!=(t=null==u?void 0:u.pageUrl)?t:"/";return(0,l.jsxs)("section",{className:"flex flex-col gap-lg w-full max-w-[1016px] px-lg",id:"membership-details-section","aria-labelledby":"membership-details-heading",children:[(0,l.jsx)("h1",{className:"font-bold sm:text-5xl text-3xl leading-[1.1] font-ivar-headline",id:"membership-details-heading",children:s}),(0,l.jsx)("div",{className:"flex flex-col gap-lg max-w-[584px] text-xl",children:(e=>{switch(e){case Z.MONTHLY_MEMBERSHIP:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:"You're in. Your monthly subscription powers the journalism that holds power to account and sets the pace in San Francisco."}),(0,l.jsx)("p",{children:"Complete your profile below and choose a few newsletters. Your article will be waiting."})]});case Z.ANNUAL_MEMBERSHIP:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:"Thanks for subscribing. Your annual subscription helps power the independent journalism that keeps San Francisco informed and accountable."}),(0,l.jsx)("p",{children:"Complete your profile below to claim your tote and select your newsletters."})]});case Z.GROUP_MEMBERSHIP:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:"You're in. Your Organization subscription powers the journalism that holds power to account and sets the pace in San Francisco."}),(0,l.jsxs)("div",{className:"flex flex-col gap-xxs",children:[(0,l.jsx)("p",{children:"Ready to bring your team onboard? Head to your subscription portal, where you can:"}),(0,l.jsxs)("ul",{className:"list-disc list-inside ml-sm",children:[(0,l.jsx)("li",{children:"Invite team members with a few clicks"}),(0,l.jsx)("li",{children:"Download invoices and track payments"}),(0,l.jsx)("li",{children:"Manage your subscription and renewal"}),(0,l.jsx)("li",{children:"Access exclusive member benefits"})]})]}),(0,l.jsxs)("p",{children:["We can't wait for your organization to dive into our coverage. Questions? We're here to help at"," ",(0,l.jsx)("a",{href:"mailto:[email protected]",className:"underline text-sfs-blue-500",children:"[email protected]"}),"."]})]});default:return null}})(r)}),(0,l.jsxs)("div",{className:"flex sm:flex-row flex-col gap-md",role:"group","aria-label":"Subscription actions",children:[u||r===Z.GROUP_MEMBERSHIP?(0,l.jsx)(a.d,{event:o.T.CLICK,trackData:{action_name:c.B.CLICK,action_context:d.y.BUTTON_CLICK,link_text:(0,m.CC)(f),element_category:i.D.CHECKOUT_FUNCTIONS,element_sub_category:"post_purchase_module",...(0,p.J4)(x)},href:x,className:"button button-blue button-lg text-lg sm:w-fit w-full text-center",children:f}):null,(0,l.jsx)("button",{type:"button","aria-describedby":"profile-cta-description",className:"button button-outline-blue button-lg text-lg sm:w-fit w-full",onClick:()=>{var e,t;
1r===Z.ANNUAL_MEMBERSHIP?window.scrollTo({top:(null==(e=document.getElementById("tote-selection-section"))?void 0:e.offsetTop)||0,behavior:"instant"}):window.scrollTo({top:(null==(t=document.getElementById("newsletter-signup-section"))?void 0:t.offsetTop)||0,behavior:"instant"})},children:h}),(0,l.jsx)("span",{id:"profile-cta-description",className:"sr-only",children:r===Z.ANNUAL_MEMBERSHIP?"Scrolls to tote bag selection section":"Scrolls to newsletter signup section"})]})]})};var f=s(18780),x=s(55729),g=s(4765),b=s(49426),w=s(32224),v=s(1909),y=s(52789),_=s(4287),j=s(93909),N=s(52231),S=s(27009),E=s(30056),C=s(4459);let T=e=>{let{title:t,description:s,selected:n,onSelect:r,value:a,children:o,isEvent:i=!1}=e,c=(0,x.useRef)(null),u="".concat(a,"-description");return(0,x.useEffect)(()=>{if(n&&c.current){let e=setTimeout(()=>{var e;null==(e=c.current)||e.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})},100);return()=>clearTimeout(e)}},[n]),(0,l.jsxs)("div",{ref:c,className:(0,N.cn)("flex flex-col p-lg bg-white rounded-xl border cursor-pointer","has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-500 has-[:focus-visible]:outline-offset-4",n?"border-blue-500":"border-warm-gray-300"),onClick:r,children:[(0,l.jsxs)("div",{className:"flex flex-row gap-sm w-full items-start",children:[(0,l.jsx)("input",{type:"radio",id:a,name:"gift-intent",value:a,checked:n,"aria-describedby":u,className:"w-lg h-lg stroke-warm-gray-300",onChange:e=>{e.target.checked&&r()}}),(0,l.jsxs)("div",{className:"flex flex-col gap-xs w-full",children:[(0,l.jsx)("label",{htmlFor:a,className:"text-xl font-bold leading-[1.1]",children:t}),(0,l.jsx)("p",{id:u,className:"text-text-secondary text-medium max-w-[584px]",children:s}),i?(0,l.jsx)("div",{className:"px-md py-xs bg-pico-sun-300 border border-pico-sun-600 w-fit font-medium text-medium mt-xs",children:"After ordering, your tote will be ready to pick up at the event."}):null]})]}),n&&o&&(0,l.jsx)("div",{className:"pl-xl",children:o})]})},P=e=>{let{control:t,availableGifts:s,onGiftSelected:n,eventName:r=null}=e,{submitGift:a,isSubmitting:o,error:i}=(0,S.C)(),c=(0,x.useCallback)(async()=>{(await a("none")).success&&n("none")},[a,n]);return(0,l.jsx)(v.xI,{name:"giftIntent",control:t,render:e=>{let{field:t}=e;return(0,l.jsxs)("div",{className:"flex flex-col gap-sm",role:"radiogroup","aria-label":"Gift selection intent",children:[(0,l.jsx)(T,{title:"Yes, I want a tote",description:null!==r?"Select from our ".concat(s.length," limited-edition tote bags."):"Select from ".concat(s.length," available tote bag designs and provide your U.S. shipping address. We'll ship your bag to you within 6 weeks."),value:j.h.TOTE,onSelect:()=>t.onChange(j.h.TOTE),selected:t.value===j.h.TOTE,isEvent:null!==r,children:(0,l.jsx)(C.K,{availableGifts:s,onSuccess:n,eventName:r})}),(0,l.jsx)(T,{title:"No, I don't want a tote",description:"This selection declines your tote bag benefit.",value:j.h.NO_TOTE,onSelect:()=>t.onChange(j.h.NO_TOTE),selected:t.value===j.h.NO_TOTE,children:(0,l.jsxs)("div",{className:"flex flex-col gap-sm pt-sm",children:[i&&(0,l.jsx)(E.f,{error:i}),(0,l.jsx)("button",{type:"button",onClick:c,disabled:o,"aria-busy":o,className:(0,N.cn)("button button-blue button-md w-fit text-medium",o&&"opacity-50 cursor-not-allowed"),children:o?"Saving...":"Save"})]})}),(0,l.jsx)(T,{title:"I'll order my tote later",description:"You can always order it later through your account settings.",value:j.h.LATER,onSelect:()=>t.onChange(j.h.LATER),selected:t.value===j.h.LATER})]})}})};var I=s(2729);let k=e=>{let{gifts:t,availableGifts:s,eventName:n=null}=e,{subscriptionLoaded:r}=(0,b.Rs)(),[a,o]=(0,x.useState)(null),[i,c]=(0,x.useState)(!1),[u,d]=(0,x.useState)(!1),{control:m}=(0,v.mN)({defaultValues:{giftIntent:void 0},resolver:(0,y.u)(I.Ay$.object({giftIntent:I.Ay$.enum(j.h).optional()}))}),p=(0,x.useCallback)(()=>{c(!0),fetch("/api/subscription/gift/").then(async e=>{if(e.ok)o((await e.json()).gift);else{let t="Failed to load gift selection: "+await e.text();g.Cp(Error(t))}}).catch(e=>{console.error(e),g.Cp(e)}).finally(()=>{c(!1)})},[]),h=(0,x.useCallback)(e=>{d(!0),o(e)},[]);if((0,x.useEffect)(()=>{p()},[p]),!r||i)return(0,l.jsx)(w.X,{showHeading:!0});let f=null!==n;return(0,l.jsx)(l.Fragment,{children:a?(0,l.jsx)(_.a,{selectedGift:a,gifts:t,scrollOnMount:u,isEvent:f,completeText:f?"Your tote is set!":"Your tote order is complete"}):(0,l.jsx)(P,{control:m,availableGifts:s,onGiftSelected:h,eventName:n})})},R=e=>{let{title:t,subtitle:s,gifts:n,availableGifts:r,eventName:a=null}=e;return(0,l.jsxs)("section",{id:"tote-selection-section","aria-labelledby":"tote-selection-heading",className:"flex flex-col sm:gap-[40px] gap-12 w-full max-w-[1016px] px-lg",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-xs",children:[(0,l.jsx)("h2",{id:"tote-selection-heading",className:"font-bold text-headline-ivar-2 sm:font-ivar-headline text-[27px] leading-[1.1]",children:t}),(0,l.jsx)("p",{className:"text-text-secondary text-medium leading-[1.3] max-w-[584px]",children:s})]}),(0,l.jsx)("div",{className:"flex flex-col gap-[40px]",children:(0,l.jsx)(k,{gifts:n,availableGifts:r,eventName:a})})]})};var O=s(75787),M=s(65119),U=s(59067),B=s(34562),L=s(57614),F=s(18314),H=s(17107),A=s(14485),Y=s(52229),D=s(81278),G=s(12959),K=s(20625),W=s(89051),$=s(16122),q=s(9414),z=s(40585),V=s(76818);let X=e=>{var t,s,n;let{onSuccess:r,onSkip:a}=e,o=(0,B.F)(),{register:i,clearErrors:c,trigger:u,getValues:d,handleSubmit:m,setError:p,formState:{errors:h,touchedFields:f}}=(0,v.mN)({resolver:(0,y.u)(z.$A),defaultValues:{password:"",confirmPassword:""},mode:"onSubmit"}),x=(0,V.n)({mutationFn:async e=>{var t,s,l,n;let r,a=await o.changePassword(e,e=>{r=("function"==typeof e?e({}):e).service});if(a.response instanceof Response&&a.response.ok)return;let i=a.json;for(let[e,l]of Object.entries(null!=(n=null==(s=i.error)||null==(t=s.data)?void 0:t.fieldErrors)?n:{}).filter(e=>"string"==typeof e[1]&&e[1].length>0))("password"===e||"confirmPassword"===e)&&p(e,{type:"manual",message:l});throw p("root.service",{type:"manual",message:r||(null==(l=i.error)?void 0:l.message)||"Unable to create your password. Please try again."}),Error("Failed to create password")},onSuccess:()=>{(0,q.P)({toastData:{type:"success",heading:"Your password has been created"}}),null==r||r()}}),g=x.isPending,b=m(async e=>{c("root.service");try{await x.mutateAsync(e)}catch(e){}});return(0,l.jsxs)("div",{className:"flex flex-col gap-[2.5rem] items-start",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"font-ivar-headline text-headline-ivar-3 font-bold",children:"Create password"}),(0,l.jsx)("p",{className:"mt-sm text-inter-m",children:"You'll use this to sign in to your account"})]}),(0,l.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-lg w-full",children:[(0,l.jsx)(G.a,{children:(0,l.jsx)(K.f,{label:"Create password",isPassword:!0,id:"password",placeholder:"Password",autoComplete:"new-password",disabled:g,error:null==(t=h.password)?void 0:t.message,...i("password",{onChange:()=>{var e;(null==(e=h.root)?void 0:e.service)&&c("root.service"),h.password&&u("password");let t=d("confirmPassword");(f.confirmPassword||t)&&u("confirmPassword")},onBlur:()=>{let e=d("password");if(e&&""!==e.trim()){u("password");let e=d("confirmPassword");(f.confirmPassword||e)&&u("confirmPassword")}}})})}),(0,l.jsx)(G.a,{children:(0,l.jsx)(K.f,{label:"Confirm password",isPassword:!0,id:"confirmPassword",placeholder:"Confirm password",autoComplete:"new-password",disabled:g,error:null==(s=h.confirmPassword)?void 0:s.message,...i("confirmPassword",{onChange:()=>{var e;(null==(e=h.root)?void 0:e.service)&&c("root.service"),h.confirmPassword&&u("confirmPassword")},onBlur:()=>{let e=d("confirmPassword");e&&""!==e.trim()&&u("confirmPassword")}})})}),(0,l.jsxs)("div",{className:"flex flex-col gap-md",children:[g?(0,l.jsx)($.m,{size:{
1width:20,height:20},className:"mx-auto my-auto"}):(0,l.jsx)("button",{type:"submit",className:"button button-blue button-lg text-lg font-semibold",disabled:Object.keys(h).length>0||g,children:"Save password"}),(null==(n=h.root)?void 0:n.service)&&(0,l.jsx)(W.Z,{htmlFor:"service",className:"text-warm-gray-900 text-xs leading-4",error:h.root.service.message||""})]}),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)("button",{type:"button",onClick:a,className:"text-inter-l font-semibold text-action underline can-hover:hover:no-underline",children:"I'll do this later"})})]})]})},J={requires_action:{text:"Your payment requires action."},requires_payment_method:{text:"Your payment was not successful, please try again."},default:{text:"Something went wrong, please try again."}};var Z=function(e){return e.MONTHLY_MEMBERSHIP="monthly_membership",e.ANNUAL_MEMBERSHIP="annual_membership",e.GROUP_MEMBERSHIP="group_membership",e}({});let Q=e=>{var t;let{gifts:s,availableGifts:a,carouselImages:g,defaultNewsletters:b,products:w,membershipTitle:v,region:y,newsletter:_,toteSelection:j}=e,N=(0,A.t2)(),[S,E]=(0,x.useState)(),[C,T]=(0,x.useState)(""),[P,I]=(0,x.useState)(),[k,G]=(0,x.useState)(null),K=(0,r.C)(),{accountState:W}=(0,B.F)(),[$,q]=(0,x.useState)(null),z=(0,Y.useSearchParams)(),V=(0,D.useRouter)(),J=z.has("createPassword","true");(0,x.useEffect)(()=>{if(!N)return;let e=new URLSearchParams(window.location.search),t=e.get("payment_intent_client_secret"),s=e.get("setup_intent_client_secret");if(!t&&!s){window.location.href="/";return}t?N.retrievePaymentIntent(t).then(e=>{let{paymentIntent:t}=e;t&&(E(t.status),T(t.id))}).catch(e=>console.error(e)):N.retrieveSetupIntent(s).then(e=>{let{setupIntent:t}=e;t&&(E(t.status),T(t.id))}).catch(e=>console.error(e));let l=e.get("groupSubscription");fetch("/api/subscription").then(e=>{if(!e.ok)throw Error("Failed to fetch subscription");return e.json()}).then(e=>{let t=e.product||"unknown";l&&"true"===l?G("group_membership"):"string"==typeof t&&"annual"===t.toLowerCase()?G("annual_membership"):G("monthly_membership"),I(e.trackingData)}).catch(e=>{console.error("Failed to fetch subscription:",e)});let n=e.get("eventName");n&&"null"!==n&&"undefined"!==n&&q(n)},[w,N]),(0,x.useEffect)(()=>{if(S&&["succeeded","processing"].includes(S)&&P){let e="tracked_subscription_status_".concat(C);H.u.get(e)||(K(o.T.SUBSCRIPTION_SUCCESS,{...(0,n.Di)((0,n.mB)()),...P}),H.u.set(e,"true")),(0,F.T$)(),(0,L.r3)()}},[S,K,C,P]),(0,x.useEffect)(()=>{if(!C||0===b.length)return;let e="tracked_newsletter_subscription_".concat(C);H.u.get(e)||(K(o.T.NEWSLETTER_SUBSCRIBE_COMPLETE,{newsletters_subscribed_to:b.join(","),element_category:i.D.NEWSLETTER_MODULES,element_sub_category:"post_purchase_module"}),(null==W?void 0:W.email)&&b.forEach(e=>{(0,U.d)(W.email,e)}),H.u.set(e,"true"))},[b.length,C,null==W?void 0:W.email]);let Z="group_membership"===k?"Continue to your account":(null==(t=(0,n.TW)())?void 0:t.pageUrl)?"Return to your article":"Return to site";if(J){let e=()=>{let e=new URL(window.location.href);e.searchParams.delete("createPassword"),V.replace(e,void 0,{shallow:!0})};return(0,l.jsx)("div",{className:"px-lg py-[2.5rem] max-w-[584px] m-auto",children:(0,l.jsx)(X,{onSuccess:e,onSkip:e})})}return C&&S&&k?(0,l.jsxs)("div",{className:"bg-warm-gray-50 lg:py-[80px] sm:py-2xl py-12 lg:gap-[80px] sm:gap-2xl gap-12 flex flex-col items-center justify-center",children:[(0,l.jsx)(M.j,{carouselImages:g}),["succeeded","processing"].includes(S)?(0,l.jsx)(h,{title:v,view:null!=k?k:"monthly_membership"}):(0,l.jsx)(u,{status:S,view:null!=k?k:"monthly_membership"}),(0,l.jsx)("hr",{className:"text-warm-gray-300 h-px w-full max-w-[1016px]","aria-hidden":"true"}),"annual_membership"===k&&"succeeded"===S&&y.isUnitedStates?(0,l.jsx)(R,{eventName:$,title:j.sectionTitle,subtitle:j.sectionSubtitle,gifts:s,availableGifts:a}):null,(0,l.jsx)(f.S,{title:_.sectionTitle,subtitle:_.sectionSubtitle,defaultNewsletters:b}),(0,l.jsx)("div",{className:"w-full max-w-[1016px] px-lg flex flex-col gap-sm",children:(0,l.jsx)("button",{type:"button",onClick:()=>{var e;let t="group_membership"===k?"/account/profile/subscription/":(null==(e=(0,n.TW)())?void 0:e.pageUrl)||"/";K(o.T.CLICK,{action_name:c.B.CLICK,action_context:d.y.BUTTON_CLICK,link_text:(0,m.CC)(Z),element_category:i.D.CHECKOUT_FUNCTIONS,element_sub_category:"post_purchase_module",...(0,p.J4)(t)}),window.location.href=t},className:"button-blue button-lg text-lg font-semibold block sm:inline-block sm:w-fit w-full leading-normal text-center",children:Z})})]}):(0,l.jsx)("div",{className:"flex items-center justify-center w-full py-xl","aria-busy":"true",role:"status",children:(0,l.jsx)(O.R,{})})};var ee=s(23640),et=s(41565),es=s(21686),el=s(5937),en=!0;function er(e){let{seo:t,payment_intent_client_secret:s,products:n,region:r,defaultNewsletters:a,carouselImages:o,membershipTitle:i,newsletter:c,toteSelection:u}=e,d=(0,el.Zj)(),m=(0,el.m1)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(es.h,{children:t.title}),(0,l.jsx)(ee.P,{children:(0,l.jsx)(A.S8,{options:{clientSecret:s,appearance:{theme:"stripe"}},stripe:et._,children:(0,l.jsx)(Q,{region:r,carouselImages:o,products:n,defaultNewsletters:a,membershipTitle:i,gifts:d,availableGifts:m,newsletter:c,toteSelection:u})})})]})}}},e=>{e.O(0,[2966,521,8635,8213,5789,1869,6653,3640,2168,636,6593,8792],()=>e(e.s=85176)),_N_E=e.O()}]);

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.