1import{c as a,D as e,r,l as t,aC as i,f as l,aD as s,o as n}from"#entry";import{r as o,c as u}from"./nX7w3--X.js";const c={already_used:"You've already used your free trial.",capacity:"Free trials are full for today â please try again tomorrow.",disabled:"Free trials arenât available right now.",unauthorized:"Please sign in to start your free trial.",error:"Something went wrong starting your trial. Please try again."};function d(){const t=a(),i=o(null),l=o(!1),s=o(!1),n=u((()=>t.isAuthenticated&&!t.hasSubscription&&!0===i.value?.eligible));return{eligibility:i,eligibilityLoaded:l,canStartTrial:n,starting:s,checkEligibility:async function(){t.isAuthenticated&&!t.hasSubscription?(i.value=await e().getTrialEligibility(),l.value=!0):l.value=!0},startTrial:async function(){if(s.value)return!1;s.value=!0;try{const a=await e().startTrial();return a.ok?(a.permissionsUpdated&&await t.refreshAuthToken(),t.previewExpiresAt=a.expiresAt,i.value={eligible:!1,reason:"already_active",expiresAt:a.expiresAt},r().showSnackbar({message:"already_active"===a.status?"You already have Pro access.":"Your 7-day free Pro trial is active â enjoy!",color:"success",timeout:5e3}),!0):(r().showSnackbar({message:c[a.reason],color:"error"===a.reason?"error":"warning",timeout:6e3}),"already_used"===a.reason?i.value={eligible:!1,reason:"already_used",expiresAt:null}:"capacity"===a.reason?i.value={eligible:!1,reason:"capacity_reached",expiresAt:null}:"disabled"===a.reason&&(i.value={eligible:!1,reason:"disabled",expiresAt:null}),!1)}finally{s.value=!1}},TRIAL_DURATION_DAYS:7}}function g(){const e=a(),r=t(),{isUpgrading:o,startFreeTrial:c}=i(),d=u((()=>e.isAuthenticated?"Upgrade":"Start Free Trial")),g=u((()=>e.isAuthenticated?"Cancel anytime.":"Sign up to start your free 7-day Pro trial. Cancel anytime."));return{isUpgrading:o,startUpgrade:async function(a){const t=l(),i=a?.returnUrl??t.fullPath,u=a?.location;if(u&&r.trackProUpgradeClicked(u),e.isAuthenticated)await c(i);else{u&&r.trackSignupClick("modal",`${u}_pro`),s({returnUrl:i,location:u}),o.value=!0;try{await n()}catch(d){console.error("[useProUpgrade] handleSignup failed:",d),o.value=!1}}},upgradeCtaLabel:d,upgradeFinePrint:g}}export{d as a,g as u};
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.