PageSourceSearch

https://feedback.common.fi/_next/static/chunks/593181-24f8f7b03afbf9ef.js

js common.fi collected 2026-10-04 21:06:19 UTC 28,074 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4debb7ac-5dd0-48bc-b4f7-1fdffa7e6e01",e._sentryDebugIdIdentifier="sentry-dbid-4debb7ac-5dd0-48bc-b4f7-1fdffa7e6e01")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[593181],{353573:(e,t,s)=>{s.d(t,{$7:()=>L,Np:()=>w,iK:()=>v,m7:()=>N,yW:()=>k});var a=s(594458),i=s(875073),l=s(289125),r=s(622976),n=s(733248),c=s(293294),o=s(176767),d=s(616128),m=s(955340),u=s(236427),x=s(985554),h=s(171371),p=s(229653),g=s(954791),f=s(768658),b=s(860286),j=s(90276);let y=new Set(["supportFollowup","supportReply","supportOutbound"]),N=20,v=1e3,w=1e8,k="w-full p-3 text-sm resize-y bg-elev-3 border-elev-line-1 shadow-sm text-yellow-900 text-content-1 placeholder:text-content-3 dark:placeholder:text-content-3",S={changelog:"Updates",userInvite:"Admin invites",ticketCreated:"Ticket created",ticketStatusChanged:"Ticket status changes",ticketLifecycle:"Ticket lifecycle"},$=[{firstUnit:0,lastUnit:5e3,priceUsd:0},{firstUnit:5001,lastUnit:1e4,priceUsd:.003},{firstUnit:10001,lastUnit:5e4,priceUsd:.0025},{firstUnit:50001,lastUnit:1e5,priceUsd:.002},{firstUnit:100001,lastUnit:5e5,priceUsd:.0016},{firstUnit:500001,lastUnit:null,priceUsd:.001}],U={0:{limit:500},1:{limit:2500},2:{limit:5e3},999:{limit:null}},C=e=>{let t=[],s=e;for(let e=0;e<$.length;e++){let a=$[e],i=a.firstUnit,l=a.lastUnit??1/0,r=Math.min(Math.max(s,0),0===i?a.lastUnit??1/0:l-i+1),n=0===e?`First ${(a.lastUnit??0).toLocaleString()}`:null===a.lastUnit?`Over ${(i-1).toLocaleString()}`:`Next ${i.toLocaleString()} to ${a.lastUnit.toLocaleString()}`,c=r*a.priceUsd;if(t.push({tierLabel:n,unitsUsed:r,unitPrice:0===a.priceUsd?"Free":`$${a.priceUsd}`,subtotal:c,isFree:0===a.priceUsd}),(!((s-=r)<=0)||null===a.lastUnit)&&s<=0)break}return t},L=({billing:e,usage:t,isUsageLoading:s=!1,onUsageRefresh:L,onBillingRefresh:q,showHeader:A=!0,title:_="Outbound Emails",enableDescription:E="You're using plan-based email limits. Switch to flexible pricing to get 5,000 free emails each month and pay only for what you send beyond that.",helpArticleUrl:T="https://help.featurebase.app/en/help/articles/0516485-email-pricing",id:F,outboundEmail
1sApproved:R=!0,approvalRequestPending:D=!1,trustLevel:Y,currentPlanLimit:I,settingsSurface:W=!1})=>{let M=W?"settings-surface":"rounded-lg border ring-0 shadow-sm dark:shadow dark:bg-elev-1 border-border",[z,O]=(0,f.useState)(!1),[H,P]=(0,f.useState)(!1),[J,G]=(0,f.useState)(0),[K,Z]=(0,f.useState)(0),[B,Q]=(0,f.useState)(!1),[V,X]=(0,f.useState)(null),[ee,et]=(0,f.useState)(""),[es,ea]=(0,f.useState)(!1),[ei,el]=(0,f.useState)(null),[er,en]=(0,f.useState)(null),[ec,eo]=(0,f.useState)(!1),[ed,em]=(0,f.useState)(0),[eu,ex]=(0,f.useState)(!1),[eh,ep]=(0,f.useState)(!1);f.useEffect(()=>{t?.caps&&(G(t.caps.soft??0),Z(t.caps.hard??0))},[t]);let eg=(0,f.useMemo)(()=>{if(!t)return{breakdown:[],total:0};let e=C(t.currentUsage),s=e.reduce((e,t)=>e+t.subtotal,0);return{breakdown:e,total:s}},[t]);(0,f.useMemo)(()=>{let e=t?.breakdown??[];if(0===e.length)return{support:0,other:0,otherRows:[]};let s=0,a=0,i=new Map;for(let t of e){if(y.has(t.source)){s+=t.units;continue}a+=t.units;let e=S[t.source]||"Other";i.set(e,(i.get(e)??0)+t.units)}return{support:s,other:a,otherRows:Array.from(i.entries()).map(([e,t])=>({label:e,units:t})).sort((e,t)=>t.units-e.units)}},[t?.breakdown]);let ef=(0,f.useMemo)(()=>J<=0?0:C(J).reduce((e,t)=>e+t.subtotal,0),[J]),eb=(0,f.useMemo)(()=>K<=0?0:C(K).reduce((e,t)=>
1e+t.subtotal,0),[K]),ej=e?.metered?.outboundEmails?.enabled;if(!R)return(0,a.jsxs)("div",{id:F,children:[A&&(0,a.jsx)("p",{className:"mb-2 text-base font-medium text-title",children:_}),(0,a.jsx)("div",{className:(0,u.cn)("p-5",M),children:D?(0,a.jsx)("div",{className:"flex flex-col gap-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-10 h-10 rounded-full bg-amber-500/10",children:(0,a.jsx)(x.A,{className:"w-5 h-5 text-amber-500"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-title",children:"Your request is under review"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-foreground",children:"We're reviewing your outbound email request and will get back to you within 1-2 business days. In the meantime, you can send emails to your workspace's admins."})]})]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-10 h-10 rounded-full bg-accent-tint-1",children:(0,a.jsx)(h.A,{className:"w-5 h-5 text-accent"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-title",children:"Enable outbound email sending"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-foreground",children:"To protect your sender reputation and ensure high email deliverability, we verify all outbound email accounts. Currently, you can send emails to your workspace's admins. Complete a quick verification to unlock sending to all your users."})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 items-center mt-1 ml-[52px]",children:[(0,a.jsx)(n.$,{size:"sm",onClick:()=>P(!0),children:"Request Email Sending Access"}),T&&(0,a.jsx)("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-accent hover:underline",children:"Learn more →"})]})]})}),(0,a.jsx)(j.Ay,{isOpen:H,setIsOpen:P,onSuccess:()=>{q?.()}})]});let ey=async()=>{if(X(null),el(null),en(null),et(""),J>=K)return void X("Soft cap must be less than hard cap");if(J<0||K<0)return void X("Caps must be positive numbers");Q(!0);try{await (0,g.sa$)({softCap:J,hardCap:K,meterType:"outboundEmail
1s"}),b.oR.success("Usage caps updated successfully"),L?.(),O(!1)}catch(e){X(e?.response?.data?.message||"Failed to update caps")}finally{Q(!1)}},eN=K>w?`That's above ${w.toLocaleString()} emails/month - double-check the number, or reach out via live chat and we'll set it up with you directly.`:K<1?"Enter the hard cap you want above, then tell us why you need it.":null,ev=void 0!==Y?U[Y]?.limit??null:null,ew=ed>w?`That's above ${w.toLocaleString()} emails/month - double-check the number, or reach out via live chat and we'll set it up with you directly.`:ed<1?"Enter the monthly limit you need, then tell us why.":null!==ev&&ed<=ev?`Enter a limit above your current ${ev.toLocaleString()}.`:null,ek=async e=>{en(null);let{requestedHardCap:t,requestedSoftCap:s}=e;ea(!0);try{await (0,g.oqx)({requestedHardCap:t,requestedSoftCap:s,reason:ee.trim()}),el({hardCap:t}),b.oR.success("Request sent - usually approved within a few hours during business hours")}catch(e){en(e?.response?.data?.message||"Could not send your request. Please try again.")}finally{ea(!1)}},eS=async()=>{ex(!0);
1try{await (0,g.xAc)({meterType:"outboundEmails",enabled:!0}),b.oR.success("Usage-based pricing enabled for outbound emails"),L?.(),q?.()}catch(e){b.oR.error(e?.response?.data?.message||"Failed to enable usage-based pricing")}finally{ex(!1)}};return ej&&t?(0,a.jsxs)("div",{id:F,children:[A&&(0,a.jsx)("p",{className:"mb-2 text-base font-medium text-title",children:_}),(0,a.jsxs)("div",{className:M,children:[(0,a.jsx)(c.Zp,{className:(0,u.cn)("flex flex-col gap-5 p-6 rounded-lg !ring-0",W?"border-t-0 border-b !border-x-0 bg-transparent dark:bg-transparent dark:border-dark-accent/50 border-elev-line-2":"border border-elev-line-1 shadow-sm dark:shadow-sm dark:bg-elev-2 -mt-px -mx-px"),children:(0,a.jsxs)("div",{className:"flex justify-between items-center pb-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-title",children:"Outbound Emails"}),t.period?.start&&t.period?.end&&(0,a.jsxs)("p",{className:"text-xs text-content-2",children:[new Date(t.period.start).toLocaleDateString("en-US",{month:"short",day:"numeric"})," ","-"," ",new Date(t.period.end).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),(0,a.jsxs)("div",{className:"flex gap-12 text-right",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1 text-xs text-content-1",children:"Pricing"}),(0,a.jsx)(m.A,{delayDuration:0,allowHoverableContent:!0,contentClass:"p-0 w-72 text-left tracking-normal",content:(0,a.jsxs)("div",{className:"p-3",children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-medium text-title",children:"Graduated pricing tiers"}),(0,a.jsx)("div",{className:"overflow-hidden rounded-md border border-border",children:(0,a.jsxs)("table",{className:"w-full text-xs",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-elev-2 dark:bg-elev-4",children:[(0,a.jsx)("th",{className:"px-3 py-1.5 text-left font-medium text-content-2",children:"Emails"}),(0,a.jsx)("th",{className:"px-3 py-1.5 text-right font-medium text-content-2",children:"Per email (USD)"})]})}),(0,a.jsx)("tbody",{className:"divide-y dark:divide-border divide-elev-line-1",children:$.map((e,s)=>(0,a.jsxs)("tr",{className:(0,u.cn)("transition-colors",t.currentUsage>=e.firstUnit&&(null===e.lastUnit||t.currentUsage<=e.lastUnit)?"bg-primary/5 dark:bg-accent-tint-1":""),children:[(0,a.jsxs)("td",{className:"px-3 py-1.5 text-title",children:[e.firstUnit.toLocaleString()," -"," ",null===e.lastUnit?"∞":e.lastUnit.toLocaleString()]}),(0,a.jsx)("td",{className:"px-3 py-1.5 text-right text-title",children:0===e.priceUsd?"Free":`$${e.priceUsd}`})]},s))})]})})]}),children:(0,a.jsx)("p",{className:"text-lg font-semibold text-title cursor-help",children:"Tiered"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1 text-xs text-content-1",children:"Emails"}),(0,a.jsx)("p",{className:"text-lg font-semibold text-title",children:t.currentUsage.toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1 text-xs text-content-1",children:"Monthly total"}),(0,a.jsx)(m.A,{delayDuration:0,allowHoverableContent:!0,contentClass:"p-0 w-[420px] max-w-[420px] text-left tracking-normal",content:(0,a.jsxs)("div",{className:"p-3",children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-medium text-title",children:"Pricing breakdown"}),(0,a.jsx)("div",{className:"overflow-hidden rounded-md border border-border",children:(0,a.jsxs)("table",{className:"w-full text-xs",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-elev-2 dark:bg-elev-4",children:[(0,a.jsx)("th",{className:"px-3 py-1.5 text-left font-medium text-content-2",children:"Tier"}),(0,a.jsx)("th",{className:"px-3 py-1.5 text-right font-medium text-content-2",children:"Qty"}),(0,a.jsx)("th",{className:"px-3 py-1.5 text-right font-medium text-content-2",children:"Unit price"}),(0,a.jsx)("th",{className:"px-3 py-1.5 text-right font-medium text-content-2",children:"Amount"})]})}),(0,a.jsx)("tbody",{className:"divide-y dark:divide-border divide-elev-line-1",children:eg.breakdown.map((e,t)=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"px-3 py-1.5 text-title",children:e.tierLabel}),(0,a.jsx)("td",{className:"px-3 py-1.5 text-right text-title",children:e.unitsUsed.toLocaleStr
1ing()}),(0,a.jsx)("td",{className:"px-3 py-1.5 text-right text-content-2",children:e.unitPrice}),(0,a.jsx)("td",{className:"px-3 py-1.5 text-right text-title",children:e.isFree?"$0.00":`$${e.subtotal.toFixed(2)}`})]},t))}),(0,a.jsx)("tfoot",{children:(0,a.jsxs)("tr",{className:"bg-elev-2 dark:bg-elev-4 font-medium",children:[(0,a.jsx)("td",{colSpan:3,className:"px-3 py-1.5 text-title",children:"Total"}),(0,a.jsxs)("td",{className:"px-3 py-1.5 text-right text-title",children:["$",eg.total.toFixed(2)]})]})})]})}),(0,a.jsx)("p",{className:"mt-2 text-[11px] text-content-2",children:"You'll be charged when your balance reaches $100"})]}),children:(0,a.jsxs)("p",{className:"text-lg font-semibold text-title cursor-help",children:["$",eg.total.toFixed(2)]})})]})]})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 p-5 rounded-b-lg bg-elev-3 dark:bg-elev-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-between items-center",children:(0,a.jsx)("p",{className:"text-sm font-medium text-title",children:"Avoid overage charges with usage caps"})}),(0,a.jsx)("p",{className:"mb-3 text-[13px] text-foreground mt-0.5",children:"Adjust maximum outbound email usage caps to avoid overage charges."}),(0,a.jsxs)("p",{className:"mb-2.5 text-sm text-title",children:["Current usage:"," ",(0,a.jsxs)("span",{className:"font-medium text-title",children:[t.currentUsage.toLocaleString()," / ",t.caps.hard.toLocaleString()||0]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(d.AU,{progress:t.currentUsage/(t.caps.hard||1),scaleStart:"0",scaleEnd:(t.caps.hard||0).toLocaleString()}),(0,a.jsx)("div",{className:"absolute top-0 flex h-7 w-3 -translate-x-1/2 cursor-help items-center justify-center",style:{left:`${(t.caps.soft||0)/(t.caps.hard||1)*100}%`},children:(0,a.jsx)(m.A,{content:`Your soft cap is set at ${t.caps.soft?.toLocaleString()||0} emails. You will be notified by email when you reach this.`,delayDuration:0,children:(0,a.jsx)("span",{className:"block h-[22px] w-[3px] rounded-full bg-white/75 shadow-[0_0_0_0.5px_rgba(0,0,0,0.18)] dark:bg-white/55 dark:shadow-[0_0_0_0.5px_rgba(0,0,0,0.4)]"})})})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs text-content-2",children:[t.currentUsage>=(t.caps.hard||0)?"Hard cap reached, no more usage allowed":t.currentUsage>=(t.caps.soft||0)?`${((t.caps.hard||0)-t.currentUsage).toLocaleString()} emails until hard cap`:`${((t.caps.soft||0)-t.currentUsage).toLocaleString()} emails until soft cap`,"."]})]}),void 0!==Y&&999!==Y&&U[Y]&&(0,a.jsx)("div",{className:"p-3 rounded-lg border border-border bg-secondary/10 dark:bg-elev-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-8 h-8 rounded-full bg-accent-tint-1",children:(0,a.jsx)(h.A,{className:"w-4 h-4 text-accent"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("p",{className:"text-sm font-medium text-title",children:["Monthly sending limit: ",U[Y].limit?.toLocaleString()," ","emails"]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-foreground",children:"This limit increases over time based on your sending history and reputation. It's separate from the spending caps below - raising those won't raise it."}),ei?(0,a.jsxs)("p",{className:"mt-2 text-xs text-foreground",children:[(0,a.jsx)("span",{className:"font-medium text-title",children:"Request sent for review."})," ","We'll email you once your limit is raised to"," ",ei.hardCap.toLocaleString(),". Requests are usually approved within a few hours during business hours, and within 24 hours outside them."]}):ec?(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(o.J,{className:"pb-1.5",htmlFor:"warmup-cap-raise-ask",children:"New monthly limit"}),(0,a.jsx)("input",{id:"warmup-cap-raise-ask",type:"number",value:ed||"",onChange:e=>em(parseInt(e.target.value)||0),className:"w-full px-2 py-1.5 text-sm",min:"0",placeholder:"5000"}),ew&&ed>0&&(0,a.jsx)("p",{className:"mt-1 text-xs text-content-2 dark:text-content-3",children:ew}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(o.J,{className:"pb-1.5",htmlFor:"warmup-cap-raise-reason",children:"Why do you need a higher limit?"}),(0,a.jsx)("textarea",{id:"warmup-cap-raise-reason",value:ee,onChange:e=>et(e.target.value),className:k,rows:3,maxLength:v,placeholder:"e.g. We're announcing a new feature to our 8,000 existing customers who opted in to product updates."}),(0,a.jsx)("p",{className:"mt-1 text-xs text-content-2 dark:text-content-3",children:ee.trim().length<N?`${N-ee.trim().length} more characters needed`:`${ee.trim().length}/${v}`})]}
1),er&&(0,a.jsx)("p",{className:"mt-2 text-sm text-rose-600 dark:text-rose-400",children:er}),(0,a.jsx)(n.$,{onClick:()=>ek({requestedHardCap:ed}),loading:es,disabled:!!ew||ee.trim().length<N,size:"sm",className:"mt-3",children:"Send request"})]}):(0,a.jsx)(n.$,{variant:"outline",size:"sm",className:"mt-2.5",onClick:()=>eo(!0),children:"Request a higher limit"})]})]})}),(0,a.jsx)("div",{children:z?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("label",{className:"block mb-1.5 text-xs text-content-1",children:[(0,a.jsx)("span",{className:"font-medium text-title",children:"Soft Cap"})," (Get notified by email when you reach this)"]}),(0,a.jsx)("input",{type:"number",value:J,onChange:e=>G(parseInt(e.target.value)||0),className:"w-full px-2 py-1.5 text-sm",min:"0"}),J>0&&(0,a.jsxs)("p",{className:"mt-1 text-xs text-content-2",children:["Cost if reached:"," ",(0,a.jsxs)("span",{className:"font-medium",children:["$",ef.toFixed(2)]})]})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("label",{className:"block mb-1.5 text-xs text-content-1",children:[(0,a.jsx)("span",{className:"font-medium text-title",children:"Hard Cap"})," (No more usage after this)"]}),(0,a.jsx)("input",{type:"number",value:K,onChange:e=>Z(parseInt(e.target.value)||0),className:"w-full px-2 py-1.5 text-sm",min:"0"}),K>0&&(0,a.jsxs)("p",{className:"mt-1 text-xs text-content-2",children:["Cost if reached:"," ",(0,a.jsxs)("span",{className:"font-medium",children:["$",eb.toFixed(2)]})]})]})]}),V&&(V.toLowerCase().includes("contact support")||V.toLowerCase().includes("exceed"))?(0,a.jsx)(l.A,{variant:"warning",children:ei?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"font-medium",children:"Request sent for review"}),(0,a.jsxs)("p",{className:"mt-1",children:["We'll email you once your limit is raised to"," ",ei.hardCap.toLocaleString(),". Requests are usually approved within a few hours during business hours, and within 24 hours outside them."]})]}):eN?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"font-medium",children:V.replace(/\.\s*contact support.*$/i,"").trim()}),(0,a.jsx)("p",{className:"mt-1",children:eN})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"font-medium",children:V.replace(/\.\s*contact support.*$/i,"").trim()}),(0,a.jsxs)("p",{className:"mt-1",children:["We can raise it to ",K.toLocaleString()," for you. Tell us what you're sending and we'll review it - usually within a few hours during business hours, and within 24 hours outside them."]}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(o.J,{className:"pb-1.5 text-yellow-900 dark:text-yellow-50",htmlFor:"cap-raise-reason",children:"Why do you need a higher limit?"}),(0,a.jsx)("textarea",{id:"cap-raise-reason",value:ee,onChange:e=>et(e.target.value),className:k,rows:3,maxLength:v,placeholder:"e.g. We're announcing a new feature to our 8,000 existing customers who opted in to product updates."}),(0,a.jsx)("p",{className:"mt-1 text-xs text-content-2 dark:text-content-3",children:ee.trim().length<N?`${N-ee.trim().length} more characters needed`:`${ee.trim().length}/${v}`})]}
1),er&&(0,a.jsx)("p",{className:"mt-2 text-sm text-rose-600 dark:text-rose-400",children:er}),(0,a.jsx)(n.$,{onClick:()=>ek({requestedHardCap:K,requestedSoftCap:J>0&&J<K?J:void 0}),loading:es,disabled:ee.trim().length<N,size:"sm",className:"mt-3",children:"Send request"})]})}):(0,a.jsx)(r.A,{error:V||void 0}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$,{size:"sm",onClick:ey,disabled:B,className:"flex-1",children:B?"Saving...":"Save Caps"}),(0,a.jsx)(n.$,{size:"sm",variant:"outline",onClick:()=>{O(!1),G(t?.caps.soft??0),Z(t?.caps.hard??0),X(null)},disabled:B,children:"Cancel"})]})]}):(0,a.jsx)("div",{className:"flex justify-between items-center",children:(0,a.jsx)(n.$,{size:"sm",variant:"outline",onClick:()=>O(!0),children:"Edit usage caps"})})})]})]})]}):(0,a.jsxs)("div",{id:F,children:[A&&(0,a.jsx)("p",{className:"mb-2 text-base font-medium text-title",children:_}),(0,a.jsx)("div",{className:(0,u.cn)("p-5",M),children:ej?(0,a.jsx)("p",{className:"text-sm text-foreground",children:s?"Loading usage data...":"No usage data available"}):(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-foreground",children:E}),(0,a.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,a.jsx)(n.$,{size:"sm",onClick:()=>ep(!0),disabled:eu,loading:eu,children:"Enable flexible pricing"}),T&&(0,a.jsx)("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-accent hover:underline",children:"Learn about flexible pricing →"})]})]})}),(0,a.jsx)(i.A,{open:eh,setOpen:ep,title:"Enable Usage-Based Pricing for Emails?",description:"Your first 5,000 emails each month are free. After that, you pay per email sent with tiered pricing. You can set soft and hard caps to control spending. This change is permanent and cannot be reverted.",callBack:eS,buttonTxt:"Enable",isLoading:eu,customComponent:e?.isLegacy===!0&&void 0!==I&&I>5e3?(0,a.jsx)("div",{className:"mt-3 p-3 bg-red-50 rounded-lg border border-red-200 dark:bg-red-900/20 dark:border-red-800",children:(0,a.jsxs)("div",{className:"flex gap-2.5",children:[(0,a.jsx)(p.A,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}),(0,a.jsxs)("p",{className:"text-[13px] text-red-700 dark:text-red-300",children:["Your current plan includes"," ",(0,a.jsxs)("span",{className:"font-medium",children:[I.toLocaleString()," emails/month"]}),". This will drop to"," ",(0,a.jsx)("span",{className:"font-medium",children:"5,000 free emails/month"}),". Any emails beyond that will be charged."]})]})}):void 0})]})}},593181:(e,t,s)=>{s.d(t,{A:()=>$});var a=s(594458),i=s(863408),l=s(289125),r=s(733248),n=s(176767),c=s(309144),o=s(159424),d=s(351813),m=s(793972),u=s(236427),x=s(561644),h=s(491492),p=s(794182),g=s(33651),f=s.n(g),b=s(954791),j=s(768658),y=s(353573);let N="/dashboard/settings/pricing/manage#outbound-emails",v=({className:e})=>(0,a.jsx)(h.n,{icon:x.VZey,className:e}),w=({className:e})=>(0,a.jsx)(h.n,{icon:x.p_kY,className:e}),k=({className:e})=>(0,a.jsx)(h.n,{icon:x.khQ8,className:e});function S(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}let $=({source:e,recipientCount:t,enabled:s,recipientCountIsLowerBound:x=!1,className:h})=>{let{capacity:g,isLoadingCapacity:$,mutateCapacity:U}=function(e,{enabled:t=!0}={}){let{data:s,error:a,mutate:i,isLoading:l,isValidating:r}=(0,c.Ay)(t?`/v1/email/outbound-capacity?source=${encodeURIComponent(e)}`:null,o.pG,{revalidateOnFocus:!1,dedupingInterval:3e4});return{capacity:s?.capacity??null,isLoadingCapacity:l,capacityError:a,mutateCapacity:i,isValidatingCapacity:r}}(e,{enabled:s}),C=(0,m.TU)("manage_billing"),L=(0,p.Xr)(i.fj),[q,A]=(0,j.useState)(""),[_,E]=(0,j.useState)(null),[T,F]=(0,j.useState)(!1),[R,D]=(0,j.useState)(null),[Y,I]=(0,j.useState)(null),W=(0,j.useMemo)(()=>g&&void 0!==t?Math.min(Math.max(5e3*Math.ceil(Math.max(g.currentUsage+t,g.hardCap??0)/5e3),5e3),y.Np):0,[g,t]),M=_??W,z=async()=>{D(null),F(!0);try{await (0,b.oqx)({requestedHardCap:M,reason:q.trim()}),I(M),U().catch(()=>void 0)}catch(e){D(e?.response?.data?.message||"Could not send your request. Please try again.")}finally{F(!1)}};if(!s||!t||$||!g||"request_approval"===g.action)return null;let{remaining:O,hardCap:H,periodEnd:P,selfServeCeiling:J,capRaiseRequest:G}
1=g,K=`${t.toLocaleString()}${x?"+":""}`;if(null===O||O>=t)return(0,a.jsxs)("p",{className:(0,u.cn)("mt-3 text-xs text-content-2 dark:text-content-3",h),children:[K," recipients \xb7"," ",null===O?"no sending limit this period":`${O.toLocaleString()} emails left this period`]});let Z=S(P),B=0===O?"No emails will be sent — you've hit your monthly email limit":`Only ${O.toLocaleString()} out of ${K} recipients will get this email`,Q=0===O?`Everyone will be skipped, not queued.${Z?` Your limit resets ${Z}.`:""}`:`That's all your monthly email limit allows — the rest will be skipped, not queued.${Z?` Your limit resets ${Z}.`:""}`,V=null!==H&&H>=y.Np?"Your limit is already at the maximum we can raise here — reach out via live chat and we'll set it up with you directly.":M>y.Np?`That's above ${y.Np.toLocaleString()} emails/month — double-check the number, or reach out via live chat and we'll set it up with you directly.`:M<1?"Enter the monthly limit you need, then tell us why.":null!==H&&M<=H?`Enter a limit above your current ${H.toLocaleString()}.`:null,X=`outbound-preflight-ask-${e}`,ee=`outbound-preflight-reason-${e}`;return(0,a.jsxs)(l.A,{variant:"warning",className:(0,u.cn)("mt-3",h),children:[(0,a.jsx)("p",{className:"font-medium",children:B}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed opacity-90",children:Q}),(()=>{if(null!==Y)return(0,a.jsxs)("p",{className:"mt-3 text-xs leading-relaxed opacity-90",children:[(0,a.jsx)("span",{className:"font-medium",children:"Request sent for review."})," We'll email you once your limit is raised to ",Y.toLocaleString(),". Requests are usually approved within a few hours during business hours, and within 24 hours outside them."]});switch(g.action){case"raise_own_cap":return(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(f(),{href:N,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center",children:(0,a.jsx)(r.$,{size:"sm",icon:v,children:"Raise your limit"})}),null!==J&&(0,a.jsxs)("p",{className:"mt-1.5 text-xs opacity-90",children:["You can set it up to ",J.toLocaleString(),"."]})]});case"request_raise":if(!C)return(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed opacity-90",children:"Ask a billing admin to raise the limit."});if(G?.status==="rejected"&&function(e){if(!e)return!1;let t=new Date(e).getTime();return Number.isFinite(t)&&t>Date.now()}(G.canRequestAgainAt))return(0,a.jsxs)("p",{className:"mt-3 text-xs leading-relaxed opacity-90",children:["Your last request was declined. You can request again on"," ",S(G.canRequestAgainAt),", or email [email protected] with more details."]});return(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(n.J,{className:"pb-1.5 text-yellow-900 dark:text-yellow-50",htmlFor:X,children:"New monthly limit"}),(0,a.jsx)("input",{id:X,type:"number",value:M||"",onChange:e=>E(parseInt(e.target.value)||0),className:"w-full px-2 py-1.5 text-sm bg-elev-3 border-elev-line-1 shadow-sm text-yellow-900 text-content-1",min:"0"}),V&&(0,a.jsx)("p",{className:"mt-1 text-xs opacity-90",children:V}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(n.J,{className:"pb-1.5 text-yellow-900 dark:text-yellow-50",htmlFor:ee,children:"Why do you need a higher limit?"}),(0,a.jsx)("textarea",{id:ee,value:q,onChange:e=>A(e.target.value),className:y.yW,rows:3,maxLength:y.iK,placeholder:"e.g. We're announcing a new feature to our 8,000 existing customers who opted in to product updates."}),(0,a.jsx)("p",{className:"mt-1 text-xs opacity-90",children:q.trim().length<y.m7?`${y.m7-q.trim().length} more characters needed`:`${q.trim().length}/${y.iK}`})]}
1),R&&(0,a.jsx)("p",{className:"mt-2 text-sm text-rose-600 dark:text-rose-400",children:R}),(0,a.jsx)(r.$,{onClick:z,loading:T,disabled:!!V||q.trim().length<y.m7,size:"sm",className:"mt-3",children:"Send request"})]});case"wait_for_pending":return(0,a.jsx)("p",{className:"mt-3 text-xs leading-relaxed opacity-90",children:G?`Request for ${G.requestedHardCap.toLocaleString()} pending${S(G.requestedAt)?` since ${S(G.requestedAt)}`:""}. We'll email you once it's decided.`:"Your cap-raise request is pending. We'll email you once it's decided."});case"upgrade_plan":return(0,a.jsx)(r.$,{size:"sm",className:"mt-3",icon:w,onClick:()=>L({title:"Higher outbound email limits are",tierCode:d.ZN.T1}),children:"Upgrade plan"});case"enable_flexible_pricing":return(0,a.jsx)(f(),{href:N,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center mt-3",children:(0,a.jsx)(r.$,{size:"sm",icon:k,children:"Enable flexible pricing"})});default:return null}})()]})}}}]);

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.