1import{_ as J}from"./BI4t_NV9.js";import{d as C,c as x,f as p,o as r,g as t,al as G,a2 as P,i as e,k as v,H as m,y as B,ae as K,p as F,T as Q,B as R,F as N,l as U,h as $,G as S,m as L,a9 as Z,a8 as Y,w as ee,D as te,C as se,s as oe,t as ae,U as re}from"#entry";import{_ as ne}from"./BuukdIkl.js";import{u as O,C as w,b as I,a as H}from"./DmSmOkD-.js";import{u as X}from"./C4DttTXL.js";import{_ as D}from"./jiNKUcgx.js";import{_ as z}from"./sX5IReoc.js";import le from"./DFygfSMa.js";import{_ as ie}from"./CD6Po8Td.js";import"./D1MPn_0g.js";const ce={class:"w-full overflow-hidden"},de=C({__name:"ProgressBar",props:{value:{},max:{default:100},barClass:{default:"bg-fm-gradient"}},setup(y){const a=y,i=x(()=>{const l=a.max>0?a.value/a.max:0;return`${Math.min(100,Math.max(0,l*100))}%`});return(l,f)=>(r(),p("div",ce,[t("div",{class:P(["h-full rounded-full transition-all",y.barClass]),style:G({width:e(i)})},null,6)]))}}),ue={class:"flex flex-col items-center gap-2"},pe={class:"text-sm text-gray-500 dark:text-gray-400"},fe=C({__name:"CancelProgressBar",props:{step:{},total:{}},setup(y){return(a,i)=>{const l=de;return r(),p("div",ue,[v(l,{value:y.step,max:y.total,"bar-class":"bg-fm-gradient",class:"max-w-[200px] h-1.5 rounded-full bg-gray-200 dark:bg-zinc-700"},null,8,["value","max"]),t("span",pe,"Step "+m(y.step)+" of "+m(y.total),1)])}}}),me={class:"container py-8 max-md:py-6"},_e={class:"flex items-start gap-5 max-lg:flex-col"},xe={class:"flex flex-col gap-6"},ge=C({__name:"CancelStepShell",props:{step:{}},setup(y){const a=y,{reason:i,offer:l,offerChecked:f,fetchOffer:d,goToStep:b}=O(),{ensureLoaded:s}=X();B(async()=>{await s(),a.step!==w.RESULT&&!f.value&&await d().catch(()=>{})});const o=I-1,_=x(()=>f.value&&!l.value),c=x(()=>_.value?o:I),g=x(()=>a.step===w.RESULT&&_.value?o:a.step);return K(()=>{a.step>w.SURVEY&&!i.value&&b(w.SURVEY)}),(u,n)=>{const h=J,k=fe,E=ne;return r(),p("div",me,[t("div",_e,[v(h),v(E,{class:"dark:border dark:!border-ds-gray-800 dark:!bg-ds-gray-800"},{default:F(()=>[t("div",xe,[v(k,{step:e(g),total:e(c)},null,8,["step","total"]),Q(u.$slots,"default")])]),_:3})])])}}}),be={class:"flex flex-col gap-6 max-w-[526px] mx-auto"},ye={class:"flex flex-col gap-3"},ve=["onClick"],he={class:"flex items-center gap-3"},ke={key:0,class:"text-xl"},we={class:"font-medium"},$e={key:0,class:"block w-3 h-3 rounded-full bg-primary"},Ce=C({__name:"SurveyStep",setup(y){const{reasons:a,reason:i,fetchOffer:l,cancel:f,goToStep:d}=O(),b=H(),s=R(i.value),o=R(!1);B(()=>b.cancelReasonScreenShown());const _=async()=>{if(!s.value||o.value)return;const c=s.value;b.cancelReasonContinueClicked(c),o.value=!0;try{let g;try{g=await l()}catch{return}g?d(w.OFFER,{reason:c,...g.type==="intro_freeze"?{offer_type:"intro_freeze"}:{}}):await f(c)&&d(w.RESULT,{reason:c})}finally{o.value=!1}};return(c,g)=>{const u=D;return r(),p("div",be,[g[1]||(g[1]=t("div",null,[t("h1",{class:"font-bold text-3xl max-md:text-2xl"},"We're sorry to see you go"),t("p",{class:"text-lg max-md:text-base text-gray-600 dark:text-gray-400 mt-2"}," Help us improve. What's the main reason for leaving? ")],-1)),t("div",ye,[(r(!0),p(N,null,U(e(a),n=>(r(),p("button",{key:n.value,onClick:h=>s.value=n.value,class:P(["flex items-center justify-between gap-3 rounded-xl border px-4 py-3 text-left transition-colors",e(s)===n.value?"border-primary bg-ds-violet-100 dark:bg-ds-violet-950":"border-transparent dark:border-ds-gray-950 dark:bg-ds-gray-950 dark:hover:bg-ds-gray-700"])},[t("span",he,[n.emoji?(r(),p("span",ke,m(n.emoji),1)):$("",!0),t("span",we,m(n.label),1)]),t("span",{class:P(["flex-shrink-0 flex items-center justify-center w-5 h-5 rounded-full border-2",e(s)===n.value?"border-primary":"border-gray-300 dark:border-zinc-600"])},[e(s)===n.value?(r(),p("span",$e)):$("",!0)],2)],10,ve))),128))]),v(u,{onClick:_,loading:e(o),disabled:!e(s),class:"w-full py-3 rounded-xl justify-center text-ds-violet-400 dark:text-ds-violet-300 border-2 border-primary text-lg text-primary font-medium transition-colors disabled:opacity-40 hover:enabled:bg-purple-50 dark:hover:enabled:bg-ds-violet-950"},{default:F(()=>[...g[0]||(g[0]=[S(" Continue ",-1)])]),_:1},8,["loading","disabled"])])}}}),Se={key:0,class:"flex gap-3 pb-2 md:grid md:grid-cols-3 p-[1px]"},Te={key:1,class:"flex overflow-x-auto snap-x snap-mandatory scrollbar-hidden [scrollbar-width:none] gap-3 pb-2 md:grid md:grid-cols-3 md:overflow-visible p-[1px] md:pb-0"},Fe={class:"relative rounded-lg overflow-hidden w-[132px] h-[112px]"},Ee={class:"font-semibold text-sm truncate"},Le={key:0,class:"text-ds-violet-700 dark:text-ds-violet-400 text-xs"},Oe={key:1,class:"flex gap-0.5"},Pe=C({__name:"OfferBookPicks",setup(y){const{bookPicks:a,bookPicksLoaded:i,fetchBookPicks:l}=O(),f=H();B(l);const d=o=>o.chapter?`/books/${o.slug}/chapter-${o.chapter.order}`:`/books/${o.slug}`,b=o=>f.cancelFlowBookClicked(String(o.id)),s=(o,_)=>{const c=o-_;return c>=0?100:c<=-1?0:(c+1)*100}
1;return(o,_)=>{const c=z,g=le,u=ie;return e(i)?e(a).length?(r(),p("div",Te,[(r(!0),p(N,null,U(e(a),n=>(r(),L(u,{key:n.id,to:d(n),onClick:h=>b(n),class:"flex flex-col gap-2 max-w-[148px] shrink-0 snap-start md:w-auto rounded-xl p-2 ring-1 ring-ds-slate-100 dark:ring-ds-gray-950 dark:bg-ds-gray-950 transition-colors hover:bg-ds-violet-200 dark:hover:bg-ds-violet-950 hover:ring-primary"},{default:F(()=>[t("div",Fe,[n.cover?(r(),L(c,{key:0,src:n.cover,class:"w-full h-full object-cover"},null,8,["src"])):$("",!0),_[1]||(_[1]=t("span",{class:"absolute top-1 left-1 rounded-md bg-hot text-white text-[10px] font-semibold px-1.5 py-0.5"}," Trending ",-1))]),t("p",Ee,m(n.title),1),n.genres?.length?(r(),p("p",Le,m(n.genres[0].name),1)):$("",!0),n.rate?(r(),p("div",Oe,[(r(),p(N,null,U(5,h=>t("span",{key:h,class:"relative w-3.5 h-3.5"},[v(g,{name:"fm:star",class:"absolute inset-0 text-gray-300 dark:text-zinc-600"}),t("span",{class:"absolute inset-0 overflow-hidden",style:G({width:`${s(n.rate,h-1)}%`})},[v(g,{name:"fm:star",class:"text-[#F5BB57]"})],4)])),64))])):$("",!0)]),_:2},1032,["to","onClick"]))),128))])):$("",!0):(r(),p("div",Se,[(r(),p(N,null,U(3,n=>t("div",{key:n,class:"flex flex-col gap-2 w-[148px] shrink-0 md:w-auto rounded-xl p-2 ring-1 ring-ds-slate-100 dark:ring-ds-gray-950"},[..._[0]||(_[0]=[t("div",{class:"rounded-lg w-[132px] md:w-full h-[112px] bg-ds-gray-100 dark:bg-ds-gray-800 animate-pulse"},null,-1),t("div",{class:"h-4 rounded bg-ds-gray-100 dark:bg-ds-gray-800 animate-pulse"},null,-1),t("div",{class:"h-3 w-1/2 rounded bg-ds-gray-100 dark:bg-ds-gray-800 animate-pulse"},null,-1)])])),64))]))}}}),Be={class:"flex flex-col gap-6 w-full max-w-[536px] mx-auto"},Re={class:"font-semibold text-3xl max-md:text-2xl"},He={key:0,class:"text-lg max-md:text-base text-gray-600 dark:text-gray-400 mt-2"},je={class:"w-full max-w-[320px] mt-3 mx-auto rounded-2xl"},Ne={class:"relative"},Ue=["innerHTML"],De={class:"flex flex-col gap-3"},ze=C({__name:"OfferStep",setup(y){const{offerCopy:a,offer:i,isIntro:l,submitting:f,offerLoading:d,fetchOffer:b,acceptOffer:s,cancel:o,goToStep:_}=O(),c=H();B(async()=>{try{i.value||await b()}catch{}c.cancelOfferScreenShown()});const g=x(()=>l.value?"/img/subscription/intro-price.webp":"/img/subscription/offer-50-off.webp"),u=x(()=>l.value?"We'll extend your intro period so you can explore more.":a.value.offer),n=x(()=>l.value?"Keep My Intro Price":`Claim ${i.value?.discount_percent??50}% Discount`),h=R(!1),k=R(!1),E=async()=>{if(!f.value){c.cancelOfferClaimClicked(),h.value=!0;try{await s()&&_(w.RESULT,{offer_claimed:"true",...l.value?{offer_type:"intro_freeze"}:{}})}finally{h.value=!1}}},T=async()=>{if(!f.value){c.cancelOfferDeclineClicked(),k.value=!0;try{await o()&&_(w.RESULT)}finally{k.value=!1}}};return(A,j)=>{const q=Pe,M=z,V=D;return r(),p("div",Be,[t("div",null,[t("h1",Re,m(e(a).heading),1),e(a).subtitle?(r(),p("p",He,m(e(a).subtitle),1)):$("",!0)]),e(a).showBookPicks&&!e(l)?(r(),L(q,{key:0})):$("",!0),t("div",je,[t("div",Ne,[v(M,{src:"/img/subscription/offer-50-off-bg.webp",width:"320",class:"w-full h-[156px]"}),v(M,{width:"220",height:"188",src:e(g),class:"absolute bottom-0 left-1/2 transform -translate-x-1/2 m-auto"},null,8,["src"])]),t("p",{class:"bg-ds-gray-100 dark:bg-ds-gray-950 rounded-b-2xl text-primary dark:text-ds-violet-300 text-center p-4 [&_strong]:font-bold",innerHTML:e(u)},null,8,Ue)]),t("div",De,[v(V,{onClick:E,loading:e(h),disabled:e(f)||e(d),class:"w-full py-4 rounded-xl justify-center bg-fm-gradient hover:bg-fm-gradient-active !text-white font-semibold transition-all disabled:opacity-60"},{default:F(()=>[S(m(e(n)),1)]),_:1},8,["loading","disabled"]),v(V,{onClick:T,loading:e(k),disabled:e(f)||e(d),class:"w-full py-4 rounded-xl justify-center border border-primary text-primary font-semibold transition-colors hover:bg-purple-50 dark:hover:bg-ds-violet-950 disabled:opacity-60"},{default:F(()=>[...j[0]||(j[0]=[S(" Cancel Anyway ",-1)])]),_:1},8,["loading","disabled"])])])}}}),Ae={class:"flex flex-col gap-6 w-full max-w-[536px] mx-auto"},Me={class:"font-semibold text-2xl max-md:text-xl"},Ve={class:"card-gradient-border rounded-xl bg-ds-gray-50 dark:bg-ds-gray-950 p-6 max-md:p-4 flex flex-col gap-4"},Ye={class:"w-max flex items-center gap-2 rounded-full bg-ds-green-200/40 text-ds-green-600 px-2.5 text-sm py-1 font-semibold"},Ie={class:"text-ds-gray-500 line-through text-lg"},We={class:"!font-semibold text-2xl max-md:text-xl"},Ge={class:"text-ds-gray-500 text-lg font-normal"},Ke={class:"flex items-center justify-between"},Xe={class:"flex items-center gap-2"},qe={class:"font-medium text-lg"}
1,Je={key:0,class:"rounded-full bg-ds-violet-100 dark:bg-ds-violet-950 text-purple-800 text-sm font-semibold px-2.5 py-1"},Qe=C({__name:"DiscountClaimed",setup(y){const{offer:a,isIntro:i,nextPeriod:l,backToHome:f}=O(),{subscription:d}=X(),b=H();B(()=>b.discountClaimedScreenShown());const s=x(()=>d.value?.product??null),o=x(()=>d.value?.retention_offer??a.value??null),_=x(()=>o.value?.original_price??s.value?.price??0),c=x(()=>o.value?.discount_percent??50),g=x(()=>o.value?.discounted_price??_.value*(1-c.value/100)),u=x(()=>s.value?Z(s.value.period_count,s.value.period_type):""),n=x(()=>{const E=s.value?.trial_days??0;return E?`(extended ${E}âdays intro)`:"(extended intro)"}),h=x(()=>Y(_.value)),k=x(()=>Y(g.value));return(E,T)=>{const A=z,j=D;return r(),p("div",Ae,[t("h1",Me,m(e(i)?"Done! Your intro period is extended.":`Done! Your ${e(l)} is half price.`),1),t("div",Ve,[t("span",Ye,[v(A,{src:"/img/subscription/discount-tag.svg",width:"24",height:"24",alt:"Check Circle"}),S(" "+m(e(i)?"intro price applied":`${e(c)}% OFF applied`),1)]),t("p",Ie,m(e(i)?"Full price:":"Current price:")+" "+m(e(h))+"/ "+m(e(u)),1),t("p",We,[S(m(e(k))+" ",1),t("span",Ge,m(e(i)?e(n):`/${e(l)}`),1)]),T[1]||(T[1]=t("hr",{class:"border-gray-200 dark:border-ds-gray-800"},null,-1)),t("div",Ke,[T[0]||(T[0]=t("span",{class:"text-gray-500"},"Next payment",-1)),t("span",Xe,[t("span",qe,m(e(k)),1),e(i)?$("",!0):(r(),p("span",Je,m(e(c))+"% OFF ",1))])])]),v(j,{onClick:e(f),class:"w-full py-4 rounded-xl justify-center text-lg bg-fm-gradient hover:bg-fm-gradient-active !text-white font-medium transition-all"},{default:F(()=>[...T[2]||(T[2]=[S(" Back to Homepage ",-1)])]),_:1},8,["onClick"])])}}}),Ze={class:"flex flex-col gap-6 w-full max-w-[536px] mx-auto"},et={class:"flex items-center gap-4"},tt={key:0,class:"flex flex-col gap-6"},st={key:1,class:"bg-ds-gray-50 dark:bg-ds-gray-900 p-6 max-md:p-4 flex flex-col gap-6"},W=1e3,ot=C({__name:"CancellationFeedback",setup(y){const{submitting:a,feedbackSubmitted:i,markFeedbackSubmitted:l,sendFeedback:f,backToHome:d}=O(),b=H(),s=R(""),o=x(()=>s.value.length>W);B(()=>{i.value?b.feedbackSubmittedScreenShown():b.cancelFeedbackScreenShown()});const _=async()=>{!s.value.trim()||o.value||a.value||(b.cancelFeedbackSubmitClicked(s.value.trim()),await f(s.value)&&(b.feedbackSubmittedScreenShown(),l()))},c=()=>{b.cancelFlowHomepageClicked(),d()};return(g,u)=>{const n=z,h=D;return r(),p("div",Ze,[t("div",et,[v(n,{src:"/img/subscription/complete.webp",width:"64",height:"64",alt:"Cancel"}),u[2]||(u[2]=t("div",null,[t("h1",{class:"font-semibold text-2xl max-md:text-xl"},"Subscription Cancelled"),t("p",{class:"text-ds-gray-700 dark:text-gray-400 mt-2 text-lg leading-relaxed"},[S(" Auto-renewal is off. You won't be charged again. "),t("br"),S(" Your coins are still yours to use. ")])],-1))]),e(i)?(r(),p("div",tt,[u[3]||(u[3]=t("div",{class:"rounded-2xl border border-ds-green-400 bg-ds-green-200/20 dark:border-ds-green-600 p-8 py-6 max-md:p-6 text-center"},[t("p",{class:"font-medium text-xl"},"Thank you! Your feedback helps us grow.")],-1)),t("button",{onClick:u[0]||(u[0]=(...k)=>e(d)&&e(d)(...k)),class:"w-full py-2 rounded-xl border border-2 border-primary text-primary dark:text-ds-violet-300 font-medium text-xl transition-colors hover:bg-purple-50 dark:hover:bg-ds-violet-950"}," Back to Homepage ")])):(r(),p("div",st,[u[5]||(u[5]=t("div",{class:"text-center"},[t("h2",{class:"font-bold text-xl"},"One last thing"),t("p",{class:"text-gray-600 dark:text-gray-400 mt-2"},"Any thoughts on what we could do better?")],-1)),t("div",null,[ee(t("textarea",{"onUpdate:modelValue":u[1]||(u[1]=k=>se(s)?s.value=k:null),rows:"6",placeholder:"Type your thoughts here...",class:P(["w-full rounded-lg border border-1.5 bg-ds-gray-50 dark:bg-ds-gray-950 p-4 resize-none focus:outline-none",e(o)?"border-yellow-400 focus:border-yellow-400":"border-ds-gray-200 dark:border-ds-gray-700 focus:border-primary"])},null,2),[[te,e(s)]]),t("p",{class:P(["text-right text-sm",e(o)?"text-yellow-500":"text-ds-gray-500"])},m(e(s).length)+"/"+m(W),3)]),v(h,{onClick:_,loading:e(a),disabled:!e(s).trim()||e(o),class:P(["w-full py-2.5 rounded-xl justify-center font-medium text-xl transition-all",e(s).trim()&&!e(o)?"bg-fm-gradient hover:bg-fm-gradient-active !text-white":"bg-ds-gray-100 dark:bg-ds-gray-800 text-ds-gray-500 cursor-not-allowed"])},{default:F(()=>[...u[4]||(u[4]=[S(" Submit Feedback ",-1)])]),_:1},8,["loading","disabled","class"]),t("button",{onClick:c,class:"w-full py-2 rounded-xl border border-2 border-primary text-primary dark:text-ds-violet-300 font-medium text-xl transition-colors hover:bg-purple-50 dark:hover:bg-ds-violet-950"}," Back to Homepage ")]))])}}}),at=C({__name:"FeedbackStep",setup(y){const{offerClaimed:a}=O();return(i,l)=>{const f=Qe,d=ot;return e(a)?(r(),L(f,{key:0})):(r(),L(d,{key:1}))}}}
1),_t=C({__name:"step-[number]",setup(y){const a=oe(),i=ae(),l={[w.SURVEY]:Ce,[w.OFFER]:ze,[w.RESULT]:at},f=x(()=>Number(a.params.number)),d=x(()=>l[f.value]);return K(()=>{d.value||i.replace("/profile/subscription")}),(b,s)=>{const o=ge;return e(d)?(r(),L(o,{key:0,step:e(f)},{default:F(()=>[(r(),L(re(e(d))))]),_:1},8,["step"])):$("",!0)}}});export{_t as default};
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.