PageSourceSearch

https://app.selfhostedemailserver.com/build/assets/Plans-DnWhl7sj.js

js selfhostedemailserver.com collected 2026-10-03 21:07:29 UTC 11,071 bytes, 1 lines download raw bytes

1import{r as a,aC as P,i as z,u as _,l as B,n as H,j as c,c as j,o as T,a1 as Y,k as fe,aD as D,v as me,a2 as he,p as pe,t as ge,a6 as ve,a4 as be,B as ye,q as xe,Y as we}from"./app-B3kQcTUR.js";import{A as Ce}from"./AuthenticatedLayout-DyRgIbn8.js";import{g as Re}from"./get-env-uyVen0u2.js";import{u as Se}from"./use-uncontrolled-DsfLAK2I.js";import{T as E}from"./Text-D2jHSsfj.js";import{G as q}from"./Grid-d1K2aTE5.js";import{C as je}from"./Card-xiHu1dtR.js";import{S as U}from"./Stack-Cjfrg9tv.js";import{T as Pe}from"./Title-mcykBrZC.js";import{B as Ee}from"./Badge-DFF-5av8.js";import{D as Ne}from"./Divider-osZAMe8-.js";import{F as $e}from"./Flex-8UDlrZjb.js";import{C as ke}from"./CheckIcon-gWObXAzs.js";import"./ApplicationLogo-DOpzIn9L.js";import"./Footer-CbfFAO21.js";import"./Icons-Bf6fm-c0.js";import"./use-resolved-styles-api-BFgbj_j6.js";function ze(r,e){if(r===e||Number.isNaN(r)&&Number.isNaN(e))return!0;if(!(r instanceof Object)||!(e instanceof Object))return!1;const t=Object.keys(r),{length:i}=t;if(i!==Object.keys(e).length)return!1;for(let n=0;n<i;n+=1){const o=t[n];if(!(o in e)||r[o]!==e[o]&&!(Number.isNaN(r[o])&&Number.isNaN(e[o])))return!1}return!0}function _e(r,e){if(!r||!e)return!1;if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t+=1)if(!ze(r[t],e[t]))return!1;return!0}function Be(r){const e=a.useRef([]),t=a.useRef(0);return _e(e.current,r)||(e.current=r,t.current+=1),[t.current]}function Te(r,e){a.useEffect(r,Be(e))}function Oe(r,e,t={autoInvoke:!1}){const i=a.useRef(null),n=a.useCallback((...f)=>{i.current||(i.current=window.setTimeout(()=>{r(f),i.current=null},e))},[e]),o=a.useCallback(()=>{i.current&&(window.clearTimeout(i.current),i.current=null)},[]);return a.useEffect(()=>(t.autoInvoke&&n(),o),[o,n]),{start:n,clear:o}}function Ie(r,e,t){const i=a.useRef(null),n=a.useRef(null);return a.useEffect(()=>{const o=typeof t=="function"?t():t;return(o||n.current)&&(i.current=new MutationObserver(r),i.current.observe(o||n.current,e)),()=>{var f;(f=i.current)==null||f.disconnect()}},[r,e]),n}function Ae(){const[r,e]=a.useState(!1);return a.useEffect(()=>e(!0),[]),r}function Fe(r,e){if(!e||!r)return!1;let t=e.parentNode;for(;t!=null;){if(t===r)return!0;t=t.parentNode}return!1}function Me({target:r,parent:e,ref:t,displayAfterTransitionEnd:i}){const n=a.useRef(-1),[o,f]=a.useState(!1),[b,h]=a.useState(typeof i=="boolean"?i:!1),u=()=>{if(!r||!e||!t.current)return;const s=r.getBoundingClientRect(),d=e.getBoundingClientRect(),g=window.getComputedStyle(r),y=window.getComputedStyle(e),R=P(g.borderTopWidth)+P(y.borderTopWidth),w=P(g.borderLeftWidth)+P(y.borderLeftWidth),x={top:s.top-d.top-R,left:s.left-d.left-w,width:s.width,height:s.height};t.current.style.transform=`translateY(${x.top}px) translateX(${x.left}px)`,t.current.style.width=`${x.width}px`,t.current.style.height=`${x.height}px`},m=()=>{window.clearTimeout(n.current),t.current&&(t.current.style.transitionDuration="0ms"),u(),n.current=window.setTimeout(()=>{t.current&&(t.current.style.transitionDuration="")},30)},p=a.useRef(null),v=a.useRef(null);return a.useEffect(()=>{if(u(),r)return p.current=new ResizeObserver(m),p.current.observe(r),e&&(v.current=new ResizeObserver(m),v.current.observe(e)),()=>{var s,d;(s=p.current)==null||s.disconnect(),(d=v.current)==null||d.disconnect()}},[e,r]),a.useEffect(()=>{if(e){const s=d=>{Fe(d.target,e)&&(m(),h(!1))};return e.addEventListener("transitionend",s),()=>{e.removeEventListener("transitionend",s)}}},[e]),Oe(()=>{Re()!=="test"&&f(!0)},20,{autoInvoke:!0}),Ie(s=>{s.forEach(d=>{d.type==="attributes"&&d.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:b}}var K={root:"m_96b553a6"};const Ge={},We=T((r,{transitionDuration:e})=>({root:{"--transition-duration":typeof e=="number"?`${e}ms`:e}})),O=z((r,e)=>{const t=_("FloatingIndicator",Ge,r),{classNames:i,className:n,style:o,styles:f,unstyled:b,vars:h,target:u,parent:m,transitionDuration:p,mod:v,displayAfterTransitionEnd:s,...d}=t,g=B({name:"FloatingIndicator",classes:K,props:t,className:n,style:o,classNames:i,styles:f,unstyled:b,vars:h,varsResolver:We}),y=a.useRef(null),{initialized:R,hidden:w}=Me({target:u,parent:m,ref:y,displayAfterTransitionEnd:s}),x=H(e,y);return!u||!m?null:c.jsx(j,{ref:x,mod:[{initialized:R,hidden:w},v],...g("root"),...d})});O.displayName="@mantine/core/FloatingIndicator";O.classes=K;var X={root:"m_7485cace"};const Le={},De=T((r,{size:e,fluid:t})=>({root:{"--container-size":t?void 0:Y(e,"container-size")}})),I=z((r,e)=>{const t=_("Container",Le,r),{classNames:i,className:n,style:o,styles:f,unstyled:b,vars:h,fluid:u,mod:m,...p}=t,v=B({name:"Container",classes:X,props:t,className:n,style:o,classNames:i,styles:f,unstyled:b,vars:h,varsResolver:De});return c.jsx(j,{ref:e,mod:[{fluid:u},m],...v("root"),...p})});I.classes=X;I.displayName="@mantine/core/Container";var J={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const qe={withItemsBorders:!0},Ue=T((r,{radius:e,color:t,transitionDuration:i,size:n,transitionTimingFunction:o})=>({root:{"--sc-radius":e===void 0?void 0:pe(e),"--sc-color":t?ge(t,r):void 0,"--sc-shadow":t?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":i===void 0?void 0:`${i}ms`,"--sc-transition-timing-function":o,"--sc-padding":Y(n,"sc-padding"),"--sc-font-size":ve(n)}})),A=z((r,e)=>{var W,L;const t=_("SegmentedControl",qe,r),{classNames:i,className:n,style:o,styles:f,unstyled:b,vars:h,data:u,value:m,defaultValue:p,onChange:v,size:s,name:d,disabled:g,readOnly:y,fullWidth:R,orientation:w,radius:x,color:F,transitionDuration:Ye,transitionTimingFunction:Ke,variant:Q,autoContrast:Z,withItemsBorders:V,mod:ee,...te}=t,C=B({name:"SegmentedControl",props:t,classes:J,className:n,style:o,classNames:i,styles:f,unstyled:b,vars:h,varsResolver:Ue}),M=fe(),G=u.map(l=>typeof l=="string"?{label:l,value:l}:l),re=Ae(),[ne,se]=a.useState(D()),[oe,ie]=a.useState(null),[N,ae]=a.useState({}),le=(l,k)=>{N[k]=l,ae(N)},[S,ce]=Se({value:m,defaultValue:p,finalValue:Array.isArray(u)?((W=G.find(l=>!l.disabled))==null?void 0:W.value)??((L=u[0])==null?void 0:L.value)??null:null,onChange:v}),$=me(d),ue=G.map(l=>a.createElement(j,{...C("control"),mod:{active:S===l.value,orientation:w},key:l.value},a.createElement("input",{...C("input"),disabled:g||l.disabled,type:"radio",name:$,value:l.value,id:`${$}-${l.value}`,checked:S===l.value,onChange:()=>!y&&ce(l.value),"data-focus-ring":M.focusRing,key:`${l.value}-input`}),a.createElement(j,{component:"label",...C("label"),mod:{active:S===l.value&&!(g||l.disabled),disabled:g||l.disabled,"read-only":y},htmlFor:`${$}-${l.value}`,ref:k=>le(k,l.value),__vars:{"--sc-label-color":F!==void 0?he({color:F,theme:M,autoContrast:Z}):void 0},key:`${l.value}-label`}
1,c.jsx("span",{...C("innerLabel"),children:l.label})))),de=H(e,l=>ie(l));return Te(()=>{se(D())},[u.length]),u.length===0?null:c.jsxs(j,{...C("root"),variant:Q,size:s,ref:de,mod:[{"full-width":R,orientation:w,initialized:re,"with-items-borders":V},ee],...te,role:"radiogroup","data-disabled":g,children:[typeof S=="string"&&c.jsx(O,{target:N[S],parent:oe,component:"span",transitionDuration:"var(--sc-transition-duration)",...C("indicator")},ne),ue]})});A.classes=J;A.displayName="@mantine/core/SegmentedControl";function He({plans:r,selectPlan:e}){const[t,i]=a.useState("month");return console.log({plans:r}),c.jsxs(I,{my:"xl",children:[c.jsx(be,{mb:"lg",children:c.jsx(A,{value:t,onChange:n=>i(n),data:[{label:"Monthly Billing",value:"month"},{label:"Annual Billing",value:"year"}]})}),c.jsx(E,{size:"lg",mb:"md",component:"div",children:"Subscribe to billing plan to create servers."}),c.jsx(q,{children:r.map(n=>{const o=t==="month"?n.prices.month:t==="year"?n.prices.year:n.prices.defaultPrice,f=(o==null?void 0:o.price)||n.prices.defaultPrice.price;return c.jsx(q.Col,{span:{base:12,md:6,lg:4,xl:4},children:c.jsx(je,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,style:{borderColor:n.highlighted?"#228be6":void 0},children:c.jsxs(U,{align:"start",children:[c.jsx(Pe,{order:3,ta:"center",w:"100%",children:n.title}),c.jsxs(E,{size:"xl",ta:"center",w:"100%",children:["$",(Number(f)/100).toFixed(2),"/",n.intervalCount>1?`${n.intervalCount}`:""," ",o?t:n.prices.defaultPrice.billingPeriod,n.prices.month&&n.prices.year&&t==="year"?c.jsx(Ee,{color:"red",size:"xs",mx:"sm",children:" 16.7% off "}):""]}),c.jsx(ye,{fullWidth:!0,variant:(n.highlighted,"filled"),onClick:()=>e(o?o.id:n.prices.defaultPrice.id,o?t:"one-time"),children:c.jsx(E,{color:"dark",children:"Start 5-day free trial"})}),c.jsx(Ne,{color:"#ddd",size:"xs",w:"100%"}),c.jsx(U,{children:n.features.map((b,h)=>c.jsxs($e,{align:"flex-start",justify:"flex-start",children:[c.jsx(ke,{size:20,height:20,width:20,color:"green",style:{paddingRight:"0.3rem"}}),c.jsx(E,{color:"#777",size:"sm",children:b})]},h))})]})})},n.id)})})]})}function ft({plans:r,auth:e}){const[t,i]=a.useState([]),n=xe();console.log(r);const o={25:["Up to 187 email inboxes ($0.133/inbox)","85-99% Email Deliverability (no spam folder!!) using an Outbound Relay (like Amazon SES, Brevo, etc)","5 GB storage per inbox","Or up to 50 GB storage (costs 4.5 normal users).","Setup as many domains as you want","Managed Email Hosting","Antivirus check","Advanced anti-spam","Cloud-based infrastructure","Good support who can go on screenshare with you"],100:["Up to 750 email inboxes ($0.133/inbox)","85-99% Email Deliverability (no spam folder!!) using an Outbound Relay (like Amazon SES, Brevo, etc)","5 GB storage per inbox","Or up to 50 GB storage (costs 4.5 normal users).","Setup as many domains as you want","Managed Email Hosting","Antivirus check","Advanced anti-spam","Cloud-based infrastructure","Good support who can go on screenshare with you"]},f={25:"187 users with 85-99% email deliverability",100:"750 users with 85-99% email deliverability"};a.useEffect(()=>{var m,p,v;const h={};for(const s of r){const d=(m=s.metadata)!=null&&m.plan?s.metadata.plan:s.product.id,g=h[d]=h[d]||{id:s.id,intervalCount:s.interval_count,title:f[d]||s.product.name,features:o[d]??[],prices:{defaultPrice:{id:"",price:""}},highlighted:s.metadata.highlighted};((p=s.recurring)==null?void 0:p.interval)==="month"?g.prices.month={id:s.id,price:s.unit_amount,billingPeriod:"month"}:((v=s.recurring)==null?void 0:v.interval)==="year"?g.prices.year={id:s.id,price:s.unit_amount,billingPeriod:"year"}:g.prices.defaultPrice={id:s.id,price:s.unit_amount,billingPeriod:"one-time"}}const u=Object.values(h);for(const s of u)s.prices.month&&!s.prices.year?s.prices.defaultPrice={...s.prices.month}:s.prices.year&&!s.prices.month&&(s.prices.defaultPrice={...s.prices.year});i(u)},[]);function b(h,u){const m=u!=="one-time"?{recurring:1}:{},p=new URLSearchParams({qty:"1",route:n.props.route_name,route_args:[].join(","),...m});window.location.href=`/checkout/${u}?${p}&price_id=${h}`}return c.jsxs(Ce,{user:e.user,children:[c.jsx(we,{title:"Plans"}),c.jsx(He,{plans:t,selectPlan:b})]})}
1export{ft as default};

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.