PageSourceSearch

https://tripwai.com/_next/static/chunks/2407-994cf08bea9fb99c.js

js tripwai.com collected 2026-10-09 05:23:26 UTC 105,057 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{37715:function(e,t,n){var r={"./en.json":[759,759],"./pt.json":[65529,5529]};function s(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],s=t[0];return n.e(t[1]).then(function(){return n.t(s,19)})}s.keys=function(){return Object.keys(r)},s.id=37715,e.exports=s},66482:function(e,t,n){"use strict";n.d(t,{Y:function(){return s}});var r=n(57437);let s=e=>{let{width:t=15,height:n=13,...s}=e;return(0,r.jsx)("svg",{width:t,height:n,viewBox:"0 0 15 13",...s,children:(0,r.jsx)("path",{d:"M13.5 6.30001L0.700001 6.30001M0.700001 6.30001L6.3 11.9M0.700001 6.30001L6.3 0.700012",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}},89591:function(e,t,n){"use strict";n.d(t,{L:function(){return s}});var r=n(57437);let s=e=>{let{width:t=15,height:n=13,...s}=e;return(0,r.jsx)("svg",{width:t,height:n,viewBox:"0 0 15 13",...s,children:(0,r.jsx)("path",{d:"M0.699951 6.30002L13.5 6.30002M13.5 6.30002L7.89995 0.700024M13.5 6.30002L7.89995 11.9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}},57564:function(e,t,n){"use strict";n.d(t,{V:function(){return s}});var r=n(57437);let s=e=>{let{width:t=20,height:n=18,...s}=e;return(0,r.jsx)("svg",{width:t,height:n,viewBox:"0 0 20 18",...s,children:(0,r.jsx)("path",{d:"M18 3H14.25V2.25C14.25 1.65326 14.0129 1.08097 13.591 0.65901C13.169 0.237053 12.5967 0 12 0H7.5C6.90326 0 6.33097 0.237053 5.90901 0.65901C5.48705 1.08097 5.25 1.65326 5.25 2.25V3H1.5C1.10218 3 0.720644 3.15804 0.43934 3.43934C0.158035 3.72064 0 4.10218 0 4.5V16.5C0 16.8978 0.158035 17.2794 0.43934 17.5607C0.720644 17.842 1.10218 18 1.5 18H18C18.3978 18 18.7794 17.842 19.0607 17.5607C19.342 17.2794 19.5 16.8978 19.5 16.5V4.5C19.5 4.10218 19.342 3.72064 19.0607 3.43934C18.7794 3.15804 18.3978 3 18 3ZM6.75 2.25C6.75 2.05109 6.82902 1.86032 6.96967 1.71967C7.11032 1.57902 7.30109 1.5 7.5 1.5H12C12.1989 1.5 12.3897 1.57902 12.5303 1.71967C12.671 1.86032 12.75 2.05109 12.75 2.25V3H6.75V2.25ZM18 4.5V8.40094C15.4685 9.77885 12.6322 10.5005 9.75 10.5C6.86794 10.5005 4.03165 9.7792 1.5 8.40188V4.5H18ZM18 16.5H1.5V10.0912C4.06868 11.3477 6.8905 12.0006 9.75 12C12.6096 12.0001 15.4313 11.3469 18 10.0903V16.5ZM7.5 8.25C7.5 8.05109 7.57902 7.86032 7.71967 7.71967C7.86032 7.57902 8.05109 7.5 8.25 7.5H11.25C11.4489 7.5 11.6397 7.57902 11.7803 7.71967C11.921 7.86032 12 8.05109 12 8.25C12 8.44891 11.921 8.63968 11.7803 8.78033C11.6397 8.92098 11.4489 9 11.25 9H8.25C8.05109 9 7.86032 8.92098 7.71967 8.78033C7.57902 8.63968 7.5 8.44891 7.5 8.25Z",fill:"currentColor"})})}},20249:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var r=n(57437);let s=e=>{let{width:t=16,height:n=18,...s}=e;return(0,r.jsxs)("svg",{width:t,height:n,viewBox:"0 0 16 18",...s,children:[(0,r.jsx)("path",{d:"M7.81484 10.7667C6.03984 10.7667 4.58984 9.32507 4.58984 7.54174C4.58984 5.75841 6.03984 4.32507 7.81484 4.32507C9.58984 4.32507 11.0398 5.76674 11.0398 7.55007C11.0398 9.33341 9.58984 10.7667 7.81484 10.7667ZM7.81484 5.57507C6.73151 5.57507 5.83984 6.45841 5.83984 7.55007C5.83984 8.64174 6.72318 9.52507 7.81484 9.52507C8.90651 9.52507 9.78984 8.64174 9.78984 7.55007C9.78984 6.45841 8.89818 5.57507 7.81484 5.57507Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M7.81387 17.925C6.58053 17.925 5.33887 17.4583 4.3722 16.5333C1.91387 14.1667 -0.802799 10.3917 0.222201 5.9C1.1472 1.825 4.70553 0 7.81387 0C7.81387 0 7.81387 0 7.8222 0C10.9305 0 14.4889 1.825 15.4139 5.90833C16.4305 10.4 13.7139 14.1667 11.2555 16.5333C10.2889 17.4583 9.0472 17.925 7.81387 17.925ZM7.81387 1.25C5.38887 1.25 2.2722 2.54167 1.4472 6.175C0.547201 10.1 3.01387 13.4833 5.2472 15.625C6.68887 17.0167 8.9472 17.0167 10.3889 15.625C12.6139 13.4833 15.0805 10.1 14.1972 6.175C13.3639 2.54167 10.2389 1.25 7.81387 1.25Z",fill:"currentColor"})]})}},10325:function(e,t,n){"use strict";n.d(t,{l:function(){return s}});var r=n(57437);let s=e=>{let{width:t=21,height:n=18,...s}=e;return(0,r.jsxs)("svg",{width:t,height:n,viewBox:"0 0 21 18",...s,children:[(0,r.jsx)("path",{d:"M15.1875 0C13.2516 0 11.5566 0.8325 10.5 2.23969C9.44344 0.8325 7.74844 0 5.8125 0C4.27146 0.00173694 2.79404 0.614681 1.70436 1.70436C0.614681 2.79404 0.00173694 4.27146 0 5.8125C0 12.375 9.73031 17.6869 10.1447 17.9062C10.2539 17.9
165 10.376 17.9958 10.5 17.9958C10.624 17.9958 10.7461 17.965 10.8553 17.9062C11.2697 17.6869 21 12.375 21 5.8125C20.9983 4.27146 20.3853 2.79404 19.2956 1.70436C18.206 0.614681 16.7285 0.00173694 15.1875 0ZM10.5 16.3875C8.78813 15.39 1.5 10.8459 1.5 5.8125C1.50149 4.66921 1.95632 3.57317 2.76475 2.76475C3.57317 1.95632 4.66921 1.50149 5.8125 1.5C7.63594 1.5 9.16687 2.47125 9.80625 4.03125C9.86275 4.16881 9.95888 4.28646 10.0824 4.36926C10.2059 4.45207 10.3513 4.49627 10.5 4.49627C10.6487 4.49627 10.7941 4.45207 10.9176 4.36926C11.0411 4.28646 11.1372 4.16881 11.1937 4.03125C11.8331 2.46844 13.3641 1.5 15.1875 1.5C16.3308 1.50149 17.4268 1.95632 18.2353 2.76475C19.0437 3.57317 19.4985 4.66921 19.5 5.8125C19.5 10.8384 12.21 15.3891 10.5 16.3875Z",fill:"currentColor",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M15.1875 1.5C13.3641 1.5 11.8331 2.46844 11.1937 4.03125C11.1372 4.16881 11.0411 4.28646 10.9176 4.36926C10.7941 4.45207 10.6487 4.49627 10.5 4.49627C10.3513 4.49627 10.2059 4.45207 10.0824 4.36926C9.95888 4.28646 9.86275 4.16881 9.80625 4.03125C9.16687 2.47125 7.63594 1.5 5.8125 1.5C4.66921 1.50149 3.57317 1.95632 2.76475 2.76475C1.95632 3.57317 1.50149 4.66921 1.5 5.8125C1.5 10.8459 8.78813 15.39 10.5 16.3875C12.21 15.3891 19.5 10.8384 19.5 5.8125C19.4985 4.66921 19.0437 3.57317 18.2353 2.76475C17.4268 1.95632 16.3308 1.50149 15.1875 1.5Z",fill:"fillColor"})]})}},54426:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(57437);let s=e=>{let{width:t=21,height:n=18,...s}=e;return(0,r.jsx)("svg",{width:t,height:n,viewBox:"0 0 21 18",...s,children:(0,r.jsx)("path",{d:"M20.25 0H13.5C12.9178 0 12.3437 0.135544 11.8229 0.395898C11.3022 0.656252 10.8493 1.03426 10.5 1.5C10.1507 1.03426 9.69776 0.656252 9.17705 0.395898C8.65634 0.135544 8.08217 0 7.5 0H0.75C0.551088 0 0.360322 0.0790178 0.21967 0.21967C0.0790176 0.360322 0 0.551088 0 0.75V14.25C0 14.4489 0.0790176 14.6397 0.21967 14.7803C0.360322 14.921 0.551088 15 0.75 15H7.5C8.09674 15 8.66903 15.2371 9.09099 15.659C9.51295 16.081 9.75 16.6533 9.75 17.25C9.75 17.4489 9.82902 17.6397 9.96967 17.7803C10.1103 17.921 10.3011 18 10.5 18C10.6989 18 10.8897 17.921 11.0303 17.7803C11.171 17.6397 11.25 17.4489 11.25 17.25C11.25 16.6533 11.4871 16.081 11.909 15.659C12.331 15.2371 12.9033 15 13.5 15H20.25C20.4489 15 20.6397 14.921 20.7803 14.7803C20.921 14.6397 21 14.4489 21 14.25V0.75C21 0.551088 20.921 0.360322 20.7803 0.21967C20.6397 0.0790178 20.4489 0 20.25 0ZM7.5 13.5H1.5V1.5H7.5C8.09674 1.5 8.66903 1.73705 9.09099 2.15901C9.51295 2.58097 9.75 3.15326 9.75 3.75V14.25C9.1015 13.762 8.3116 13.4987 7.5 13.5ZM19.5 13.5H13.5C12.6884 13.4987 11.8985 13.762 11.25 14.25V3.75C11.25 3.15326 11.4871 2.58097 11.909 2.15901C12.331 1.73705 12.9033 1.5 13.5 1.5H19.5V13.5ZM13.5 3.75H17.25C17.4489 3.75 17.6397 3.82902 17.7803 3.96967C17.921 4.11032 18 4.30109 18 4.5C18 4.69891 17.921 4.88968 17.7803 5.03033C17.6397 5.17098 17.4489 5.25 17.25 5.25H13.5C13.3011 5.25 13.1103 5.17098 12.9697 5.03033C12.829 4.88968 12.75 4.69891 12.75 4.5C12.75 4.30109 12.829 4.11032 12.9697 3.96967C13.1103 3.82902 13.3011 3.75 13.5 3.75ZM18 7.5C18 7.69891 17.921 7.88968 17.7803 8.03033C17.6397 8.17098 17.4489 8.25 17.25 8.25H13.5C13.3011 8.25 13.1103 8.17098 12.9697 8.03033C12.829 7.88968 12.75 7.69891 12.75 7.5C12.75 7.30109 12.829 7.11032 12.9697 6.96967C13.1103 6.82902 13.3011 6.75 13.5 6.75H17.25C17.4489 6.75 17.6397 6.82902 17.7803 6.96967C17.921 7.11032 18 7.30109 18 7.5ZM18 10.5C18 10.6989 17.921 10.8897 17.7803 11.0303C17.6397 11.171 17.4489 11.25 17.25 11.25H13.5C13.3011 11.25 13.1103 11.171 12.9697 11.0303C12.829 10.8897 12.75 10.6989 12.75 10.5C12.75 10.3011 12.829 10.1103 12.9697 9.96967C13.1103 9.82902 13.3011 9.75 13.5 9.75H17.25C17.4489 9.75 17.6397 9.82902 17.7803 9.96967C17.921 10.1103 18 10.3011 18 10.5Z",fill:"currentColor"})})}},59852:function(e,t,n){"use strict";n.d(t,{W:function(){return V}});var r=n(57437),s=n(2265),l=n(33145),i=n(42586),a=n(94508),o=n(99376),c=n(29501),d=n(91351),u=n(13590),m=n(29827),x=n(22085),h=n(84211),p=n(38774);let f=e=>d.Ry({email:d.Z_().min(1,e("required")).email(e("invalidEmail")),password:d.Z_().min(1,e("required")).min(8,e("passwordMin"))}),g=e=>{var t,n;let r=(0,i.useTranslations)("validations"),l=(0,i.useTranslations)("auth"),a=(0,m.useQueryClient)(),d=(0,o.useRouter)(),g=(0,i.useLocale)(),[b,v]=(0,s.use
1State)(null),[w,j]=(0,s.useState)(!1),y=f(r),{register:N,handleSubmit:C,formState:{errors:k,isSubmitting:W}}=(0,c.cI)({resolver:(0,u.F)(y)}),S=[{type:"email",name:"email",label:l("enterYourEmail"),placeholder:l("emailPlaceholder"),register:N("email"),error:null===(t=k.email)||void 0===t?void 0:t.message},{type:"password",name:"password",label:l("enterYourPassword"),placeholder:l("passwordPlaceholder"),register:N("password"),error:null===(n=k.password)||void 0===n?void 0:n.message}],E=()=>{a.removeQueries({queryKey:["user-me"]})},A=async()=>{v(null),j(!0);let t=await x.u.signInWithGoogle();if(!t.success){var n;v(null!==(n=t.error)&&void 0!==n?n:"Something went wrong"),j(!1);return}E(),e(),j(!1)},F=async()=>{v(null),j(!0);let t=await x.u.signInWithFacebook();if(!t.success){var n;v(null!==(n=t.error)&&void 0!==n?n:"Facebook login is temporarily unavailable. Please use email or Google."),j(!1);return}E(),e(),j(!1)},M=async()=>{v(null),j(!0);let t=await x.u.signInAsGuest();if(!t.success){var n;v(null!==(n=t.error)&&void 0!==n?n:"Something went wrong"),j(!1);return}E(),e(),j(!1)};return{onSubmit:C(async t=>{v(null);let n=await x.u.signIn(t);if(console.log("[useLoginSlideForm] AuthAPI.signIn result:",n),!n.success){var r;v(null!==(r=n.error)&&void 0!==r?r:"Something went wrong");return}if(E(),n.needsEmailVerification){e(),d.replace((0,h.yF)(g,p.Z6.CONFIRM_EMAIL));return}e()}),fields:S,handleGoogleSignIn:A,handleFacebookSignIn:F,handleGuest:M,isSubmitting:W,isSocialLoading:w,formError:b}},b=e=>e.replace(RegExp("[^\\p{L}\\s\\-']","gu"),""),v=e=>{let{label:t,register:n,error:s,value:l,onChange:i,ref:a,onBlur:o,...c}=e,d=void 0!==l&&i;return n||d?(0,r.jsxs)("div",{className:w.field,children:[(0,r.jsx)("p",{className:w.fieldLabel,children:t}),(0,r.jsx)("input",{className:w.input,...null!=n?n:{value:l,onChange:i,ref:a,onBlur:o},...c}),(0,r.jsx)("p",{className:w.error,children:s})]}):null},w={field:(0,a.cn)("relative"),fieldLabel:(0,a.cn)("mb-2 text-sm text-ui-label"),input:(0,a.cn)("w-full rounded-md border border-[#EDEDED] px-3 py-3 text-sm transition-colors focus:border-brand-blue-button outline-none placeholder:text-ui-placeholder"),error:(0,a.cn)("text-[11px] absolute bottom-0 translate-y-full text-red-600")},j=e=>{let{onBack:t}
1=e,n=(0,i.useTranslations)("auth"),[l,a]=(0,s.useState)(""),[o,c]=(0,s.useState)(!1),[d,u]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1),p=async e=>{if(e.preventDefault(),!l.trim())return;c(!0),u(null);let t=await x.u.sendPasswordReset(l.trim());if(c(!1),t.success)h(!0);else{var r;u(null!==(r=t.error)&&void 0!==r?r:n("resetLinkError"))}};return m?(0,r.jsxs)("div",{className:y.form,children:[(0,r.jsx)("p",{className:"mb-6 text-center text-sm text-[#4A4F5C]",children:n("resetLinkSent")}),(0,r.jsx)("button",{type:"button",onClick:t,className:y.backButton,children:n("backToLogin")})]}):(0,r.jsxs)("form",{onSubmit:p,className:y.form,children:[(0,r.jsx)("p",{className:"mb-4 text-sm text-[#4A4F5C]",children:n("forgotPasswordDescription")}),(0,r.jsx)(v,{type:"email",name:"email",label:n("enterYourEmail"),placeholder:n("emailPlaceholder"),value:l,onChange:e=>a(e.target.value)}),d&&(0,r.jsx)("p",{className:"mt-1 text-xs font-medium text-red-500",children:d}),(0,r.jsx)("button",{type:"submit",disabled:o||!l.trim(),className:y.submitButton,children:o?n("sendingResetLink"):n("sendResetLink")}),(0,r.jsx)("div",{className:"mt-3 text-center",children:(0,r.jsx)("button",{type:"button",onClick:t,className:y.backButton,children:n("backToLogin")})})]})},y={form:(0,a.cn)("w-full shrink-0 space-y-4 px-6 py-6"),submitButton:(0,a.cn)("mt-2 h-11 w-full cursor-pointer rounded-md bg-[#001F53] text-sm font-semibold text-white disabled:opacity-70"),backButton:(0,a.cn)("cursor-pointer text-sm font-semibold text-[#D50F64]")},N=e=>{let{onSuccess:t,onOpenSignUp:n}=e,o=(0,i.useTranslations)("auth"),[c,d]=(0,s.useState)(!1),{onSubmit:u,fields:m,formError:x,isSubmitting:h,isSocialLoading:p,handleGoogleSignIn:f,handleFacebookSignIn:b,handleGuest:w}=g(t);return c?(0,r.jsx)(j,{onBack:()=>d(!1)}):(0,r.jsxs)("form",{onSubmit:u,className:C.form,children:[m.map(e=>(0,r.jsx)(v,{...e},e.name)),x&&(0,r.jsx)("div",{className:"mb-4 text-xs font-medium text-red-500",children:x}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)("button",{type:"button",onClick:()=>d(!0),className:C.forgotPasswordButton,children:o("forgotPassword")})}),(0,r.jsx)("button",{type:"submit",disabled:h||p,className:C.submitButton,children:o(h?"loggingIn":"login")}),(0,r.jsxs)("p",{className:C.signUpText,children:[o("dontHaveAccount")," ",(0,r.jsx)("button",{type:"button",onClick:n,className:C.signUpButton,children:o("signUp")})]}),(0,r.jsx)("div",{className:C.divider,children:(0,r.jsx)("span",{children:o("or")})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("button",{type:"button",onClick:f,disabled:p||h,className:C.socialButton,children:[(0,r.jsx)(l.default,{src:"/Google.svg",alt:"Google icon",width:22,height:20}),o("continueWithGoogle")]}),(0,r.jsxs)("button",{type:"button",onClick:b,disabled:p||h,className:C.socialButton,children:[(0,r.jsx)(l.default,{src:"/Facebook.svg",alt:"Facebook icon",width:22,height:20}),o("continueWithFacebook")]})]}),(0,r.jsx)("div",{className:C.divider,children:(0,r.jsx)("span",{children:o("or")})}),(0,r.jsx)("div",{className:"mt-2 text-center",children:(0,r.jsx)("button",{type:"button",onClick:w,disabled:p||h,className:(0,a.cn)(C.signUpButton,"text-sm"),children:o("continueAsGuest")})})]})},C={form:(0,a.cn)("w-full shrink-0 space-y-4 px-6 py-6"),submitButton:(0,a.cn)("mt-2 h-11 w-full cursor-pointer rounded-md bg-[#001F53] text-sm font-semibold text-white disabled:opacity-70"),signUpText:(0,a.cn)("text-center text-xs text-[#4A4F5C]"),signUpButton:(0,a.cn)("cursor-pointer font-semibold text-[#D50F64]"),divider:(0,a.cn)("flex items-center justify-center gap-2 py-1 text-xs text-[#9CA0AA]"),dividerLine:(0,a.cn)("h-px flex-1 bg-[#E2E4EA]"),socialButton:(0,a.cn)("flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-md border border-[#E2E4EA] text-sm font-medium transition-colors hover:bg-gray-50 disabled:opacity-70"),forgotPasswordButton:(0,a.cn)("cursor-pointer text-xs font-medium text-[#9CA0AA] hover:text-[#D50F64] transition-colors")};var k=n(99892),W=n(69064),S=n(39160),E=n(94010);let A=e=>d.Ry({firstName:d.Z_().min(1,e("firstNameRequired")).refine(e=>!/\d/.test(e),{message:e("firstNameNoNumbers")}).refine(e=>RegExp("^[\\p{L}\\s\\-']*$","u").test(e),{message:e("firstNameNoSpecialChars")}),phoneNumber:d.Z_().min(1,e("mobileRequired")),phoneCountry:d.Z_(),email:d.Z_().min(1,e("required")).email(e("invalidEmail")),dateOfBirth:d.Z_().min(1,e("dateOfBirthRequired")),password:d.Z_().min(1,e("passwordRequired")).min(8,e("passwordMin")),confirmPassword:d.Z_().min(1,e("confirmPasswordRequired")).min(8,e("passwordMin"))}).refine(e=>e.password===e.confirmPassword,{path:["confirmPassword"],message:e("passwordsMustMatch")}).refine(e=>{var t;if(!(null===(t=e.phoneNumber)||void 0===t?void 0:t.trim()))return!1;let n=e.phoneNumber.replace(/\D/g,""),r=(0,k.Gg)(e.phoneCountry).length;return n.length>r},{path:["phoneNumber"],message:e("mobileRequired")}).refine(e=>{var t;return null===(t=e.phoneNumber)||void 0===t||!t.trim()||(0,k.yf)(e.phoneNumber,e.phoneCountry)},{path:["phoneNumber"],message:e("invalidPhoneLength")}),F=e=>{var t,n,r,s,l,a;let d=(0,i.useTranslations)("validations"),m=(0,i.useTranslations)("auth"),f=(0,o.useRouter)(),g=(0,i.useLocale)(),v=A(d
1),{register:w,control:j,handleSubmit:y,setValue:N,formState:{errors:C,isSubmitting:k}}=(0,c.cI)({resolver:(0,u.F)(v),defaultValues:{phoneCountry:"BR"},shouldUseNativeValidation:!1}),F=[{name:"firstName",type:"text",label:m("firstNameLabel"),placeholder:m("firstNamePlaceholder"),register:w("firstName",{setValueAs:b}),error:null===(t=C.firstName)||void 0===t?void 0:t.message},{name:"phoneNumber",type:"phone",label:m("mobileLabel"),placeholder:m("mobilePlaceholder"),error:null===(n=C.phoneNumber)||void 0===n?void 0:n.message,setValue:N,phoneCountryFieldName:"phoneCountry"},{type:"email",name:"email",label:m("enterYourEmail"),placeholder:m("emailPlaceholder"),register:w("email"),error:null===(r=C.email)||void 0===r?void 0:r.message},{name:"dateOfBirth",type:"date",label:m("dobLabel"),placeholder:m("dobPlaceholder"),register:w("dateOfBirth"),error:null===(s=C.dateOfBirth)||void 0===s?void 0:s.message},{name:"password",type:"password",label:m("createPasswordLabel"),placeholder:m("passwordPlaceholder"),register:w("password"),error:null===(l=C.password)||void 0===l?void 0:l.message},{name:"confirmPassword",type:"password",label:m("confirmPasswordLabel"),placeholder:m("passwordPlaceholder"),register:w("confirmPassword"),error:null===(a=C.confirmPassword)||void 0===a?void 0:a.message}];return{onSubmit:y(async t=>{let n=await x.u.signUp(t);if(!n.success){W.ZP.error((0,E.t)(n.error,m));return}if(n.needsEmailVerification){S.Y.generateNewUserPromoCode().catch(()=>void 0),f.replace((0,h.yF)(g,p.Z6.CONFIRM_EMAIL)),e();return}S.Y.generateNewUserPromoCode().catch(()=>void 0),e()},e=>{let t=[e.firstName,e.phoneNumber,e.email,e.dateOfBirth,e.password,e.confirmPassword].map(e=>null==e?void 0:e.message).find(Boolean);t&&W.ZP.error(t)}),control:j,fields:F,isSubmitting:k}};var M=n(68933),D=n(32628),P=n(27648);let L=e=>"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0")),T=e=>{if(!e)return null;let[t,n,r]=e.split("-").map(Number);if(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))return null;let s=new Date(t,n-1,r);return Number.isNaN(s.getTime())?null:s},I=e=>{let{onSuccess:t,onBackToLogin:n}=e,{onSubmit:s,control:a,fields:o,isSubmitting:d}=F(t),u=(0,i.useTranslations)("auth"),m=(0,i.useLocale)();return(0,r.jsxs)("form",{onSubmit:s,className:B.form,children:[(0,r.jsxs)("div",{className:B.slideHeading,onClick:n,children:[(0,r.jsx)(l.default,{src:"arrow-left.svg",alt:"Arrow icon",width:18,height:15}),(0,r.jsx)("p",{className:B.title,children:u("startYourTrip")})]}),o.map(e=>"phone"===e.type?(0,r.jsx)(M.a,{control:a,name:e.name,label:e.label,placeholder:e.placeholder,error:e.error,setValue:e.setValue,phoneCountryFieldName:e.phoneCountryFieldName},e.name):"date"===e.type?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.Qr,{control:a,name:e.name,render:t=>{let{field:{value:n,onChange:s}}=t,l=new Date;return l.setFullYear(l.getFullYear()-120),(0,r.jsx)(D.M,{label:e.label,placeholder:e.placeholder,value:T(null!=n?n:""),onChange:e=>s(e?L(e):""),range:{minDate:l,maxDate:new Date,navigationClamp:"both"},showCourseStartsInfo:!1,defaultMonth:new Date(1996,0,1),excludeAdjacentMonths:!0})}}),e.error&&(0,r.jsx)("p",{className:B.error,children:e.error})]},e.name):(0,r.jsx)(v,{...e},e.name)),(0,r.jsxs)("p",{className:B.termsText,children:[u("termsIntro")," ",(0,r.jsx)(P.default,{href:(0,h.yF)(m,p.Z6.TERMS),className:B.termsLink,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:u("termsOfService")})," ",u("and")," ",(0,r.jsx)(P.default,{href:(0,h.yF)(m,p.Z6.PRIVACY_POLICY),className:B.termsLink,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:u("privacyPolicy")})," ",u("andMarketingCommunication")]}),(0,r.jsx)("button",{type:"submit",disabled:d,className:B.submitButton,children:u(d?"creatingAccount":"createTripwaiAccount")}),(0,r.jsxs)("p",{className:B.loginText,children:[u("alreadyHaveAccount")," ",(0,r.jsx)("button",{type:"button",onClick:n,className:B.loginButton,children:u("login")})]})]})},B={form:(0,a.cn)("w-full shrink-0 space-y-5 px-6 py-6"),slideHeading:(0,a.cn)("flex gap-6 items-center mb-5 curs
1or-pointer"),title:(0,a.cn)("text-base font-semibold text-[#071231]"),termsText:(0,a.cn)("mt-2 text-[11px] leading-4 text-[#4A4F5C]"),termsLink:(0,a.cn)("cursor-pointer text-[#001F53] underline"),submitButton:(0,a.cn)("mt-2 h-11 w-full cursor-pointer rounded-md bg-[#001F53] text-sm font-semibold text-white disabled:opacity-70"),loginText:(0,a.cn)("text-center text-xs text-[#4A4F5C]"),loginButton:(0,a.cn)("cursor-pointer font-semibold text-[#D50F64]"),error:(0,a.cn)("text-[11px] absolute bottom-0 translate-y-full text-red-600")};var _=n(61466),R=n(30469),q=n(25883);let H=e=>d.Ry({newPassword:d.Z_().min(1,e("passwordRequired")).min(8,e("passwordMin")),confirmPassword:d.Z_().min(1,e("confirmPasswordRequired"))}).refine(e=>e.newPassword===e.confirmPassword,{path:["confirmPassword"],message:e("passwordsMustMatch")}),K=e=>{let{oobCode:t,onSuccess:n}=e,a=(0,i.useTranslations)("auth"),o=(0,i.useTranslations)("validations"),d=(0,q.H)(e=>e.setPendingResetOobCode),[m,x]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1),[f,g]=(0,s.useState)(null),[b,v]=(0,s.useState)(!1),{register:w,handleSubmit:j,formState:{errors:y,isSubmitting:N}}=(0,c.cI)({resolver:(0,u.F)(H(o)),mode:"onChange"}),C=async e=>{if(R.firebaseAuth){g(null);try{await (0,_.LG)(R.firebaseAuth,t,e.newPassword),v(!0)}catch(e){g(a("resetPasswordError"))}}};return b?(0,r.jsxs)("div",{className:O.form,children:[(0,r.jsx)("p",{className:"mb-6 text-center text-sm text-[#4A4F5C]",children:a("resetPasswordSuccess")}),(0,r.jsx)("button",{type:"button",onClick:()=>{d(null),n()},className:O.submitButton,children:a("login")})]}):(0,r.jsxs)("form",{onSubmit:j(C),className:O.form,children:[(0,r.jsx)("p",{className:"mb-4 text-sm text-[#4A4F5C]",children:a("resetPasswordDescription")}),(0,r.jsxs)("div",{className:O.field,children:[(0,r.jsx)("p",{className:O.fieldLabel,children:a("newPasswordLabel")}),(0,r.jsxs)("div",{className:O.inputWrapper,children:[(0,r.jsx)("input",{type:m?"text":"password",placeholder:"••••••••",autoComplete:"new-password",className:O.input,...w("newPassword")}),(0,r.jsx)("button",{type:"button",onClick:()=>x(e=>!e),className:O.eyeButton,children:(0,r.jsx)(l.default,{src:m?"/EyeSlash.svg":"/Eye.svg",alt:"",width:20,height:20})})]}),y.newPassword&&(0,r.jsx)("p",{className:O.error,children:y.newPassword.message})]}),(0,r.jsxs)("div",{className:O.field,children:[(0,r.jsx)("p",{className:O.fieldLabel,children:a("confirmPasswordLabel")}),(0,r.jsxs)("div",{className:O.inputWrapper,children:[(0,r.jsx)("input",{type:h?"text":"password",placeholder:"••••••••",autoComplete:"new-password",className:O.input,...w("confirmPassword")}),(0,r.jsx)("button",{type:"button",onClick:()=>p(e=>!e),className:O.eyeButton,children:(0,r.jsx)(l.default,{src:h?"/EyeSlash.svg":"/Eye.svg",alt:"",width:20,height:20})})]}),y.confirmPassword&&(0,r.jsx)("p",{className:O.error,children:y.confirmPassword.message})]}),f&&(0,r.jsx)("p",{className:"text-xs font-medium text-red-500",children:f}),(0,r.jsx)("button",{type:"submit",disabled:N,className:O.submitButton,children:N?a("savingPassword"):a("savePassword")})]})},O={form:(0,a.cn)("w-full space-y-4 px-6 py-6"),field:(0,a.cn)("relative pb-4"),fieldLabel:(0,a.cn)("mb-2 text-sm text-ui-label"),inputWrapper:(0,a.cn)("relative flex items-center"),input:(0,a.cn)("w-full rounded-md border border-[#EDEDED] px-3 py-3 pr-10 text-sm transition-colors focus:border-brand-blue-button outline-none placeholder:text-ui-placeholder"),eyeButton:(0,a.cn)("absolute right-3 cursor-pointer text-[#9CA0AA]"),error:(0,a.cn)("absolute bottom-0 translate-y-[2px] text-[11px] text-red-600"),submitButton:(0,a.cn)("mt-2 h-11 w-full cursor-pointer rounded-md bg-[#001F53] text-sm font-semibold text-white disabled:opacity-70")},V=e=>{let{onSuccess:t,initialSlide:n="login"}=e,l=(0,q.H)(e=>e.pendingResetOobCode),[i,a]=(0,s.useState)(n),o=(0,s.useRef)(null),c=(0,s.useRef)(null),d=(0,s.useRef)(null);return((0,s.useLayoutEffect)(()=>{let e="login"===i?o.current:c.current,t=d.current;if(!e||!t)return;let n=e.offsetHeight;t.style.height="".concat(n,"px")},[i]),l)?(0,r.jsx)(K,{oobCode:l,onSuccess:t}):(0,r.jsx)("div",{ref:d,className:Z.container,children:(0,r.jsxs)("div",{className:Z.track(i),children:[(0,r.jsx)("div",{ref:o,className:Z.slideWrapper,children:(0,r.jsx)(N,{onSuccess:t,onOpenSignUp:()=>a("signup")})}),(0,r.jsx)("div",{ref:c,className:Z.slideWrapper,children:(0,r.jsx)(I,{onSuccess:t,onBackToLogin:()=>a("login")})})]})})},Z={container:(0,a.cn)("overflow-hidden transition-[height]"),track:e=>(0,a.cn)("flex items-start transition-transform duration-300 ease-out","login"===e?"translate-x-0":"-translate-x-full"),slideWrapper:(0,a.cn)("w-full shrink-0")}},68933:function(e,t,n){"use strict";n.d(t,{a:function(){return x}});var r=n(57437),s=n(2265),l=n(29501),i=n(99892);n(28356);var a=n(94508),o=n(42013);let c=n(10006);function d(e){try{let t=(0,o.L)(e,c);if(t)return t.nationalNumber.length}catch(e){}return 15}function u(e){try{let t=(0,o.L)(e,c);if(t)return t.formatInternational().length}catch(e){}return 20}let m=(0,a.cn)("flex items-center w-full rounded-md border border-[#
1EDEDED] text-sm transition-colors focus:border-brand-blue-button outline-none placeholder:text-ui-placeholder","[&_.PhoneInput]:flex-1 [&_.PhoneInput]:flex [&_.PhoneInput]:items-center [&_.PhoneInput]:min-h-0","[&_.PhoneInputInput]:flex-1 [&_.PhoneInputInput]:border-none [&_.PhoneInputInput]:outline-none [&_.PhoneInputInput]:bg-transparent [&_.PhoneInputInput]:text-sm [&_.PhoneInputInput]:placeholder:text-ui-placeholder","[&_.PhoneInputCountryIcon]:!mt-0 [&_.PhoneInputCountryIcon--border]:!mt-0 [&_.PhoneInputCountrySelectArrow]:!m-0");function x(e){let{control:t,name:n,label:a,placeholder:o,error:c,setValue:x,phoneCountryFieldName:h,onValueChange:p}=e,[f,g]=(0,s.useState)("BR"),b=(0,s.useRef)(u("BR")),v=(0,s.useMemo)(()=>(function(e){let t=(0,s.forwardRef)((t,n)=>(0,r.jsx)("input",{...t,ref:n,maxLength:e.current}));return t.displayName="LimitedInput",t})(b),[]);return(0,r.jsx)(l.Qr,{control:t,name:n,render:e=>{let{field:t}=e;return(0,r.jsxs)("div",{className:"relative",children:[a?(0,r.jsx)("p",{className:"mb-2 text-sm text-ui-label",children:a}):null,(0,r.jsx)(i.ZP,{international:!0,defaultCountry:"BR",value:t.value,onCountryChange:e=>{var n;if(!e)return;let r=(0,i.Gg)(f).length,s=d(e);b.current=u(e),g(e),h&&x&&x(h,e);let l=null!==(n=t.value)&&void 0!==n?n:"";if(l){let n=l.replace(/\D/g,"").slice(r).slice(0,s),a=(0,i.Gg)(e)+n;t.onChange("+"+a)}},onChange:e=>{let n=null!=e?e:"",r=(0,i.Gg)(f).length+d(f),s=n.replace(/\D/g,""),l=s.length>r?"+"+s.slice(0,r):n;t.onChange(l),null==p||p()},onBlur:t.onBlur,placeholder:o,className:m,inputComponent:v}),c&&(0,r.jsx)("p",{className:"text-[11px] absolute bottom-0 translate-y-full text-red-600",children:c})]})}})}},83777:function(e,t,n){"use strict";n.d(t,{$Y:function(){return c},JV:function(){return o},bf:function(){return i},fl:function(){return a},v2:function(){return l}});var r=n(2265);function s(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,r=null!=e&&"string"==typeof e&&"malta"===e.toLowerCase().trim()&&t>12?90:30,l=s(n);return l.setDate(l.getDate()+r),l}function i(e){let t=s(e),n=t.getDay();return t.setDate(t.getDate()+(0===n?1:(8-n)%7)),t}function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;return i(l(e,t,n))}function o(e,t){return e&&s(e)>=s(t)?e:i(t)}function c(e,t){return(0,r.useMemo)(()=>l(e,t),[e,t])}},22126:function(e,t,n){"use strict";n.d(t,{BestSellersSection:function(){return v}});var r=n(57437),s=n(27648),l=n(94508),i=n(71632),a=n(8164),o=n(42586),c=n(71154);let d={section:"py-[48px]",header:(0,l.cn)("mb-[40px] flex flex-col items-start gap-2","md:flex-row md:items-center md:justify-between"),title:(0,l.cn)("text-[34px] font-semibold leading-[1.3em] text-[#383838]"),moreLink:(0,l.cn)("cursor-pointer text-[24px] font-semibold leading-[1.3em] text-[#D50F64] hover:underline"),grid:(0,l.cn)("grid gap-7","sm:grid-cols-2","xl:grid-cols-4"),card:(0,l.cn)("overflow-hidden rounded-2xl border border-[#000]/10 bg-white shadow-sm"),imageWrapper:(0,l.cn)("relative h-[134px] w-full"),image:(0,l.cn)("object-cover"),cardBody:(0,l.cn)("p-4"),cardHeader:(0,l.cn)("flex items-start justify-between gap-2"),cardTitle:(0,l.cn)("text-[18px] font-bold text-[#403A3A]"),cardIcons:(0,l.cn)("flex items-center gap-2.5 shrink-0"),infoButton:(0,l.cn)("flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-[#878787] text-[11px] italic text-[#878787]"),likeButton:(0,l.cn)("cursor-pointer text-[#001E52] shrink-0 flex items-center justify-center w-[21px] h-[18px] min-w-[21px] min-h-[18px]"),schoolRow:(0,l.cn)("mb-4 mt-2 flex items-center gap-2"),schoolLogo:(0,l.cn)("flex h-6 w-6 items-center justify-center rounded-full bg-[#FF7A00] text-[10px] font-semibold text-white"),schoolName:(0,l.cn)("text-[16px] font-semibold text-[#606060]"),startingFromRow:(0,l.cn)("mb-1 flex items-center justify-between"),startingFrom:(0,l.cn)("text-[14px] font-semibold text-[#D50F64]"),startDate:(0,l.cn)("text-[14px] font-normal text-[#606060]"),oldPrice:(0,l.cn)("text-[12px] font-bold text-[#475467] line-through"),priceSuffix:(0,l.cn)("font-normal"),newPrice:(0,l.cn)("text-[22px] font-bold text-[#D50F64]"),newPriceSuffix:(0,l.cn)("text-[18px] font-normal"),courseName:(0,l.cn)("mt-2 text-[14px] text-[#252525]")};var u=n(2265),m=n(33145),x=n(37830),h=n(49181),p=n(23920),f=n(99967);let g=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(e).map(e=>"decimal"===e.type?",":"group"===e.type?".":"currency"===e.type?"".concat(e.value," "):e.value).join("");function b(e){var t,n,l,i,a,c,b,v,w,j,y,N;
1let{course:C,locale:k,schoolId:W,schoolName:S}=e,E=(0,o.useTranslations)("home.bestSellers"),{user:A}=(0,f.a)(),{data:F}=(0,p.e_)(),M=(0,p.xb)(),D=(0,p.oQ)(),P=null===(t=C.campus)||void 0===t?void 0:t.id,L=(null===(n=C.campus)||void 0===n?void 0:n.name)||"",T=null===(i=C.campus)||void 0===i?void 0:null===(l=i.school)||void 0===l?void 0:l.logo,I=null===(a=C.campus)||void 0===a?void 0:a.images,B=Array.isArray(I)&&I.length>0,_=B?null===(c=I[0])||void 0===c?void 0:c.imageUrl:null,R=C.summary,q=null!==(b=null==R?void 0:R.courseMinDurationSubtotal)&&void 0!==b?b:null==R?void 0:R.courseMinBasePricePerWeek,H=null!==(v=null==R?void 0:R.courseMinDurationTotal)&&void 0!==v?v:null==R?void 0:R.courseMinTotalPricePerWeek,K=void 0!==q||void 0!==H,O=K?null!=q?q:null:null!==(j=null!==(w=null==R?void 0:R.courseBasePrice)&&void 0!==w?w:C.totalPrice)&&void 0!==j?j:null,V=K?null!=H?H:null:null!==(N=null!==(y=null==R?void 0:R.courseTotalPrice)&&void 0!==y?y:C.priceWithDiscount)&&void 0!==N?N:null,Z=(0,u.useMemo)(()=>{var e,t;return null!==(t=null==F?void 0:null===(e=F.data)||void 0===e?void 0:e.some(e=>e.courseId===C.id))&&void 0!==t&&t},[F,C.id]),U=(0,u.useMemo)(()=>C.name,[C.name]),Y=(0,u.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),Z){var t,n;let e=null==F?void 0:null===(n=F.data)||void 0===n?void 0:null===(t=n.find(e=>e.courseId===C.id))||void 0===t?void 0:t.id;e&&D.mutate(e)}else M.mutate(C.id)},[Z,M,D,F,C.id]),G=(0,h.u)({amount:O||0,fromCurrency:C.currency||"EUR",enabled:null!==O&&O>0}),Q=(0,h.u)({amount:V||0,fromCurrency:C.currency||"EUR",enabled:null!==V&&V>0}),z=Q.toCurrency||G.toCurrency||"EUR",J="/".concat(k,"/course/").concat(C.id);return(0,r.jsxs)(s.default,{href:J,className:d.card+" flex h-full flex-col",style:{cursor:"pointer",textDecoration:"none"},children:[(0,r.jsx)("div",{className:d.imageWrapper,children:B&&_?(0,r.jsx)(m.default,{src:_,alt:L,className:d.image,fill:!0}):(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gray-200",children:(0,r.jsx)("span",{className:"text-sm text-gray-500",children:"No images available"})})}),(0,r.jsxs)("div",{className:d.cardBody+" flex flex-1 flex-col",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:d.cardHeader,children:[(0,r.jsx)("div",{className:d.cardTitle,title:U,children:U.length>20?"".concat(U.slice(0,20),"..."):U}),(0,r.jsx)("div",{className:d.cardIcons,children:A&&!A.isAnonymous&&(0,r.jsx)("button",{className:d.likeButton,onClick:Y,"aria-label":E(Z?"removeFromWishlist":"addToWishlist"),children:Z?(0,r.jsx)(m.default,{src:"/Vector (1).svg",alt:"Added to wishlist",width:21,height:18,className:"shrink-0",style:{width:21,height:18,minWidth:21,minHeight:18}}):(0,r.jsx)(x.l,{width:21,height:18,className:"shrink-0 fill-transparent text-[#001E52]",style:{width:21,height:18,minWidth:21,minHeight:18}})})})]}),(0,r.jsxs)("div",{className:d.schoolRow,children:[W?(0,r.jsx)(s.default,{href:"/".concat(k,"/schools/").concat(W),className:"cursor-pointer transition-opacity hover:opacity-80",onClick:e=>e.stopPropagation(),children:T?(0,r.jsx)(m.default,{src:T,alt:S,width:24,height:24,className:"h-6 w-6 rounded-full object-cover"}):(0,r.jsx)("div",{className:d.schoolLogo,children:S.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)})}):T?(0,r.jsx)(m.default,{src:T,alt:S,width:24,height:24,className:"h-6 w-6 rounded-full object-cover"}):(0,r.jsx)("div",{className:d.schoolLogo,children:S.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}),P?(0,r.jsx)(s.default,{href:"/".concat(k,"/campuses/").concat(P),className:"".concat(d.schoolName," cursor-pointer hover:underline"),onClick:e=>e.stopPropagation(),children:L}):(0,r.jsx)("span",{className:d.schoolName,children:L})]})]}),(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("div",{className:d.startingFromRow,children:(0,r.jsx)("span",{className:d.startingFrom,children:E("startingFrom")})}),null!==O&&null!==V&&O>V&&null!==O&&(0,r.jsx)("div",{className:d.oldPrice,children:g(G.convertedAmount,z)}),null!==V&&(0,r.jsx)("div",{className:d.newPrice,children:g(Q.convertedAmount,z)})]})]})]})}let v=e=>{var t,n,u;let{hideHeader:m=!1,limit:x=4,sectionClassName:h,gridClassName:p,hasDiscount:f,maximumPrice:g,campusIds:v,cityIds:w,countryIds:j}=e,y=(0,o.useTranslations)("home.bestSellers"),N=(0,o.useLocale)(),C=null!=f&&"any"!==f||null!=g||(null!==(t=null==v?void 0:v.length)&&void 0!==t?t:0)>0||(null!==(n=null==w?void 0:w.length)&&void 0!==n?n:0)>0||(null!==(u=null==j?void 0:j.length)&&void 0!==u?u:0)>0,{data:k,isLoading:W}=(0,i.useQuery)({queryKey:C?["courses-filtered",f,g,v,w,j,x]:["courses-best-sellers",x],queryFn:()=>C?c.tB.getBlogCourses(x,f,g,v,w,j):c.tB.getBestSellers(x),staleTime:3e5}),S=(null==k?void 0:k.slice(0,x))||[],E=[...new Set(S.map(e=>{var t;return null===(t=e.campus)||void 0===t?void 0:t.id}).filter(e=>!!e))],A=(0,a.useQueries)({queries:E.map(e=>({queryKey:["campus",e],queryFn:()=>c._f.getCampusById(e),staleTime:3e5,enabled:!!e}))}),F=new Map;A.forEach((e,t)=>{if(e.data){var n,r;F.set(E[t],{schoolId:e.data.schoolId||(null===(n=e.data.school)||void 0===n?void 0:n.id),schoolName:null===(r=e.data.school)||void 0===r?void 0:r.name})}});let M=W||A.some(e=>e.isLoading),D=new URLSearchParams;return(C?(null!=f&&"any"!==f&&D.set("hasDiscount",("yes"===f).toString()),null!=g&&D.set("maxPrice",g.toString()),w&&w.length>0&&D.set("cityIds",w.join(",")),j&&j.length>0&&D.set("countryIds",null==j?void 0:j.join(","))):D.set("bestSeller","true"),M)?(0,r.jsxs)("section",{className:(0,l.cn)(d.section,h),children:[!m&&(0,r.jsxs)("div",{className:d.header,children:[(0,r.jsx)("h2",{className:d.title,children:y("title")}),(0,r.jsx)(s.default,{href:"/".concat(N,"/search-result?").concat(D.toString()),className:d.moreLink,children:y("allCourses")})]}),(0,r.jsx)("div",{className:(0,l.cn)(d.grid,p),children:[1,2,3,4].slice(0,x).map(e=>(0,r.jsxs)("div",{className:d.card,children:[(0,r.jsx)("div",{className:d.imageWrapper,children:(0,r.jsx)("div",{className:"h-full w-full animate-pulse bg-gray-200"})}),(0,r.jsxs)("div",{className:d.cardBody,children:[(0,r.jsx)("div",{className:"mb-2 h-4 animate-pulse rounded bg-gray-200"}),(0,r.jsx)("div",{className:"h-3 w-2/3 animate-pulse rounded bg-gray-200"})]})]},e))})]}):(0,r.jsxs)("section",{className:(0,l.cn)(d.section,h),children:[!m&&(0,r.jsxs)("div",{className:d.header,children:[(0,r.jsx)("h2",{className:d.title,children:y("title")}),(0,r.jsx)(s.default,{href:"/".concat(N,"/search-result?").concat(D.toString()),className:d.moreLink,children:y("allCourses")})]}),(0,r.jsx)("div",{className:(0,l.cn)(d.grid,p),children:S.length?S.map(e=>{var t,n,s;let l=null===(t=e.campus)||void 0===t?void 0:t.id,i=l?F.get(l):void 0,a=null==i?void 0:i.schoolId,o=(null==i?void 0:i.schoolName)||(null===(s=e.campus)||void 0===s?void 0:null===(n=s.school)||void 0===n?void 0:n.name)||"";return(0,r.jsx)(b,{course:e,locale:N,schoolId:a,schoolName:o},e.id)}):y("notFound")})]})}},31689:function(e,t,n){"use strict";n.d(t,{FAQSection:function(){return m}});var r=n(57437),s=n(94508),l=n(2265),i=n(33145),a=n(42586),o=n(48614),c=n(40521);let d={section:"pb-[48px] pt-[48px]",header:(0,s.cn)("mb-[40px]"),title:(0,s.cn)("text-[34px] font-semibold leading-[130%] text-[#383838]"),seeAllWrapper:(0,s.cn)("mt-[40px]"),seeAllLink:(0,s.cn)("cursor-pointer text-[24px] font-semibold leading-[130%] text-[#D50F64] hover:underline"),faqList:(0,s.cn)("flex flex-col gap-[24px]"),faqItem:(0,s.cn)("flex flex-col self-stretch rounded-[5px] border border-[#
1EDEDED] bg-[#EDEDED] p-[14px]","items-start gap-[7px]","xl:gap-[19px]"),questionButton:(0,s.cn)("flex w-full items-start justify-between gap-[11px]","cursor-pointer text-left","outline-none focus:outline-none focus-visible:outline-none","ring-0 focus:ring-0 focus-visible:ring-0","border-0 bg-transparent p-0","appearance-none"),questionText:(0,s.cn)("flex-1 text-[18px] font-semibold leading-[150%] text-[#403A3A]"),icon:e=>(0,s.cn)("h-6 w-6 flex-shrink-0 transition-transform duration-300",!e&&"rotate-180"),answerWrapper:(0,s.cn)("w-full"),answer:(0,s.cn)("flex w-full flex-col"),answerContent:(0,s.cn)("text-[16px] font-normal leading-[150%] text-[#403A3A]","whitespace-pre-line")},u=[{id:1,questionKey:"question1",answerKey:"answer1"},{id:2,questionKey:"question2",answerKey:"answer2"},{id:3,questionKey:"question3",answerKey:"answer3"},{id:4,questionKey:"question4",answerKey:"answer4"},{id:5,questionKey:"question5",answerKey:"answer5"}],m=e=>{let{className:t}=e,n=(0,a.useTranslations)("home.faq"),[m,x]=(0,l.useState)([1]),h=e=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,r.jsx)("section",{className:(0,s.cn)(d.section,t),children:(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[1140px]",children:[(0,r.jsx)("div",{className:d.header,children:(0,r.jsx)("h2",{className:d.title,children:n("title")})}),(0,r.jsx)("div",{className:d.faqList,children:u.map(e=>{let t=m.includes(e.id);return(0,r.jsxs)("div",{className:d.faqItem,children:[(0,r.jsxs)("button",{onClick:()=>h(e.id),className:d.questionButton,children:[(0,r.jsx)("span",{className:d.questionText,children:n(e.questionKey)}),(0,r.jsx)(i.default,{src:"/collapsible.svg",alt:t?"Close":"Open",width:24,height:24,className:d.icon(t)})]}),(0,r.jsx)(o.M,{children:t&&(0,r.jsx)(c.E.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:"easeInOut"},style:{overflow:"hidden"},className:d.answerWrapper,children:(0,r.jsx)("div",{className:d.answer,children:(0,r.jsx)("div",{className:d.answerContent,children:n(e.answerKey)})})})})]},e.id)})})]})})}},82568:function(e,t,n){"use strict";n.d(t,{HeroSection:function(){return Y}});var r=n(57437),s=n(54544),l=n(61135),i=n(33145),a=n(94508);let o={image:(0,a.cn)("absolute inset-0 object-cover")},c=()=>(0,r.jsx)(i.default,{className:o.image,src:"/home/hero-bg.jpg",alt:"Students abroad",fetchPriority:"high",priority:!0,fill:!0});var d=n(2265),u=n(71632),m=n(99376),x=n(42586),h=n(9270),p=n(20653),f=n(71154),g=n(57564),b=n(20249),v=n(54426),w=n(83777),j=n(25843),y=n(82460),N=n(32628),C=n(51777),k=n(89292);let W=e=>{let{label:t,placeholder:n,searchPlaceholder:s,emptyLabel:l,citiesGroupLabel:o,schoolsGroupLabel:c,countries:u,value:m,onChange:x,countryPrefix:h="country:",cityPrefix:f="city:",schoolPrefix:g="school:",icon:b}=e,[v,w]=(0,d.useState)(!1),[j,y]=(0,d.useState)(""),[N,W]=(0,d.useState)({}),S=(0,d.useMemo)(()=>{let e=j.trim().toLowerCase();return e?u.map(t=>{let n=t.label.toLowerCase().includes(e),r=t.cities.filter(t=>t.label.toLowerCase().includes(e)),s=t.schools.filter(t=>t.label.toLowerCase().includes(e));return n?t:r.length||s.length?{...t,cities:r,schools:s}:null}).filter(Boolean):u},[u,j]),E=(0,d.useMemo)(()=>{let e=[];return S.forEach(t=>{t.schools.forEach(n=>{e.push({id:n.id,label:n.label,countryLabel:t.label})})}),e.sort((e,t)=>e.label.localeCompare(t.label))},[S]),A=(0,d.useMemo)(()=>{let e=new Map;return u.forEach(t=>{e.set("".concat(h).concat(t.id),t.label),t.cities.forEach(n=>{e.set("".concat(f).concat(n.id),"".concat(n.label,", ").concat(t.label))}),t.schools.forEach(n=>{e.set("".concat(g).concat(n.id),"".concat(n.label,", ").concat(t.label))})}),e},[u,h,f,g]),F=m.map(e=>A.get(e)).filter(Boolean).join(", "),M=e=>{W(t=>({...t,[e]:!t[e]}))},D=e=>{x(m.includes(e)?m.filter(t=>t!==e):[...m,e]),w(!1),y("")},P=e=>{if(j.trim()){let t=S.find(t=>t.id===e),n=j.trim().toLowerCase();if(t&&!t.label.toLowerCase().includes(n))return!0}return!!N[e]};return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:k.W.label,children:t}),(0,r.jsxs)(C.fC,{open:v,onOpenChange:e=>{w(e),e||y("")},children:[(0,r.jsx)(C.xz,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:k.W.button(!F),children:[b,F||n,(0,r.jsx)(i.default,{src:"/chevronDown.svg",alt:"",width:10,height:10,className:k.W.icon})]})}),(0,r.jsx)(C.h_,{children:(0,r.jsxs)(C.VY,{side:"bottom",align:"start",sideOffset:8,className:k.W.popoverContent,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,r.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),placeholder:s,className:k.W.searchInput,autoFocus:!0,"aria-label":s}),(0,r.jsxs)("div",{className:k.W.optionsList,children:[0===S.length?(0,r.jsx)("p",{className:"px-2 py-3 text-[14px] text-[#878787]",children:l}):S.map(e=>{let t="".concat(h).concat(e.id),n=m.includes(t),s=P(e.id),l=e.cities.length>0;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex w-full items-center gap-1",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>D(t),className:(0,a.cn)(k.W.option,"flex-1"),children:[e.image&&(0,r.jsx)(i.default,{src:e.image,width:20,height:20,alt:e.label,className:"rounded-full object-cover"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:e.label}),(0,r.jsx)("span",{className:k.W.checkmark(n)})]}),l&&(0,r.jsx)("button",{type:"button","aria-expanded":s,"aria-label":e.label,onClick:()=>M(e.id),className:"flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-md text-[#606060] hover:bg-[#
1E5E7EB]",children:(0,r.jsx)(p.v4q,{className:(0,a.cn)("h-4 w-4 transition-transform",s&&"rotate-180")})})]}),l&&s&&(0,r.jsxs)("div",{className:"ml-6 border-l border-[#EDEDED] pl-2",children:[(0,r.jsx)("div",{className:"px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-[#878787]",children:o}),e.cities.map(e=>{let t="".concat(f).concat(e.id),n=m.includes(t);return(0,r.jsxs)("button",{type:"button",onClick:()=>D(t),className:k.W.option,children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:e.label}),(0,r.jsx)("span",{className:k.W.checkmark(n)})]},e.id)})]})]},e.id)}),E.length>0&&(0,r.jsxs)("div",{className:"mt-1 border-t border-[#EDEDED] pt-1",children:[(0,r.jsx)("div",{className:"px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-[#878787]",children:c}),E.map(e=>{let t="".concat(g).concat(e.id),n=m.includes(t);return(0,r.jsxs)("button",{type:"button",onClick:()=>D(t),className:k.W.option,children:[(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate text-left",children:[e.label,(0,r.jsx)("span",{className:"text-[#878787]",children:", ".concat(e.countryLabel)})]}),(0,r.jsx)("span",{className:k.W.checkmark(n)})]},e.id)})]})]})]})})]})]})};var S=n(72969),E=n(40999),A=n(39845);let F={button:e=>(0,a.cn)("cursor-pointer rounded-xl bg-black/10 p-[1px] transition-colors",e&&"bg-gradient-to-r from-[#F27138] to-[#EE5395]"),buttonInner:e=>(0,a.cn)("flex items-center justify-center gap-2 rounded-xl bg-white px-3 py-2 text-[12px] leading-[1.3em] text-[#606060] transition-colors whitespace-nowrap",e&&"bg-gradient-to-r from-[#F27138] to-[#EE5395] font-semibold text-white"),iconWrapper:(0,a.cn)("flex h-6 w-6 items-center justify-center")},M=e=>(0,r.jsx)("button",{type:"button",className:F.button(e.isActive),onClick:e.onClick,children:(0,r.jsxs)("div",{className:F.buttonInner(e.isActive),children:[(0,r.jsx)("div",{className:F.iconWrapper,children:e.icon}),e.text]})});var D=n(3520);let P={button:(0,a.cn)("flex-1 cursor-pointer rounded-md py-3 text-[18px] font-semibold text-white",D.J)},L=()=>{let{t:e}=(0,s.j1)("common");return(0,r.jsx)("button",{className:P.button,children:e("search")})};var T=n(65713);let I={form:(0,a.cn)("rounded-xl bg-white p-4","md:p-8"),programTypes:(0,a.cn)("grid grid-cols-2 gap-2 md:flex md:flex-wrap md:items-start md:gap-3"),collapse:e=>(0,a.cn)("grid transition-[grid-template-rows] duration-300 ease-in-out",e?"grid-rows-[1fr]":"grid-rows-[0fr]"),collapseInner:(0,a.cn)("min-h-0 overflow-hidden"),workAllowedRow:(0,a.cn)("mt-3 flex items-center rounded-xl border border-[#F27138]/40 bg-[#FFF4ED] px-4 py-3.5"),workAllowedLabel:(0,a.cn)("flex w-full cursor-pointer items-center gap-3 text-[#101010]"),workAllowedCheckbox:(0,a.cn)("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 border-[#F27138]","data-[state=checked]:border-[#F27138] data-[state=checked]:bg-[#F27138]"),workAllowedIcon:(0,a.cn)("flex h-5 w-5 shrink-0 items-center justify-center text-[#F27138]"),workAllowedText:(0,a.cn)("flex min-w-0 flex-col gap-0.5"),workAllowedTitle:(0,a.cn)("text-[14px] font-semibold leading-snug text-[#101010]"),workAllowedSubtitle:(0,a.cn)("text-[13px] font-normal leading-snug text-[#878787]"),workNoteWrap:(0,a.cn)("mt-3 mb-1"),bannersBlock:(0,a.cn)("mb-4 flex flex-col gap-2"),fieldsWrapper:e=>(0,a.cn)("my-4 grid grid-cols-2 gap-x-2 gap-y-4","md:gap-6",e?"xl:grid-cols-5":"xl:grid-cols-4"),formButtons:(0,a.cn)("flex gap-2","md:gap-4"),dateField:(0,a.cn)("relative"),dateError:(0,a.cn)("text-[11px] absolute bottom-0 translate-y-full text-red-600")},B="country:",_="city:",R="school:",q=e=>{let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)},H=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),K=e=>{let t=H(new Date(e)),n=t.getDay();return t.setDate(t.getDate()+(1-n+7)%7),t},O=e=>"BRL"===e?75e3:1e4,V=["vocational","undergraduate","postgraduate","languagePathway"],Z=()=>{let e=(0,m.useRouter)(),t=(0,x.useLocale)(),n=(0,E.u)(e=>e.selectedCurrency),{t:l}=(0,s.j1)("common"),{t:i}=(0,s.j1)("campus"),a=(0,x.useTranslations)("validations"),{t:o}=(0,s.j1)("courseTypes"),c=(0,x.useTranslations)("homeSearch"),[C,k]=(0,d.useState)("short"),[F,D]=(0,d.useState)(!1),[P,Z]=(0,d.useState)([]),[U,Y]=(0,d.useState)([]),[G,Q]=(0,d.useState)(1),[z,J]=(0,d.useState)({short:null,long:null}),[X,$]=(0,d.useState)(null),[ee,et]=(0,d.useState)({}),[en,er]=(0,d.useState)(!1),[es,el]=(0,d.useState)(!1),{data:ei}=(0,u.useQuery)({queryKey:["countries"],queryFn:()=>f.sR.getAllCountries()}),{data:ea}=(0,u.useQuery)({queryKey:["cities-all"],queryFn:()=>f.GI.getAllCities(200)}),{data:eo}=(0,u.useQuery)({queryKey:["schools-all-search"],queryFn:()=>f.df.searchSchools({limit:500,sortBy:"name",sortDirection:"asc"})}),ec="long"===C&&F,ed=(0,d.useMemo)(()=>{var e;if(!ei)return[];let n=null!==(e=null==eo?void 0:eo.data)&&void 0!==e?e:[];return(ec?ei.filter(e=>!0===e.studyWorkAvailable):ei).map(e=>{var r;let s="en"===t&&e.engName||e.name,l=(null!=ea?ea:[]).filter(t=>{var n;return(null===(n=t.country)||void 0===n?void 0:n.id)===e.id}).map(e=>({id:e.id,label:"en"===t&&e.engName||e.name})),i=n.filter(t=>t.countryId===e.id).map(e=>({id:e.id,label:e.name}));return{id:e.id,label:s,image:null!==(r=e.image)&&void 0!==r?r:null,cities:l,schools:i}})},[ei,ea,null==eo?void 0:eo.data,t,ec]),eu=(0,d.useMemo)(()=>S.J.filter(e=>"workAndStudy"!==e&&"holidayAndStudy"!==e).map(e=>({value:e,label:o(e),image:null})),[o]),em=e=>{k(e),"short"===e?(D(!1),er(!1),Q(e=>(0,A.aM)("short",e))):Q(e=>(0,A.aM)("long",e))},ex=(0,d.useMemo)(()=>U.filter(e=>e.startsWith(B)).map(e=>e.slice(B.length)),[U]),eh=(0,d.useMemo)(()=>U.filter(e=>e.startsWith(_)).map(e=>e.slice(_.length)),[U]),ep=(0,d.useMemo)(()=>(0,A.dw)({countryIds:ex,cityIds:eh,countries:ei,cities:ea}),[ex,eh,ei,ea]),ef=(0,A.VE)(ep),eg=F?Math.max(G,ef):G,eb=ep.hasMalta,ev=(0,d.useMemo)(()=>(0,w.v2)(eb?"malta":null,eg,new Date),[eb,eg]),ew=(0,d.useMemo)(()=>{let e=z[C];return!e||H(e)<ev?K(ev):e},[z,C,ev]);(0,d.useEffect)(()=>{J(e=>{let t=e[C];return!t||H(t)<ev?{...e,[C]:K(ev)}:e})},[C,ev]),(0,d.useEffect)(()=>{F&&"long"===C&&Q(e=>e<ef?ef:e)},[F,C,ef]);let ej=(0,d.useMemo)(()=>(0,A.jA)(C,G,{workAllowed:F,workDestination:ep}).filter(e=>!ee[e]),[C,G,ee,F,ep]),ey="long"===C&&F&&!en,eN=(0,d.useMemo)(()=>(0,A.Tq)(ei,["malta"]),[ei]),eC=(0,d.useMemo)(()=>(0,A.Tq)(ei,["ireland","irlanda"]),[ei]),ek={bold:T.M};return(0,r.jsxs)("form",{className:I.form,onSubmit:r=>{if(r.preventDefault(),$(null),!ew){$(a("required"));return}let s=new URLSearchParams;s.set("termType",C),s.set("workAllowed",F?"true":"false");let l=(0,A.aM)(C,G);s.set("duration",String(l));let i=[];
1P.map(S._).forEach(e=>{"higherEducation"===e?i.push(...V):i.push(e)}),F&&"long"===C&&i.push("workAndStudy");let o=Array.from(new Set(i.filter(e=>"holidayAndStudy"!==e&&("long"===C||"workAndStudy"!==e))));o.length&&s.set("programTypes",o.join(","));let c=U.filter(e=>e.startsWith(B)).map(e=>e.slice(B.length)),d=U.filter(e=>e.startsWith(_)).map(e=>e.slice(_.length)),u=U.filter(e=>e.startsWith(R)).map(e=>e.slice(R.length)),m=(0,A.Xl)({explicitCountryIds:c,cityIds:d,schoolIds:u,cities:ea,schools:null==eo?void 0:eo.data});m.length&&s.set("countryIds",m.join(",")),d.length&&s.set("cityIds",[...d].sort().join(",")),u.length&&s.set("schoolIds",[...u].sort().join(",")),s.set("startDateFrom",q(ew)),s.set("minPrice","1"),s.set("maxPrice",String(O(n))),e.push("/".concat(t,"/search-result?").concat(s.toString()))},children:[(0,r.jsxs)("div",{className:I.programTypes,children:[(0,r.jsx)(M,{text:c("shortTerm"),icon:(0,r.jsx)(v.b,{}),isActive:"short"===C,onClick:()=>em("short")}),(0,r.jsx)(M,{text:c("longTerm"),icon:(0,r.jsx)(g.V,{}),isActive:"long"===C,onClick:()=>em("long")})]}),(0,r.jsx)("div",{className:I.collapse("long"===C),"aria-hidden":"long"!==C,children:(0,r.jsx)("div",{className:I.collapseInner,children:(0,r.jsx)("div",{className:I.workAllowedRow,children:(0,r.jsxs)("label",{className:I.workAllowedLabel,children:[(0,r.jsx)(h.fC,{checked:F,disabled:"long"!==C,onCheckedChange:e=>{let t=!0===e;if(D(t),t){er(!1),Q(e=>Math.max((0,A.aM)("long",e),(0,A.VE)(ep)));let{values:e,removed:t}=(0,A.Ej)(U,{countries:ei,cities:ea,schools:null==eo?void 0:eo.data,countryPrefix:B,cityPrefix:_,schoolPrefix:R});t&&(Y(e),el(!0))}else el(!1)},className:I.workAllowedCheckbox,children:(0,r.jsx)(h.z$,{children:(0,r.jsx)(p.nQG,{className:"h-3.5 w-3.5 text-white"})})}),(0,r.jsx)("span",{className:I.workAllowedIcon,"aria-hidden":!0,children:(0,r.jsx)(g.V,{})}),(0,r.jsx)("span",{className:I.workAllowedText,children:(0,r.jsx)("span",{className:I.workAllowedTitle,children:c("workAllowed")})})]})})})}),(0,r.jsx)("div",{className:I.collapse(ey),children:(0,r.jsx)("div",{className:I.collapseInner,children:(0,r.jsx)("div",{className:I.workNoteWrap,children:(0,r.jsx)(T.k,{dismissLabel:c("dismiss"),onDismiss:()=>er(!0),children:c.rich("workAllowedNote",ek)})})})}),(0,r.jsx)("div",{className:I.collapse(es),children:(0,r.jsx)("div",{className:I.collapseInner,children:(0,r.jsx)("div",{className:I.workNoteWrap,children:(0,r.jsx)(T.k,{dismissLabel:c("dismiss"),onDismiss:()=>el(!1),children:c("destinationClearedForWork")})})})}),(0,r.jsxs)("div",{className:I.fieldsWrapper(!1),children:[(0,r.jsx)(W,{label:l("destinationOrSchool"),placeholder:c("destinationPlaceholder"),searchPlaceholder:l("search"),emptyLabel:c("noMatches"),citiesGroupLabel:c("citiesGroup"),schoolsGroupLabel:c("schoolsGroup"),countries:ed,value:U,onChange:Y,countryPrefix:B,cityPrefix:_,schoolPrefix:R,icon:(0,r.jsx)(b.s,{})}),(0,r.jsx)(j.N,{label:o("label"),placeholder:o("placeholder"),options:eu,value:P,onChange:Z,filterable:!1}),(0,r.jsxs)("div",{className:I.dateField,children:[(0,r.jsx)(N.M,{label:i("startDate"),placeholder:"DD/MM/AAAA",value:ew,onChange:e=>{J(t=>({...t,[C]:e})),$(null)},range:{navigationClamp:"min",minDate:ev},disableDate:e=>1!==e.getDay(),excludeAdjacentMonths:!0,locale:t}),X&&(0,r.jsx)("p",{className:I.dateError,children:X})]}),(0,r.jsx)(y.F,{label:i("duration"),prefixLabel:i("weeks"),value:G,onChange:e=>Q((0,A.aM)(C,e)),min:"short"===C?1:13,max:"short"===C?12:99,disabled:F})]}),(0,r.jsx)("div",{className:I.collapse(ej.length>0),children:(0,r.jsx)("div",{className:I.collapseInner,children:(0,r.jsx)("div",{className:I.bannersBlock,children:ej.map(e=>(0,r.jsxs)(T.k,{dismissLabel:c("dismiss"),flagUrl:"maltaWork"===e?eN:"irelandWork"===e?eC:null,flagAlt:"maltaWork"===e?"Malta":"irelandWork"===e?"Ireland":"",onDismiss:()=>et(t=>({...t,[e]:!0})),children:["shortNearMax"===e&&c("hintShortNearMax"),"maltaWork"===e&&c.rich("hintMaltaWork",ek),"irelandWork"===e&&c.rich("hintIrelandWork",ek)]},e))})})}),(0,r.jsx)("div",{className:I.formButtons,children:(0,r.jsx)(L,{})})]})},U={section:(0,a.cn)("relative py-6","md:py-12"),content:(0,a.cn)("relative","max-w-[1140px]","mx-auto"),title:(0,a.cn)("text-center text-[28px] md:text-[56px] font-bold leading-[1.1em] -tracking-[0.02em] text-white"),subtitle:(0,a.cn)("mb-8 mt-6 text-center text-[14px] xl:text-[24px] text-white")},Y=()=>{let{tRich:e,t}=(0,s.j1)("home.hero");return(0,r.jsxs)("section",{className:U.section,children:[(0,r.jsx)(c,{}),(0,r.jsx)(l.PageContentContainer,{children:(0,r.jsxs)("div",{className:U.content,children:[(0,r.jsx)("h1",{className:U.title,children:e("title")}),(0,r.jsx)("p",{className:U.subtitle,children:t("subtitle")}),(0,r.jsx)(Z,{})]})})]})}},65713:function(e,t,n){"use strict";n.d(t,{M:function(){return o},k:function(){return a}});var r=n(57437),s=n(33145),l=n(20653),i=n(94508);function a(e){let{children:t,onDismiss:n,dismissLabel:a,flagUrl:o,flagAlt:c="",className:d}=e;return(0,r.jsxs)("div",{className:(0,i.cn)("flex items-center gap-2 rounded-xl border border-[#F27138]/40 bg-[#FFF5F0] px-3 py-2.5",d),role:"status",children:[(0,r.jsx)(l.H4u,{className:"h-4 w-4 shrink-0 text-[#F27138]"}),o?(0,r.jsx)(s.default,{src:o,alt:c,width:16,height:16,className:"h-4 w-4 shrink-0 rounded-full object-cover"}):null,(0,r.jsx)("p",{className:"flex-1 text-[13px] leading-snug text-[#101010]",children:t}),(0,r.jsx)("button",{type:"button",className:"shrink-0 rounded p-1 text-[#606060] hover:bg-black/5","aria-label":a,onClick:n,children:(0,r.jsx)(l.Pxu,{})})]})}let o=e=>(0,r.jsx)("strong",{className:"font-semibold",children:e})},2039:function(e,t,n){"use strict";n.d(t,{HomeWelcomePromo:function(){return P}});var r,s=n(57437),l=n(2265),i=n(99376),a=n(99967),o=n(87301);let c=["en","pt"];(0,o.cF)(async e=>{let{requestLocale:t}=e,r=await t;null==r||c.includes(r)||(0,i.notFound)();let s=r&&c.includes(r)?r:"en";return{locale:s,messages:(await n(37715)("./".concat(s,".json"))).default}});var d=n(40257);let u="tripwai_home_welcome_banner_dismissed",m="tripwai_home_welcome_modal_session",x=void 0!==d&&(null===(r=d.env.NEXT_PUBLIC_WELCOME_PROMO_CODE)||void 0===r?void 0:r.trim())||"TRIPWELCOME";var h=n(33145),p=n(20653),f=n(42586),g=n(94508),b=n(41973),v=n(3520);let w=(0,l.forwardRef)(function(e,t){let{onDismiss:n,onCreateAccount:r}=e,l=(0,f.useTranslations)("homeWelcome");return(0,s.jsx)("div",{ref:t,role:"region","aria-label":l("bannerLead"),className:(0,g.cn)("fixed left-0 right-0 top-0 z-[80] border-b border-white/10","bg-[#071231] text-white shadow-[0_4px_24px_rgba(0,0,0,0.12)]"),children:(0,s.jsx)("div",{className:"mx-auto w-full px-6 md:px-16",style:{maxWidth:"".concat(b.D.CONTENT,"px")},children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-[1140px] flex-wrap items-center gap-2 py-2.5 md:flex-nowrap md:gap-4 md:py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-[1_1_200px] items-center gap-2 md:flex-1 md:gap-3",children:[(0,s.jsx)("div",{className:(0,g.cn)("hidden h-9 w-9 shrink-0 items-center justify-center rounded-lg sm:flex",v.J),"aria-hidden":!0,
1children:(0,s.jsx)(h.default,{src:"/Vector%20(4).svg",alt:"",width:20,height:20,unoptimized:!0})}),(0,s.jsxs)("p",{className:"min-w-0 text-xs leading-snug text-white/95 md:text-sm md:leading-tight",children:[(0,s.jsx)("span",{className:"font-semibold",children:l("bannerLead")})," ",(0,s.jsx)("span",{className:"font-normal",children:l("bannerBody")})]})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 md:gap-3",children:[(0,s.jsx)("span",{className:(0,g.cn)("inline-flex shrink-0 rounded-md border border-dashed border-white px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-[#F27138]","md:text-xs"),children:"WELCOME"}),(0,s.jsx)("button",{type:"button",onClick:r,className:(0,g.cn)("cursor-pointer whitespace-nowrap rounded-full px-3 py-2 text-xs font-semibold text-white","shadow-sm transition-opacity hover:opacity-95 active:opacity-90 md:px-4 md:text-sm",v.J),children:l("createFreeAccount")}),(0,s.jsx)("button",{type:"button",onClick:n,className:"flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-lg text-white/80 transition-colors hover:bg-white/10 hover:text-white","aria-label":l("dismissBanner"),children:(0,s.jsx)(p.Pxu,{className:"h-4 w-4"})})]})]})})})});var j=n(70001),y=n(27648),N=n(29827),C=n(78867),k=n(69064),W=n(22085),S=n(59852),E=n(46467),A=n(84211),F=n(38774);let M=(0,g.cn)("inline-flex min-h-[45px] w-full cursor-pointer items-center justify-center gap-3 rounded-full border border-[#DDE1E8] bg-white px-6 py-3 text-sm font-semibold text-[#1B2232] transition-colors","hover:bg-[#FAFBFC] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60");function D(e){let{open:t,onOpenChange:n,onAuthenticatedSuccess:r}=e,i=(0,f.useTranslations)("homeWelcome"),a=(0,f.useTranslations)("auth"),o=(0,f.useLocale)(),c=(0,N.useQueryClient)(),d=(0,E.T)(),[u,m]=(0,l.useState)("promo"),[b,w]=(0,l.useState)(null),D=(0,l.useRef)(null),P=(0,l.useRef)(null);P.current=b,(0,l.useEffect)(()=>{if(!t){w(null),D.current&&(clearTimeout(D.current),D.current=null);return}let e=()=>{P.current&&(D.current&&clearTimeout(D.current),D.current=window.setTimeout(()=>{D.current=null,w(e=>e?null:e)},1200))},n=()=>e(),r=()=>{"visible"===document.visibilityState&&e()};return window.addEventListener("focus",n),document.addEventListener("visibilitychange",r),()=>{window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",r),D.current&&(clearTimeout(D.current),D.current=null)}},[t]),(0,l.useEffect)(()=>{t||m("promo")},[t]);let L=(0,l.useCallback)(e=>{n(e),e||m("promo")},[n]),T=(0,l.useCallback)(()=>{r(),L(!1),d()},[L,d,r]),I=(0,l.useCallback)(async()=>{try{await navigator.clipboard.writeText(x),k.ZP.success(i("codeCopied"))}catch(e){k.ZP.error(i("codeCopyFailed"))}},[i]),B=(0,l.useCallback)(async e=>{w(e);try{let n="google"===e?await W.u.signInWithGoogle():await W.u.signInWithFacebook();if(!n.success){var t;k.ZP.error(null!==(t=n.error)&&void 0!==t?t:i("socialError"));return}c.removeQueries({queryKey:["user-me"]}),T()}finally{w(null)}},[T,c,i]);return(0,s.jsx)(j.fC,{open:t,onOpenChange:L,children:(0,s.jsxs)(j.h_,{children:[(0,s.jsx)(j.aV,{className:(0,g.cn)("fixed bottom-0 left-0 right-0 top-[var(--home-welcome-banner-height,0px)] z-[110]","animate-in fade-in-0 duration-200","bg-primary/70 backdrop-blur-md")}),(0,s.jsxs)(j.VY,{className:(0,g.cn)("fixed left-1/2 top-1/2 z-[111] flex max-h-[90vh] w-[calc(100vw-2rem)] max-w-[520px] -translate-x-1/2 -translate-y-1/2 flex-col","overflow-hidden rounded-2xl border border-[#E8EAED] bg-white text-[#162D5A] shadow-[0_20px_50px_rgba(22,45,90,0.12)]","animate-in fade-in-0 zoom-in-95 duration-200 focus:outline-none"),children:[(0,s.jsx)(j.x8,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:(0,g.cn)("absolute right-4 top-4 z-10 flex h-9 w-9 cursor-pointer items-center justify-center rounded-full","bg-[#F0F2F4] text-[#676F7E] transition-colors hover:bg-[#E4E7EA] hover:text-[#162D5A]"),"aria-label":a("authRequired.cancelButton"),children:(0,s.jsx)(p.Pxu,{className:"h-4 w-4"})})}),"promo"===u?(0,s.jsxs)("div",{className:"relative px-6 py-8 text-center md:px-8 md:py-10",children:[(0,s.jsx)(j.Dx,{asChild:!0,children:(0,s.jsx)("h2",{className:"mb-3 pr-11 text-2xl font-bold leading-tight text-[#162D5A] md:text-3xl",children:i.rich("modalTitle",{discount:e=>(0,s.jsx)("span",{className:"text-[#F97A1F]",children:e})})})}),(0,s.jsx)(j.dk,{asChild:!0,children:(0,s.jsx)("p",{className:(0,g.cn)("mx-auto mb-6 max-w-[460px] text-pretty text-[15px] leading-snug text-[#676F7E]","sm:text-[15px] sm:leading-snug md:max-w-[480px] md:text-base md:leading-relaxed"),children:i("modalSubtitle")})}),(0,s.jsx)("div",{className:"mb-6 flex justify-center",children:(0,s.jsxs)("button",{type:"button",onClick:I,className:(0,g.cn)("group inline-flex cursor-pointer items-center justify-center gap-3 rounded-xl bg-[#F0F2F4] px-5 py-3 transition-colors","hover:bg-[#
1E4E7EA]/90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#162D5A]"),"aria-label":i("copyCode"),children:[(0,s.jsx)("span",{className:"font-mono text-base font-bold tracking-[0.15em] text-[#162D5A] md:text-lg",children:x}),(0,s.jsx)(C.Z,{className:"text-muted-foreground group-hover:text-primary h-4 w-4 shrink-0 transition-colors","aria-hidden":!0})]})}),(0,s.jsx)("button",{type:"button",onClick:()=>m("signup"),className:(0,g.cn)("inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-full px-6 py-3 text-sm font-semibold text-white shadow-sm transition-opacity",v.J,"hover:opacity-95"),children:i("createMyAccount")}),(0,s.jsxs)("div",{className:"relative my-6 flex items-center justify-center",children:[(0,s.jsx)("div",{className:"h-px w-full bg-[#E2E4EA]"}),(0,s.jsx)("span",{className:"absolute bg-white px-3 text-xs font-medium text-[#9CA0AA]",children:i("or")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>B("google"),disabled:!!b,className:M,children:[(0,s.jsx)(h.default,{src:"/Google.svg",alt:"",width:22,height:20}),a("continueWithGoogle")]}),(0,s.jsxs)("button",{type:"button",onClick:()=>B("facebook"),disabled:!!b,className:M,children:[(0,s.jsx)(h.default,{src:"/Facebook.svg",alt:"",width:22,height:20}),a("continueWithFacebook")]})]}),(0,s.jsx)("p",{className:"mt-6 text-center text-[11px] leading-relaxed text-[#676F7E] md:text-xs",children:i.rich("termsFooter",{terms:e=>(0,s.jsx)(y.default,{href:(0,A.yF)(o,F.Z6.TERMS),className:"cursor-pointer text-[#162D5A] underline underline-offset-2 transition-opacity hover:opacity-75",target:"_blank",rel:"noopener noreferrer",children:e}),privacy:e=>(0,s.jsx)(y.default,{href:(0,A.yF)(o,F.Z6.PRIVACY_POLICY),className:"cursor-pointer text-[#162D5A] underline underline-offset-2 transition-opacity hover:opacity-75",target:"_blank",rel:"noopener noreferrer",children:e})})})]}):(0,s.jsxs)("div",{className:"max-h-[min(85vh,720px)] overflow-y-auto px-4 py-6 md:px-6",children:[(0,s.jsx)(j.Dx,{className:"sr-only",children:a("startYourTrip")}),(0,s.jsx)(S.W,{onSuccess:T,initialSlide:"signup"})]})]})]})})}function P(){let e=(0,i.usePathname)(),{isAuthenticated:t,initialized:n}=(0,a.a)(),[r,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(!1),[h,p]=(0,l.useState)(!1),f=(0,l.useRef)(null),g=!!e&&new RegExp("^\\/(".concat(c.join("|"),")\\/?$")).test(e);(0,l.useEffect)(()=>{o(!0)},[]),(0,l.useEffect)(()=>{r&&x("1"===localStorage.getItem(u))},[r]);let b=r&&n&&g&&!t&&!d;(0,l.useLayoutEffect)(()=>{if(!b||!f.current){document.documentElement.style.removeProperty("--home-welcome-banner-height");return}let e=f.current,t=()=>{document.documentElement.style.setProperty("--home-welcome-banner-height","".concat(e.offsetHeight,"px"))};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect(),document.documentElement.style.removeProperty("--home-welcome-banner-height")}},[b]);let v=(0,l.useCallback)(()=>{"undefined"!=typeof sessionStorage&&sessionStorage.setItem(m,"1")},[]),j=(0,l.useCallback)(()=>{v(),p(!0)},[v]),y=(0,l.useCallback)(()=>{localStorage.setItem(u,"1"),x(!0)},[]);return((0,l.useEffect)(()=>{if(!r||!n||!g||!b||t||"undefined"==typeof sessionStorage||sessionStorage.getItem(m))return;let e=window.setTimeout(()=>{sessionStorage.getItem(m)||(sessionStorage.setItem(m,"1"),p(!0))},12e3);return()=>window.clearTimeout(e)},[r,n,g,b,t]),(0,l.useEffect)(()=>{t&&h&&p(!1)},[t,h]),r&&n&&g&&!t)?(0,s.jsxs)(s.Fragment,{children:[b?(0,s.jsx)(w,{ref:f,onDismiss:y,onCreateAccount:j}):null,(0,s.jsx)(D,{open:h,onOpenChange:p,onAuthenticatedSuccess:y})]}):null}},51782:function(e,t,n){"use strict";n.d(t,{HowProgramsWorkSection:function(){return m}});var r=n(57437),s=n(33145),l=n(27648),i=n(42586),a=n(38774),o=n(94508);let c={section:"w-full py-12 md:py-[48px]",header:"mb-8 md:mb-10 flex flex-wrap items-center justify-between gap-4",title:(0,o.cn)("text-[28px] font-semibold leading-[130%] text-[#383838] md:text-[34px]"),grid:(0,o.cn)("grid grid-cols-1 gap-3 md:gap-4","md:grid-cols-2","xl:grid-cols-3","md:items-stretch w-full"),card:(0,o.cn)("flex h-full w-full min-w-0 flex-col","rounded-[12px] border border-black/10","gap-6 p-4","bg-white transition-shadow hover:shadow-md"),imageWrapper:(0,o.cn)("relative h-[200px] w-full min-w-0 shrink-0 overflow-hidden rounded-lg"),image:"h-full w-full object-cover",cardContent:"flex flex-col items-start gap-4 w-full flex-1 min-h-0",cardTitle:(0,o.cn)("text-[28px] font-semibold leading-[130%] text-[#383838]","self-stretch"),cardDescription:(0,o.cn)("text-[18px] font-semibold leading-[130%] text-[#383838]","self-stretch"),button:(0,o.cn)("mt-auto inline-flex shrink-0 items-center justify-center rounded-lg","h-[52px] min-w-[125px] px-3 py-2","text-[18px] font-semibold leading-[100%] text-white","cursor-pointer transition-colors hover:opacity-90"),allProgramsLink:(0,o.cn)("text-[24px] font-semibold leading-[130%] text-[#E91E7A]","transition-opacity hover:opacity-90")},d=[{id:"study-and-holiday",slug:"study-and-holiday",namespace:"studyAndHoliday",buttonKey:"card1Button",image:"/study%20and%20holiday%20480x398.png"},{id:"study-and-work",slug:"study-and-work",namespace:"studyAndWork",buttonKey:"card2Button",image:"/study%20and%20work%20480x398.png"},{id:"higher-education",slug:"higher-education",namespace:"higherEducation",buttonKey:"card3Button",image:"/higher%20education%20480x398.png"}];function u(e){let{program:t,buttonText:n,locale:a}=e,o=(0,i.useTranslations)(t.namespace),d="/".concat(a,"/").concat(t.slug);return(0,r.jsxs)(l.default,{href:d,className:c.card,children:[(0,r.jsx)("div",{className:c.imageWrapper,children:(0,r.jsx)(s.default,{src:t.image,alt:o("title"),fill:!0,className:c.image,sizes:"(max-width: 768px) 100vw, (max-width: 1280px) 50vw, 330px"})}),(0,r.jsxs)("div",{className:c.cardContent,children:[(0,r.jsx)("h3",{className:c.cardTitle,children:o("title")}),(0,r.jsx)("p",{className:c.cardDescription,children:o("description")}),(0,r.jsx)("span",{className:c.button,style:{backgroundColor:"#001E52",display:"inline-flex",minHeight:52}
1,"aria-hidden":!0,children:n||"Learn more"})]})]})}let m=()=>{let e=(0,i.useTranslations)("home.howProgramsWork"),t=(0,i.useLocale)();return(0,r.jsxs)("section",{className:c.section,children:[(0,r.jsxs)("div",{className:c.header,children:[(0,r.jsx)("h2",{className:c.title,children:e("title")}),(0,r.jsx)(l.default,{href:"/".concat(t).concat(a.Z6.TYPES_OF_PROGRAMS),className:c.allProgramsLink,children:e("allPrograms")})]}),(0,r.jsx)("div",{className:c.grid,children:d.map(n=>(0,r.jsx)(u,{program:n,buttonText:e("learnMore"),locale:t},n.id))})]})}},88168:function(e,t,n){"use strict";n.d(t,{MeetTripwaiSection:function(){return o}});var r=n(57437),s=n(33145),l=n(42586),i=n(94508);let a={section:(0,i.cn)("relative pb-[48px] pt-[48px]"),header:(0,i.cn)("mb-[40px] flex flex-col items-start gap-2","md:flex-row md:items-center md:justify-between"),title:(0,i.cn)("text-[34px] font-semibold leading-[130%] text-[#383838]"),downloadAppLink:(0,i.cn)("cursor-pointer whitespace-nowrap text-[24px] font-semibold leading-[130%] text-[#D50F64] hover:underline"),description:(0,i.cn)("mb-[40px] text-[24px] font-normal leading-[130%] text-[#606060]","md:text-[24px]"),cardsContainer:(0,i.cn)("flex flex-col gap-4","md:flex-row md:gap-4"),card:(0,i.cn)("flex flex-1 flex-col rounded-lg border border-[#0000001A] bg-white p-4","md:p-4"),cardIcon:(0,i.cn)("mb-4 flex h-12 w-12 items-center justify-center"),cardTitle:(0,i.cn)("mb-2 text-[18px] font-bold leading-[130%] text-[#001E52]","md:text-[18px]"),cardDescription:(0,i.cn)("text-[14px] font-normal leading-[130%] text-[#606060]","md:text-[14px]")},o=()=>{let e=(0,l.useTranslations)("home.meetTripwai"),t=[{icon:"/Airplane Icon.svg",title:e("transparentStudy.title"),description:e("transparentStudy.description")},{icon:"/Sparkle Icon.svg",title:e("aiUnderstands.title"),description:e("aiUnderstands.description")},{icon:"/Suitcase Icon.svg",title:e("noHassle.title"),description:e("noHassle.description")}];return(0,r.jsxs)("section",{className:a.section,children:[(0,r.jsx)("div",{className:a.header,children:(0,r.jsx)("h2",{className:a.title,children:e("title")})}),(0,r.jsx)("p",{className:a.description,children:e("description")}),(0,r.jsx)("div",{className:a.cardsContainer,children:t.map((e,t)=>(0,r.jsxs)("div",{className:a.card,children:[(0,r.jsx)("div",{className:a.cardIcon,children:(0,r.jsx)(s.default,{src:e.icon,alt:e.title,width:48,height:48})}),(0,r.jsx)("h3",{className:a.cardTitle,children:e.title}),(0,r.jsx)("p",{className:a.cardDescription,children:e.description})]},t))})]})}},32523:function(e,t,n){"use strict";n.d(t,{PopularDestinationsSection:function(){return p}});var r=n(57437),s=n(33145),l=n(27648),i=n(2265),a=n(71632),o=n(42586),c=n(71154),d=n(59220),u=n(94508),m=n(54544),x=n(80665),h=n(84211);let p=()=>{let e=(0,o.useTranslations)("home.popularDestinations"),t=(0,o.useLocale)(),n=(0,m.Lm)(),p=n>0&&n<1280,[f,g]=(0,i.useState)(null),[b,v]=(0,i.useState)(0),[w,j]=(0,i.useState)(0),[y,N]=(0,i.useState)(!0),[C,k]=(0,i.useState)(!0),W=(0,i.useRef)(null),S=(0,i.useRef)(null),E=(0,i.useRef)(null),A=(0,i.useRef)(null),F=(0,i.useRef)(null),M=(0,i.useRef)(!1),D=(0,i.useRef)(!1),{data:P}=(0,a.useQuery)({queryKey:["countries"],queryFn:()=>c.sR.getAllCountries()}),L=(0,i.useMemo)(()=>P?P.sort((e,t)=>(e.order||0)-(t.order||0)).slice(0,4):[],[P]);(0,i.useEffect)(()=>{L&&L.length>0&&!f&&g(L[0].id)},[L,f]);let{data:T,isLoading:I}=(0,a.useQuery)({queryKey:["cities",f],queryFn:()=>f?c.GI.getCitiesByCountry(f,10):Promise.resolve([]),enabled:!!f});(0,i.useEffect)(()=>{v(0),N(!0),k(!0),M.current=!1,D.current=!1,A.current&&(clearTimeout(A.current),A.current=null),F.current&&(clearTimeout(F.current),F.current=null),p&&S.current&&S.current.scrollTo({left:0,behavior:"instant"})},[f,p]),(0,i.useEffect)(()=>{if(p||!E.current)return;let e=E.current,t=()=>j(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[p,null==T?void 0:T.length]),(0,i.useEffect)(()=>{if(!p||!S.current||!T||0===T.length)return;let e=S.current,t=()=>
1{v(Math.max(0,Math.min(Math.round(e.scrollLeft/230.154),T.length-1)))};return e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t)}},[p,T]);let B=e=>{g(e)},{carouselOffset:_,maxOffset:R}=(0,i.useMemo)(()=>{if(!T||0===T.length||p)return{carouselOffset:0,maxOffset:0};let e=206.154*T.length+24*Math.max(0,T.length-1),t=Math.min(1120,908.616+(window.innerWidth-1280)*.75),n=Math.min(0,(w>0?w:t)-e);return{carouselOffset:Math.max(n,Math.min(0,-(230.154*b))),maxOffset:n}},[b,T,p,w]),q=!!(T&&T.length>=6),H=!!(T&&T.length<5),K=!p&&T&&T.length>0&&_<=R+1,O=b>0,V=T&&T.length>0&&q&&(p?b<T.length-1:T.length>4&&!K);(0,i.useEffect)(()=>{if(q){if(O)M.current=!0,N(!0),A.current&&(clearTimeout(A.current),A.current=null);else{let e=M.current?500:0;e>0?A.current=setTimeout(()=>{N(!1),A.current=null},e):N(!1)}return()=>{A.current&&clearTimeout(A.current)}}},[q,O]),(0,i.useEffect)(()=>{if(q){if(V)D.current=!0,k(!0),F.current&&(clearTimeout(F.current),F.current=null);else{let e=D.current?500:0;e>0?F.current=setTimeout(()=>{k(!1),F.current=null},e):k(!1)}return()=>{F.current&&clearTimeout(F.current)}}},[q,V]);let Z=e=>e.media&&e.media.length>0?e.media[0].url:"/home/hero-bg.jpg",U=e=>{let t=null==L?void 0:L.find(t=>t.id===e);return(null==t?void 0:t.image)||""};return(0,r.jsxs)("section",{className:x.W.section,children:[(0,r.jsxs)("div",{className:x.W.header,children:[(0,r.jsx)("h2",{className:x.W.title,children:e("title")}),(0,r.jsx)(l.default,{href:(0,h.mK)(t),className:x.W.allDestinationsLink,children:e("allDestinations")})]}),L&&L.length>0&&(0,r.jsx)("div",{className:x.W.countriesFilters,children:(0,r.jsx)("div",{className:x.W.countriesFiltersInner,children:L.map(e=>(0,r.jsxs)("button",{onClick:()=>B(e.id),className:(0,u.cn)(x.W.countryButton,f===e.id?x.W.countryButtonActive:x.W.countryButtonInactive),children:[e.image&&(0,r.jsx)(s.default,{src:e.image,alt:e.name,width:24,height:24,className:x.W.countryFlag}),(0,r.jsx)("span",{className:x.W.countryName,children:"en"===t&&e.engName||e.name})]},e.id))})}),I?(0,r.jsx)("div",{className:(0,u.cn)(p?x.W.citiesCarouselWrapperMobile:x.W.citiesCarouselWrapper,"justify-center"),children:(0,r.jsx)("div",{className:p?x.W.citiesViewportMobile:x.W.citiesViewport,children:(0,r.jsx)("div",{className:(0,u.cn)(x.W.citiesContainer,"justify-center"),children:[1,2,3,4].map(e=>(0,r.jsxs)("div",{className:x.W.skeletonCard,children:[(0,r.jsx)("div",{className:x.W.skeletonImage}),(0,r.jsxs)("div",{className:x.W.skeletonBody,children:[(0,r.jsx)("div",{className:x.W.skeletonText}),(0,r.jsx)("div",{className:(0,u.cn)(x.W.skeletonText,"w-1/2")})]})]},e))})})}):T&&T.length>0&&(p?(0,r.jsx)("div",{className:x.W.citiesCarouselWrapperMobile,children:(0,r.jsx)("div",{ref:S,className:x.W.citiesViewportMobile,children:(0,r.jsx)("div",{ref:W,className:x.W.citiesContainer,children:T.map(n=>{let i=Z(n),a=U(n.country.id),o=(0,h.yF)(t,"/cities/".concat("en"===t&&n.engName||n.name));return(0,r.jsx)(l.default,{href:o,className:x.W.cityCard,children:(0,r.jsxs)("div",{className:x.W.cityCardImage,children:[(0,r.jsx)(s.default,{src:i,alt:"".concat("en"===t&&n.engName||n.name,", ").concat("en"===t&&n.country.engName||n.country.name),fill:!0,className:x.W.cityCardImageContent}),a&&(0,r.jsx)("div",{className:"absolute left-2 top-2",children:(0,r.jsx)(s.default,{src:a,alt:"en"===t&&n.country.engName||n.country.name,width:20,height:20,className:"rounded"})}),(0,r.jsxs)("div",{className:x.W.cityCardTitle,children:["en"===t&&n.engName||n.name,","," ","en"===t&&n.country.engName||n.country.name]}),(0,r.jsx)("div",{className:x.W.cityCardHoverOverlay,children:(0,r.jsx)("div",{className:x.W.learnMoreButton,children:e("learnMore")})})]})},n.id)})})})}):(0,r.jsxs)("div",{className:q?x.W.citiesCarouselWrapper:x.W.citiesCarouselWrapperWithoutArrows,children:[q&&(0,r.jsx)("div",{className:x.W.carouselArrowWrapper,style:{width:y?55:0},children:(0,r.jsx)("button",{onClick:()=>{if(T&&T.length>0){if(p){let e=Math.max(0,b-1);v(e),S.current&&S.current.scrollTo({left:230.154*e,behavior:"smooth"})}else v(e=>Math.max(0,e-1))}},className:(0,u.cn)(x.W.carouselArrow,x.W.carouselArrowLeft,O?x.W.carouselArrowActive:x.W.carouselArrowInactive,!O&&x.W.carouselArrowHidden
1),"aria-label":"Scroll to previous",children:(0,r.jsx)(d.Y,{})})}),(0,r.jsx)("div",{ref:E,className:(0,u.cn)(q?q?x.W.citiesViewport:x.W.citiesViewportWithoutArrows:x.W.citiesViewportNoSlider,!q&&(H?x.W.citiesViewportNoSliderStart:x.W.citiesViewportNoSliderCenter)),children:(0,r.jsx)("div",{ref:W,className:(0,u.cn)(q?x.W.citiesContainer:x.W.citiesContainerNoSlider,!q&&(H?x.W.citiesContainerNoSliderStart:x.W.citiesContainerNoSliderCenter)),style:q?{transform:"translateX(".concat(_,"px)")}:void 0,children:T.map(n=>{let i=Z(n),a=U(n.country.id),o=(0,h.yF)(t,"/cities/".concat("en"===t&&n.engName||n.name));return(0,r.jsx)(l.default,{href:o,className:x.W.cityCard,children:(0,r.jsxs)("div",{className:x.W.cityCardImage,children:[(0,r.jsx)(s.default,{src:i,alt:"".concat("en"===t&&n.engName||n.name,", ").concat("en"===t&&n.country.engName||n.country.name),fill:!0,className:x.W.cityCardImageContent}),a&&(0,r.jsx)("div",{className:"absolute left-2 top-2",children:(0,r.jsx)(s.default,{src:a,alt:"en"===t&&n.country.engName||n.country.name,width:20,height:20,className:"rounded"})}),(0,r.jsxs)("div",{className:x.W.cityCardTitle,children:["en"===t&&n.engName||n.name,","," ","en"===t&&n.country.engName||n.country.name]}),(0,r.jsx)("div",{className:x.W.cityCardHoverOverlay,children:(0,r.jsx)("div",{className:x.W.learnMoreButton,children:e("learnMore")})})]})},n.id)})})}),q&&(0,r.jsx)("div",{className:x.W.carouselArrowWrapper,style:{width:C?55:0},children:(0,r.jsx)("button",{onClick:()=>{if(T&&T.length>0){if(p){let e=Math.min(b+1,T.length-1);v(e),S.current&&S.current.scrollTo({left:230.154*e,behavior:"smooth"})}else v(e=>Math.min(e+1,T.length-1))}},className:(0,u.cn)(x.W.carouselArrow,x.W.carouselArrowRight,V?x.W.carouselArrowActive:x.W.carouselArrowInactive,!V&&x.W.carouselArrowHidden),"aria-label":"Scroll to next",children:(0,r.jsx)(d.L,{})})})]}))]})}},80665:function(e,t,n){"use strict";n.d(t,{W:function(){return s}});var r=n(94508);let s={section:(0,r.cn)("relative pb-[48px] pt-[48px]","overflow-x-hidden d1480:overflow-visible"),header:(0,r.cn)("mb-[40px] flex flex-col items-start gap-2","md:flex-row md:items-center md:justify-between"),title:(0,r.cn)("text-[34px] font-semibold leading-[130%] text-[#383838]"),allDestinationsLink:(0,r.cn)("cursor-pointer text-[24px] font-semibold leading-[130%] text-[#D50F64] hover:underline"),countriesFilters:(0,r.cn)("mb-[40px] flex gap-2 overflow-x-auto pb-2","-mx-6 md:mx-0","scrollbar-hide","[&::-webkit-scrollbar]:hidden","[-ms-overflow-style:none]","[scrollbar-width:none]"),countriesFiltersInner:(0,r.cn)("flex gap-2 items-center","min-w-max","px-6 md:px-0 md:justify-center"),countryButton:(0,r.cn)("inline-flex h-[41.231px] min-w-fit cursor-pointer items-center justify-center gap-2 rounded-[10.308px] px-[15.462px] py-[10.308px] transition-colors"),countryButtonActive:(0,r.cn)("border-[2px] border-[#001E51] bg-[#EAF3FF] text-[#001E51]"),countryButtonInactive:(0,r.cn)("border border-[#0000001A] bg-white text-[#606060]"),countryFlag:(0,r.cn)("h-6 w-6 flex-shrink-0"),countryName:(0,r.cn)("text-center text-[16px] font-normal leading-[130%]"),citiesCarouselWrapper:(0,r.cn)("relative flex w-full items-center","md:-mr-16 d1480:mr-0","[--arrow-space:55px]"),carouselArrowWrapper:(0,r.cn)("flex flex-shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out"),citiesCarouselWrapperWithoutArrows:(0,r.cn)("relative flex w-full items-center","md:-mr-16 d1480:mr-0"),citiesCarouselWrapperMobile:(0,r.cn)("relative w-full transition-all duration-500 ease-in-out"),carouselArrowLeft:(0,r.cn)("mr-4"),carouselArrowRight:(0,r.cn)("ml-4"),carouselArrowLeftMobile:(0,r.cn)("absolute z-10","top-[calc(50%+100px)] -translate-y-1/2","left-6","md:left-16"),carouselArrowRightMobile:(0,r.cn)("absolute z-10","top-[calc(50%+100px)] -translate-y-1/2","right-6","md:right-16"),citiesViewport:(0,r.cn)("relative flex-1 overflow-hidden min-w-0","min-w-[908.616px]","xl:pl-0","[--viewport-width:clamp(908.616px,calc(908.616px+(100vw-1280px)*0.75),1120px)]","d1480:[max-width:var(--viewport-width)]"),citiesViewportWithoutArrows:(0,r.cn)("relative flex-1 overflow-hidden","min-w-[908.616px]","xl:pl-0","[--viewport-width:clamp(908.616px,calc(908.616px+(100vw-1280px)*0.75),1120px)]","d1480:[max-width:var(--viewport-width)]"),citiesViewportNoSlider:(0,r.cn)("relative flex-1 min-w-0 overflow-x-auto overflow-y-visible flex","scrollbar-hide [&::-webkit-scrollbar]:hidden"),citiesViewportNoSliderCenter:(0,r.cn)("justify-center"),citiesViewportNoSliderStart:(0,r.cn)("justify-start"),citiesContainerNoSlider:(0,r.cn)("flex [--cards-gap:24px] [gap:var(--cards-gap)] flex-shrink-0"),citiesContainerNoSliderCenter:(0,r.cn)("justify-center"),citiesContainerNoSliderStart:(0,r.cn)("justify-start"),citiesViewportMobile:(0,r.cn)("relative min-w-0","overflow-x-auto overflow-y-visible","scrollbar-hide","[&::-webkit-scrollbar]:hidden","[-ms-overflow-style:none]","[scrollbar-width:none]","snap-x snap-mandatory scroll-smooth"),citiesContainer:(0,r.cn)("flex will-change-transform","transition-transform duration-500 ease-in-out","[--cards-gap:24px]","[gap:var(--cards-gap)]","xl:pl-0 xl:pr-0","max-xl:snap-x snap-mandatory","max-xl:pb-4"),cityCard:(0,r.cn)("group relative h-[283.462px] w-[206.154px] flex-shrink-0 cursor-pointer overflow-hidden rounded-[10.308px]","max-xl:snap-center","block no-underline"),cityCardImage:(0,r.cn)("relative h-full w-full"),cityCardImageContent:(0,r.cn)("h-full w-full object-cover"),cityCardTitle:(0,r.cn)("absolute bottom-[
110px] left-[10px] text-[20.62px] font-normal leading-[100%] text-white"),cityCardHoverOverlay:(0,r.cn)("absolute inset-0 flex items-center justify-center bg-black/40 px-[30px] py-[121px] opacity-0 transition-all duration-300 group-hover:opacity-100"),learnMoreButton:(0,r.cn)("inline-flex h-[41.231px] w-full cursor-pointer items-center justify-center rounded-[10.308px] border-[2px] border-white bg-transparent px-[15.462px] py-[10.308px] text-center text-[16px] font-normal leading-[130%] text-[#FFFFFF] transition-all duration-300 hover:scale-105"),carouselArrow:(0,r.cn)("flex h-[39px] w-[39px] flex-shrink-0 cursor-pointer items-center justify-center rounded-full","bg-[#314973] text-white shadow-lg","transition-[width,min-width,margin,opacity] duration-300 ease-in-out","hover:bg-[#1e2f4d]"),carouselArrowActive:(0,r.cn)("bg-[#314973] text-white"),carouselArrowInactive:(0,r.cn)("bg-[#C4CAD4] text-white"),carouselArrowVisible:(0,r.cn)("opacity-100 pointer-events-auto"),carouselArrowHidden:(0,r.cn)("opacity-0 pointer-events-none"),skeletonCard:(0,r.cn)("relative h-[283.462px] w-[206.154px] flex-shrink-0 overflow-hidden rounded-[10.308px] border border-[rgba(0,0,0,0.1)] bg-white"),skeletonImage:(0,r.cn)("h-[154.615px] w-full animate-pulse bg-gray-200"),skeletonBody:(0,r.cn)("p-[10.308px]"),skeletonText:(0,r.cn)("mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200")}},57875:function(e,t,n){"use strict";n.d(t,{SpecialOffersSection:function(){return v}});var r=n(57437),s=n(27648),l=n(71632),i=n(8164),a=n(42586),o=n(71154),c=n(94508);let d={section:"py-12",header:(0,c.cn)("mb-8 flex flex-col items-start gap-2","md:flex-row md:items-center md:justify-between"),title:(0,c.cn)("text-[34px] font-semibold leading-[1.3em] text-[#383838]"),moreLink:(0,c.cn)("cursor-pointer text-[24px] font-semibold leading-[1.3em] text-[#D50F64] hover:underline"),grid:(0,c.cn)("grid gap-7","sm:grid-cols-2","xl:grid-cols-4"),card:(0,c.cn)("flex flex-col h-full overflow-hidden rounded-2xl border border-[#000]/10"),imageWrapper:(0,c.cn)("relative h-[134px] w-full"),image:(0,c.cn)("object-cover"),cardBody:(0,c.cn)("flex flex-col p-4 flex-1"),cardHeader:(0,c.cn)("flex items-start justify-between gap-2"),cardTitle:(0,c.cn)("text-[18px] font-bold text-[#403A3A] line-clamp-2"),cardIcons:(0,c.cn)("flex items-center gap-2.5 shrink-0"),infoButton:(0,c.cn)("flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-[#878787] text-[11px] italic text-[#878787]"),likeButton:(0,c.cn)("cursor-pointer text-[#001E52] shrink-0 flex items-center justify-center w-[21px] h-[18px] min-w-[21px] min-h-[18px]"),schoolRow:(0,c.cn)("mb-4 mt-2 flex items-center gap-2"),schoolLogo:(0,c.cn)("flex h-5 w-5 items-center justify-center rounded-full bg-[#FF7A00] text-[10px] font-semibold text-white"),schoolName:(0,c.cn)("text-[16px] font-semibold text-[#606060] truncate"),startingFromRow:(0,c.cn)("mb-1 flex items-center justify-between"),startingFrom:(0,c.cn)("text-[14px] font-semibold text-[#D50F64]"),startDate:(0,c.cn)("text-[14px] font-normal text-[#606060]"),oldPrice:(0,c.cn)("text-[12px] font-bold text-[#475467] line-through"),priceSuffix:(0,c.cn)("font-normal text-[#475467]"),newPrice:(0,c.cn)("text-[22px] font-bold text-[#D50F64]"),newPriceSuffix:(0,c.cn)("text-[18px] font-normal text-[#D50F64]"),courseName:(0,c.cn)("mt-2 text-[14px] text-[#252525]")};var u=n(2265),m=n(33145),x=n(37830),h=n(49181),p=n(23920),f=n(99967),g=n(84211);function b(e){var t,n,l,i,o,b,v,w,j,y,N,C,k,W;let{course:S,locale:E,schoolId:A,schoolName:F}=e,M=(0,a.useTranslations)("home.specialOffers"),D=(0,a.useTranslations)("common"),{user:P}=(0,f.a)(),{data:L}=(0,p.e_)(),T=(0,p.xb)(),I=(0,p.oQ)(),B=null===(t=S.campus)||void 0===t?void 0:t.id,_=(null===(n=S.campus)||void 0===n?void 0:n.name)||"",R=(null===(i=S.campus)||void 0===i?void 0:null===(l=i.city)||void 0===l?void 0:l.name)||"",q=(null===(b=S.campus)||void 0===b?void 0:null===(o=b.country)||void 0===o?void 0:o.name)||"",H=(0,u.useMemo)(()=>{if(!R)return"";let e=R.trim().toLowerCase();return D.has("cities.".concat(e))?D("cities.".concat(e)):R},[R,D]),K=(0,u.useMemo)(()=>
1{if(!q)return"";let e=q.trim().toLowerCase();return D.has("countries.".concat(e))?D("countries.".concat(e)):q},[q,D]),O=null===(w=S.campus)||void 0===w?void 0:null===(v=w.school)||void 0===v?void 0:v.logo,V=null===(j=S.campus)||void 0===j?void 0:j.images,Z=V&&Array.isArray(V)&&V.length>0&&(null===(y=V[0])||void 0===y?void 0:y.imageUrl)?V[0].imageUrl:"/home/hero-bg.jpg",U=S.summary,Y=null!==(C=null!==(N=null==U?void 0:U.courseMinDurationSubtotal)&&void 0!==N?N:null==U?void 0:U.courseMinBasePricePerWeek)&&void 0!==C?C:null,G=null!==(W=null!==(k=null==U?void 0:U.courseMinDurationTotal)&&void 0!==k?k:null==U?void 0:U.courseMinTotalPricePerWeek)&&void 0!==W?W:null,Q=(0,u.useMemo)(()=>{var e,t;return null!==(t=null==L?void 0:null===(e=L.data)||void 0===e?void 0:e.some(e=>e.courseId===S.id))&&void 0!==t&&t},[L,S.id]),z=(0,u.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),Q){var t,n;let e=null==L?void 0:null===(n=L.data)||void 0===n?void 0:null===(t=n.find(e=>e.courseId===S.id))||void 0===t?void 0:t.id;e&&I.mutate(e)}else T.mutate(S.id)},[Q,T,I,L,S.id]),J=(0,h.u)({amount:Y||0,fromCurrency:S.currency||"EUR",enabled:null!==Y&&Y>0&&null!==G&&G>0&&Y>G}),X=(0,h.u)({amount:G||0,fromCurrency:S.currency||"EUR",enabled:null!==G&&G>0}),$=X.toCurrency||J.toCurrency,ee=J.convertedAmount,et=X.convertedAmount,en=S.id?(0,g.yF)(E,"/course/".concat(S.id)):null;return(0,r.jsxs)(s.default,{href:en||"#",className:d.card,style:{textDecoration:"none",display:"flex"},onClick:e=>{en||e.preventDefault()},children:[(0,r.jsx)("div",{className:d.imageWrapper,children:(0,r.jsx)(m.default,{src:Z,alt:K?"".concat(H||_,", ").concat(K):H||_,className:d.image,fill:!0})}),(0,r.jsxs)("div",{className:d.cardBody,children:[(0,r.jsxs)("div",{className:d.cardHeader,children:[(0,r.jsx)("div",{className:d.cardTitle,title:S.name,children:S.name}),(0,r.jsx)("div",{className:d.cardIcons,children:P&&!P.isAnonymous&&(0,r.jsx)("button",{className:d.likeButton,onClick:z,"aria-label":M(Q?"removeFromWishlist":"addToWishlist"),children:Q?(0,r.jsx)(m.default,{src:"/Vector (1).svg",alt:"Added to wishlist",width:21,height:18,className:"shrink-0",style:{width:21,height:18,minWidth:21,minHeight:18}}):(0,r.jsx)(x.l,{width:21,height:18,className:"fill-transparent text-[#001E52] shrink-0",style:{width:21,height:18,minWidth:21,minHeight:18}})})})]}),(0,r.jsxs)("div",{className:d.schoolRow,children:[A?(0,r.jsx)(s.default,{href:"/".concat(E,"/schools/").concat(A),className:"cursor-pointer transition-opacity hover:opacity-80",onClick:e=>e.stopPropagation(),children:O?(0,r.jsx)(m.default,{src:O,alt:F,width:20,height:20,className:"h-5 w-5 rounded-full object-cover"}):(0,r.jsx)("div",{className:d.schoolLogo,children:F.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)})}):O?(0,r.jsx)(m.default,{src:O,alt:F,width:20,height:20,className:"h-5 w-5 rounded-full object-cover"}):(0,r.jsx)("div",{className:d.schoolLogo,children:F.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}),B?(0,r.jsx)(s.default,{href:"/".concat(E,"/campuses/").concat(B),className:"".concat(d.schoolName," cursor-pointer hover:underline"),onClick:e=>e.stopPropagation(),children:_}):(0,r.jsx)("span",{className:d.schoolName,children:_})]}),(0,r.jsxs)("div",{className:"mt-auto",children:[(0,r.jsx)("div",{className:d.startingFromRow,children:(0,r.jsx)("span",{className:d.startingFrom,children:M("startingFrom")})}),null!==Y&&Y>0&&null!==G&&G>0&&Y>G&&(0,r.jsx)("div",{className:d.oldPrice,children:(0,c.lb)(ee,$)}),null!==G&&G>0&&(0,r.jsx)("div",{className:d.newPrice,children:(0,c.lb)(et,$)})]})]})]})}let v=()=>{let e=(0,a.useTranslations)("home.specialOffers"),t=(0,a.useLocale)(),{data:n,isLoading:c}=(0,l.useQuery)({queryKey:["courses-with-discounts"],queryFn:()=>o.tB.getCoursesWithDiscounts(4),staleTime:3e5}),u=(null==n?void 0:n.slice(0,4))||[],m=[...new Set(u.map(e=>{var t;return null===(t=e.campus)||void 0===t?void 0:t.id}).filter(e=>!!e))],x=(0,i.useQueries)({queries:m.map(e=>({queryKey:["campus",e],queryFn:()=>o._f.getCampusById(e),staleTime:3e5,enabled:!!e}))}),h=new Map;x.forEach((e,t)=>{if(e.data){var n,r;h.set(m[t],{schoolId:e.data.schoolId||(null===(n=e.data.school)||void 0===n?void 0:n.id),schoolName:null===(r=e.data.school)||void 0===r?void 0:r.name})}});let p=c||x.some(e=>e.isLoading),f=new URLSearchParams;return(f.set("hasDiscount","true"),p)?(0,r.jsxs)("section",{className:d.section,children:[(0,r.jsxs)("div",{className:d.header,children:[(0,r.jsx)("h2",{className:d.title,children:e("title")}),(0,r.jsx)(s.default,{href:"/".concat(t,"/search-result?").concat(f.toString()),className:d.moreLink,children:e("findMoreOffers")})]}),(0,r.jsx)("div",{className:d.grid,children:[1,2,3,4].map(e=>(0,r.jsxs)("div",{className:d.card,children:[(0,r.jsx)("div",{className:d.imageWrapper,children:(0,r.jsx)("div",{className:"h-full w-full animate-pulse bg-gray-200"})}),(0,r.jsxs)("div",{className:d.cardBody,children:[(0,r.jsx)("div",{className:"mb-2 h-4 animate-pulse rounded bg-gray-200"}),(0,r.jsx)("div",{className:"h-3 w-2/3 animate-pulse rounded bg-gray-200"})]})]},e))})]}):(0,r.jsxs)("section",{className:d.section,children:[(0,r.jsxs)("div",{className:d.header,children:[(0,r.jsx)("h2",{className:d.title,children:e("title")}),(0,r.jsx)(s.default,{href:"/".concat(t,"/search-result?").concat(f.toString()),className:d.moreLink,children:e("findMoreOffers")})]}),(0,r.jsx)("div",{className:d.grid,children:u.map(e=>{var n,s,l;let i=null===(n=e.campus)||void 0===n?void 0:n.id,a=i?h.get(i):void 0,o=null==a?void 0:a.schoolId,c=(null==a?void 0:a.schoolName)||(null===(l=e.campus)||void 0===l?void 0:null===(s=l.school)||void 0===s?void 0:s.name)||"";return(0,r.jsx)(b,{course:e,locale:t,schoolId:o,schoolName:c}
1,e.id)})})]})}},88149:function(e,t,n){"use strict";n.d(t,{StayInformedSection:function(){return u}});var r=n(57437),s=n(33145),l=n(27648),i=n(42586),a=n(94508);let o={section:"pb-[48px] pt-[48px]",header:(0,a.cn)("mb-[40px] flex flex-col items-start gap-2","md:flex-row md:items-center md:justify-between"),title:(0,a.cn)("text-[34px] font-semibold leading-[1.3em] text-[#383838]"),findMoreLink:(0,a.cn)("cursor-pointer text-[24px] font-semibold leading-[1.3em] text-[#D50F64] hover:underline"),grid:(0,a.cn)("grid grid-cols-1 gap-7","xl:grid-cols-3"),card:(0,a.cn)("flex w-full flex-col overflow-hidden bg-white","rounded-[13.15px] border border-[#0000001A]","pb-[13.15px]"),imageWrapper:(0,a.cn)("relative h-[197px] w-full overflow-hidden rounded-t-[13.15px]","md:h-[197px]"),image:(0,a.cn)("h-full w-full object-cover"),cardContent:(0,a.cn)("flex flex-col gap-[13.15px] px-[13.15px] pt-[13.15px]"),cardTitle:(0,a.cn)("h-[78.911px] max-h-[78.911px] overflow-hidden","text-[20px] font-semibold leading-[150%] text-[#403A3A]","md:text-[20px]"),seeMoreLink:(0,a.cn)("cursor-pointer text-[16px] font-semibold leading-[150%] text-[#403A3A] hover:underline")};var c=n(84211);let d=[{id:1,image:"/Rectangle 31.svg",titleKey:"cardTitle",linkKey:"seeMore"},{id:2,image:"/Rectangle 31 (1).svg",titleKey:"cardTitle",linkKey:"seeMore"},{id:3,image:"/Rectangle 31 (2).svg",titleKey:"cardTitle",linkKey:"seeMore"}],u=()=>{let e=(0,i.useTranslations)("home.stayInformed"),t=(0,i.useLocale)();return(0,r.jsxs)("section",{className:o.section,children:[(0,r.jsxs)("div",{className:o.header,children:[(0,r.jsx)("h2",{className:o.title,children:e("title")}),(0,r.jsx)(l.default,{href:(0,c.mK)(t),className:o.findMoreLink,children:e("findMoreNews")})]}),(0,r.jsx)("div",{className:o.grid,children:d.map(n=>(0,r.jsxs)("div",{className:o.card,children:[(0,r.jsx)("div",{className:o.imageWrapper,children:(0,r.jsx)(s.default,{src:n.image,alt:e(n.titleKey),fill:!0,className:o.image})}),(0,r.jsxs)("div",{className:o.cardContent,children:[(0,r.jsx)("h3",{className:o.cardTitle,children:e(n.titleKey)}),(0,r.jsx)(l.default,{href:(0,c.mK)(t),className:o.seeMoreLink,children:e(n.linkKey)})]})]},n.id))})]})}},31064:function(e,t,n){"use strict";n.d(t,{StepsSection:function(){return c}});var r=n(57437),s=n(33145),l=n(42586),i=n(94508);let a={section:"pb-[42px] pt-[30px]",title:(0,i.cn)("font-['Open_Sans'] text-[36px] font-bold leading-[100%] text-[#383838]","md:text-center"),titleNoSubtitle:(0,i.cn)("mb-[30px]"),titleWithSubtitle:(0,i.cn)("mb-[8px]"),subtitle:(0,i.cn)("font-['Open_Sans'] text-[24px] font-normal leading-[100%] text-[#383838]","mb-[30px]","md:text-center"),stepsGrid:(0,i.cn)("grid grid-cols-1 gap-6","mx-auto w-fit","md:mx-0 md:w-full md:grid-cols-2 md:px-16","md:[--grid-padding:128px]","md:[--cards-width:520px]","md:[--gap:calc((100%-var(--grid-padding)-var(--cards-width)))]","md:[gap:max(16px,var(--gap))]","xl:grid-cols-4 xl:justify-items-start xl:gap-6 xl:px-0"),stepCard:(0,i.cn)("flex flex-col items-center","w-[260px]","md:h-[261px] md:w-[260px] md:max-w-[260px] md:flex-shrink-0 md:rounded-[12px] md:px-1 md:py-2"),iconWrapper:(0,i.cn)("mb-4 flex h-24 w-24 items-center justify-center"),icon:(0,i.cn)("h-full w-full object-contain"),stepNumber:(0,i.cn)("mb-4 text-center text-[18px] font-bold leading-[116.667%] text-[#403A3A]"),stepDescription:(0,i.cn)("text-center text-[16px] font-normal leading-[150%] text-[#403A3A]")},o=[{icon:"/Frame 3 (1).svg",stepKey:"step1",descriptionKey:"step1Description"},{icon:"/Frame 3 (2).svg",stepKey:"step2",descriptionKey:"step2Description"},{icon:"/Frame 3 (3).svg",stepKey:"step3",descriptionKey:"step3Description"},{icon:"/Frame 3 (4).svg",stepKey:"step4",descriptionKey:"step4Description"}],c=e=>{let{title:t,subtitle:n,alignLeft:c,step1Description:d,step2Description:u,step3Description:m,step4Description:x,translationNamespace:h="home.steps",items:p,stepsGridClassName:f,className:g}=e,b=(0,l.useTranslations)(h),v=[d,u,m,x],w=(e,t)=>"string"==typeof e?(0,r.jsx)(s.default,{src:e,alt:t,width:96,height:96,className:a.icon}):e;return(0,r.jsxs)("section",{className:(0,i.cn)(a.section,g),children:[(0,r.jsx)("h2",{className:(0,i.cn)(a.title,n?a.titleWithSubtitle:a.titleNoSubtitle,c&&"md:text-left"),children:t||b("title")}),n&&(0,r.jsx)("p",{className:(0,i.cn)(a.subtitle,c&&"md:text-left"),children:n}),(0,r.jsx)("div",{className:(0,i.cn)(a.stepsGrid,f),children:p?p.map((e,t)=>(0,r.jsxs)("div",{className:a.stepCard,children:[e.icon&&(0,r.jsx)("div",{className:a.iconWrapper,children:w(e.icon,e.stepTitle)}),(0,r.jsx)("div",{className:a.stepNumber,children:e.stepTitle}),(0,r.jsx)("div",{className:a.stepDescription,children:e.description})]},t)):o.map((e,t)=>(0,r.jsxs)("div",{className:a.stepCard,children:[(0,r.jsx)("div",{className:a.iconWrapper,children:w(e.icon,b(e.stepKey))}),(0,r.jsx)("div",{className:a.stepNumber,children:b(e.stepKey)}),(0,r.jsx)("div",{className:a.stepDescription,children:v[t]?v[t]:b(e.descriptionKey)})]},t))})]})}},25843:function(e,t,n){"use strict";n.d(t,{N:function(){return o}});var r=n(57437),s=n(2265),l=n(33145),i=n(51777),a=n(89292);let o=e=>{let{label:t,placeholder:n,options:o,value:c,onChange:d,filterable:u,searchPlaceholder:m="Search..."}
1=e,[x,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(""),g=(0,s.useMemo)(()=>{if(!u||!p.trim())return o;let e=p.trim().toLowerCase();return o.filter(t=>t.label.toLowerCase().includes(e))},[o,u,p]),b=e=>{d(c.includes(e)?c.filter(t=>t!==e):[...c,e]),h(!1),f("")},v=o.filter(e=>c.includes(e.value)).map(e=>e.label).join(", ");return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:a.W.label,children:t}),(0,r.jsxs)(i.fC,{open:x,onOpenChange:e=>{h(e),e||f("")},children:[(0,r.jsx)(i.xz,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:a.W.button(!v),children:[e.icon,v||n,(0,r.jsx)(l.default,{src:"/chevronDown.svg",alt:"",width:10,height:10,className:a.W.icon})]})}),(0,r.jsx)(i.h_,{children:(0,r.jsxs)(i.VY,{side:"bottom",align:"start",sideOffset:8,className:a.W.popoverContent,children:[u&&(0,r.jsx)("input",{type:"text",value:p,onChange:e=>f(e.target.value),placeholder:m,className:a.W.searchInput,autoFocus:!0,"aria-label":m}),(0,r.jsx)("div",{className:a.W.optionsList,children:g.map(e=>{let t=c.includes(e.value);return(0,r.jsxs)("button",{type:"button",onClick:()=>b(e.value),className:a.W.option,children:[e.image&&(0,r.jsx)(l.default,{src:e.image,width:20,height:20,alt:e.label}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:e.label}),(0,r.jsx)("span",{className:a.W.checkmark(t)})]},e.value)})})]})})]})]})}},89292:function(e,t,n){"use strict";n.d(t,{W:function(){return s}});var r=n(94508);let s={label:(0,r.cn)("mb-2 text-sm text-ui-label"),button:e=>(0,r.cn)("h-[52px] w-full group flex items-center gap-2 cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap rounded-[8px]","border border-[rgba(237,237,237,1)] py-3 px-4 text-left text-[14px] leading-[150%] transition-colors hover:border-brand-blue-button","text-[rgba(135,135,135,1)]"),icon:(0,r.cn)("transition-transform ml-auto group-data-[state=open]:rotate-180"),popoverContent:(0,r.cn)("flex min-w-[var(--radix-popover-trigger-width)] z-[60] flex-col rounded-md","border border-[#EDEDED] bg-white p-4 shadow-[0_16px_40px_rgba(0,0,0,0.16)]","max-h-[400px] overflow-hidden","data-[state=open]:animate-[popover-enter_0.15s_ease-out]","data-[state=closed]:animate-[popover-exit_0.1s_ease-in_forwards]"),searchInput:(0,r.cn)("mb-3 w-full shrink-0 rounded-[8px] border border-[#EDEDED] py-2 px-3 text-[14px] text-[#101010] outline-none transition-colors","placeholder:text-[#878787] focus:border-[#001E52]"),optionsList:(0,r.cn)("flex flex-col gap-0 max-h-[280px] overflow-y-scroll","[scrollbar-gutter:stable]","[scrollbar-width:thin] [scrollbar-color:#878787_#EDEDED]","[&::-webkit-scrollbar]:block [&::-webkit-scrollbar]:w-2","[&::-webkit-scrollbar-track]:bg-[#EDEDED] [&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[#878787] [&::-webkit-scrollbar-thumb]:min-h-8"),option:(0,r.cn)("flex w-full cursor-pointer items-center gap-2 rounded-md py-2 px-2 text-left text-[16px] text-[#101010]","transition-colors hover:bg-[#E5E7EB]"),checkmark:e=>(0,r.cn)("h-2 w-3 -translate-y-0.5 -rotate-45","border-b-2 border-l-2 border-brand-pink-main transition-all",e?"scale-100 opacity-100":"scale-75 opacity-0")}},82460:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(57437),s=n(2265),l=n(94508);let i={label:(0,l.cn)("mb-2 text-sm text-[#2A2A2A]"),field:(0,l.cn)("flex items-center gap-2","h-[52px] rounded-[8px] border border-[rgba(237,237,237,1)] bg-white","px-4 py-3 transition-colors"),fieldDisabled:(0,l.cn)("cursor-not-allowed opacity-50 bg-gray-100"),middleBlock:(0,l.cn)("flex flex-1 flex-col min-w-0 leading-tight items-center justify-center text-center"),prefix:(0,l.cn)("text-sm text-[#878787] leading-[150%]"),value:(0,l.cn)("text-sm text-[#101010] leading-[150%] font-normal"),input:(0,l.cn)("w-full min-w-0 bg-transparent text-sm text-[#101010] leading-[150%] font-normal text-center","border-none outline-none p-0 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),controlButton:(0,l.cn)("flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-md","text-base text-[#101010] font-medium","transition-colors hover:bg-[#
1E5E7EB]","disabled:cursor-not-allowed disabled:opacity-20 disabled:hover:bg-transparent")},a=(e,t)=>0===t.length?e:t.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t),o=e=>{let{label:t,prefixLabel:n,value:o,onChange:c,min:d=0,max:u=Number.MAX_SAFE_INTEGER,step:m=1,disabled:x=!1,maxLength:h,allowedValues:p,pulse:f=!1}=e,[g,b]=(0,s.useState)(()=>String(o)),v=(0,s.useRef)(null),w=(0,s.useRef)(g);(0,s.useEffect)(()=>{let e=String(o);b(e),w.current=e,v.current&&(clearTimeout(v.current),v.current=null)},[o]),(0,s.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]);let j=e=>{let t=Number(e),n=Math.round((Number.isFinite(t)?Math.min(u,Math.max(d,t)):o)/m)*m,r=p&&p.length>0?a(n,p):n;c(r),b(String(r))},y=e=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{v.current=null,j(e)},500)},N=null!=h?h:String(u).length,C=x||(p&&p.length>0?!p.some(e=>e<o):o<=d),k=x||(p&&p.length>0?!p.some(e=>e>o):o>=u);return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:i.label,children:t}),(0,r.jsxs)("div",{className:(0,l.cn)(i.field,x&&i.fieldDisabled,f&&"animate-attention-shake"),children:[(0,r.jsx)("button",{type:"button","aria-label":"Decrease value",onClick:()=>{if(!x){if(p&&p.length>0){let e=[...p].reverse().find(e=>e<o);void 0!==e&&c(e);return}c(Math.max(d,o-m))}},disabled:C,className:i.controlButton,children:"–"}),(0,r.jsxs)("div",{className:i.middleBlock,children:[n&&(0,r.jsx)("span",{className:i.prefix,children:n}),(0,r.jsx)("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:g,onChange:e=>{let t=e.target.value.replace(/\D/g,"");if(""===t){v.current&&clearTimeout(v.current),b(""),w.current="";return}t.length>N||(b(t),w.current=t,y(t))},onBlur:()=>{v.current&&clearTimeout(v.current),j(w.current)},onKeyDown:e=>{"Enter"===e.key&&(v.current&&clearTimeout(v.current),j(w.current))},onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData("text").replace(/\D/g,"");if(""===t)return;let n=Number(t),r=Math.round((Number.isFinite(n)?Math.min(u,Math.max(d,n)):o)/m)*m,s=String(r);b(s),w.current=s,v.current&&(clearTimeout(v.current),v.current=null),c(r)},disabled:x,maxLength:N,className:i.input,"aria-label":t})]}),(0,r.jsx)("button",{type:"button","aria-label":"Increase value",onClick:()=>{if(!x){if(p&&p.length>0){let e=p.find(e=>e>o);void 0!==e&&c(e);return}c(Math.min(u,o+m))}},disabled:k,className:i.controlButton,children:"+"})]})]})}},23920:function(e,t,n){"use strict";n.d(t,{e_:function(){return a},oQ:function(){return c},xb:function(){return o}});var r=n(71632),s=n(29827),l=n(21770),i=n(71154);let a=()=>(0,r.useQuery)({queryKey:["wishlist"],queryFn:()=>i._I.getWishlist()}),o=()=>{let e=(0,s.useQueryClient)();return(0,l.useMutation)({mutationFn:e=>i._I.addToWishlist(e),onSuccess:()=>{e.invalidateQueries({queryKey:["wishlist"]})},onError:e=>{console.error("Error adding to wishlist:",e)}})},c=()=>{let e=(0,s.useQueryClient)();return(0,l.useMutation)({mutationFn:e=>i._I.removeFromWishlist(e),onSuccess:()=>{e.invalidateQueries({queryKey:["wishlist"]})},onError:e=>{console.error("Error removing from wishlist:",e)}})}},3520:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r="bg-gradient-to-r from-[#F27138] to-[#EE5395]"},59220:function(e,t,n){"use strict";n.d(t,{L:function(){return s.L},Y:function(){return r.Y}});var r=n(66482),s=n(89591)},37830:function(e,t,n){"use strict";n.d(t,{l:function(){return r.l}});var r=n(10325)},72969:function(e,t,n){"use strict";n.d(t,{J:function(){return r},_:function(){return s}});let r=["general","business","examPreparation","teacherTraining","juniorProgram","higherEducation","vocational","undergraduate","postgraduate","languagePathway"],s=e=>"junioProgram"===e?"juniorProgram":e}}]);

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.