PageSourceSearch

https://suno.com/_next/static/immutable/chunks/0t-c9bpn7xa6i.js

js suno.com collected 2026-10-01 08:31:02 UTC 70,963 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="606dfdf7-f34c-52c8-b884-4c0a639ec497")}catch(e){}}();
3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,499697,670960,534518,747075,803683,554071,704223,549628,874493,633258,100248,e=>{"use strict";var t=e.i(673157),a=e.i(7284);e.i(975824);var n=e.i(524986),s=e.i(249892);e.i(462951);var l=e.i(646984),i=e.i(177888),r=e.i(877130);e.i(696800);var o=e.i(37874);let c=({tooltip:e,children:a,triggerClassName:n})=>{let l=(0,s.useRef)(null),c=(0,s.useRef)(null),[u,d]=(0,s.useState)(!1),[p,m]=(0,s.useState)(!1),[x,f]=(0,s.useState)(240),g=u?l.current?.getBoundingClientRect():null;return(0,s.useEffect)(()=>{u?(c.current&&f(c.current.offsetWidth),requestAnimationFrame(()=>m(!0))):m(!1)},[u]),(0,s.useEffect)(()=>{if(!u)return;let e=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]),(0,t.jsxs)("span",{ref:l,role:"button",tabIndex:0,"aria-label":e,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:()=>d(e=>!e),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),d(e=>!e))},className:(0,r.twMerge)("inline-flex items-center text-gray-800/40 transition-colors hover:text-gray-800/60",n),children:[a??(0,t.jsx)(o.InfoIcon,{className:"size-3.5"}),u&&g&&(0,i.createPortal)((0,t.jsx)("div",{ref:c,className:"pointer-events-none fixed z-50 w-max max-w-60 rounded-lg bg-background-glass-thick px-3 py-2 text-xs text-foreground-primary shadow-lg backdrop-blur-[3.125rem] transition-all duration-150 ease-out",style:{top:g.bottom+8,left:Math.max(12,Math.min(g.left+g.width/2-x/2,window.innerWidth-x-12)),opacity:+!!p,transform:p?"translateY(0)":"translateY(-0.25rem)"},children:e}),document.body)]})};e.s(["CreditDisplayInfoTip",0,c],670960);var u=e.i(228749),d=e.i(398513),p=e.i(84695),m=e.i(157348),x=e.i(277565);function f({fallback:e}){return(0,t.jsx)(m.NamespaceLoadErrorBoundary,{renderFallback:()=>e,children:(0,t.jsx)(s.Suspense,{fallback:e,children:(0,t.jsx)(g,{})})})}function g(){let{t:e}=(0,l.useTranslation)("account");return e("autoReload.modalTitle")}let h=({open:e,onOpenChange:a,status:n,changeSource:i="amount_modal"})=>{let{t:r}=(0,l.useTranslation)("common"),o=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{e&&(o.current=!1)},[e]),(0,t.jsx)(p.default,{open:e,onOpenChange:e=>{e||o.current||(0,x.default)({actionName:"AutoReloadModalDismissed",context:{modal:"amount"}}),a(e)},title:(0,t.jsx)(f,{fallback:r("fallbacks.contentUnavailable")}),titleClassName:"px-10 text-[1.75rem] sm:text-[2.5rem]",children:(0,t.jsx)(d.ReloadAmountSettings,{open:e,status:n,changeSource:i,onConfirmed:()=>{o.current=!0,a(!1)}})})};var b=e.i(893773),y=e.i(741467),j=e.i(470601);e.i(179395);var S=e.i(274918),N=e.i(280887),v=e.i(429131);function _({fallback:e}){return(0,t.jsx)(m.NamespaceLoadErrorBoundary,{renderFallback:()=>e,children:(0,t.jsx)(s.Suspense,{fallback:e,children:(0,t.jsx)(w,{})})})}function w(){let{t:e}=(0,l.useTranslation)("account");return e("autoReload.limitModalTitle")}function C({currency:e,handleConfirm:n,hasSpendLimit:s,index:i,isBusy:r,isUnchanged:o,maxIndex:c,selected:u,setIndex:d,stops:p,subscription:m}){let{t:x}=(0,l.useTranslation)("account"),f=null==u.capValue?x("autoReload.unlimitedOption"):u.label;return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:"text-center text-base font-normal sm:text-lg",children:x("autoReload.limitModalDescription")}),(0,t.jsxs)("div",{className:"mx-10 flex flex-col gap-1",children:[(0,t.jsx)(P,{value:i,max:c,onChange:d,ariaLabel:x("autoReload.limitSliderLabel"),ariaValueText:f}),(0,t.jsx)("div",{className:"relative h-7",children:p.map((e,n)=>(0,t.jsx)("button",{type:"button",onClick:()=>d(n),className:(0,a.clsx)("absolute -translate-x-1/2 cursor-pointer text-base whitespace-nowrap md:text-lg",n===i?"text-foreground-primary":"text-white/40"),style:{left:`${c>0?n/c*100:0}%`},children:null==e.capValue?x("autoReload.unlimitedOption"):e.label},e.capValue??"unlimited"))})]}),(0,t.jsx)(b.ModalButton,{onClick:n,disabled:r||o,variant:S.ButtonVariant.Primary,className:"mt-4",children:s?x("autoReload.updateSpendLimit"):x("autoReload.setSpendLimit")}),(0,t.jsx)(j.TopupCurrencyNotice,{subscription:m,chargeCurrency:e,className:"text-center"})]})}function P({value:e,max:n,onChange:l,ariaLabel:i,ariaValueText:r}){let o=(0,s.useRef)(null),c=t=>{let a=o.current?.getBoundingClientRect();return a&&0!==a.width?Math.round(Math.min(Math.max((t-a.left)/a.width,0),1)*n):e},u=e=>n>0?e/n*100:0;return(0,t.jsxs)("div",{ref:o,role:"slider",tabIndex:0,"aria-label":i,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":e,"aria-valuetext":r,className:"relative h-6 w-full cursor-pointer touch-none select-none",onKeyDown:t=>{"ArrowLeft"===t.key||"ArrowDown"===t.key?(t.preventDefault(),l(Math.max(0,e-1))):"ArrowRight"===t.key||"ArrowUp"===t.key?(t.preventDefault(),l(Math.min(n,e+1))):"Home"===t.key?(t.preventDefault(),l(0)):"End"===t.key&&(t.preventDefault(),l(n))},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),l(c(e.clientX))},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&l(c(e.clientX))},children:[(0,t.jsx)("div",{className:"absolute top-1/2 h-1 w-full -translate-y-1/2 roun
3ded-full bg-white/20"}),(0,t.jsx)("div",{className:"absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-foreground-primary",style:{width:`${u(e)}%`}}),Array.from({length:n+1},(n,s)=>(0,t.jsx)("span",{className:(0,a.clsx)("absolute top-1/2 h-4 w-1 -translate-x-1/2 -translate-y-1/2 rounded-full",s<=e?"bg-foreground-primary":"bg-foreground-secondary"),style:{left:`${u(s)}%`}},s)),(0,t.jsx)("span",{className:"absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground-primary shadow",style:{left:`${u(e)}%`}})]})}let B=(0,n.observer)(({open:e,onOpenChange:a,status:n})=>{let{t:i}=(0,l.useTranslation)("common"),{session:r}=(0,v.useStores)(),{enableAutoReloadAsync:o,isBusy:c}=(0,N.useAutoReloadMutations)(),d=(0,s.useRef)(!1),f=(0,y.parseCurrency)(n.currency),g=(0,s.useMemo)(()=>{let e=[...n.cap_options];return null==n.spend_cap||n.is_unlimited||e.some(e=>Number(e)===Number(n.spend_cap))||(e.push(n.spend_cap),e.sort((e,t)=>Number(e)-Number(t))),[...e.map(e=>({capValue:e,label:(0,u.getDisplayPrice)(Number(e),f)})),{capValue:null}]},[n.cap_options,n.spend_cap,n.is_unlimited,f]),h=g.length-1,b=(0,s.useMemo)(()=>{if(null!=n.spend_cap&&!n.is_unlimited){let e=g.findIndex(e=>null!=e.capValue&&Number(e.capValue)===Number(n.spend_cap));if(e>=0)return e}return h},[g,h,n.spend_cap,n.is_unlimited]),[j,S]=(0,s.useState)(b);(0,s.useEffect)(()=>{e&&(S(b),d.current=!1)},[e,b]);let w=Math.min(j,h),P=g[w]??g[h],B=w===b,T=async()=>{P&&(null==P.capValue?await o({isUnlimited:!0,source:"limit_modal"}):await o({spendCap:P.capValue,source:"limit_modal"}),d.current=!0,a(!1))};return(0,t.jsx)(p.default,{open:e,onOpenChange:e=>{e||d.current||(0,x.default)({actionName:"AutoReloadModalDismissed",context:{modal:"limit"}}),a(e)},title:(0,t.jsx)(_,{fallback:i("fallbacks.contentUnavailable")}),titleClassName:"px-10 text-[1.75rem] sm:text-[2.5rem]",children:(0,t.jsx)(m.NamespaceLoadErrorBoundary,{renderFallback:m.ContentUnavailableRetryView,children:(0,t.jsx)(s.Suspense,{fallback:null,children:(0,t.jsx)(C,{currency:f,handleConfirm:T,hasSpendLimit:null!=n.spend_cap&&!n.is_unlimited,index:w,isBusy:c,isUnchanged:B,maxIndex:h,selected:P,setIndex:S,stops:g,subscription:r.sub})})})})});function T({isActive:e,isPastDue:t,isSubscriptionLoaded:a,hideCredits:n,showCredits:s,hasUnlimitedCredits:l}){return!l&&!!(e||t)&&a&&(n||s)}e.s(["shouldShowCreditDisplayToggle",0,T],534518);var k=e.i(73605),A=e.i(81804),R=e.i(334959),E=e.i(838038),M=e.i(235200),D=e.i(873860),U=e.i(511927),L=e.i(248949);e.i(948952);var I=e.i(350671),O=e.i(964977),V=e.i(79076);function F(){let{session:e}=(0,v.useStores)(),t=(0,V.useApiClient)(),a=(0,O.useAppI18n)(),n=(0,U.useMutation)({mutationFn:async e=>{let{error:a}=await t.POST("/api/user/update_user_config/",{body:{show_credits:e}});if(a)throw Error("Failed to update credit display");return e},onMutate:t=>{let a=e.showCredits;return e.showCredits=t,{previousShowCredits:a}},onSuccess:e=>{(0,x.default)({actionName:"CreditDisplaySettingsUpdateSucceeded",context:{newValue:e}})},onError:(t,n,s)=>{e.showCredits=s?.previousShowCredits??!n,(0,x.default)({actionName:"CreditDisplaySettingsUpdateFailed",context:{attemptedValue:n,errorMessage:t instanceof Error?t.message:"Unknown error"}}),(0,L.resolveTranslationsOnDemand)({instance:a,namespace:"account",resolve:e=>({title:e("creditDisplaySettings.error.title"),description:e("creditDisplaySettings.error.description")}),fallback:e=>{let t=e("fallbacks.contentUnavailable");return{title:t,description:t}}}).then(e=>{I.toastManager.add({...e,type:"error"})})}});return{toggle:e=>{(0,x.default)({actionName:"CreditDisplaySettingsUpdateClicked",context:{newValue:e}}),n.mutate(e)},isPending:n.isPending}}e.s(["useUpdateShowCredits",0,F],747075);var z=e.i(151948),K=e.i(84204);let G=(0,n.observer)(({status:e})=>{let{t:n}=(0,l.useTranslation)("account"),{session:s}=(0,v.useStores)(),i=(0,y.parseCurrency)(e.currency),r=Number(e.charged_this_cycle),o=null==e.spend_cap?null:Number(e.spend_cap),c=!e.is_unlimited&&null!=o&&o>0&&r>=o,d=e.is_unlimited?n("autoReload.unlimitedSummary",{amount:(0,u.getDisplayPrice)(r,i)}):c?n("autoReload.limitReached",{cap:(0,u.getDisplayPrice)(o??0,i)}):null!=o?n("autoReload.usageSummary",{used:(0,u.getDisplayPrice)(r,i),cap:(0,u.getDisplayPrice)(o,i)}):null,p=s.showCredits&&e.credits_granted_this_cycle>0;return null==d?null:(0,t.jsxs)("div",{className:"flex flex-col items-center text-right leading-tight md:items-end",children:[(0,t.jsx)("span",{className:(0,a.default)("text-xs md:text-base",c?"text-accent-error":"text-foreground-primary/60"),children:d}),p&&(0,t.jsx)("span",{className:"text-xs text-foreground-primary/40",children:n("autoReload.usageCredits",{granted:e.credits_granted_this_cycle.toLocaleStr
3ing()})})]})}),H=({label:e,value:a,actionLabel:n,onAction:s})=>(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between gap-4 md:justify-start",children:[(0,t.jsx)("span",{className:"text-xs text-gray-800/60",children:e}),(0,t.jsxs)(k.Button,{onClick:s,variant:S.ButtonVariant.Tertiary,"aria-label":n,className:"-ml-2 h-auto rounded-lg px-2 py-0.5 text-sm whitespace-nowrap md:text-[0.9375rem] text-gray-950/90 backdrop-filter-none transition-colors hover:bg-gray-950/10 [--hxc-btn-content-gap:0.25rem] [--hxc-btn-bg:transparent] [--hxc-btn-border:transparent] [--hxc-btn-overlay:transparent]",children:[a,(0,t.jsx)(z.EditIcon,{className:"size-4 shrink-0 text-gray-800/60"})]})]});e.s(["default",0,({currentSubscription:e,isMobileSubscription:n=!1})=>{let{session:i}=(0,v.useStores)(),{openModal:r,openModalWithData:o}=(0,E.useModalContext)(),d=(0,M.useDownloadTopUpsVisible)(),p=(e?.download_credit_packs?.length??0)>0,{t:m}=(0,l.useTranslation)("account"),f=e?.total_credits_left??0,g=e?.monthly_limit??0,b=(0,K.hasUnlimitedCredits)(i),_=(0,D.useHideCredits)(),w=T({isActive:e?.is_active,isPastDue:e?.is_past_due,isSubscriptionLoaded:i.isSubLoaded,hideCredits:_,showCredits:i.showCredits,hasUnlimitedCredits:b}),{toggle:C,isPending:P}=F(),U=e?.is_past_due||n,{data:L}=(0,N.useAutoReloadStatus)({enabled:!!i.isSubscriber}),{disableAutoReload:I,isDisablePending:O}=(0,N.useAutoReloadMutations)(),[V,z]=(0,s.useState)(!1),W=(0,s.useRef)("amount_modal"),[Q,q]=(0,s.useState)(!1),$=(0,y.parseCurrency)(L?.currency),Y=L?.spend_cap==null?null:Number(L?.spend_cap),X=Number(L?.reload_amount??L?.amount_options[1]??0),J=L?.status==="active",Z=L?.status==="disabled_payment_failure",ee=e=>{(0,x.default)({actionName:"AutoReloadModalOpened",context:{modal:"amount",source:e}}),W.current="toggle"===e?"account_row_toggle":"amount_modal",z(!0)};return(0,t.jsxs)("div",{className:"flex h-full w-full flex-2 flex-col items-start gap-2 rounded-3xl bg-foreground-primary/5 p-6",children:[(0,t.jsxs)("div",{className:"flex w-full flex-1 flex-col gap-2",children:[(0,t.jsx)("p",{className:"font-sans text-sm font-bold text-foreground-primary uppercase",children:m("account.creditsRemaining")}),(0,t.jsx)("p",{className:"font-serif text-3xl font-light",children:b?m("account.creditsUnlimited"):(0,t.jsxs)(t.Fragment,{children:[f.toLocaleString(),(0,t.jsxs)("span",{className:"font-sans text-sm text-foreground-primary/60",children:[" ","/ ",g.toLocaleString()]})]})})]}),(0,t.jsxs)("div",{className:"flex w-full flex-col items-center justify-between gap-4 pt-4 md:flex-row md:gap-0",children:[w&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(A.default,{checked:i.showCredits,onCheckedChange:C,disabled:P,size:A.SwitchSize.Small,variant:A.SwitchVariant.Understated,className:"mt-0.5"}),(0,t.jsx)("p",{className:"mr-1",children:m("account.showCredits")}),(0,t.jsx)(c,{tooltip:m("creditDisplaySettings.description")})]}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 md:w-auto md:flex-row",children:[(0,t.jsx)(k.Button,{className:"w-full md:w-auto",onClick:()=>r(R.ModalTypes.CREDITS_PURCHASE,"SubscriptionPage"),disabled:U,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,variant:S.ButtonVariant.Secondary,children:m("account.buyCredits")}),d&&p&&(0,t.jsx)(k.Button,{className:"w-full md:w-auto",onClick:()=>o(R.ModalTypes.DOWNLOADS_PURCHASE,{},"SubscriptionPage"),disabled:U,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,variant:S.ButtonVariant.Secondary,children:m("account.buyDownloads")})]})]}),L?.eligible&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"my-2 w-full border-border-primary"}),(0,t.jsxs)("div",{className:"flex w-full flex-col justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center md:flex-row md:items-start",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(A.default,{"aria-label":m("autoReload.label"),checked:J,onCheckedChange:e=>{e?ee("toggle"):I({source:"account_row_toggle"})},disabled:O,size:A.SwitchSize.Small,variant:A.SwitchVariant.Understated,className:"mt-0.5"}),(0,t.jsx)("p",{className:"mr-1",children:m("account.autoReload")}),(0,t.jsx)(c,{tooltip:m("autoReload.tooltip",{threshold:L?.low_credit_threshold.toLocaleStr
3ing()})})]}),(0,t.jsx)("div",{inert:!J,className:(0,a.default)("flex-1 transition-opacity duration-300 ease-out motion-reduce:transition-none",J?"my-4 opacity-100 md:my-0":"pointer-events-none opacity-0"),children:(0,t.jsx)(G,{status:L})})]}),(0,t.jsx)("div",{inert:!J,className:(0,a.default)("grid transition-all duration-300 ease-out motion-reduce:transition-none",J?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:(0,t.jsxs)("div",{className:"overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col justify-start gap-8 pt-4 md:flex-row",children:[(0,t.jsx)(H,{label:m("autoReload.reloadAmount"),value:(0,u.getDisplayPrice)(X,$),actionLabel:m("autoReload.adjustAmount"),onAction:()=>ee("adjust_amount")}),(0,t.jsx)(H,{label:m("autoReload.spendLimitLabel"),value:L.is_unlimited||null==Y?m("autoReload.unlimitedOption"):(0,u.getDisplayPrice)(Y,$),actionLabel:m(null==L.spend_cap||L.is_unlimited?"autoReload.setSpendLimit":"autoReload.updateSpendLimit"),onAction:()=>{(0,x.default)({actionName:"AutoReloadModalOpened",context:{modal:"limit",source:"set_limit"}}),q(!0)}})]}),(0,t.jsx)(j.TopupCurrencyNotice,{subscription:e,chargeCurrency:$,className:"pt-4"})]})}),Z&&(0,t.jsx)("span",{className:"mt-4 text-xs text-accent-warning",children:m("autoReload.paymentFailed")}),(0,t.jsx)(h,{open:V,onOpenChange:z,status:L,changeSource:W.current}),(0,t.jsx)(B,{open:Q,onOpenChange:q,status:L})]})]})]})}],499697);var W=e.i(300288);e.s(["default",0,({downloadQuota:e})=>{let{t:a}=(0,l.useTranslation)("account");return(0,W.hasDownloadAllotmentToShow)(e)?(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-start gap-2 rounded-3xl bg-foreground-primary/5 p-6",children:[(0,t.jsx)("p",{className:"font-sans text-sm font-bold text-foreground-primary uppercase",children:a("account.downloadsRemaining")}),(0,t.jsx)("p",{className:"font-serif text-3xl font-light",children:e.downloadsRemaining.toLocaleString()})]}):null}],803683);var Q=e.i(628615),q=e.i(853629),$=e.i(230902),Y=e.i(740851),X=e.i(107765),J=e.i(173799),Z=e.i(917395),ee=e.i(328062),et=e.i(123223),ea=e.i(548004),en=e.i(524105),es=e.i(511308),el=S;e.i(418886);var ei=e.i(57642),er=e.i(865311);let eo=({onCancelSubscription:e,onUpdatePayment:a,onDowngrade:n,onOpen:s,disabled:i,buttonVariant:r=el.ButtonVariant.FrostedGlass,className:o="group flex-1 cursor-pointer sm:flex-initial"})=>{let{t:c}=(0,l.useTranslation)("account");return(0,t.jsxs)(ei.Menu.Root,{onOpenChange:e=>{e&&s()},modal:!1,children:[(0,t.jsxs)(ei.Menu.Trigger,{nativeButton:!0,disabled:i,render:(0,t.jsx)(k.Button,{className:o,variant:r,shape:el.ButtonShape.Pill,disabled:i}),children:[c("account.manageSubscription"),(0,t.jsx)(er.ChevronDownIcon,{className:"ml-1 size-4 transition-transform duration-200 group-data-[popup-open]:rotate-180","aria-hidden":"true"})]}),(0,t.jsxs)(ei.Menu.Content,{align:"start",side:"bottom",sideOffset:8,children:[(0,t.jsx)(ei.Menu.Item,{onClick:a,children:c("account.updatePayment")}),n&&(0,t.jsx)(ei.Menu.Item,{onClick:n,children:c("account.downgradePlan")}),(0,t.jsx)(ei.Menu.Item,{onClick:e,children:c("account.cancelPlan")})]})]})};e.s(["default",0,eo],554071);let ec=({sub:e})=>{let{t:a}=(0,l.useTranslation)("account"),{openModal:n}=(0,E.useModalContext)();return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(k.Button,{shape:S.ButtonShape.Pill,variant:S.ButtonVariant.Secondary,size:S.ButtonSize.Mini,onClick:()=>{(0,x.default)({actionName:"KeepMySubscriptionButtonClicked",context:{currentUsagePlanId:e?.plan?.id||"",currentPeriod:e?.period||"",subPageVersion:Z.SUBSCRIPTION_PAGE_VERSIONS.aura}}),n(R.ModalTypes.RENEW_SUBSCRIPTION)},children:a("billingCancel.renewSubscriptionTitle")})})};e.s(["RenewButton",0,ec],704223);var eu=e.i(919879),ed=e.i(771629);let ep=({isOpen:e,onClose:a,onResume:n,onUpdatePayment:s,isBillingPortalPending:i,onCancelSubscription:r,sub:o})=>{let{t:c}=(0,l.useTranslation)(["account","common"]);return e?(0,t.jsx)(ed.default,{onClose:a,title:c("billing.pausedManageModal.title"),titleClassName:"text-2xl font-serif font-light",contentWrapperClasses:"bg-background-primary/60 backdrop-blur-xl border border-white/10 rounded-2xl max-w-[460px]",wrapperClasses:"mb-0",width:460,children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-6 text-foreground-secondary",children:c("billing.pausedManageModal.description")}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(k.Button,{variant:S.ButtonVariant.Primary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:n,children:c("cta.resumeSubscription",{ns:"common"})}),(0,t.jsx)(k.Button,{variant:S.ButtonVariant.Secondary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:s,disabled:i,children:c("billing.updatePayment")}),r&&(0,t.jsx)(k.Button,{variant:S.ButtonVariant.Secondary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:()=>{(0,x.default)({actionName:"SubCancelFlowFeaturesAboutToLoseStepShown",context:{currentPeriod:o.period||"",currentUsagePlanId:o?.plan?.id||"",modalStep:1}}),r()},children:c("account.cancelPlan")})]})]})}):null};e.s(["default",0,ep],549628);let em=({isOpen:e,onClose:a,onResume:n,isPending:s})=>{let{t:i}=(0,l.useTranslation)(["account","common"]);return e?(0,t.jsxs)(ed.default,{onClose:a,title:i("billing.resumeModal.title"),titleClassName:"text-2xl font-serif font-light",contentWrapperClasses:"bg-background-primary/60 backdrop-blur-xl border border-white/10 rounded-2xl max-w-[28.75rem]",wrapperClasses:"mb-0",width:460,disableOutsideClick:s,showCloseButton:!s,children:[(0,t.jsx)("p",{className:"mb-6 text-foreground-secondary",children:i("billing.resumeModal.description")}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(k.Button,{variant:S.ButtonVariant.Primary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:n,disabled:s,icon:s?(0,t.jsx)(ee.default,{className:"fill-black"}):null,children:i(s?"cta.processing":"cta.resumeSubscription",{ns:"common"})}),(0,t.jsx)(k.Button,{variant:S.ButtonVariant.Secondary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:a,disabled:s,children:i("billing.keepPaused")})]})]}):null};e.s(["default",0,em],874493);e.s(["default",0,({currentSubscription:e,session:n,onCancelSubscription:i,showCancelButton:r=!1,graceCancelEnabled:o=!1,isMobileSubscription:c=!1,alwaysShowManageMenu:u=!1,scrollToUpgrade:d,className:m})=>{let f,g,h,{t:b,i18n:y}=(0,l.useTranslation)(["account","common"]),j=(0,V.useApiClient)(),N=(0,q.useQueryClient)(),v=(0,Y.useRouter)(),_=(0,Y.useSearchParams)(),{openBillingPortal:w,isPending:C}
3=(0,et.useBillingPortal)(),P=(0,ea.useBreakpointMd)(),B=!(0,K.isSubscriber)(n),T=e?.is_past_due??!1,A=e?.is_paused??!1,R=e?.is_pause_scheduled??!1,E=A&&!!e?.pause_ends_at,M=!B||T&&o,[D,U]=(0,s.useState)(!1),[L,O]=(0,s.useState)(!1),[F,z]=(0,s.useState)(!1),G=(0,s.useMemo)(()=>{if(!e||c||e.is_gifted)return;let t=(e=>{let t=e.plan?.level;if(void 0===t)return;let a=e.plans.filter(e=>e.plan_key!==en.PlanKey.Free&&e.level<t);if(0!==a.length)return a.reduce((e,t)=>t.level>e.level?t:e)})(e);if(t)return(0,es.getSubscriptionAction)(e,t,e.period)===es.SubscriptionAction.Downgrade?t:void 0},[e,c]),H=(0,eu.useUnpauseSubscription)(j,{onSuccess:async t=>{if(!t?.ok)return void I.toastManager.add({title:b("billing.pauseApiError"),type:"error",timeout:3e3});if(U(!1),O(!1),await Promise.all([N.invalidateQueries({queryKey:["subscriptionInfo"]}),N.invalidateQueries({queryKey:["subscription"]})]),R){I.toastManager.add({title:b("billing.pauseRevokedToast"),type:"info",timeout:3e3}),(0,x.default)({actionName:"SubCancelFlowPauseScheduledRevoked",context:{currentPeriod:e?.period||"",currentUsagePlanId:e?.plan?.id||""}});return}I.toastManager.add({title:b("billing.resumeSuccessToast"),type:"info",timeout:3e3}),setTimeout(()=>{N.invalidateQueries({queryKey:["subscriptionInfo"]})},3e3),(0,x.default)({actionName:"SubCancelFlowUnpauseConfirmed",context:{currentPeriod:e?.period||"",currentUsagePlanId:e?.plan?.id||""}})},onError:()=>{I.toastManager.add({title:b("billing.pauseApiError"),type:"error",timeout:3e3})}}),W=_?.get("action");(0,s.useEffect)(()=>{if("unpause"===W&&E){U(!0);let e=new URLSearchParams(_?.toString());e.delete("action");let t=e.toString();v.replace(`/account${t?`?${t}`:""}`,{scroll:!1})}},[W,v,_,E]);let el=e?.period===K.SubscriptionPeriod.Monthly?b("account.periodMonthly"):b("account.periodAnnual"),ei=M&&!E&&!!e,er=((0,Q.useGateValue)("hide-cancel-button-top")||u)&&r&&M&&!E&&!!i&&!e?.cancel_on,ed=E?e?.paused_plan_name??e?.plan?.name.replace("Plan","").trimEnd()??b("account.free"):T||!B?e?.plan?.name.replace("Plan","").trimEnd()??b("account.free"):b("account.free");return(0,t.jsxs)("div",{className:(0,a.default)("flex h-full w-full flex-col items-start gap-4 roun
3ded-3xl bg-foreground-primary/5 p-6 md:flex-row md:gap-2",m),children:[(0,t.jsxs)("div",{className:"flex h-full w-full flex-1 flex-col items-start",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-start gap-2",children:[(0,t.jsx)("p",{className:"font-sans text-sm font-bold text-foreground-primary uppercase",children:b("account.currentPlan")}),(0,t.jsx)("p",{className:"font-serif text-3xl font-light",children:ed}),E?(0,t.jsx)("p",{className:"font-sans text-sm text-foreground-primary/60",children:(0,t.jsx)(X.Trans,{t:b,ns:"account",i18nKey:"billing.pausedBanner.message",values:{date:(0,$.format)(new Date(e.pause_ends_at),"MMMM d, yyyy")},components:{bold:(0,t.jsx)("span",{className:"font-medium text-foreground-primary"})}})}):B&&!T?(0,t.jsx)("p",{className:"font-sans text-sm text-foreground-primary/60",children:b("account.upgradeAnytime")}):R&&e?.pause_starts_at?(0,t.jsxs)("p",{className:"flex items-center gap-2 font-sans text-sm text-foreground-primary/60",children:[b("account.pauseBegins")," ",(0,$.format)(new Date(e.pause_starts_at),"MMM d, y"),(0,t.jsx)(k.Button,{onClick:()=>H.mutate(void 0),disabled:H.isPending,variant:S.ButtonVariant.FrostedGlass,shape:S.ButtonShape.Pill,size:S.ButtonSize.Micro,icon:H.isPending?(0,t.jsx)(ee.default,{className:"fill-white"}):null,children:H.isPending?b("cta.processing",{ns:"common"}):b("billing.undoPause")})]}):(0,t.jsx)("p",{className:"font-sans text-sm text-foreground-primary/60",children:b("account.renewsOn",{period:el,date:(f=e?.renews_on,g=y.language,f?new Date(f).toLocaleDateString(g,{month:"short",day:"numeric",year:"numeric"}):"")})})]}),E?(0,t.jsxs)("div",{className:"mt-4 mb-2 flex w-full flex-1 flex-col items-start justify-end gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,t.jsx)(k.Button,{onClick:()=>O(!0),variant:S.ButtonVariant.FrostedGlass,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,children:b("billing.manage")}),(0,t.jsx)(k.Button,{onClick:()=>U(!0),variant:S.ButtonVariant.Primary,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,children:b("cta.resumeSubscription",{ns:"common"})})]}),(0,t.jsx)("p",{className:"font-sans text-xs text-foreground-primary/40",children:(0,t.jsx)(X.Trans,{t:b,ns:"account",i18nKey:"account.needHelp",components:{emailLink:(0,t.jsx)("a",{href:"mailto:[email protected]"})}})})]}):ei&&(0,t.jsxs)("div",{className:"mt-4 flex w-full flex-1 flex-col items-end justify-end gap-2 sm:flex-row",children:[e?.cancel_on&&!e?.is_gifted&&(0,t.jsx)(ec,{sub:e}),er&&(0,t.jsx)(eo,{onCancelSubscription:()=>{(0,x.default)({actionName:"SubCancelFlowFeaturesAboutToLoseStepShown",context:{currentPeriod:e?.period||"",currentUsagePlanId:e?.plan?.id||"",modalStep:1}}),i?.()},onUpdatePayment:()=>{(0,x.default)({actionName:"EditBillingDetailsButtonClicked",context:{currentUsagePlanId:e?.plan?.id||"",currentPeriod:e?.period||"",subPageVersion:Z.SUBSCRIPTION_PAGE_VERSIONS.aura}}),w()},onDowngrade:G&&!T?()=>{(0,x.default)({actionName:"DowngradePlanMenuItemClicked",context:{currentPeriod:e?.period||"",currentUsagePlanId:e?.plan?.id||"",targetUsagePlanId:G?.id||""}}),z(!0)}:void 0,onOpen:()=>{(0,x.default)({actionName:"ManageSubscriptionMenuOpened",context:{currentPeriod:e?.period||"",currentUsagePlanId:e?.plan?.id||""}})},disabled:c,buttonVariant:P?S.ButtonVariant.Tertiary:S.ButtonVariant.Secondary,className:"group w-full flex-1 cursor-pointer sm:flex-initial md:w-auto"})]})]}),!e?.plan&&!E&&!R&&(0,t.jsx)("div",{className:"mt-2 flex w-full flex-col gap-2 md:w-auto",children:(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("p",{className:"mb-2 font-sans text-sm",children:b("account.whatsMissing")}),(0,t.jsxs)("ul",{className:"list-disc pl-5",children:[(0,t.jsx)("li",{children:(0,t.jsx)("p",{className:"font-sans text-sm",children:b("account.missingCredits")})}),(0,t.jsx)("li",{children:(0,t.jsx)("p",{className:"font-sans text-sm",children:b("account.missingBestModel")})}),(0,t.jsx)("li",{children:(0,t.jsx)("p",{className:"font-sans text-sm",children:b("account.missingCommercialUse")})}),(0,t.jsx)("li",{children:(0,t.jsx)("p",{className:"font-sans text-sm",children:b("account.missingAdvancedEditing")})})]})]})}),(0,t.jsx)(k.Button,{className:"visible w-full flex-1 md:hidden",variant:S.ButtonVariant.Aura,shape:S.ButtonShape.Pill,size:S.ButtonSize.Small,onClick:d,children:b("account.upgrade")}),e&&G&&(0,t.jsx)(p.default,{open:F,onOpenChange:z,title:b("account.downgradePlan"),children:(0,t.jsx)(J.default,{currentSubscription:e,targetPlan:G,period:e.period,selectedCurrency:(h=e.plan_currency?.toUpperCase())&&Object.values(Z.Currency).includes(h)?h:Z.DEFAULT_CURRENCY,trigger:"user_click",onClose:()=>z(!1)})}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{isOpen:D,onClose:()=>U(!1),onResume:()=>H.mutate(void 0),isPending:H.isPending}),(0,t.jsx)(ep,{isOpen:L,onClose:()=>O(!1),onResume:()=>{O(!1),U(!0)},onUpdatePayment:w,isBillingPortalPending:C,onCancelSubscription:i?()=>{O(!1),i()}:void 0,sub:e})]})]})}],633258);let ex=(0,n.observer)(()=>{let{t:e}=(0,l.useTranslation)("account"),{session:a}=(0,v.useStores)(),{data:n}=(0,N.useAutoReloadStatus)({enabled:!!a.isSubscriber}),{disableAutoReload:i,isBusy:r}
3=(0,N.useAutoReloadMutations)(),[o,d]=(0,s.useState)(!1),p=(0,s.useRef)("amount_modal"),[m,f]=(0,s.useState)(!1);if(!n?.eligible)return null;let g="active"===n.status,b="disabled_payment_failure"===n.status,S=(0,y.parseCurrency)(n.currency),_=null==n.spend_cap?null:Number(n.spend_cap),w=Number(n.reload_amount??n.amount_options[1]??0),C=e=>{(0,x.default)({actionName:"AutoReloadModalOpened",context:{modal:"amount",source:e}}),p.current="toggle"===e?"account_row_toggle":"amount_modal",d(!0)};return(0,t.jsxs)("div",{className:"mt-1 grid w-full grid-cols-2 gap-x-4 gap-y-3 border-t border-white/10 pt-4 md:grid-cols-[auto_1fr] md:items-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm whitespace-nowrap text-gray-950/90",children:e("autoReload.label")}),(0,t.jsx)(A.default,{"aria-label":e("autoReload.label"),checked:g,onCheckedChange:e=>{e?C("toggle"):i({source:"account_row_toggle"})},disabled:r,size:A.SwitchSize.Small,variant:A.SwitchVariant.Understated}),(0,t.jsx)(c,{tooltip:e("autoReload.tooltip")})]}),g&&(0,t.jsxs)("div",{className:"contents md:flex md:gap-0 md:divide-x md:divide-white/10 md:justify-self-end",children:[(0,t.jsx)("div",{className:"col-start-1 row-start-2 md:col-auto md:row-auto md:flex md:items-center md:px-4 md:first:pl-0",children:(0,t.jsx)(eh,{status:n})}),(0,t.jsx)("div",{className:"col-start-2 row-start-1 md:col-auto md:row-auto md:px-4",children:(0,t.jsx)(eg,{label:e("autoReload.reloadAmount"),value:(0,u.getDisplayPrice)(w,S),actionLabel:e("autoReload.adjustAmount"),onAction:()=>C("adjust_amount")})}),(0,t.jsx)("div",{className:"col-start-2 row-start-2 md:col-auto md:row-auto md:px-4 md:last:pr-0",children:(0,t.jsx)(eg,{label:e("autoReload.spendLimitLabel"),value:n.is_unlimited||null==_?e("autoReload.unlimitedOption"):(0,u.getDisplayPrice)(_,S),actionLabel:e(null==n.spend_cap||n.is_unlimited?"autoReload.setSpendLimit":"autoReload.updateSpendLimit"),onAction:()=>{(0,x.default)({actionName:"AutoReloadModalOpened",context:{modal:"limit",source:"set_limit"}}),f(!0)}})})]}),g&&(0,t.jsx)(j.TopupCurrencyNotice,{subscription:a.sub,chargeCurrency:S,className:"col-span-full"}),b&&(0,t.jsx)(ef,{}),(0,t.jsx)(h,{open:o,onOpenChange:d,status:n,changeSource:p.current}),(0,t.jsx)(B,{open:m,onOpenChange:f,status:n})]})}),ef=()=>{let{t:e}=(0,l.useTranslation)("account");return(0,s.useEffect)(()=>{(0,x.default)({actionName:"AutoReloadPaymentFailureViewed",context:{}})},[]),(0,t.jsx)("span",{className:"col-span-2 text-xs text-yellow-400/90",children:e("autoReload.paymentFailed")})},eg=({label:e,value:a,actionLabel:n,onAction:s})=>(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5 md:gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-gray-800/60",children:e}),(0,t.jsxs)(k.Button,{onClick:s,variant:S.ButtonVariant.Tertiary,"aria-label":n,className:"-ml-2 h-auto rounded-lg px-2 py-0.5 text-sm whitespace-nowrap md:text-[0.9375rem] text-gray-950/90 backdrop-filter-none transition-colors hover:bg-gray-950/10 [--hxc-btn-content-gap:0.25rem] [--hxc-btn-bg:transparent] [--hxc-btn-border:transparent] [--hxc-btn-overlay:transparent]",children:[a,(0,t.jsx)(z.EditIcon,{className:"size-4 shrink-0 text-gray-800/60"})]})]}),eh=(0,n.observer)(({status:e})=>{let{t:a}=(0,l.useTranslation)("account"),{session:n}=(0,v.useStores)(),i=(0,y.parseCurrency)(e.currency),r=Number(e.charged_this_cycle),d=null==e.spend_cap?null:Number(e.spend_cap),p=!e.is_unlimited&&null!=d&&d>0&&r>=d;(0,s.useEffect)(()=>{p&&(0,x.default)({actionName:"AutoReloadLimitReachedViewed",context:{}})},[p]);let m=n.showCredits&&e.credits_granted_this_cycle>0,f=a("autoReload.unlimitedSummary",{amount:(0,u.getDisplayPrice)(r,i)}),g=a("autoReload.usageCredits",{granted:e.credits_granted_this_cycle.toLocaleString()});return p?(0,t.jsxs)(c,{tooltip:m?a("autoReload.limitReachedDetail",{amount:(0,u.getDisplayPrice)(r,i),credits:e.credits_granted_this_cycle.toLocaleString()}):a("autoReload.limitReachedDetailNoCredits",{amount:(0,u.getDisplayPrice)(r,i)}),triggerClassName:"gap-1 text-xs whitespace-nowrap text-accent-error hover:text-accent-error md:text-[0.9375rem]",children:[a("autoReload.limitReached"),(0,t.jsx)(o.InfoIcon,{className:"size-3.5 shrink-0"})]}):(0,t.jsxs)("div",{className:"flex flex-col items-start text-left leading-tight",children:[(0,t.jsx)("span",{className:"text-xs text-gray-800/60 md:text-[0.9375rem]",children:f}),m&&(0,t.jsx)("span",{className:"text-xs text-gray-800/40",children:g})]})});e.s(["default",0,ex],100248)},925502,810627,716681,e=>{"use strict";var t=e.i(673157),a=e.i(628615),n=e.i(853629),s=e.i(230902),l=e.i(661977),i=e.i(825822);e.i(975824);var r=e.i(524986),o=e.i(249892);e.i(462951);var c=e.i(107765),u=e.i(646984),d=e.i(877130),p=e.i(100248),m=e.i(670960),x=e.i(534518),f=e.i(884717);e.i(179395);var g=e.i(73605),h=e.i(274918),b=e.i(81804),y=e.i(334959),j=e.i(300288),S=e.i(328062);e.i(948952);var N=e.i(350671),v=e.i(838038),_=e.i(123223),w=e.i(717139);let C=e=>{let t=(0,w.useDownloadRestrictionsEnabled)(),a=e?.download_usage;return(0,o.useMemo)(()=>t&&a?(0,j.getDownloadQuota)({sub:{download_usage:a}},void 0):null,[t,a])};e.s(["useDownloadQuota",0,C],810627);var P=e.i(873860),B=e.i(77421),T=e.i(747075);e.i(696800);var k=e.i(872745),A=e.i(79076),R=e.i(277565),E=e.i(429131),M=e.i(84204),D=e.i(917395),U=e.i(554071);let L=({sub:e})=>{let{t:a}
3=(0,u.useTranslation)("account"),{openModal:n}=(0,v.useModalContext)();return(0,t.jsx)("div",{children:(0,t.jsx)(g.Button,{shape:h.ButtonShape.Pill,variant:h.ButtonVariant.Secondary,size:h.ButtonSize.Mini,onClick:()=>{(0,R.default)({actionName:"CancelChangePlanButtonClicked",context:{subPageVersion:D.SUBSCRIPTION_PAGE_VERSIONS.aura,currency:e?.plan_currency||""}}),n(y.ModalTypes.CANCEL_SUBSCRIPTION_CHANGES)},children:a("billingCancel.cancelChangesTitle")})})};var I=e.i(704223),O=e.i(919879),V=e.i(740851),F=e.i(549628),z=e.i(874493);let K=({sub:e,onCancelSubscription:a})=>{let{t:l}=(0,u.useTranslation)(["account","common"]),i=(0,A.useApiClient)(),r=(0,n.useQueryClient)(),d=(0,V.useRouter)(),p=(0,V.useSearchParams)(),[m,x]=(0,o.useState)(!1),[b,y]=(0,o.useState)(!1),{openBillingPortal:j,isPending:S}=(0,_.useBillingPortal)(),v=(0,O.useUnpauseSubscription)(i,{onSuccess:async t=>{t?.ok?(x(!1),y(!1),await Promise.all([r.invalidateQueries({queryKey:["subscriptionInfo"]}),r.invalidateQueries({queryKey:["subscription"]})]),N.toastManager.add({title:l("billing.resumeSuccessToast"),type:"info",timeout:3e3}),setTimeout(()=>{r.invalidateQueries({queryKey:["subscriptionInfo"]})},3e3),(0,R.default)({actionName:"SubCancelFlowUnpauseConfirmed",context:{currentPeriod:e.period||"",currentUsagePlanId:e?.plan?.id||""}})):N.toastManager.add({title:l("billing.pauseApiError"),type:"error",timeout:3e3})},onError:()=>{N.toastManager.add({title:l("billing.pauseApiError"),type:"error",timeout:3e3})}}),w=p?.get("action");if((0,o.useEffect)(()=>{if("unpause"===w){x(!0);let e=new URLSearchParams(p?.toString());e.delete("action");let t=e.toString();d.replace(`/account${t?`?${t}`:""}`,{scroll:!1})}},[w,d,p]),!e.pause_ends_at)return null;let C={planName:e.paused_plan_name??"",date:(0,s.format)(new Date(e.pause_ends_at),"MMMM d, yyyy")};return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsx)(f.GlassBanner,{children:(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)("span",{className:"font-sans text-sm text-foreground-primary",children:e.paused_plan_name?(0,t.jsx)(c.Trans,{t:l,ns:"account",i18nKey:"billing.pausedBanner.messageWithPlan",values:C,components:{bold:(0,t.jsx)("span",{className:"font-medium text-foreground-primary"})}}):(0,t.jsx)(c.Trans,{t:l,ns:"account",i18nKey:"billing.pausedBanner.message",values:C,components:{bold:(0,t.jsx)("span",{className:"font-medium text-foreground-primary"})}})}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-row gap-2",children:[(0,t.jsx)(g.Button,{onClick:()=>y(!0),variant:h.ButtonVariant.FrostedGlass,shape:h.ButtonShape.Pill,size:h.ButtonSize.Small,children:l("billing.manage")}),(0,t.jsx)(g.Button,{onClick:()=>x(!0),variant:h.ButtonVariant.Primary,shape:h.ButtonShape.Pill,size:h.ButtonSize.Small,children:l("cta.resumeSubscription",{ns:"common"})})]})]})}),(0,t.jsx)("div",{className:"w-full text-center font-sans text-xs text-white/30",children:(0,t.jsx)(c.Trans,{t:l,ns:"account",i18nKey:"account.needHelp",components:{emailLink:(0,t.jsx)("a",{href:"mailto:[email protected]"})}})}),(0,t.jsx)(F.default,{isOpen:b,onClose:()=>y(!1),onResume:()=>{y(!1),x(!0)},onUpdatePayment:j,isBillingPortalPending:S,onCancelSubscription:a?()=>{y(!1),a()}:void 0,sub:e}),(0,t.jsx)(z.default,{isOpen:m,onClose:()=>x(!1),onResume:()=>v.mutate(void 0),isPending:v.isPending})]})},G=(0,r.observer)(({sub:e,isPauseScheduled:a,onUndoPause:n,isUndoPending:l})=>{let{t:i}=(0,u.useTranslation)(["account","common"]),{session:r}=(0,E.useStores)(),c=(0,P.useHideCredits)(),d=(0,M.hasUnlimitedCredits)(r),p=(0,x.shouldShowCreditDisplayToggle)({isActive:e.is_active,isPastDue:e.is_past_due,isSubscriptionLoaded:r.isSubLoaded,hideCredits:c,showCredits:r.showCredits,hasUnlimitedCredits:d}),f=C(e),{toggle:y,isPending:N}=(0,T.useUpdateShowCredits)(),v=(0,o.useMemo)(()=>{let r=[{label:i("account.currentPlan"),value:e?.plan?.name??""}];return e.period&&r.push({label:i("account.billingPeriod"),value:e.period===M.SubscriptionPeriod.Monthly?i("account.periodMonthly"):i("account.periodAnnual")}),e.cancel_on?r.push({label:e.is_gifted?i("account.giftEndDate"):i("account.planEndDate"),value:(0,t.jsx)("span",{className:"flex w-full flex-row items-center gap-2",children:H(e.cancel_on)})}
3):a?r.push({label:i("account.pauseBegins"),value:(0,t.jsxs)("span",{className:"flex w-full flex-row items-center gap-2",children:[(0,s.format)(new Date(e.pause_starts_at),"MMM d, y"),(0,t.jsx)(g.Button,{onClick:()=>n?.(),disabled:l,variant:h.ButtonVariant.FrostedGlass,shape:h.ButtonShape.Pill,size:h.ButtonSize.Micro,icon:l?(0,t.jsx)(S.default,{className:"fill-white"}):null,children:l?i("cta.processing",{ns:"common"}):i("billing.undoPause")})]})}):e.renews_on&&r.push({label:i("account.nextBillingDate"),value:(0,t.jsxs)("span",{className:"flex w-full flex-row items-center gap-2",children:[(0,t.jsx)(k.RotateReverseIcon,{className:"hidden md:block"}),H(e.renews_on)]})}),r.push({label:i("account.creditsRemaining"),value:d?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[i("account.creditsUnlimited"),(0,t.jsx)(m.CreditDisplayInfoTip,{tooltip:i("account.creditsUnlimitedTooltip")})]}):e.total_credits_left}),f&&(0,j.hasDownloadAllotmentToShow)(f)&&r.push({label:i("account.downloadsRemaining"),value:f.downloadsRemaining.toLocaleString()}),r},[e,f,d,i,a,n,l]);return(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3 md:flex md:flex-row md:gap-0 md:divide-x md:divide-white/10",children:[v.map((e,a)=>(0,t.jsx)(W,{...e},a)),p&&(0,t.jsx)(W,{className:"col-start-2 pb-1 md:pb-0",label:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[i("creditDisplaySettings.showCredits"),(0,t.jsx)(m.CreditDisplayInfoTip,{tooltip:i("creditDisplaySettings.description")})]}),value:(0,t.jsx)(b.default,{checked:r.showCredits,onCheckedChange:y,disabled:N,size:b.SwitchSize.Small,variant:b.SwitchVariant.Understated,className:"mt-0.5"})})]})}),H=e=>{if(!e)return"";let t=(0,i.parseISO)(e);return(0,l.isValid)(t)?(0,s.format)(t,"MMM d, y"):""},W=({label:e,value:a,className:n})=>(0,t.jsxs)("div",{className:(0,d.twMerge)("flex flex-col gap-0.5 md:gap-1 md:px-4 md:first:pl-0 md:last:pr-0",n),children:[(0,t.jsx)("span",{className:"text-xs text-gray-800/60",children:e}),(0,t.jsx)("span",{className:"text-sm text-gray-950/90",children:a})]});e.s(["CurrentSubscription",0,({sub:e,isMobileSubscription:s,onCancelSubscription:l,showCancelButton:i})=>{let{t:r}=(0,u.useTranslation)(["account","common"]),o=(0,A.useApiClient)(),d=(0,n.useQueryClient)(),m=(0,a.useGateValue)("hide-cancel-button-top"),{openModalWithData:x,openModal:b}=(0,v.useModalContext)(),j=(0,w.useDownloadRestrictionsEnabled)(),S=(0,B.useLogDownloadRestrictionsExposure)(),C=(e?.download_credit_packs||[]).length>0,P=()=>{(0,R.default)({actionName:"SubCancelFlowFeaturesAboutToLoseStepShown",context:{currentPeriod:e.period||"",currentUsagePlanId:e?.plan?.id||"",modalStep:1}}),l?.()},T=()=>{(0,R.default)({actionName:"EditBillingDetailsButtonClicked",context:{currentUsagePlanId:e?.plan?.id||"",currentPeriod:e.period||"",subPageVersion:D.SUBSCRIPTION_PAGE_VERSIONS.aura}}),z()},k=m&&!!i&&!!l&&!e.cancel_on,E=e.is_paused??!1,M=e.is_pause_scheduled??!1,V=E||M,F=(0,O.useUnpauseSubscription)(o,{onSuccess:async t=>{t?.ok?(await Promise.all([d.invalidateQueries({queryKey:["subscriptionInfo"]}),d.invalidateQueries({queryKey:["subscription"]})]),N.toastManager.add({title:r("billing.pauseRevokedToast"),type:"info",timeout:3e3}),(0,R.default)({actionName:"SubCancelFlowPauseScheduledRevoked",context:{currentPeriod:e.period||"",currentUsagePlanId:e?.plan?.id||""}})):N.toastManager.add({title:r("billing.pauseApiError"),type:"error",timeout:3e3})},onError:()=>{N.toastManager.add({title:r("billing.pauseApiError"),type:"error",timeout:3e3})}}),{openBillingPortal:z}=(0,_.useBillingPortal)();return V&&E&&e.pause_ends_at?(0,t.jsx)(K,{sub:e,onCancelSubscription:l}):(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsx)(f.GlassBanner,{children:(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3 md:flex-row md:flex-wrap md:items-center md:gap-4 min-[70.3125rem]:justify-between",children:[(0,t.jsx)(G,{sub:e,isPauseScheduled:V&&M&&!E,onUndoPause:()=>F.mutate(void 0),isUndoPending:F.isPending}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto 
3sm:flex-row",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2 min-[23.4375rem]:flex-row sm:contents",children:[e.cancel_on&&!e.is_gifted&&(0,t.jsx)(I.RenewButton,{sub:e}),k?(0,t.jsx)(U.default,{onCancelSubscription:P,onUpdatePayment:T,onOpen:()=>{(0,R.default)({actionName:"ManageSubscriptionMenuOpened",context:{currentPeriod:e.period||"",currentUsagePlanId:e?.plan?.id||""}})},disabled:s}):(0,t.jsxs)(t.Fragment,{children:[i&&l&&!e.cancel_on&&(0,t.jsx)(g.Button,{className:"flex-1 sm:flex-initial",onClick:P,disabled:s,variant:h.ButtonVariant.FrostedGlass,shape:h.ButtonShape.Pill,children:r("account.cancelPlan")}),(0,t.jsx)(g.Button,{className:"flex-1 sm:flex-initial",onClick:T,disabled:s,variant:h.ButtonVariant.FrostedGlass,shape:h.ButtonShape.Pill,children:r("account.updatePayment")})]})]}),(0,t.jsx)(g.Button,{className:"w-full sm:w-auto",variant:h.ButtonVariant.Primary,shape:h.ButtonShape.Pill,onClick:()=>b(y.ModalTypes.CREDITS_PURCHASE,"SubscriptionPage"),disabled:e.is_past_due||s,children:r("account.buyMoreCredits")}),j&&C&&(0,t.jsx)(g.Button,{className:"w-full sm:w-auto",variant:h.ButtonVariant.Primary,shape:h.ButtonShape.Pill,onClick:()=>{S(),x(y.ModalTypes.DOWNLOADS_PURCHASE,{},"SubscriptionPage")},disabled:e.is_past_due||s,children:r("account.buyDownloads")})]})]}),(0,t.jsx)(p.default,{}),!e.cancel_on&&e.changing_to&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 md:justify-start md:gap-3",children:[(0,t.jsx)("span",{className:"text-sm text-gray-800/60",children:r("account.changingTo",{plan:e.changing_to})}),(0,t.jsx)(L,{sub:e})]})]})}),(e.plan?.plan_key==="pro_20250501"||e.plan?.plan_key==="basic")&&(0,t.jsx)("div",{className:"w-full rounded-lg border border-yellow-400/20 bg-yellow-400/10 p-3 text-center font-sans text-sm text-yellow-400/90",children:r("account.legacyPlanNotice",{planName:e.plan?.plan_key==="basic"?"Basic":"Pro"})}),(0,t.jsx)("div",{className:"w-full text-center font-sans text-xs text-white/30",children:(0,t.jsx)(c.Trans,{t:r,ns:"account",i18nKey:"account.needHelp",components:{emailLink:(0,t.jsx)("a",{href:"mailto:[email protected]"})}})})]})}],925502);var Q=e.i(431838),q=e.i(157348),$=e.i(379694);let Y="harvard-banner-dismissed";function X({onDismiss:e}){let{t:a}=(0,u.useTranslation)("account");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"font-sans text-lg font-bold text-accent-brand",children:a("harvard.title")}),(0,t.jsx)("p",{className:"font-sans text-sm text-accent-brand/80",children:a("harvard.discountPrompt")})]}),(0,t.jsx)(Q.default,{onClick:e,"aria-label":a("harvard.dismissBanner"),variant:h.ButtonVariant.FrostedGlassBorderless})]}),(0,t.jsx)("p",{className:"font-sans text-sm leading-relaxed text-foreground-primary",children:a("harvard.description")})]})}e.s(["HarvardBanner",0,()=>{let[e,a]=(0,o.useState)(!1),n=(0,o.useRef)(!1);return((0,o.useEffect)(()=>{a("true"===$.safeLocalStorage.getItem(Y))},[]),(0,o.useEffect)(()=>{e||n.current||((0,R.default)({actionName:"SchoolBannerShown",context:{schoolName:"harvard"}}),n.current=!0)},[e]),e)?null:(0,t.jsx)(f.GlassBanner,{className:"border border-accent-brand/30 bg-accent-brand/10",children:(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(q.NamespaceLoadErrorBoundary,{expectedNamespace:"account",renderFallback:q.ContentUnavailableRetryView,children:(0,t.jsx)(o.Suspense,{fallback:null,children:(0,t.jsx)(X,{onDismiss:()=>{(0,R.default)({actionName:"SchoolBannerDismissed",context:{schoolName:"harvard"}}),$.safeLocalStorage.setItem(Y,"true"),a(!0)}})})})})})},"shouldShowHarvardBanner",0,e=>{if(!e?.eligible_discounts)return!1;for(let t of Object.values(e.eligible_discounts))if(t){for(let e of Object.values(t))if(e?.slug==="harvard2025")return!0}return!1}],716681)},357756,e=>{"use strict";var t=e.i(673157);e.i(462951);var a=e.i(646984),n=e.i(884717);e.i(179395);var s=e.i(73605),l=e.i(274918),i=e.i(123223);e.i(696800);var r=e.i(282724),o=e.i(524105),c=e.i(917395);e.s(["MobileBillingWarning",0,({subscriptionPlatform:e})=>{let{t:u}=(0,a.useTranslation)("account"),{openBillingPortal:d}=(0,i.useBillingPortal)();if(!e)return null;let p=(0,o.getSubscriptionPlatform)(e),m=p&&c.SUBSCRIPTION_PLATFORM_TO_OS_MAP[p]||e;return(0,t.jsx)(n.GlassBanner,{className:"bg-yellow-700/50",children:(0,t.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-3 font-sans text-base",children:[(0,t.jsx)(r.MobileIcon,{width:36,height:36}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"leading-none font-bold",children:u("billing.mobileSubscribedOn",{platform:m})}),(0,t.jsx)("span",{children:u("billing.mobileManageDescription",{platform:m})})]})]}),(0,t.jsx)(s.Button,{variant:l.ButtonVariant.Primary,shape:l.ButtonShape.Pill,onClick:d,children:u("billing.mobileManageSubscription")})]})})}])},281238,e=>{"use strict";var t=e.i(673157);e.i(462951);var a=e.i(646984),n=e.i(884717);e.i(179395);var s=e.i(73605),l=e.i(274918),i=e.i(123223);e.i(696800);var r=e.i(733962);e.s(["PastDueWarning",0,()=>{let{t:e}=(0,a.useTranslation)(["account","common"]),{openBillingPortal:o}=(0,i.useBillingPortal)();return(0,t.jsx)(n.GlassBanner,{className:"bg-red-700/50",children:(0,t.jsxs)("div",{"data-testid":"past-due-warning",className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-3 font-sans text-base",children:[(0,t.jsx)(r.WarningIcon,{className:"size-9"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"leading-none font-bold",children:e("billing.pastDueTitle")}),(0,t.jsx)("span",{children:e("billing.pastDueDescription")})]})]}),(0,t.jsx)(s.Button,{variant:l.ButtonVariant.Primary,shape:l.ButtonShape.Pill,onClick:o,children:e("cta.updateBilling",{ns:"common"})})]})})}])},66738,e=>{"use strict";e.s(["Plans",()=>M,"SUB_STATE_UPSELL_EXPERIMENT_VARIANT",()=>
3A,"buildBackendDrivenCards",()=>R,"usePlansBillingPeriodState",()=>E]);var t=e.i(673157),a=e.i(628615),n=e.i(740851),s=e.i(249892);e.i(462951);var l=e.i(646984),i=e.i(877130),r=e.i(423204),o=e.i(719244),c=e.i(567588),u=e.i(228749),d=e.i(917395),p=e.i(451068),m=e.i(659382),x=e.i(832583),f=e.i(1260),g=e.i(879067),h=e.i(981342),b=e.i(741085),y=e.i(213322),j=e.i(290693),S=e.i(697079),N=e.i(993001),v=e.i(277565),_=e.i(524105),w=e.i(414086),C=e.i(84204),P=e.i(941011),B=e.i(688765);let{Annual:T,Monthly:k}=C.SubscriptionPeriod,A={CONTROL:"control",TEST:"test"},R=(e,t)=>e.flatMap(e=>{let a=t.find(t=>t.plan_key===e.plan_key);return a?[{plan:a,period:"year"===e.period?T:k,highlight:e.highlight}]:[]});function E(){let e=(0,n.useSearchParams)(),t=(0,y.useDefaultBillingPeriod)(),a=e.get("period"),l="true"===e.get(d.UPGRADE_ANNUAL_PARAM),[i]=(0,s.useState)(l),[r,o]=(0,s.useState)(l?T:a||t);return(0,s.useEffect)(()=>{a||i||o(t)},[t,a,i]),{period:r,setPeriod:o}}let M=({plans:e,currentSubscription:y,canManageSubscription:M,usagePlanDescriptions:D,ctaButtons:U,selectedCurrency:L,countryCode:I,checkoutSource:O=N.CHECKOUT_SOURCE.ACCOUNT_PAGE,alwaysShowFreePlan:V=!1,isSubscriptionPending:F=!1,billingPeriodState:z})=>{let{t:K,i18n:G}=(0,l.useTranslation)("account"),H=(0,n.useSearchParams)().get("plan_key")===_.PlanKey.Premier&&e.some(e=>e.plan_key===_.PlanKey.Premier)?_.PlanKey.Premier:void 0,W=(0,a.useGateValue)("2026-spring-sale"),{publishViewItemEvent:Q}=(0,h.useAxon)(),{data:q}=(0,j.useEligibleDiscounts)(),$=E(),{period:Y,setPeriod:X}=z??$;(0,s.useEffect)(()=>{if(F)return;let t=e.find(e=>e.plan_key===_.PlanKey.Pro);if(!t)return;let{price:a}=(0,u.resolvePriceForPlanAndCurrency)({plan:t,currency:L,period:Y});if(Number.isNaN(a))return;let n=[{item_variant_id:(0,h.createAxonItemVariantIdForSubscription)(t.plan_key,Y),item_id:t.plan_key,item_name:t.name,price:a,quantity:1,item_category_id:b.AXON_ITEM_CATEGORY_ID}];Q({currency:d.Currency.USD,value:Y===T?t.annual_price_usd:t.monthly_price_usd,items:n})},[Q,Y,e,L,F]);let J=(e,t)=>{let{price:a,currency:n}=((e,t)=>{if(t===T){let{overlayPrice:a}=(0,j.findAnnualOfferOverlay)({data:q,planKey:e.plan_key,period:t,currency:L,t:K});if(void 0!==a)return{price:a/12,currency:L};let n=(0,u.resolvePriceForPlanAndCurrency)({plan:e,currency:L,period:C.SubscriptionPeriod.Annual});return{price:n.price/12,currency:n.currency}}return(0,u.resolvePriceForPlanAndCurrency)({plan:e,currency:L,period:C.SubscriptionPeriod.Monthly})})(e,t);return{price:a,displayCurrency:n,priceBeforeDiscount:(0,u.resolvePriceForPlanAndCurrency)({plan:e,currency:n,period:C.SubscriptionPeriod.Monthly}).price}},Z=(0,a.useParameterStore)(P.ParameterStore.SUNO_WEB),ee=Z.get(P.Parameter.SUB_STATE_PAYWALL_VARIANT,B.SUB_STATE_PAYWALL_EXPERIMENT_VARIANT.CONTROL),et=Z.get(P.Parameter.SUB_STATE_UPSELL_VARIANT,A.CONTROL)===A.TEST,{planOptions:ea}=(0,S.default)("settings",{enabled:et}),en=et&&"filtered"===ea.mode,es=(0,s.useMemo)(()=>en?R(ea.options??[],e):[],[en,ea,e]),el=(0,s.useMemo)(()=>e?[...(({paywallVariant:e,canManageSubscription:t,alwaysShowFreePlan:a})=>e===B.SUB_STATE_PAYWALL_EXPERIMENT_VARIANT.TEST||t&&!a)({paywallVariant:ee,canManageSubscription:M,alwaysShowFreePlan:V})?e.filter(e=>e.plan_key!==_.PlanKey.Free):e].sort((e,t)=>{let a=(0,u.getMonthlyPriceForPlanAndCurrency)(e,L),n=(0,u.getMonthlyPriceForPlanAndCurrency)(t,L);return Number.isNaN(a)&&Number.isNaN(n)?0:Number.isNaN(a)?1:Number.isNaN(n)?-1:a-n}):[],[e,L,M,V,ee]),ei=()=>{let e=document.querySelectorAll("[data-description]");if(0===e.length)return;e.forEach(e=>{e.style.minHeight="auto",e.style.height="auto"});let t=Math.max(...Array.from(e).map(e=>e.scrollHeight));e.forEach(e=>{e.style.minHeight=`${t}px`})},er=(0,s.useRef)(null);(0,r.useResizeObserver)({ref:er,onResize:()=>{requestAnimationFrame(()=>{ei()})}}),(0,s.useEffect)(()=>{let e=setTimeout(()=>{ei()},10);return()=>clearTimeout(e)},[el,es,D,Y]);let eo=()=>{(0,v.default)({actionName:"SaveByPayingAnnuallyLinkClicked",context:{pageUrl:window.location.pathname}}),X(T)},ec=en?es.map(e=>({plan:e.plan,cardPeriod:e.period,highlightPlans:e.highlight?[e.plan.plan_key]:[],setPeriodAnnual:void 0})):el.map(e=>({plan:e,cardPeriod:Y,highlightPlans:[H??_.PlanKey.Pro],setPeriodAnnual:eo}
3)),eu=(0,i.twMerge)("w-full gap-6 grid grid-cols-1 auto-rows-[1fr] items-start",ec.length>=2&&"min-[37.5rem]:grid-cols-2",ec.length>=3&&"min-[64rem]:grid-cols-3",ec.length>=4&&"min-[75rem]:grid-cols-4"),ed=(0,s.useMemo)(()=>(0,j.hasAnnualOffer)(q,L),[q,L]),ep=(0,j.getAnnualOfferToggleLabel)({data:q,currency:L,t:K})??(ed?K("billing.annualOfferMix.toggleBadge"):K("billing.fallbackAnnualSavingsBadge"));return(0,t.jsxs)("div",{className:"mt-4 flex w-full flex-col items-center gap-10",children:[!en&&(0,t.jsx)(g.default,{value:Y,options:[{label:K("account.monthly"),value:k},{label:K("account.periodAnnual"),value:T,badge:{text:ep,className:W?"bg-[#1F8BFF] text-black":"bg-accent-brand text-foreground-primary-glass"}}],onChange:e=>{(0,v.default)({actionName:"SubscriptionPeriodTabClicked",context:{period:e,pageUrl:window.location.pathname},componentContext:""}),X(e)}}),(0,t.jsx)("div",{ref:er,className:eu,children:ec.map(({plan:e,cardPeriod:a,highlightPlans:n,setPeriodAnnual:s})=>{if(et){let l=D[e.plan_key],i=(({plan:e,description:t,currentPlanKey:a,cardPeriod:n,currentPeriod:s})=>({upgradeKind:a===e.plan_key&&n===T&&s===k?"period":"tier",title:t?.plan_display_name?.text||e.name,featuresIntro:t?.plan_description||""}))({plan:e,description:l,currentPlanKey:y?.plan?.plan_key,cardPeriod:a,currentPeriod:y?.period}),r=(0,o.getUpsellFeaturesIntro)({upgradeKind:i.upgradeKind,annualUpsellDescription:l?.annual_upsell_description,planDescription:i.featuresIntro,currentSubscription:y,targetPlan:e,locale:G.language}),u=J(e,a);return(0,t.jsx)(x.default,{showFeatureList:"tier"===i.upgradeKind,eyebrow:"period"===i.upgradeKind?K("account.switchToAnnual"):K("account.upgrade"),title:"tier"===i.upgradeKind?i.title:K("account.switchToAnnualBilling"),description:(0,t.jsx)("div",{children:(0,t.jsx)("p",{className:"font-sans text-sm whitespace-pre-line",children:r})}),highlightBorder:n.includes(e.plan_key),priceBlock:(0,t.jsx)(f.PlanPriceBlock,{plan:e,...u,countryCode:I,period:a,discountDetails:q?.eligible_discounts[e.plan_key]?.[a],planDescription:l,selectedCurrency:L,onSaveAnnuallyClick:s}),cta:(0,t.jsxs)("div",{children:[(0,t.jsx)(c.ChangePlanButton,{currentSubscription:y,targetPlan:e,period:a,highlightPlans:n,checkoutSource:O,selectedCurrency:L,ctaButtons:U}),e.plan_key!==_.PlanKey.Free&&(0,t.jsx)(p.BillingCurrencyNotice,{subscription:y,renderedCurrency:u.displayCurrency,className:"mt-3"})]}),planDescription:l},`${e.id}-${a}`)}return(0,t.jsx)(m.AuraSubscriptionCard,{plan:e,...J(e,a),countryCode:I,discountDetails:q?.eligible_discounts[e.plan_key]?.[a],annualOffer:(0,j.findAnnualOfferOverlay)({data:q,planKey:e.plan_key,period:a,currency:L,t:K}),period:a,billed:a===T?"yearly":"monthly",features:(0,w.getPlanFeatureDescriptions)(e,D),currentSubscription:y,setPeriodAnnual:s,planDescription:D[e.plan_key],ctaButtons:U,checkoutSource:O,selectedCurrency:L,isSpringSale:W,highlightPlans:n,focusedPlanKey:H},`${e.id}-${a}`)})})]})}},688765,279039,e=>{"use strict";e.s(["AuraSubscriptionsBase",()=>et,"SUB_STATE_PAYWALL_EXPERIMENT_VARIANT",()=>Y],688765);var t=e.i(673157),a=e.i(628615),n=e.i(7284);e.i(975824);var s=e.i(524986),l=e.i(740851),i=e.i(249892);e.i(462951);var r=e.i(107765),o=e.i(646984),c=e.i(179323),u=e.i(228749),d=e.i(499697),p=e.i(803683),m=e.i(633258),x=e.i(925502),f=e.i(742069),g=e.i(716681),h=e.i(357756),b=e.i(718799),y=e.i(281238),j=e.i(66738),S=e.i(328062),N=e.i(171967),v=e.i(157348);function _({subtitleClassName:e,titleClassName:a}){let{t:s}=(0,o.useTranslation)("marketing");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.default,{text:s("spring_sale_2026_pricing_web.title_text"),withLineClamp:!1,className:(0,n.default)("text-center leading-[3rem] break-normal",a)}),(0,t.jsx)("span",{className:(0,n.default)("font-sans text-sm",e),children:s("spring_sale_2026_pricing_web.subtitle_text")})]})}function w(){let{t:e}=(0,o.useTranslation)("shell");return(0,t.jsxs)("div",{role:"status",className:"flex min-h-20 items-center justify-center",children:[(0,t.jsx)(S.default,{}),(0,t.jsx)("span",{className:"sr-only",children:e("media.loading")})]})}function C({isRetrying:e,retry:a}){return(0,t.jsx)("div",{className:"min-h-20 w-full",children:(0,t.jsx)(v.ContentUnavailableRetryView,{isRetrying:e,retry:a})})}function P({subtitleClassName:e,titleClassName:a}
3){return(0,t.jsx)(v.NamespaceLoadErrorBoundary,{renderFallback:C,children:(0,t.jsx)(i.Suspense,{fallback:(0,t.jsx)(w,{}),children:(0,t.jsx)(_,{subtitleClassName:e,titleClassName:a})})})}e.s(["SpringSalePricingHeader",0,P],279039);var B=e.i(917395),T=e.i(741467),k=e.i(172329);e.i(179395);var A=e.i(73605),R=e.i(274918),E=e.i(300288),M=e.i(810627),D=e.i(290693),U=e.i(285250),L=e.i(61260),I=e.i(697079),O=e.i(791421),V=e.i(134787),F=e.i(748355),z=e.i(26569);e.i(696800);var K=e.i(178862),G=e.i(615383),H=e.i(993001),W=e.i(429131),Q=e.i(84204),q=e.i(941011);let $="https://cdn-o.suno.com/auras-v2/Aura-1.png",Y={CONTROL:"control",TEST:"test"};function X(e){return(0,t.jsx)("div",{className:"relative flex min-h-80 w-full items-center justify-center p-6",children:(0,t.jsx)(v.ContentUnavailableRetryView,{...e})})}function J(){let{t:e}=(0,o.useTranslation)("account");return(0,t.jsx)(N.default,{text:e("account.yourCurrentPlan"),className:"w-full text-center font-serif text-2xl font-light md:text-left"})}function Z({hasLongTitle:e}){let{t:a}=(0,o.useTranslation)("account");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.default,{text:a("account.upgradeYourPlan"),withLineClamp:!e,className:(0,n.default)("leading-[3rem] text-foreground-primary/90",e?"text-center break-normal":"")}),(0,t.jsx)("span",{className:"font-sans text-sm text-foreground-secondary",children:a("account.selectThePlanThatBestFitsYourNeeds")})]})}function ee({hasUpgradeCards:e,onComparePlansClick:a,onFaqsClick:n}){let{t:s}=(0,o.useTranslation)("account");return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-8",children:[e&&(0,t.jsxs)("div",{className:"flex flex-row flex-wrap gap-2",children:[(0,t.jsxs)(A.Button,{variant:R.ButtonVariant.Secondary,shape:R.ButtonShape.Pill,onClick:n,children:[s("account.faqs")," ",(0,t.jsx)(K.ArrowDownIcon,{})]}),(0,t.jsxs)(A.Button,{className:"whitespace-nowrap",variant:R.ButtonVariant.Secondary,shape:R.ButtonShape.Pill,onClick:a,children:[s("account.comparePlans")," ",(0,t.jsx)(K.ArrowDownIcon,{})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsx)("h2",{className:"font-sans text-xs font-bold",children:s("account.needMore")}),(0,t.jsx)("span",{className:"w-full text-center font-sans text-xs text-foreground-secondary",children:(0,t.jsx)(r.Trans,{t:s,ns:"account",i18nKey:"account.creditsDisclaimer",components:{termsLink:(0,t.jsx)("a",{className:"underline",href:"https://suno.com/legal/terms"}),billingLink:(0,t.jsx)("a",{className:"underline",href:"mailto:[email protected]"})}})})]})]})}let et=(0,s.observer)(()=>{let{session:e}=(0,W.useStores)(),s=(0,a.useGateValue)("2026-spring-sale"),r=(0,l.useSearchParams)(),o=(0,i.useRef)(null),N=(0,i.useRef)(null),_=(0,i.useRef)(null),w=(0,i.useRef)(null),[C,A]=(0,i.useState)(!1),R=(0,a.useParameterStore)(q.ParameterStore.SUNO_WEB),K=R.get(q.Parameter.SUB_STATE_PAYWALL_VARIANT,Y.CONTROL),et=R.get("sub-state-upsell-variant",j.SUB_STATE_UPSELL_EXPERIMENT_VARIANT.CONTROL),ea=et===j.SUB_STATE_UPSELL_EXPERIMENT_VARIANT.TEST?"upsell":void 0,{data:en}=(0,O.useUsagePlanDescriptionsResponse)(ea),{data:es,isLoading:el}=(0,D.useEligibleDiscounts)(),ei=(0,z.default)(),{currency:er,setCurrency:eo,currencyOptions:ec}=(0,V.useResolvedCurrency)({planCurrency:e.sub?.plan_currency,defaultCurrency:ei.data?.default_currency,eligibleCurrencies:ei.data?.eligible_currencies,plans:ei.data?.plans??[],isLoaded:e.isSubLoaded});(0,L.default)({actionName:"PageViewed",componentContext:"subscription"});let eu=(0,i.useRef)(!1),ed=ei.data,ep=(0,U.useIsGeoLockedCurrencyEnabled)({subscription:ed}),em=(0,M.useDownloadQuota)(ed),ex=!!em&&(0,E.hasDownloadedThisPeriod)(ed)&&(0,E.hasDownloadAllotmentToShow)(em);(0,i.useEffect)(()=>{!eu.current&&ed&&(eu.current=!0,(0,G.logCustomEvent)("subscriptions_page_viewed",{is_active:ed.is_active,plan_key:ed.plan?.plan_key||null,period:ed.period||null,subscription_platform:ed.subscription_platform||null,is_past_due:ed.is_past_due||!1,selected_currency:er}))},[ed,er]);let ef=(0,B.isMobileSubscriptionPlatform)(ed?.subscription_platform),eg=!!ed?.is_past_due&&!0===R.get(q.Parameter.GRACE_CANCEL_VISIBILITY,!1),eh=(0,Q.canManageSubscription)(ed,eg),eb=!!e.user&&eh,ey=eb&&ed?.plan?.plan_key!=="basic",ej=ed?.plan?.plan_key||null,eS=ed?.plans||[],eN=et===j.SUB_STATE_UPSELL_EXPERIMENT_VARIANT.TEST,{planOptions:ev}=(0,I.default)("settings",{enabled:eN}
3),e_=!(eN&&"filtered"===ev.mode&&0===(0,j.buildBackendDrivenCards)(ev.options??[],eS).length),ew=r?.get("source"),eC=ew&&Object.values(H.CHECKOUT_SOURCE).includes(ew)?ew:H.CHECKOUT_SOURCE.ACCOUNT_PAGE,eP=(0,Q.isSubscriber)(e)&&ed?.is_active||ed?.is_paused||ed?.is_past_due,eB=K===Y.TEST,eT=(0,F.useIsTopNavLayoutEnabled)();return(0,t.jsxs)("div",{className:"relative flex h-full w-full flex-col items-center overflow-y-auto",children:[eT&&(0,t.jsx)(k.default,{image:$,blur:"0px"}),(0,t.jsxs)("div",{className:(0,n.default)("absolute inset-0",eT&&"md:hidden"),children:[(0,t.jsx)("img",{src:$,className:"h-full w-full object-cover",alt:""}),(0,t.jsx)("div",{className:"absolute inset-0 bg-[linear-gradient(var(--color-background-fog-thick)_-69.77%,var(--color-background-primary)_53.4%)]"})]}),(0,t.jsx)(v.NamespaceLoadErrorBoundary,{renderFallback:X,children:(0,t.jsxs)(i.Suspense,{fallback:(0,t.jsx)("div",{className:"relative flex min-h-80 w-full items-center justify-center p-6",children:(0,t.jsx)(S.default,{})}),children:[eP&&K===Y.CONTROL&&(0,t.jsx)("div",{ref:w,className:"relative w-full p-6",children:(0,t.jsx)(x.CurrentSubscription,{sub:ed,isMobileSubscription:ef,onCancelSubscription:()=>{A(!0)},showCancelButton:eb})}),(0,t.jsx)("div",{className:"relative flex w-full max-w-[60rem] flex-col items-start gap-6 p-6",children:ed?(0,t.jsxs)(t.Fragment,{children:[ed?.is_past_due&&(0,t.jsx)(y.PastDueWarning,{}),eB&&(0,t.jsxs)("div",{className:"relative flex w-full max-w-[60rem] flex-col items-start gap-2 lg:pt-4",children:[(0,t.jsx)(J,{}),(0,t.jsxs)("div",{className:"flex w-full flex-1 flex-col items-start gap-4 md:flex-row",children:[(0,t.jsx)(m.default,{className:(0,n.default)(ex&&!eP?"flex-2":"flex-1"),currentSubscription:ed,alwaysShowManageMenu:eB,session:e,isMobileSubscription:ef,onCancelSubscription:()=>{A(!0)},showCancelButton:ey,graceCancelEnabled:eg,scrollToUpgrade:()=>{N.current?.scrollIntoView({behavior:"smooth",block:"start"})}}),(eP||ex)&&(0,t.jsxs)("div",{className:(0,n.default)("flex w-full flex-col gap-2",ex&&!eP?"flex-1":"flex-2"),children:[eP&&(0,t.jsx)(d.default,{currentSubscription:ed,isMobileSubscription:ef}),ex&&(0,t.jsx)(p.default,{downloadQuota:em})]})]})]}),ef&&(0,t.jsx)(h.MobileBillingWarning,{subscriptionPlatform:ed?.subscription_platform??void 0}),!el&&(0,g.shouldShowHarvardBanner)(es)&&(0,t.jsx)(g.HarvardBanner,{}),(0,t.jsxs)("div",{className:"flex flex-col gap-12 md:gap-[6.25rem]",children:[(0,t.jsxs)("div",{className:"mt-6 flex w-full flex-col gap-10",children:[e_&&(0,t.jsxs)("div",{className:(0,n.default)("flex flex-col gap-2",K===Y.TEST?"items-start":"items-center"),children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center gap-4 md:flex-row md:gap-2",children:[(0,t.jsx)("div",{ref:N,className:(0,n.default)("flex flex-1 flex-col items-center",K===Y.TEST?"md:items-start":"md:items-center"),children:s?(0,t.jsx)(P,{subtitleClassName:"text-foreground-secondary",titleClassName:"text-foreground-primary/90"}):(0,t.jsx)(Z,{hasLongTitle:s})}),(0,T.isCurrencySelectorEligible)(ed)&&!ep&&ec.length>0&&(0,t.jsx)(u.default,{value:er,onChange:eo,currencyOptions:ec})]}),(0,t.jsx)(j.Plans,{plans:eS,currentSubscription:ed,canManageSubscription:eh,usagePlanDescriptions:en?.usage_plan_descriptions||{},ctaButtons:en?.cta_buttons??null,selectedCurrency:er,countryCode:(0,T.getPayloadCountryCode)(ed),checkoutSource:eC})]}),(0,t.jsx)(ee,{hasUpgradeCards:e_,onComparePlansClick:()=>{o.current?.scrollIntoView({behavior:"smooth",block:"start"})},onFaqsClick:()=>{_.current?.scrollIntoView({behavior:"smooth",block:"start"})}})]}),(0,t.jsx)(f.FAQ,{ref:_,items:e.usagePlanFaqs}),(0,t.jsx)(c.ComparePlansTable,{ref:o,tableComparison:e.usagePlanTableComparison,currentPlanKey:ej,plans:eS,usagePlanDescriptions:en?.usage_plan_descriptions||{}})]})]}):(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,t.jsx)(S.default,{})})}),(0,t.jsx)(b.default,{open:C,onClose:()=>A(!1),currentSubscription:ed,canShow:eh||!!ed?.is_paused||!!ed?.is_pause_scheduled})]})})]})})},719244,832583,1260,e=>{"use strict";var t=e.i(228749),a=e.i(917395);e.s(["getUpsellFeaturesIntro",0,({upgradeKind:e,annualUpsellDescription:n,planDescription:s,currentSubscription:l,targetPlan:i,locale:r})=>{if("period"===e&&n){let e=(({currentSubscription:e,targetPlan:n,locale:s})=>{let l;if(!e)return null;let i=e.plan_currency_price,r=e.renews_on;if(null==i||!r)return null;let o=(l=e.plan_currency?.toUpperCase())&&Object.values(a.Currency).includes(l)?l:a.DEFAULT_CURRENCY,c=(0,t.getAnnualPriceForPlanAndCurrency)(n,o);return Number.isNaN(c)?null:{current_price:(0,t.getDisplayPrice)(i,o),annual_price:(0,t.getDisplayPrice)(c,o),annual_savings:(0,t.getDisplayPrice)(12*i-c,o),renewal_date:new Date(r).toLocaleDateString(s,{month:"long",day:"numeric"})}})({currentSubscription:l,targetPlan:i,locale:r});if(e)return Object.keys(e).reduce((t,a)=>t.replaceAll(`{${a}}`,e[a]),n)}return s??""}],719244);var n=e.i(673157),s=e.i(7284);e.i(696800);var l=e.i(3867),i=e.i(714791);let r=({features:e})=>(0,n.jsx)("ul",{className:"flex-1 space-y-2 overflow-y-auto text-sm",children:e?.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-start space-x-2",children:[(0,n.jsx)("span",{className:"text-primary mt-[0.1875rem] flex h-4 w-4 items-center justify-center rounded-full border border-border-primary/15 bg-white/4 font-sans",children:"plus"===e.type?(0,n.jsx)(l.CheckIcon,{className:"h-4 w-4 text-accent-green-on-primary"}):(0,n.jsx)(i.CloseIcon,{className:"h-4 w-4 text-foreground-tertiary"})}),(0,n.jsx)("span",{className:"font-sans text-foreground-primary",children:e.text.replace("[v4]","").trimEnd()})]},t))});e.s(["default",0,({eyebrow:e,title:t,description:a,priceBlock:l,cta:i,highlightBorder:o=!1,planDescription:c,showFeatureList:u=!0})=>(0,n.jsxs)("div",{className:(0,s.default)("flex h-full flex-col gap-4 roun
3ded-3xl bg-background-glass-thick p-6",o?"border border-accent-primary":"border border-transparent"),children:[(0,n.jsx)("p",{className:"font-sans text-sm font-bold text-accent-brand uppercase",children:e}),(0,n.jsx)("p",{className:"font-serif text-3xl font-light",children:t}),(0,n.jsx)("div",{children:a}),l,i,u&&(0,n.jsx)(r,{features:c?.feature_descriptions??[]})]})],832583);var o=e.i(249892);e.i(462951);var c=e.i(646984),u=e.i(877130),d=e.i(741467),p=e.i(157348),m=e.i(524105);let{Annual:x,Monthly:f}=e.i(84204).SubscriptionPeriod,g=({plan:e,price:a,priceBeforeDiscount:s,period:l,discountDetails:i,planDescription:r,selectedCurrency:o,displayCurrency:p,countryCode:g,hideSavingSubtitle:h=!1,onSaveAnnuallyClick:b})=>{let y,j,{t:S}=(0,c.useTranslation)("account"),{t:N}=(0,c.useTranslation)("marketing"),v=p??o,_=(0,d.shouldShowCurrencyCode)({currency:v,countryCode:g}),w=e.plan_key!==m.PlanKey.Free&&(void 0===s||l!==x),C=r?.billing_period_month?.text||S("billingConfirm.periodMonth"),P=i?.duration_months&&l===f?S("billing.discountDuration",{count:i.duration_months}):`/${C}`;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"flex w-full flex-row items-end gap-1 text-xl",children:[i?.percent_off?(0,n.jsxs)("div",{className:"flex flex-row items-end gap-1",children:[(0,n.jsx)("div",{className:"text-sm text-foreground-tertiary-on-light line-through",children:(0,t.getLabeledDisplayPrice)({price:a,currency:v,showCurrencyCode:_})}),(0,n.jsx)("h3",{className:"text-xl font-medium text-accent-brand",children:(0,t.getLabeledSaleDisplayPrice)({price:a,currency:v,percentOff:i.percent_off,showCurrencyCode:_})})]}):(0,n.jsx)("div",{children:(0,t.getLabeledDisplayPrice)({price:a,currency:v,showCurrencyCode:_})}),(0,n.jsx)("span",{className:"text-sm font-medium text-foreground-primary/50",children:P})]}),(0,n.jsx)("div",{className:(0,u.twMerge)("min-h-8",h?"hidden":""),children:w?(0,n.jsxs)("div",{className:"flex flex-col",children:[b?(0,n.jsx)("button",{type:"button",onClick:b,className:"cursor-pointer text-left text-xs font-medium text-foreground-primary/50",children:r?.annual_savings_generic?.text||N("pricing.saveAnnually")}):(0,n.jsx)("span",{className:"text-xs font-medium text-foreground-primary/50",children:r?.annual_savings_generic?.text||N("pricing.saveAnnually")}),(0,n.jsx)("span",{className:"text-xs text-foreground-primary/50",children:r?.taxes_message?.text||N("pricing.taxesAtCheckout")})]}):s?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-foreground-primary/50",children:(y=i?.percent_off?(0,t.getLabeledDisplayPrice)({price:(s-a*(1-(0,t.getDiscountMultiplier)(i.percent_off)))*12,currency:v,showCurrencyCode:_}):(0,t.getLabeledDisplayPrice)({price:(s-a)*12,currency:v,showCurrencyCode:_}),(j=r?.annual_savings_message?.text)?j.replaceAll("{amount}",y).replaceAll("{current_price}",(0,t.getLabeledDisplayPrice)({price:s,currency:v,showCurrencyCode:_})):S("billing.annualSavings",{amount:y}))}),(0,n.jsx)("span",{className:"text-xs text-foreground-primary/50",children:r?.taxes_message?.text||N("pricing.taxesAtCheckout")})]}):null})]})};e.s(["PlanPriceBlock",0,e=>(0,n.jsx)(p.NamespaceLoadErrorBoundary,{renderFallback:p.ContentUnavailableRetryView,children:(0,n.jsx)(o.Suspense,{fallback:null,children:(0,n.jsx)(g,{...e})})})],1260)},884717,e=>{"use strict";var t=e.i(673157),a=e.i(877130);e.s(["GlassBanner",0,({children:e,className:n="bg-white/5"})=>(0,t.jsx)("div",{className:(0,a.twMerge)("w-full rounded-2xl p-4 backdrop-blur-lg",n),children:e})])}]);
4
5//# sourceMappingURL=1zgfb2lr0ee5t.js.map
6//# debugId=606dfdf7-f34c-52c8-b884-4c0a639ec497

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.