PageSourceSearch

https://surviveaccounting.com/assets/checkout-B3J0VT2Q.js

js surviveaccounting.com collected 2026-10-09 03:04:49 UTC 8,574 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pricing.sample-hQNqsRN3.js","assets/index-B-VekllG.js","assets/index-BnuhLJ6X.css"])))=>i.map(i=>d[i]);
2import{j as e,lC as u,Y as l,bl as _,br as x,ai as k,aj as y,mr as T,bQ as z,r as d,bR as R,u as I,bS as O,ms as S,mt as F,q as W,_ as v}from"./index-B-VekllG.js";import{C as D}from"./CheckoutFrame-CGNzenwc.js";function $({s}){return e.jsx("ul",{className:"co-lines",children:s.lines.map((t,c)=>e.jsxs("li",{className:"co-line",children:[e.jsxs("span",{className:"co-line-l",children:[t.label,t.note&&e.jsx("small",{children:t.note})]}),e.jsxs("span",{className:"co-line-r co-num",children:[t.compareAtCents!=null&&e.jsx("s",{children:u(t.compareAtCents)}),e.jsx("span",{children:u(t.amountCents)})]})]},c))})}function Y({s,button:t,fine:c,crossSellHref:m,held:n,children:i}){return e.jsxs("aside",{className:"co-sum","aria-label":"Order summary",children:[e.jsx("div",{className:"co-sum-h",children:"Order summary"}),e.jsx($,{s}),e.jsxs("div",{className:"co-total",children:[e.jsx("span",{children:"Total"}),e.jsxs("span",{className:"co-num",children:[s.compareAtCents!=null&&e.jsx("s",{children:u(s.compareAtCents)}),e.jsx("b",{children:u(s.totalCents)})]})]}),s.savesCents>0&&e.jsxs("p",{className:"co-saves",children:[e.jsx(l,{size:14,strokeWidth:3,"aria-hidden":!0})," You save ",u(s.savesCents)]}),n?e.jsxs("p",{className:"co-ok",style:{marginTop:16},children:[e.jsx(l,{size:18,strokeWidth:3,"aria-hidden":!0})," Already yours."]}):t,i,c&&e.jsxs("p",{className:"co-fine",children:[e.jsx(_,{size:12,"aria-hidden":!0,style:{verticalAlign:"-1px",marginRight:4}}),c]}),s.crossSell&&m&&e.jsx("p",{className:"co-cross",children:e.jsxs("a",{href:m,children:[s.crossSell.text,e.jsx(x,{size:13,"aria-hidden":!0,style:{verticalAlign:"-2px",marginLeft:3}})]})})]})}function q({s,button:t,held:c}){return c?null:e.jsxs("div",{className:"co-bar",children:[e.jsxs("span",{className:"co-num",children:[e.jsx("b",{children:u(s.totalCents)}),s.compareAtCents!=null&&e.jsxs(e.Fragment,{children:[" ",e.jsx("s",{style:{color:"var(--co-muted)",fontSize:13},children:u(s.compareAtCents)})]})]}),t]})}const U=k({method:"GET"}).handler(y("11af5fda3294f7ca9273c8786007468cdb0787af43c01b9454dfd978a1ff15da")),B=k({method:"POST"}).handler(y("5c6f8e1b74babccce41d8ec6cb356a5f8318bca5d32256b12fa0d7982549cce7")),H=k({method:"POST"}).handler(y("02ce3d8e77abd5066c1243b2a9cbc14b6c5121baa442a1753df021fa46119e40"));function w(s){const t=new URLSearchParams({item:s.item});return s.campus&&t.set("campus",s.campus),s.chapter&&t.set("chapter",s.chapter),s.trial&&t.set("trial",s.trial),s.back&&t.set("back",s.back),s.sample&&t.set("sample","1"),`/checkout?${t.toString()}`}async function M(s){const{samplePricing:t}=await v(async()=>{const{samplePricing:h}=await import("./pricing.sample-hQNqsRN3.js");return{samplePricing:h}},__vite__mapDeps([0,1,2])),{orderSummary:c,itemIncludes:m}=await v(async()=>{const{orderSummary:h,itemIncludes:o}=await import("./index-B-VekllG.js").then(f=>f.xO);return{orderSummary:h,itemIncludes:o}},__vite__mapDeps([1,2])),n=t(),i=s.chapter?{nickname:"Alpha Chi",memberRateCents:n.member_rate_default.amountCents}:null,j=c(s.item,n,{memberRateCents:i?.memberRateCents??null,memberRateLabel:i?.nickname??null,trialFeedback:!!s.trial,accessEndsLabel:"Dec 15, 2026"});return{item:s.item,pricing:n,summary:j,includes:m(s.item,"ACCY 201"),campusId:null,campusName:"Ole Miss",courseId:null,courseCode:"ACCY 201",termLabel:"Fall 2026",expiresLabel:"Dec 15, 2026",disclosure:"Access runs through Dec 15, 2026 (end of Fall 2026) and does not roll over to the next term.",chapter:i,trialDiscount:!!s.trial,configured:!0,held:!1}}function G(){const s=T.useSearch(),t=z(),[c,m]=d.useState(null),[n,i]=d.useState(""),[j,h]=d.useState(!!s.session_id),[o,f]=d.useState(null),N=d.useRef(!1);d.useEffect(()=>{R.auth.getSession().then(({data:r})=>m(r.session?.access_token??null))},[t.userId]);const p=I({queryKey:["checkout",s.item,s.campus??"",s.chapter??"",s.trial??"",c??"",s.sample?1:0],queryFn:()=>s.sample?M(s):U({data:{item:s.item,campusSlug:s.campus??null,schoolSlug:s.campus??null,chapterSlug:s.chapter??null,trialId:s.trial??null,accessToken:c}}),retry:!1}),a=p.data,A=w(s),b=s.campus?`/learn/${encodeURIComponent(s.campus)}`:"/learn";d.useEffect(()=>{!s.session_id||N.current||(N.current=!0,(async()=>{const r=await H({data:{sessionId:s.session_id,redirectTo:s.back??b}});if(!r.ok){i(r.error),h(!1);return}if(f(r.item),r.signInUrl){window.location.replace(r.signInUrl);return}h(!1),await p.refetch()})())},[s.session_id]);const g=O({mutationFn:async()=>{const r=await B({data:{item:s.item,campusSlug:s.campus??null,schoolSlug:s.campus??null,chapterSlug:s.chapter??null,trialId:s.trial??null,returnPath:A}});if(!r.ok)throw new Error(r.error);window.location.assign(r.url)},onError:r=>i(r instanceof Error?r.message:"checkout failed")}),E=a?.summary.title??S[s.item],C=a&&!a.configured?e.jsxs("p",{className:"co-meta",style:{display:"flex",gap:8,marginTop:16},children:[e.jsx(_,{size:15,"aria-hidden":!0,style:{flex:"none",marginTop:2}}),"Checkout isn't switched on for this deployment yet."]}):e.jsxs("button",{type:"button",className:"co-btn",onClick:()=>g.mutate(),disabled:g.isPending||!a,children:[g.isPending?"Opening checkout…":a?.summary.button??"Pay",e.
2jsx(x,{size:16,"aria-hidden":!0})]}),L=a?.summary.crossSell?w({...s,item:"semester_pass",trial:s.trial}):null,P=p.isError?e.jsxs("section",{className:"co-card",children:[e.jsx("h2",{className:"co-h2",children:"Prices aren't set up yet."}),e.jsx("p",{className:"co-meta",children:p.error instanceof Error?p.error.message:"Couldn't load the prices."})]}):j?e.jsxs("section",{className:"co-card",children:[e.jsx("h2",{className:"co-h2",children:"Unlocking your course…"}),e.jsx("p",{className:"co-meta",children:"One moment. You'll land in the course, signed in."})]}):o?e.jsxs("section",{className:"co-card",children:[e.jsxs("p",{className:"co-ok",children:[e.jsx(l,{size:18,strokeWidth:3,"aria-hidden":!0})," Paid."]}),e.jsx("h2",{className:"co-h2",style:{marginTop:8},children:F(o,a?.expiresLabel)}),e.jsxs("a",{className:"co-btn","data-v":"dark",href:s.back??b,children:["Start studying",e.jsx(x,{size:16,"aria-hidden":!0})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"co-card",children:[e.jsx("h2",{className:"co-h2",children:"What you're getting"}),e.jsx("ul",{className:"co-list",children:(a?.includes??[]).map(r=>e.jsxs("li",{children:[e.jsx(l,{size:16,strokeWidth:3,"aria-hidden":!0}),e.jsx("span",{children:r})]},r))}),a&&e.jsxs("p",{className:"co-meta",children:["Access runs through ",a.expiresLabel," (end of ",a.termLabel,"). Practice questions are free for everyone, always."]})]}),e.jsxs("section",{className:"co-card",children:[e.jsx("h2",{className:"co-h2",children:"How paying works"}),e.jsxs("ul",{className:"co-list",children:[e.jsxs("li",{children:[e.jsx(l,{size:16,strokeWidth:3,"aria-hidden":!0}),e.jsx("span",{children:"Tap the button. Stripe takes your card and email on its own page."})]}),e.jsxs("li",{children:[e.jsx(l,{size:16,strokeWidth:3,"aria-hidden":!0}),e.jsx("span",{children:"You come straight back, signed in, with everything unlocked. No account to make first."})]}),a?.chapter&&e.jsxs("li",{children:[e.jsx(l,{size:16,strokeWidth:3,"aria-hidden":!0}),e.jsxs("span",{children:["This is ",a.chapter.nickname,"'s member rate."]})]}),a?.trialDiscount&&e.jsxs("li",{children:[e.jsx(l,{size:16,strokeWidth:3,"aria-hidden":!0}),e.jsx("span",{children:"Thanks for the feedback — your trial discount is on."})]})]}),s.checkout==="cancel"&&e.jsx("p",{className:"co-meta",children:"Checkout was closed before paying. Nothing was charged."}),n&&e.jsx("p",{className:"co-err",children:n})]})]});return e.jsx(D,{eyebrow:a?.campusName?`${a.campusName}${a.courseCode?` · ${a.courseCode}`:""}`:"Survive Accounting",title:E,sub:s.item==="semester_pass"?"Every exam, all semester. One price, once.":`Everything for ${S[s.item]}, through the end of the term.`,left:P,right:a&&!o?e.jsx(Y,{s:a.summary,button:C,fine:a.disclosure,crossSellHref:L,held:a.held,children:a.held&&e.jsxs("a",{className:"co-btn","data-v":"dark",href:b,children:["Start studying",e.jsx(x,{size:16,"aria-hidden":!0})]})}):null,below:e.jsxs(e.Fragment,{children:[a&&!o&&e.jsx(q,{s:a.summary,button:C,held:a.held}),!o&&e.jsxs("p",{className:"co-back",children:["Already bought it? ",e.jsx(W,{to:"/learn/{-$campus}/{-$chapter}",params:{campus:s.campus,chapter:void 0},children:"Sign in on /learn"}),"."]})]})})}export{G as component};

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.