1import{r as f,j as t}from"./react-CRjXmzdu.js";import{Q as R,Y as z,f as A,a8 as S,aa as L}from"./index-CSKv4Qvu.js";import{bG as F,ap as k,bH as V,bI as q,B as g,I as E,bJ as H,bK as O,aH as W,T as D,K as P,aq as G,P as J,bL as Q}from"./mui-BxdtjvkT.js";import{g as Y,r as K,s as M}from"./localStorage-Cdrt_xyx.js";import{L as X}from"./listPublicPlans-_XKpv3ki.js";import{u as Z,a as ee}from"./router-BwRsLQU1.js";import"./iconify-DtB_gzCW.js";import"./react-query-BRXozuDR.js";import"./redux-Dts5QXDw.js";import"./vendor-COBpgtl7.js";import"./lodash-CpjO0APP.js";import"./ui-utils-DqNXFlDe.js";import"./http-DoGoLSvF.js";import"./date-utils-Cj6NCtA4.js";import"./sanitize-B6Pz2xYC.js";import"./validation-B8dh9o27.js";import"./i18n-BIJR05_R.js";import"./emotion-CfcNTy1E.js";import"./firebase-Deeb8HW7.js";import"./carousel-ONjmYhJW.js";const U=["Home"];function te(){const{isAuthenticated:n}=R(),[a,i]=f.useState(null),[,x]=f.useState(null),[,y]=f.useState(""),c=r=>{i(r.currentTarget)},u=()=>{i(null)},h=r=>{x(null),r==="Products"&&(window.location.href="/plans"),r==="Pricing"&&(window.location.href="/plans"),r==="Home"&&(window.location.href="/")};return f.useEffect(()=>{const r=z();if(r){const{profileUrl:s}=r;y(s)}},[]),t.jsx(F,{position:"static",sx:{backgroundColor:"card.main",borderBottom:"1px solid",borderColor:"grey.300"},children:t.jsx(k,{maxWidth:"xl",children:t.jsxs(V,{disableGutters:!0,sx:{height:"40px"},children:[t.jsx(q,{onClick:()=>h("Home"),sx:{display:{xs:"none",md:"flex"},mr:"20px"},children:t.jsx(A,{height:"28px"})}),t.jsxs(g,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[t.jsx(E,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:c,color:"inherit",children:t.jsx(H,{})}),t.jsx(O,{id:"menu-appbar",anchorEl:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"left"},open:!!a,onClose:u,sx:{display:{xs:"block",md:"none"},paddingLeft:"20px"},children:U.map(r=>t.jsx(W,{onClick:u,children:t.jsx(D,{textAlign:"center",children:r})},r))})]}),t.jsx(q,{onClick:()=>h("Home"),sx:{display:{xs:"flex",md:"none"},transform:"translateX(-50%)",ml:"10px"},children:t.jsx(A,{height:"28px"})}),t.jsx(g,{sx:{flexGrow:1,display:{xs:"none",md:"flex",justifyContent:"end"}},children:U.map(r=>t.jsx(P,{onClick:()=>h(r),sx:{my:2,color:"grey.800",display:"block",border:"1px solid #dcdfe4"},children:r},r))}),n?null:t.jsxs(g,{sx:{display:"flex",flexDirection:"row",gap:2},children:[t.jsx(P,{variant:"contained",sx:{backgroundColor:"#fff",color:"primary.main",textTransform:"none",fontWeight:500,"&:hover":{backgroundColor:"#f5f5f5"}},onClick:()=>window.location.href="/domainregister",children:"Register"}),t.jsx(P,{variant:"contained",sx:{backgroundColor:"#fff",color:"primary.main",textTransform:"none",fontWeight:500,"&:hover":{backgroundColor:"#f5f5f5"}},onClick:()=>window.location.href="/login",children:"Login"})]})]})})})}const oe=(n={})=>{const a=!!n?.isTrialPlan,i=Number(n?.monthlyDiscount??n?.monthly_discount??0),x=Number(n?.quarterlyDiscount??0),y=Number(n?.yearlyDiscount??n?.yearly_discount??0),c=n?.variations?.find(d=>(d.variantId||d.planId||d.plan_id)===n?.selectedVariantId)||n?.variations?.[0]||{},u=Number(c?.pricing?.monthly??n?.monthlyPrice??n?.price??0),h=c?.pricing?.quarterly!==void 0&&c?.pricing?.quarterly!==null?Number(c.pricing.quarterly):u*3,r=c?.pricing?.yearly!==void 0&&c?.pricing?.yearly!==null?Number(c.pricing.yearly):u*12,s=Number((h*(1-x/100)).toFixed(2)),o=Number((r*(1-y/100)).toFixed(2)),l=a?0:Number((u*(1-i/100)).toFixed(2)),e=a?0:Number(s.toFixed(2)),p=a?0:Number(o.toFixed(2));return{monthlyPrice:l,quarterlyPrice:e,yearlyPrice:p,monthlyDiscountPercent:i,quarterlyDiscountPercent:x,yearlyDiscountPercent:y}},ne=(n,a,i)=>n==="annual"||n==="yearly"?{unitPrice:a.yearlyPrice,discount:i.yearlyDiscountPercent}:n==="quarterly"?{unitPrice:a.quarterlyPrice,discount:i.quarterlyDiscountPercent}:{unitPrice:a.monthlyPrice,discount:i.monthlyDiscountPercent},Se=()=>{const n=Z(),a=ee(),[i,x]=f.useState([]),[y]=f.useState(()=>{try{const o=new URLSearchParams(window.location.search).get("planSelection");if(o){const l=JSON.parse(decodeURIComponent(escape(atob(decodeURIComponent(o)))));if(l)return l}}catch{}const s=Y("plansPageSelection");return K("plansPageSelection"),s?.selectedPlan||null}),c=s=>{x(s)},u=s=>{const o=Array.isArray(s)?s:i;
1if(!o||o.length===0)return;const l=o.map(e=>{const p=e.isTrialPlan,d=oe(e),{monthlyPrice:m,quarterlyPrice:b,yearlyPrice:N,monthlyDiscountPercent:C,quarterlyDiscountPercent:w,yearlyDiscountPercent:I}=d,j=e.isAddon?Number(e.users??e.storage??0):e.users||1,T=e?.subsType||"monthly",{unitPrice:$,discount:B}=ne(T,{monthlyPrice:m,quarterlyPrice:b,yearlyPrice:N},{monthlyDiscountPercent:C,quarterlyDiscountPercent:w,yearlyDiscountPercent:I}),_=(Array.isArray(e.variations)&&e.selectedVariantId?e.variations.find(v=>(v.variantId||v.planId||v.plan_id)===e.selectedVariantId):null)||(Array.isArray(e.variations)?e.variations[0]:null);return{name:e.planName||e.plan_name,productName:e.productName,slabId:e.slabId,credit:e.credit,productId:e.productId,planId:e.parentPlanId||e.planId||e.plan_id,selectedVariantId:e.selectedVariantId||e.planId||e.plan_id,users:j,storage:e?.storageGb??e?.storage,archiveStorage:e?.archive_storage?.size||e?.archive_storage||e?.storage,priceMonthly:m,priceQuarterly:b,priceAnnually:N,subsType:T,actualPrice:e.isAddon?m*j:$*j,minUser:_?.minLicenses??e.minLicenses??e.minUsers??1,maxUser:_?.maxLicenses??e.maxLicenses??e.maxUsers??0,apiCalls:e.api_calls,attachmentLimit:e.attachments_limit?.size||e.attachment_limit?.size||e.attachment_limit,discount:B,monthlyDiscount:C,quarterlyDiscount:w,yearlyDiscount:I,monthly_discount:C,yearly_discount:I,selectedSlab:e?.selectedSlab,edit:!0,isTrialPlan:p,isAddon:e.isAddon,contacts:e.contacts,teamSize:e.teamSize,team_size:e.team_size}});if(M("planDetails",l),M("plansPageSelection",{selectedPlan:o[0]}),S()){const e=encodeURIComponent(btoa(unescape(encodeURIComponent(JSON.stringify(l))))),d=`/plans?planSelection=${encodeURIComponent(btoa(unescape(encodeURIComponent(JSON.stringify(o[0])))))}`,m=L()??"0";window.open(`/u/${m}/checkout?page=product&source=iframe&planData=${e}&from=${encodeURIComponent(d)}`,"_blank","noopener,noreferrer");return}n("/checkout?page=product",{state:{from:`${a.pathname}${a.search}`}})},h=()=>{if(S()){const s=L()??"0";window.open(`/u/${s}/contact-us?from=${encodeURIComponent("/plans")}`,"_blank","noopener,noreferrer");return}n("/contact-us",{state:{from:`${a.pathname}${a.search}`}})},r=()=>i.reduce((s,o)=>{const e={annual:12,yearly:12,quarterly:3,monthly:1}[o.subsType]??1,d={annual:o?.yearlyDiscount??o?.yearly_discount??0,yearly:o?.yearlyDiscount??o?.yearly_discount??0,quarterly:o?.quarterlyDiscount??0,monthly:o?.monthlyDiscount??o?.monthly_discount??0}[o.subsType]??0,m=o.price*(1-d/100)*e,b=o.users||1;return s+m*b},0);return t.jsxs(g,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",bgcolor:"grey.100"},children:[!S()&&t.jsx(te,{}),t.jsx(k,{maxWidth:"xl",sx:{mt:4,mb:{xs:22,sm:12},flexGrow:1},children:t.jsx(X,{onPlansChange:c,handleBuyNowClick:u,onContactSalesClick:h,initialSelectedPlan:y,initialBillingCycle:y?.subsType||"monthly",showTrialOption:!1})}),t.jsx(G,{in:i.length>0,children:t.jsx(J,{elevation:4,sx:{position:"fixed",bottom:0,left:0,right:0,zIndex:1100,bgcolor:"background.paper",borderTop:"1px solid",borderColor:"grey.200",p:2,py:0},children:t.jsx(k,{maxWidth:"xl",children:t.jsxs(g,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2,paddingY:2},children:[t.jsxs(g,{children:[t.jsxs(D,{variant:"subtitle1",fontWeight:600,color:"text.primary",children:[i.length," Plan",i.length!==1?"s":""," Selected"]}),t.jsx(D,{variant:"body2",color:"text.secondary",children:(()=>{const s=r(),o=Number(s.toFixed(2)),l=Number.isInteger(o)?o:o.toFixed(2),e=i[0];if(e?.isAddon){const m=e?.limits?.unit||e?.unit||"unit";return`Total: â¹${l}/${m}`}const d={annual:"year",yearly:"year",quarterly:"quarter",monthly:"month"}[e?.subsType]||"month";return`Total: â¹${l} / ${d} (approx)`})()})]}),t.jsx(P,{variant:"contained",color:"primary",size:"large",startIcon:t.jsx(Q,{}),onClick:u,sx:{px:4,textTransform:"none"},children:"Proceed to Checkout"})]})})})})]})};export{Se 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.