PageSourceSearch

https://rocketwriter.ai/_nuxt/B7lqjHAT.js

js rocketwriter.ai collected 2026-10-05 13:39:33 UTC 6,370 bytes, 1 lines download raw bytes

1import{B as D,h as B,e as C,p as z,c as r,o as a,n as y,a as t,l as f,t as o,F as v,r as P,b as h,d as b,w as _,f as S,m as p,i as A,x as I}from"./D3mXZbvm.js";import{B as $}from"./CbyiM6aK.js";import{S as N}from"./D0HDmefO.js";function T(){const{request:e}=D(),u=B(),s=n=>{window.location.href=n};return{startInstantCheckout:async n=>{const i=await e("/api/v3/me/orders/create",{method:"POST",headers:{Authorization:`Bearer ${u.token}`},body:JSON.stringify({token:n})});if(!i.ok)return{ok:!1,error:"Failed to create order."};let l=i.data?.id||i.data?.order?.id;if(!l){const c=await e("/api/v3/me/orders/current",{headers:{Authorization:`Bearer ${u.token}`}});if(!c.ok||!c.data?.id)return{ok:!1,error:"Could not resolve current order."};l=c.data.id}const g=await e(`/api/v3/orders/${l}/finalize`,{method:"POST",headers:{Authorization:`Bearer ${u.token}`},body:JSON.stringify({backUrl:window.location.origin+"/order/"+l})});return g.ok?g.data?.paymentUrl?(s(g.data.paymentUrl),{ok:!0,redirected:!0}):{ok:!1,error:"No payment URL returned from finalize."}:{ok:!1,error:"Failed to finalize order."}}}}const F={class:"text-lg font-bold text-gray-900"},R={key:0,class:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-primary text-white text-[9px] font-black px-2 py-0.5 rounded-full shadow-md uppercase tracking-widest z-20 whitespace-nowrap"},U={class:"p-6 flex flex-col flex-grow text-center group"},V={class:"mb-4"},j={key:0,class:"flex flex-col items-center mb-1"},q={class:"text-4xl font-extrabold text-gray-400 line-through"},E={class:"flex items-center gap-2 mt-1"},M={class:"text-xl font-bold text-primary"},J={class:"bg-primary/10 text-primary text-[10px] font-black px-1.5 py-0.5 rounded uppercase"},L={key:0,class:"text-sm font-bold text-gray-400 mt-1"},G={key:1,class:"mb-1"},W={class:"text-4xl font-extrabold text-gray-900"},H={key:0,class:"text-sm font-bold text-gray-400 mt-1"},K={class:"text-[11px] text-gray-400 mt-0.5"},Q={class:"space-y-3 mb-6 text-left"},X={class:"flex items-center gap-2.5"},Y={class:"flex items-center gap-1.5 flex-wrap min-h-[1.5rem]"},Z={class:"text-gray-700 font-semibold uppercase text-[11px] leading-normal py-0.5"},ee={key:0,class:"group/tooltip relative inline-flex items-center"},te={class:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover/tooltip:block w-40 p-1.5 bg-gray-900 text-white text-[10px] rounded shadow-lg z-50 normal-case font-normal text-center"},ae={key:0,class:"border-b border-gray-100 my-1"},re={class:"mt-auto"},oe=C({__name:"PricingCard",props:{packageData:{},loading:{type:Boolean}},emits:["select"],setup(e){return(u,s)=>{const m=z("font-awesome-icon");return a(),r("div",{class:y(["flex flex-col bg-white rounded-xl border transition-all duration-300 relative h-full",[e.packageData.featured?"border-primary shadow-lg scale-105 z-10":"border-gray-200 shadow-sm hover:shadow-md"]])},[t("div",{class:y(["p-3 text-center border-b rounded-t-xl relative",e.packageData.featured?"bg-blue-50":"bg-gray-50"])},[t("h3",F,o(e.packageData.name),1),e.packageData.featured?(a(),r("div",R," Most Popular ")):f("",!0)],2),t("div",U,[t("div",V,[e.packageData.discountPrice?(a(),r("div",j,[t("div",q," $"+o(e.packageData.price),1),t("div",E,[t("span",M," $"+o(e.packageData.discountPrice),1),t("span",J," -"+o(Math.round((1-e.packageData.discountPrice/e.packageData.price)*100))+"% ",1)]),e.packageData.numberOfBooks?(a(),r("div",L,o(e.packageData.numberOfBooks)+" "+o(e.packageData.numberOfBooks===1?"Book":"Books"),1)):f("",!0)])):(a(),r("div",G,[t("div",W," $"+o(e.packageData.price),1),e.packageData.numberOfBooks?(a(),r("div",H,o(e.packageData.numberOfBooks)+" "+o(e.packageData.numberOfBooks===1?"Book":"Books"),1)):f("",!0)])),t("div",K," $"+o(((e.packageData.discountPrice||e.packageData.price)/(e.packageData.numberOfBooks||1)).toFixed(2))+" per Book ",1)]),t("div",Q,[(a(!0),r(v,null,P(e.packageData.features,(n,i)=>(a(),r(v,{key:i},[t("div",X,[h(m,{icon:"check-circle",class:"flex-shrink-0 text-base transition-colors duration-300 text-primary"}),t("div",Y,[t("span",Z,o(n.name),1),n.tooltip?(a(),r("div",ee,[h(m,{icon:"info-circle",class:"text-gray-400 hover:text-gray-600 cursor-help text-xs"}),t("div",te,[b(o(n.tooltip)+" ",1),s[1]||(s[1]=t("div",{class:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-900"},null,-1))])])):f("",!0)])]),i!==e.packageData.features.length-1?(a(),r("div",ae)):f("",!0)],64))),128))]),t("div",re,[h($,{variant:e.packageData.featured?"primary":"ghost",block:"",size:"sm",class:y(["font-bold border-2 text-xs py-2.5 shadow-lg transition-all duration-300",[e.packageData.featured?"hover:scale-105":"hover:bg-primary hover:border-primary hover:text-white hover:scale-105"]]),onClick:s[0]||(s[0]=n=>u.$emit("select",e.packageData)),loading:e.loading},{default:_(()=>[...s[2]||(s[2]=[b(" START WRITING ",-1)])]),_:1},8,["variant","class","loading"])])])],2)}}}),se=Object.assign(oe,{__name:"PricingCard"}),ne={key:0,class:"flex justify-center py-20"},ie={key:1,class:"text-center py-20"},ce={class:"text-red-500 mb-4"},le={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 items-stretch pt-4 max-w-6xl mx-auto"},de=C({__name:"Cards",setup(e){const u=S(),s=B(),{request:m}=D(),{startInstantCheckout:n}=T(),i=p([]),l=p(!0),g=p(null),c=p(null),w=async()=>{l.value=!0,c.value=null;try{const d=await m("/api/v3/packages");d.ok?i.value=d.data:c.value="Failed to load packages. Please try again later."}catch(d){console.error("Error fetching packages:",d),c.value="An error occurred while loading packages."}finally{l.value=!1}},O=async d=>{if(!s.token){u.push({path:"/login",query:{redirect:"/pricing"}});return}g.value=d.id;try{const k=await n(d.token);k.ok||alert(k.error||"Failed to start checkout. Please try again.")}catch(k){console.error("Error starting instant checkout:",k),alert("An error occurred. Please try again.")}finally{g.value=null}};return A(()=>{w()}),(d,k)=>(a(),r("div",null,[l.value?(a(),r("div",ne,[h(N,{size:"lg",color:"primary"})])):c.value?(a(),r("div",ie,[t("p",ce,o(c.value),1),h($,{onClick:w},{default:_(()=>[...k[0]||(k[0]=[b("Try Again",-1)])]),_:1})])):(a(),r("div",le,[(a(!0),r(v,null,P(i.value,x=>(a(),I(se,{key:x.id,packageData:x,loading:g.value===x.id,onSelect:O},null,8,["packageData","loading"]))),128))]))]))}}),me=Object.assign(de,{__name:"PricingCards"});export{me as C};

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.