1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6d1572eb-f740-4232-8c70-62fb31f860ce",e._sentryDebugIdIdentifier="sentry-dbid-6d1572eb-f740-4232-8c70-62fb31f860ce")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2440],{51757:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/[plan]",function(){return n(18564)}])},18564:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return V}});var a=n(52322),s=n(33330),i=n(47023),r=n(65232),l=n(1973),o=n(77590),c=n(43493),d=n(38785),u=n(90269),m=n(59829),p=n(24389),x=n(41798),b=n(42369),g=n(2369),v=n(92942),y=n(13980),h=n.n(y),f=n(31515),j=n(76467);let w=e=>{if(!e)return"";let t=(0,f.w0)(e);return t?t.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"Invalid date"},N=e=>{let{subscription:t,invoice:n,onViewInvoice:s,onDownloadInvoice:l,isDownloading:o=!1}=e;return(0,a.jsx)(r.ZP,{children:(0,a.jsx)(r.eW,{children:(0,a.jsxs)("div",{className:"text-center py-4",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-yellow-100 ring-4 ring-yellow-50 mb-4",children:(0,a.jsx)(v.FontAwesomeIcon,{className:"text-yellow-600 text-3xl",icon:g.SZw})}),(0,a.jsx)(j.Z,{className:"mb-2",color:"text-gray-900",size:"text-xl",variant:"heading3",weight:"font-semibold",children:"Payment Pending"}),(0,a.jsxs)(j.Z,{className:"mb-6 max-w-md mx-auto",color:"text-gray-600",variant:"body",children:["Your"," ",(0,a.jsx)(j.Z,{as:"span",variant:"body",weight:"font-medium",children:null==t?void 0:t.name})," ","subscription has been initiated. Please complete payment to activate your subscription. If you have any questions, please contact support."]}),!!n&&(0,a.jsxs)("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md p-4 mb-6 max-w-sm mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-3",children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"text-gray-400",icon:g.fab}),(0,a.jsxs)(j.Z,{color:"text-gray-900",variant:"body",weight:"font-medium",children:["Invoice #",n.invoice_number]})]}),(0,a.jsx)(j.Z,{className:"mb-1",color:"text-gray-900",size:"text-2xl",variant:"stat",weight:"font-bold",children:n.formatted_total}),(0,a.jsxs)(j.Z,{color:"text-gray-500",size:"text-sm",variant:"body",children:["Due:"," ",(0,a.jsx)("time",{dateTime:(0,f.w0)(n.due_date)?n.due_date:void 0,children:w(n.due_date)})]})]}),(0,a.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-4 mb-6 max-w-md mx-auto text-left",children:[(0,a.jsx)(j.Z,{className:"mb-2",color:"text-blue-900",variant:"body",weight:"font-medium",children:"Payment Instructions"}),(0,a.jsxs)("ol",{className:"text-sm text-blue-800 space-y-2 list-decimal list-inside",children:[(0,a.jsx)("li",{children:"Download or view your invoice below"}),(0,a.jsx)("li",{children:"Make payment via M-Pesa or bank transfer"}),(0,a.jsx)("li",{children:"Include your invoice number as reference"}),(0,a.jsx)("li",{children:"We will activate your subscription within 24 hours of payment confirmation"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[!!(n&&s)&&(0,a.jsxs)(i.Z,{design:"primary",onClick:()=>s(n.iid),children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"mr-2",icon:g.fab}),"View Invoice"]}),!!(n&&l)&&(0,a.jsxs)(i.Z,{design:"secondary",disabled:o,onClick:()=>l(n.iid),children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"mr-2",icon:g.q7m}),o?"Downloading...":"Download Invoice"]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 mt-6 pt-6 border-t border-gray-200",children:[(0,a.jsxs)(j.Z,{color:"text-gray-500",size:"text-sm",variant:"body",children:["Need help with payment?"," "]}),(0,a.jsxs)(j.Z,{as:"a",className:"hover:text-blue-700",color:"text-blue-600",href:"/contact",variant:"body",weight:"font-medium",children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"mr-1",icon:g.FU$,size:"sm"}),"Contact Support"]})]})]})})})};N.propTypes={subscription:h().shape({sid:h().string,name:h().string,
1status:h().string}),invoice:h().shape({iid:h().string,invoice_number:h().string,formatted_total:h().string,due_date:h().string}),onViewInvoice:h().func,onDownloadInvoice:h().func,isDownloading:h().bool};var _=n(2784),C=n(32128),Z=n(17602),S=n(12524),k=n.n(S),P=n(48194);let A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"user";return"tenant"===e?{active_job_posts:"Active Job Posts",ai_analysis_credits:"AI Analysis Credits",screening_questions:"Screening Questions",applicant_tracking:"Applicant Tracking",featured_job_posts:"Featured Job Posts",applications_screening:"Applications Screening",chat_messaging:"Chat & Messaging",private_notes:"Private Notes",interview_scheduling:"Interview Scheduling",candidate_offer_letters:"Candidate Offer Letters",candidate_recommendations:"Candidate Recommendations",employee_directory:"Employee Directory",data_management:"Data Management",document_storage:"Document Storage",leave_requests:"Leave Requests",accrual_policies:"Accrual Policies",leave_calendar:"Leave Calendar"}:{cv_downloads:"CV Downloads",ai_content_credits:"AI Content Credits",spark_templates:"Spark Templates",multi_column_layouts:"Multi-Column Layouts",surge_templates:"Surge Templates",volt_templates:"Volt Templates",modern_designs:"Premium Designs",priority_support:"Priority Support"}},z=e=>{let{features:t={},customFeatures:n=[],modules:s=[],variant:i="default",className:r,type:l="user"}=e,o=A(l),c=Object.entries(t).filter(e=>{let[t]=e;return o[t]}).map(e=>{let[t,n]=e;return{label:o[t],value:function(e,t){return(arguments.length>2&&void 0!==arguments[2]&&arguments[2],-1===t)?(0,a.jsxs)(j.Z,{as:"span",className:"inline-flex items-center gap-1 text-green-600 font-medium",children:[(0,a.jsx)(v.FontAwesomeIcon,{icon:g.vqe,size:"sm"}),"Unlimited"]}):"boolean"==typeof t?t:"number"==typeof t?t.toLocaleString():t}(t,n,l),enabled:!!n}}),d=[];if("tenant"===l&&Array.isArray(s)&&s.length>0){let e=s.map(e=>{var t;return(null===(t=P.Ht[e])||void 0===t?void 0:t.shortLabel)||e});d.push({label:"Included Modules",value:e.join(", "),enabled:!0})}let u=[...c,...d,...n.map(e=>({label:e,value:null,enabled:!1}))];return 0===u.length?null:(0,a.jsx)("ul",{className:k()("space-y-2",{"text-sm":"compact"===i},r),children:u.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[!!e.enabled&&(0,a.jsx)(v.FontAwesomeIcon,{className:"text-green-500 mt-0.5",icon:g.LEp,size:"compact"===i?"xs":"sm"}),!e.enabled&&(0,a.jsx)(v.FontAwesomeIcon,{className:"text-gray-300 mt-0.5",icon:g.NBC,size:"compact"===i?"xs":"sm"}),(0,a.jsxs)(j.Z,{as:"span",className:"text-gray-700",children:[!!e.value&&(0,a.jsx)(j.Z,{as:"span",className:"font-medium mr-1",children:e.value}),e.label]})]},"".concat(e.label,"-").concat(t)))})};z.propTypes={features:h().object,customFeatures:h().arrayOf(h().string),modules:h().arrayOf(h().string),variant:h().oneOf(["default","compact"]),className:h().string,type:h().oneOf(["user","tenant"])};var I=n(43235),T=n(83700),F=n(52184);let U=e=>{let{label:t,value:n,highlight:s=!1}=e;return(0,a.jsxs)("div",{className:"flex justify-between py-1.5 border-b border-gray-100 last:border-0",children:[(0,a.jsx)(j.Z,{as:"span",color:"text-gray-600",size:"text-sm",variant:"body",children:t}),(0,a.jsx)(j.Z,{as:"span",color:s?"text-blue-600":"text-gray-900",size:"text-sm",variant:"body",weight:"font-medium",children:n})]})};U.propTypes={highlight:h().bool,label:h().string.isRequired,value:h().oneOfType([h().string,h().number]).isRequired};let L=e=>{let{userCount:t,billedUsers:n,minUsers:s,pricePerUser:i,formattedPricePerUser:r,priceBreakdown:l,currency:o="KES",className:c,compact:d=!1}=e,u=r||(0,F.T4)(parseFloat(i),o),m=n>t,p=(null==l?void 0:l.formatted)||(n&&i?"".concat(n," users \xd7 ").concat(u):null);return d?(0,a.jsxs)("div",{className:k()("text-sm text-gray-600",c),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"text-blue-500",icon:g.FVb}),(0,a.jsxs)(j.Z,{as:"span",color:"text-gray-600",size:"text-sm",variant:"body",children:[t," user",1!==t?"s":"",!!m&&(0,a.jsxs)(j.Z,{as:"span",color:"text-gray-400",size:"text-sm",variant:"body",children:[" ","(billed for ",n,")"]})]})]}),!!p&&(0,a.jsx)(j.Z,{className:"mt-1 pl-6",color:"text-gray-500",size:"text-sm",variant:"body",children:p})]}):(0,a.jsxs)("div",{className:k()("bg-gray-50 rounded-md p-4",c),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"text-blue-600",icon:g.lTt}),(0,a.jsx)(j.Z,{as:"h4",variant:"label",children:"Per-User Billing"})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(U,{label:"Current Users",value:t}),(0,a.jsx)(U,{highlight:m,label:"Billed Users",value:n}),s>1&&(0,a.jsx)(U,{label:"Minimum Users",value:s}),(0,a.jsx)(U,{label:"Price per User",value:u})]}),!!p&&(0,a.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:(0,a.jsx)(j.Z,{color:"text-blue-600",size:"text-sm",variant:"body",weight:"font-medium",children:p})}),!!m&&(0,a.jsxs)(j.Z,{className:"mt-2",color:"text-gray-500",size:"text-xs",variant:"body",children:["You have ",t," users but are billed for the minimum of ",s," users."]})]})};L.propTypes={billedUsers:h().number.isRequired,className:h().string,compact:h().bool,currency:h().string,formattedPricePerUser:h().string,minUsers:h().number,priceBreakdown:h().shape({formatted:h().string}),pricePerUser:h().oneOfType([h().string,h().number]).isRequired,userCount:h().number.isRequired};let q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=Math.round(e/(1+t/100));return{subtotal:n,vat:e-n,total:e}},D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"KES";return null==e?(0,F.T4)(e,t):"".concat(t," ").concat(e.toLocaleStr
1ing())},O=e=>{var t,n,s,i,r,l;let o,c,d,u,{plan:m,billingCycle:p="monthly",userCount:x,vatRate:b=16,currency:g="KES"}=e,v=(0,T.NA)(null==m?void 0:m.pricing_model);if(v){d=(null==m?void 0:null===(r=m.pricing)||void 0===r?void 0:null===(i=r.per_user)||void 0===i?void 0:null===(s=i[p])||void 0===s?void 0:s.amount)||0;let e=(null==m?void 0:m.min_users)||5;c=(0,T.UQ)(x||0,e),o=(0,T.MG)(x||0,d,e).total,u={actual_users:x||0,billed_users:c,min_users:e,price_per_user:d,subtotal:o,formatted:"".concat(c," users \xd7 ").concat(D(d,g)," = ").concat(D(o,g))}}else{let e=null==m?void 0:null===(l=m.pricing)||void 0===l?void 0:l[p];o=(null==e?void 0:e.amount)||0}let{subtotal:y,vat:h}=q(o,b);return(0,a.jsx)("div",{className:"border border-gray-200 shadow-sm rounded-md overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsx)(j.Z,{className:"mb-4",variant:"sectionHeader",children:"Order Summary"}),!!(v&&void 0!==x)&&(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(L,{billedUsers:c,className:"!bg-white border border-gray-200",currency:g,minUsers:(null==m?void 0:m.min_users)||5,priceBreakdown:u,pricePerUser:d,userCount:x})}),(0,a.jsx)("div",{className:"space-y-3 mb-4",children:(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:[null==m?void 0:m.name," -"," ","monthly"===p?"Monthly":"Yearly"," Subscription",!!(v&&c)&&(0,a.jsxs)(j.Z,{as:"span",className:"block",color:"text-gray-400",size:"text-xs",variant:"body",children:["(",c," users)"]})]}),(0,a.jsx)(j.Z,{color:"text-gray-900",size:"text-sm",variant:"body",weight:"font-medium",children:D(y,g)})]})}),(0,a.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,a.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,a.jsx)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:"Subtotal (excl. VAT)"}),(0,a.jsx)(j.Z,{color:"text-gray-900",size:"text-sm",variant:"body",children:D(y,g)})]}),(0,a.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,a.jsxs)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:["VAT (",b,"%)"]}),(0,a.jsx)(j.Z,{color:"text-gray-900",size:"text-sm",variant:"body",children:D(h,g)})]}),(0,a.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,a.jsxs)("div",{className:"bg-blue-50 rounded-md p-3 flex justify-between items-center",children:[(0,a.jsx)(j.Z,{color:"text-gray-900",size:"text-lg",variant:"body",weight:"font-semibold",children:"Total"}),(0,a.jsx)(j.Z,{color:"text-gray-900",size:"text-lg",variant:"body",weight:"font-bold",children:D(o,g)})]}),(0,a.jsxs)(j.Z,{className:"mt-4",color:"text-gray-500",size:"text-xs",variant:"body",children:["Billed ","monthly"===p?"monthly":"annually",".",!!("yearly"===p&&(null==m?void 0:null===(n=m.pricing)||void 0===n?void 0:null===(t=n[p])||void 0===t?void 0:t.savings))&&(0,a.jsxs)(j.Z,{as:"span",className:"ml-1",color:"text-green-600",size:"text-xs",variant:"body",children:["You save ",m.pricing[p].savings,"% with yearly billing!"]})]}),!!v&&(0,a.jsx)(j.Z,{className:"mt-2",color:"text-gray-500",size:"text-xs",variant:"body",children:"Per-user pricing adjusts automatically as your team size changes."}),(0,a.jsx)(j.Z,{className:"mt-2",color:"text-gray-500",size:"text-xs",variant:"body",children:"Your subscription will be activated after payment confirmation."})]})})};O.propTypes={plan:h().shape({key:h().string,name:h().string,pricing_model:h().oneOf(["flat","per_user","custom"]),min_users:h().number,pricing:h().shape({monthly:h().shape({amount:h().number,formatted:h().string}),yearly:h().shape({amount:h().number,formatted:h().string,savings:h().number}),per_user:h().shape({monthly:h().shape({amount:h().number,formatted:h().string}),yearly:h().shape({amount:h().number,formatted:h().string})})})}),billingCycle:h().oneOf(["monthly","yearly"]),userCount:h().number,vatRate:h().number,currency:h().string};let B=e=>{var t,n,s,r,l;let{plan:o,defaultBillingCycle:c="yearly",defaultAutoRenew:d=!0,onSubscribe:u,isLoading:m=!1,disabled:p=!1,type:x="user",userCount:b,onUserCountChange:y}=e,[h,f]=(0,_.useState)(c),[w,N]=(0,_.useState)(d),[S,k]=(0,_.useState)(b),P=(0,T.NA)(null==o?void 0:o.pricing_model),A=null!=S?S:b,F=(null==o?void 0:null===(n=o.pricing)||void 0===n?void 0:null===(t=n.yearly)||void 0===t?void 0:t.savings)||0,U=(0,_.useCallback)(e=>{f(e)},[]),L=(0,_.useCallback)(e=>{N(e.target.checked)},[]),q=(0,_.useCallback)((e,t)=>{k(e),y&&y(e,t)},[y]),D=(0,_.useCallback)(()=>{u&&u({plan:o.key,billing_cycle:h,auto_renew:w})},[o,h,w,u]);return o?(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(j.Z,{className:"mb-4",color:"text-gray-900",size:"text-xl",variant:"heading3",children:["Subscription: ",o.name]}),!!o.description&&(0,a.jsx)(j.Z,{className:"mb-6",color:"text-gray-600",variant:"body",children:o.description}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(j.Z,{className:"mb-3",color:"text-gray-700",size:"text-sm",variant:"label",weight:"font-medium",children:"What is included:"}),(0,a.jsx)(z,{features:o.features,type:x})]}),!!P&&(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(j.Z,{className:"mb-3",color:"text-gray-700",size:"text-sm",variant:"label",weight:"font-medium",children:"Team Size"}),(0,a.jsx)(Z.Z,{billingCycle:h,defaultUserCount:b||(null==o?void 0:o.min_users),disabled:p||m,minUsers:null==o?void 0:o.min_users,onChange:q,pricePerUser:null==o?void 0:null===(l=o.pricing)||void 0===l?void 0:null===(r=l.per_user)||void 0===r?void 0:null===(s=r[h])||void 0===s?void 0:s.amount})]}),(0,a.jsxs)("div",{className:"mb-6 flex flex-col gap-2",children:[(0,a.jsx)(j.Z,{className:"mb-3",color:"text-gray-700",size:"text-sm",variant:"label",weight:"font-medium",children:"Billing Cycle"}),(0,a.jsx)(I.Z,{align:"start",disabled:p||m,onChange:U,value:h,yearlySavings:F})]}),(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(C.J,{align:"center",checked:w,label:"Automatically renew when your subscription expires",name:"auto-renew",onChange:L})})]}),(0,a.jsxs)("div",{className:"lg:sticky lg:top-20 lg:self-start",children:[(0,a.jsx)(O,{billingCycle:h,plan:o,userCount:A}),(0,a.jsxs)("div",{className:"mt-6 bg-blue-50 border border-blue-100 rounded-md p-4",children:[(0,a.jsx)(j.Z,{className:"mb-3 text-center",color:"text-gray-500",size:"text-sm",variant:"body",children:"No credit card required."}),(0,a.jsxs)(i.Z,{className:"w-full",design:"primary",disabled:p||m,onClick:D,size:"lg",children:[(0,a.jsx)(v.FontAwesomeIcon,{className:"mr-2",icon:g.byT}),m?"Processing...":"Complete Payment"]})]}),(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-8 h-8 bg-green-50 rounded-full",children:(0,a.jsx)(v.FontAwesomeIcon,{className:"text-green-600 text-sm",icon:g.U7t})}),(0,a.jsx)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:"Secure checkout"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-8 h-8 bg-green-50 rounded-full",children:(0,a.jsx)(v.FontAwesomeIcon,{className:"text-green-600 text-sm",icon:g.sqG})}),(0,a.jsx)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:"Switch plans anytime"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-8 h-8 bg-green-50 rounded-full",children:(0,a.jsx)(v.FontAwesomeIcon,{className:"text-green-600 text-sm",icon:g.byT})}),(0,a.jsx)(j.Z,{color:"text-gray-600",size:"text-sm",variant:"body",children:"Your data is protected"})]})]}),(0,a.jsxs)(j.Z,{className:"mt-4",color:"text-gray-400",size:"text-sm",variant:"body",children:["By subscribing, you agree to our"," ",(0,a.jsx)(j.Z,{as:"a",className:"hover:underline",color:"text-blue-600",href:"/terms",size:"text-sm",variant:"body",children:"Terms of Service"})," ","and"," ",(0,a.jsx)(j.Z,{as:"a",className:"hover:underline",color:"text-blue-600",href:"/privacy",size:"text-sm",variant:"body",children:"Privacy Policy"}),"."]})]})]}):null};B.propTypes={plan:h().shape({key:h().string.isRequired,name:h().string.isRequired,description:h().string,features:h().object,pricing_model:h().oneOf(["flat","per_user","custom"]),min_users:h().number,pricing:h().shape({monthly:h().shape({amount:h().number,currency:h().string,formatted:h().string}),yearly:h().shape({amount:h().number,currency:h().string,formatted:h().string,
1savings:h().number}),per_user:h().shape({monthly:h().shape({amount:h().number,formatted:h().string}),yearly:h().shape({amount:h().number,formatted:h().string})})})}),defaultBillingCycle:h().oneOf(["monthly","yearly"]),defaultAutoRenew:h().bool,onSubscribe:h().func,isLoading:h().bool,disabled:h().bool,type:h().oneOf(["user","tenant"]),userCount:h().number,onUserCountChange:h().func};var R=n(84475),E=n(5632),M=n(79337),V=(0,R.withAuthSync)(e=>{var t,n;let{user:g}=e,v=null==g?void 0:null===(t=g.tenant)||void 0===t?void 0:t.name,y=(0,E.useRouter)(),{plan:h,billing:f="monthly"}=y.query,[w,C]=(0,_.useState)(!1),[Z,S]=(0,_.useState)(null),[k,P]=(0,_.useState)(!0);(0,_.useEffect)(()=>{g&&((0,c.userIsAdmin)(g)?P(!1):y.push("/hr/".concat(v)))},[g,y,v]);let{data:A,isLoading:z,error:I}=(0,p.Be)(h,{enabled:!!h&&!k}),{hasPendingSubscription:T,pendingSubscription:F,pendingSubscriptionInvoice:U}=(0,d.T)(null==g?void 0:g.tenant_id,{enabled:!!(null==g?void 0:g.tenant_id)&&!k}),{data:L}=(0,u.dD)(),q=(null==L?void 0:null===(n=L.data)||void 0===n?void 0:n.length)||0,D=(0,x.oG)(null==g?void 0:g.tenant_id),O=(0,m.sc)(null==g?void 0:g.tenant_id),R=(0,_.useCallback)(async e=>{try{let t=await D.mutateAsync(e);S(t.data),C(!0)}catch(e){}},[D]),V=(0,_.useCallback)(()=>{y.push("/hr/".concat(v,"/settings/plan-billing"))},[y,v]),J=(0,_.useCallback)(async e=>{await O.mutateAsync(e)},[O]),W=(0,_.useCallback)(async e=>{y.push("/hr/".concat(v,"/settings/plan-billing?tab=invoices&invoice=").concat(e))},[y,v]);if((0,_.useEffect)(()=>{T&&!w&&C(!0)},[T,w]),k||!g)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Z,{description:"Complete your subscription payment",page:"Checkout - ".concat((null==A?void 0:A.name)||"Plan"),title:"".concat((0,o.kC)((0,o.parseUnderScore)(v))," - Checkout")}),(0,a.jsx)("div",{className:"bg-gray-50 min-h-screen",children:(0,a.jsx)("div",{className:"container mx-auto px-4 sm:px-6 md:px-8 lg:px-12",children:(0,a.jsx)(b.J,{fixed:!1})})})]});if(w){let e=(null==Z?void 0:Z.subscription)||F,t=(null==Z?void 0:Z.latest_invoice)||U;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Z,{description:"Complete your subscription payment",page:"Checkout - ".concat((null==A?void 0:A.name)||"Plan"),title:"".concat((0,o.kC)((0,o.parseUnderScore)(v))," - Payment Pending")}),(0,a.jsx)("div",{className:"container flex flex-col mx-auto px-4 sm:px-6 md:px-8 lg:px-12 gap-y-4 mt-16 mb-10",children:(0,a.jsxs)("div",{className:"w-full flex flex-col mt-4 md:mt-6 mx-auto max-w-2xl gap-y-4",children:[(0,a.jsx)("div",{className:"w-full flex justify-start",children:(0,a.jsx)(s.Z,{href:"/hr/".concat(v,"/settings/plan-billing"),text:"Back to Plan & Billing"})}),(0,a.jsx)(N,{invoice:t,isDownloading:D.isPending,onBackToBilling:V,onDownloadInvoice:J,onViewInvoice:W,subscription:e})]})})]})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Z,{description:"Subscribe to ".concat((null==A?void 0:A.name)||"a plan"," for your organization"),page:"Checkout - ".concat((null==A?void 0:A.name)||"Plan"),title:"".concat((0,o.kC)((0,o.parseUnderScore)(v))," - Checkout")}),(0,a.jsxs)("div",{className:"container flex flex-col mx-auto px-4 sm:px-6 md:px-8 lg:px-12 mt-12 md:mt-16 mb-10 gap-y-4",children:[(0,a.jsx)("div",{className:"w-full flex justify-start mt-4 md:mt-6",children:(0,a.jsx)(s.Z,{href:"/hr/".concat(v,"/settings/plan-billing"),text:"Back to Plan & Billing"})}),(0,a.jsx)(r.ZP,{children:(0,a.jsxs)(r.eW,{children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)(j.Z,{className:"mb-2",color:"text-gray-900",size:"text-2xl",variant:"heading3",children:"Complete Your Subscription"}),(0,a.jsx)(j.Z,{variant:"body",children:"Review your order and complete the subscription process."})]}),!!z&&(0,a.jsx)(b.J,{fixed:!1}),!!I&&(0,a.jsx)(l.Z,{description:"Please try again or select a different plan.",design:"wrapped",message:"Failed to load plan details"}),!!(!z&&!I&&!A)&&(0,a.jsx)(l.Z,{action:(0,a.jsx)(i.Z,{href:"/pricing",children:"View Available Plans"}),description:"The selected plan could not be found.",design:"wrapped",message:"Plan not found"}),!!(!z&&!I&&A)&&(0,a.jsx)(B,{defaultBillingCycle:f,disabled:D.isPending,isLoading:D.isPending,onSubscribe:R,plan:A,type:"tenant",userCount:q})]})})]})]})})},33330:function(e,t,n){"use strict";var a=n(52322);n(2784);var s=n(13980),i=n.n(s),r=n(5632),l=n(92942),o=n(2369),c=n(47023);let d=e=>{let{href:t,className:n,text:s="Back"}=e,i=(0,r.useRouter)();return(0,a.jsx)("div",{children:(0,a.jsxs)(c.Z,{className:"pt-2 pb-2 text-blue ".concat(n),design:t?"link":"plain",href:t,onClick:e=>{t||(e.preventDefault(),i.back())},children:[(0,a.jsx)(l.FontAwesomeIcon,{className:"mr-2",icon:o.acZ,size:"xs"}),s]})})};d.propTypes={href:i().string,text:i().string,className:i().string},t.Z=d},65232:function(e,t,n){"use strict";n.d(t,{Ol:function(){return r},eW:function(){return l}});var a=n(52322),s=n(13980),i=n.n(s);n(2784);let r=e=>{let{heading:t,padding:n={}}=e,{x:s=4,y:i=3}=n;return(0,a.jsxs)("div",{className:"card-header",children:[(0,a.jsxs)("div",{className:"px-".concat(s," py-").concat(i),children:[!!t&&(0,a.jsx)("h3",{className:"text-xl font-semibold",children:t}),e.children]}),(0,a.jsx)("hr",{className:"border-gray-200"})]})};
1r.propTypes={heading:i().string,children:i().node,padding:i().object};let l=e=>{let{padding:t=4}=e;return(0,a.jsx)("div",{className:"p-".concat(t," w-full relative"),children:e.children})};l.propTypes={padding:i().number,children:i().node};let o=e=>{let{heading:t,footer:n,className:s="",...i}=e;return(0,a.jsxs)("div",{className:"w-full bg-white rounded ".concat(s),...i,children:[t?(0,a.jsx)(r,{heading:t}):null,e.children,n]})};o.propTypes={heading:i().string,className:i().node,children:i().node,footer:i().node},t.ZP=o},59829:function(e,t,n){"use strict";n.d(t,{aK:function(){return p},fH:function(){return m},sc:function(){return x}});var a=n(59820),s=n(78298),i=n(87686),r=n(60418),l=n(62202),o=n(82036),c=n(84475),d=n(74618);let u={all:["tenantInvoices"],lists:()=>[...u.all,"list"],list:e=>[...u.lists(),e],details:()=>[...u.all,"detail"],detail:e=>[...u.details(),e]},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{status:n,dateFrom:i,dateTo:l,sortBy:d="created_at",sortDirection:m="desc",perPage:p=15,page:x=1,enabled:b=!0}=t;return(0,a.a)({queryKey:u.list({tenantId:e,status:n,dateFrom:i,dateTo:l,sortBy:d,sortDirection:m,perPage:p,page:x}),placeholderData:s.Wk,queryFn:async()=>{let e=new URLSearchParams;return n&&e.append("status",n),i&&e.append("date_from",i),l&&e.append("date_to",l),d&&e.append("sort_by",d),m&&e.append("sort_direction",m),e.append("per_page",p.toString()),e.append("page",x.toString()),(await r.Z.get("".concat(o.JW,"tenant/invoices?").concat(e.toString()),{withCredentials:!0,headers:{...(0,c.g0)(),"x-elv-realm":"hr"}})).data},enabled:!!e&&b})},p=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{enabled:s=!0}=n;return(0,a.a)({queryKey:u.detail(t),queryFn:async()=>{var e;return null===(e=(await r.Z.get("".concat(o.JW,"tenant/invoices/").concat(t),{withCredentials:!0,headers:{...(0,c.g0)(),"x-elv-realm":"hr"}})).data)||void 0===e?void 0:e.data},enabled:!!e&&!!t&&s})},x=e=>(0,i.D)({mutationFn:async e=>{var t;let n=await r.Z.get("".concat(o.JW,"tenant/invoices/").concat(e,"/download"),{withCredentials:!0,headers:{...(0,c.g0)(),"x-elv-realm":"hr"}});return(null===(t=n.data)||void 0===t?void 0:t.data)||n.data},onSuccess:e=>{if(null==e?void 0:e.download_url){let t=(0,d.Ld)(e.download_url);t&&window.open(t,"_blank")}else if(null==e?void 0:e.download_data){let t=window.atob(e.download_data),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);let a=new Blob([n],{type:e.content_type||"application/pdf"}),s=window.URL.createObjectURL(a),i=document.createElement("a");i.href=s,i.download=e.filename||"invoice-".concat(e.invoice_number||"download",".pdf"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(s)}},onError:e=>{var t,n,a,s,i;let r=(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||"Failed to download invoice";if((null==e?void 0:null===(a=e.response)||void 0===a?void 0:a.status)===404){l.default.error("Invoice not found.");return}if((null==e?void 0:null===(s=e.response)||void 0===s?void 0:s.status)===400){l.default.error("PDF is not available for this invoice.");return}if((null==e?void 0:null===(i=e.response)||void 0===i?void 0:i.status)===403){l.default.error("Only administrators can download invoices.");return}l.default.error(r)},meta:{expected404:!0}})},41798:function(e,t,n){"use strict";n.d(t,{Ll:function(){return c},oG:function(){return d}});var a=n(14010),s=n(87686),i=n(60418),r=n(62202),l=n(82036),o=n(84475);let c={all:["tenantSubscriptions"],lists:()=>[...c.all,"list"],list:e=>[...c.lists(),e],details:()=>[...c.all,"detail"],detail:e=>[...c.details(),e]},d=e=>{let t=(0,a.NL)();return(0,s.D)({mutationFn:async e=>{let{plan:t,billing_cycle:n,auto_renew:a=!0}=e;return(await i.Z.post("".concat(l.JW,"tenant/subscriptions"),{plan:t,billing_cycle:n,auto_renew:a},{withCredentials:!0,headers:{...(0,o.g0)(),"x-elv-realm":"hr"}})).data},onSuccess:()=>{r.default.success("Subscription initiated! Please complete payment to activate."),t.invalidateQueries({queryKey:c.all}),t.invalidateQueries({queryKey:["tenantInvoices"]}),t.invalidateQueries({queryKey:["billing","tenant",e]})},onError:e=>{var t,n,a,s,i,l,o,c;let d=(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||"Failed to create subscription",u=null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.errors;if((null==e?void 0:null===(i=e.response)||void 0===i?void 0:i.status)===422&&u){if(null==u?void 0:null===(o=u.plan)||void 0===o?void 0:o.includes("already have an active subscription")){r.default.error("Your organization already has an active subscription for this plan.");return}if(null==u?void 0:null===(c=u.plan)||void 0===c?void 0:c.includes("pending payment")){r.default.error("Your organization has a pending payment. Please complete payment first.");return}}if((null==e?void 0:null===(l=e.response)||void 0===l?void 0:l.status)===403){r.default.error("Only administrators can manage subscriptions.");return}r.default.error(d)}})}},48194:function(e,t,n){"use strict";n.d(t,{H$:function(){return s},Ht:function(){return i},pT:function(){return a}});let a={cv_generation_enabled:{label:"CV Generation",description:"Generate professional CVs",type:"boolean"},ai_content_enabled:{label:"AI Content Assistant",description:"AI-powered content suggestions",type:"boolean"},premium_templates_enabled:{label:"Premium Templates",description:"Access to premium CV templates",type:"boolean"},custom_colors:{label:"Custom Colors",description:"Customize CV color themes",type:"boolean"},priority_support:{label:"Priority Support",description:"Priority customer support",type:"boolean"}},s={ai_analysis_enabled:{label:"AI Candidate Analysis",description:"AI-powered candidate analysis and scoring",type:"boolean"},ai_content_enabled:{label:"AI Content Assistant",description:"AI-powered job description generation",type:"boolean"},pro_features_enabled:{label:"Pro Features",description:"Advanced HR features",type:"boolean"},signature_requests_enabled:{label:"E-Signatures",description:"Electronic document signatures",type:"boolean"}},i={ats:{label:"Applicant Tracking",shortLabel:"ATS",description:"Job posting and candidate management",icon:"faBriefcase"},hris:{label:"HR Information System",shortLabel:"HRIS",description:"Employee records and management",icon:"faUsers"},timeoff:{label:"Time Off Management",shortLabel:"Time Off",description:"Leave requests and approvals",icon:"faCalendarAlt"},performance:{label:"Performance Management",shortLabel:"Performance",description:"Goals, feedback and 360 review cycles",icon:"faChartLine"},payroll:{label:"Payroll",shortLabel:"Payroll",description:"Salary and compensation management",icon:"faMoneyBill"},signatures:{label:"E-Signatures",shortLabel:"Signatures",description:"Electronic document signing",icon:"faSignature"}}}},function(e){e.O(0,[5351,1422,1451,2888,9774,179],function(){return e(e.s=51757)}),_N_E=e.O()}]);
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.