import{r as e,j as t}from"./vendor-react-Dp9pL_Wn.js";import{w as n,a3 as a,qm as o,$D as s,bx as r}from"./c6eedc03a-CsEFTfjy.js";import{D as i}from"./vendor-luxon-CZxT8ieM.js";import{u as l,M as c}from"./vendor-intl-D2wGIp4M.js";import{a as u}from"./c14703658-0O8Mq3Ud.js";import{C as p}from"./c93f725a0-CMHxg2b9.js";function d({isOpen:d,onClose:_,onSuccess:m}){const f=l(),g=n(),{addError:y}=a(),{data:b}=o(),x=b?.manual_pause_scheduled_at&&i.fromSeconds(b.manual_pause_scheduled_at)<=i.now()&&b?.payment_paused_until&&i.fromSeconds(b.payment_paused_until)>i.now(),S=x?"active":"scheduled",h=e.useRef(!1);e.useEffect(()=>{d?b&&!h.current&&(h.current=!0,g.track({event_key:"claudeai.subscription.unpause_modal.shown",phase:S})):h.current=!1},[d,b,g,S]);const{mutate:k,isPending:w}=s({onSuccess:async e=>{await g.track({event_key:e.success?"claudeai.subscription.unpause_modal.succeeded":"claudeai.subscription.unpause_modal.failed",phase:S}),m?.(),_(),x&&window.location.reload()},onError:e=>{g.track({event_key:"claudeai.subscription.unpause_modal.failed",phase:S}),y(e.message||"Failed to unpause subscription",{error:e,errorContext:{tags:{source:"subscription_unpause"}}})}}),E=b?.manual_pause_scheduled_at?i.fromSeconds(b?.manual_pause_scheduled_at):null,F=E?.toLocaleString(i.DATE_FULL)??f.formatMessage({defaultMessage:"your next billing date",id:"WChm1quNOX"}),I=b?.currency||"USD",O=u(I),R=b?.price?new Intl.NumberFormat(f.locale,{style:"currency",currency:I,minimumFractionDigits:O,maximumFractionDigits:O}).format(b.price/10**O):null,v=b?.plan_type?.toLowerCase().includes("max")?"Max":"Pro";return t.jsx(p,{isOpen:d,onClose:_,title:x?f.formatMessage({defaultMessage:"Resume plan",id:"NhThVFviNF"}):f.formatMessage({defaultMessage:"Cancel pause",id:"IYjbDFq1xb"}),actions:t.jsxs(t.Fragment,{children:[t.jsx(r,{variant:"secondary",onClick:_,disabled:w,children:t.jsx(c,{defaultMessage:"Go back",id:"orvpWhO3rI"})}),t.jsx(r,{variant:"primary",onClick:()=>{g.track({event_key:"claudeai.subscription.unpause_modal.confirm_clicked",phase:S}),k()},busy:w,children:x?t.jsx(c,{defaultMessage:"Resume plan",id:"NhThVFviNF"}):t.jsx(c,{defaultMessage:"Cancel Pause",id:"8eC982dSuo"})})]}),children:t.jsx("p",{className:"text-text-200",children:x?R?t.jsx(c,{defaultMessage:"Resume your {planType} plan. You will be charged {price}, plus applicable taxes, today and your next billing cycle will be one month from now on {nextDate}.",id:"UW54ayq6qb",values:{planType:v,price:R,nextDate:i.now().plus({months:1}).toLocaleString(i.DATE_FULL)}}):t.jsx(c,{defaultMessage:"Resume your {planType} plan. You will be charged at your current rate today and your next billing cycle will be one month from now on {nextDate}.",id:"pUtlFVPzbw",values:{planType:v,nextDate:i.now().plus({months:1}).toLocaleString(i.DATE_FULL)}}):R?t.jsx(c,{defaultMessage:"If you cancel this upcoming pause, your next billing cycle will continue as normal. Your plan will renew and you will be automatically charged {price}, plus applicable taxes, on {nextDate}.",id:"pjnvRZt8LA",values:{price:R,nextDate:F}}):t.jsx(c,{defaultMessage:"If you cancel this upcoming pause, your next billing cycle will continue as normal. Your plan will renew at your current rate on {nextDate}.",id:"zQovHKXzcp",values:{nextDate:F}})})})}const _=Object.freeze(Object.defineProperty({__proto__:null,UnpauseModal:d},Symbol.toStringTag,{value:"Module"}));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var m={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}};const f=Object.freeze(Object.defineProperty({__proto__:null,conf:m,language:{tokenPostfix:".rust",defaultToken:"invalid",keywords:["as","async","await","box","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","true","try","type","unsafe","use","where","while","catch","default","union","static","abstract","alignof","become","do","final","macro","offsetof","override","priv","proc","pure","sizeof","typeof","unsized","virtual","yield"],typeKeywords:["Self","m32","m64","m128","f80","f16","f128","int","uint","float","char","bool","u8","u16","u32","u64","f32","f64","i8","i16","i32","i64","str","Option","Either","c_float","c_double","c_void","FILE","fpos_t","DIR","dirent","c_char","c_schar","c_uchar","c_short","c_ushort","c_int","c_uint","c_long","c_ulong","size_t","ptrdiff_t","clock_t","time_t","c_longlong","c_ulonglong","intptr_t","uintptr_t","off_t","dev_t","ino_t","pid_t","mode_t","ssize_t"],constants:["true","false","Some","None","Left","Right","Ok","Err"],supportConstants:["EXIT_FAILURE","EXIT_SUCCESS","RAND_MAX","EOF","SEEK_SET","SEEK_CUR","SEEK_END","_IOFBF","_IONBF","_IOLBF","BUFSIZ","FOPEN_MAX","FILENAME_MAX","L_tmpnam","TMP_MAX","O_RDONLY","O_WRONLY","O_RDWR","O_APPEND","O_CREAT","O_EXCL","O_TRUNC","S_IFIFO","S_IFCHR","S_IFBLK","S_IFDIR","S_IFREG","S_IFMT","S_IEXEC","S_IWRITE","S_IREAD","S_IRWXU","S_IXUSR","S_IWUSR","S_IRUSR","F_OK","R_OK","W_OK","X_OK","STDIN_FILENO","STDOUT_FILENO","STDERR_FILENO"],supportMacros:["format!","print!","println!","panic!","format_args!","unreachable!","write!","writeln!"],operators:["!","!=","%","%=","&","&=","&&","*","*=","+","+=","-","-=","->",".","..","...","/","/=",":",";","<<","<<=","<","<=","=","==","=>",">",">=",">>",">>=","@","^","^=","|","|=","||","_","?","#"],escapes:/\\([nrt0\"''\\]|x\h{2}|u\{\h{1,6}\})/,delimiters:/[,]/,symbols:/[\#\!\%\&\*\+\-\.\/\:\;\<\=\>\@\^\|_\?]+/,intSuffixes:/[iu](8|16|32|64|128|size)/,floatSuffixes:/f(32|64)/,tokenizer:{root:[[/r(#*)"/,{token:"string.quote",bracket:"@open",next:"@stringraw.$1"}],[/[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,{cases:{"@typeKeywords":"keyword.type","@keywords":"keyword","@supportConstants":"keyword","@supportMacros":"keyword","@constants":"keyword","@default":"identifier"}}],[/\$/,"identifier"],[/'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])/,"identifier"],[/'(\S|@escapes)'/,"string.byteliteral"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],{include:"@numbers"},{include:"@whitespace"},[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}],[/[{}()\[\]<>]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],stringraw:[[/[^"#]+/,{token:"string"}],[/"(#*)/,{cases:{"$1==$S2":{token:"string.quote",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["#]/,{token:"string"}]],numbers:[[/(0o[0-7_]+)(@intSuffixes)?/,{token:"number"}],[/(0b[0-1_]+)(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(\.[\d][\d_]*)?[eE][+-][\d_]+(@floatSuffixes)?/,{token:"number"}],[/\b(\d\.?[\d_]*)(@floatSuffixes)?\b/,{token:"number"}],[/(0x[\da-fA-F]+)_?(@intSuffixes)?/,{token:"number"}],[/[\d][\d_]*(@intSuffixes?)?/,{token:"number"}]]}}},Symbol.toStringTag,{value:"Module"}));export{d as U,_ as a,f as r};
