1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9869],{13468:(t,e,r)=>{"use strict";r.r(e),r.d(e,{__N_SSP:()=>h,default:()=>p});var a=r(77269),n=r(13385),o=r(49936),i=r(88936),s=r(53862),c=r(58051),u=r(44112);let l=new Set(["active","trialing","past_due","unpaid"]);var h=!0;function p(){return(0,n.useEffect)(()=>{let t=!1,e="true"===new URLSearchParams(window.location.search).get("checkoutWithoutTrial"),r=()=>{t||window.location.assign(function(){var t;let e=null!=(t=new URLSearchParams(window.location.search).get("returnTo"))?t:"";return e.startsWith("/")&&!e.startsWith("//")?e:"/account"}())};return(0,i.J0)(t=>{(async()=>{try{var a,n,o;let i=await (null==(a=t.getToken)?void 0:a.call(t));if(!i)return r();let u=await (0,s.jp)(i),h=null!=(o=null==u||null==(n=u.subscription)?void 0:n.subscriptionStatus)?o:"none";if(l.has(h))return r();(e?await (0,c.z)({skipTrial:!0}):await (0,c.z)())||r()}catch(t){u.A.error(t,"PostAuthCheckoutGateError"),r()}})()}),()=>{t=!0}},[]),(0,a.jsx)("main",{className:(0,o.A)("mxa","mw640px","my40","p24"),children:(0,a.jsx)("p",{children:"One momentâ¦"})})}},15683:(t,e,r)=>{"use strict";r.d(e,{N:()=>i});var a,n,o=r(23727);let i={priceId:"price_1TTShf6j0yIh3qvxfdEPCiwF",trialPeriodDays:7,appStore:{ios:null!=(a=o.env.NEXT_PUBLIC_SFGATE_APP_IOS_URL)?a:"",android:null!=(n=o.env.NEXT_PUBLIC_SFGATE_APP_ANDROID_URL)?n:"",fallback:"https://onelink.to/3f4xnr"}}},43373:(t,e,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/checkout",function(){return r(13468)}])},53862:(t,e,r)=>{"use strict";r.d(e,{Mg:()=>h,Nx:()=>n.N,VK:()=>
1l,fw:()=>u,jp:()=>c});var a=r(644),n=r(15683);let o="".concat(a.A.misApiUrl,"/api/v1");class i extends Error{constructor(t,e){super(e),this.name="MembershipError",this.status=t}}async function s(t,e,r){var a;let n=await fetch("".concat(o).concat(t),{...r,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e),...null!=(a=null==r?void 0:r.headers)?a:{}}});if(!n.ok)throw new i(n.status,"MIS ".concat(t," ").concat(n.status));return await n.json()}let c=t=>s("/auth/me",t),u=(t,e)=>s("/stripe/create-checkout-session",t,{method:"POST",body:JSON.stringify(e)}),l=(t,e)=>s("/stripe/create-customer-portal-session",t,{method:"POST",body:JSON.stringify(e)}),h=(t,e)=>s("/stripe/subscription-status/".concat(encodeURIComponent(e)),t)},58051:(t,e,r)=>{"use strict";r.d(e,{z:()=>i});var a=r(88936),n=r(44112),o=r(15683);async function i(){var t,e;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i="https://api.sfgate.hnpapps.com",s="price_1TTShf6j0yIh3qvxfdEPCiwF";if(!i||!s)return!1;let c=await (null==(e=(0,a.mh)())||null==(t=e.getToken)?void 0:t.call(e));if(!c)return!1;let u=r.skipTrial?void 0:o.N.trialPeriodDays;try{let{origin:t}=window.location,e=await fetch("".concat(i,"/api/v1/stripe/create-checkout-session"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)},body:JSON.stringify({priceId:s,success_url:"".concat(t,"/account?checkout=success&session_id={CHECKOUT_SESSION_ID}"),cancel_url:"".concat(t,"/account"),...void 0===u?{}:{trialPeriodDays:u}})});if(!e.ok)return n.A.error("MIS create-checkout-session returned ".concat(e.status),"SfgateCheckoutError"),!1;let{url:r}=await e.json();if(r)return window.location.assign(r),!0;return!1}catch(t){return n.A.error(t,"SfgateCheckoutError"),!1}}}},t=>{t.O(0,[636,6593,8792],()=>t(t.s=43373)),_N_E=t.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.