1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{9943:(e,t,a)=>{"use strict";function r(e,t){try{var a,r;null==(a=(r=window).gtag)||a.call(r,"event",e,t)}catch(e){}}a.d(t,{s:()=>r})},17194:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(31892);function s(e){let{className:t=""}=e;return(0,r.jsx)("div",{className:"bg-gray-300 animate-pulse rounded ".concat(t)})}},17351:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var r=a(93208),s=a(92837),l=a(39259),n=a(17776);let i="btrnews_token_cookie_lax";function o(){return(0,r.useEffect)(()=>{let e=(0,l.Ri)("token");if(!e||(!function(e){try{if(localStorage.getItem(i))return;(0,l.u3)("token",e),localStorage.setItem(i,"1")}catch(e){}}(e),(0,n.ve)()))return;let t="https://api.btrnews.co.uk/api";t&&(async()=>{try{var a;let{data:r}=await s.A.post("".concat(t,"auth/ensure-refresh"),{},{headers:{Authorization:"Bearer ".concat(e)}}),l=(null==r||null==(a=r.data)?void 0:a.refresh_token)||(null==r?void 0:r.refresh_token);l&&(0,n.setRefreshToken)(l)}catch(e){}})()},[]),(0,r.useEffect)(()=>{let e=!1,t=()=>{!(e||(0,l.Ri)("token"))&&(0,n.ve)()&&(0,n.AI)()};t();let a=()=>t(),r=()=>{document.hidden||t()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",r),()=>{e=!0,window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",r)}},[]),null}},27466:(e,t,a)=>{"use strict";a.d(t,{default:()=>b});var r=a(31892),s=a(93208),l=a(17776),n=a(55559),i=a(47494),o=a(39259),d=a(35160),c=a(88971),u=a(19171),m=a(91787),x=a(50392),h=a(9943);function p(e){var t,a;let{onDone:n}=e,[i,o]=(0,s.useState)(null),[d,u]=(0,s.useState)(!0),[m,p]=(0,s.useState)(new Set),[b,f]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{var t,a;let r=await (0,l.Jt)("follows/onboarding"),s=null!=(a=null==r||null==(t=r.data)?void 0:t.data)?a:null==r?void 0:r.data;!e&&s&&o(s)}catch(t){e||o(null)}finally{e||u(!1)}})(),()=>{e=!0}},[]);let g=e=>p(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a}),v=async()=>{let e=[...m];if(0===e.length){(0,h.s)("onboarding_follows_skipped"),n();return}f(!0),await Promise.allSettled(e.map(e=>(0,l.post)("follows/".concat(encodeURIComponent(e))))),(0,h.s)("onboarding_follows_done",{count:e.length}),(0,x.sX)(),f(!1),n()},w=null!=(t=null==i?void 0:i.your_company)?t:[],y=null!=(a=null==i?void 0:i.popular)?a:[],j=!d&&0===w.length&&0===y.length,k=m.size,N=e=>{let{entity:t}=e,a=m.has(t.slug);return(0,r.jsxs)("button",{type:"button","aria-pressed":a,onClick:()=>g(t.slug),className:"w-full flex items-center gap-3 px-4 py-3 rounded-lg border text-left transition ".concat(a?"border-[#E91E63] bg-[#E91E63]/[0.07]":"border-gray-200 dark:border-gray-700 hover:border-[#E91E63]"),children:[(0,r.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"block text-sm font-semibold text-black dark:text-white truncate",children:t.name}),(0,r.jsxs)("span",{className:"block text-xs text-[#888] mt-0.5",children:[t.article_count," article",1===t.article_count?"":"s"]})]}),(0,r.jsx)("span",{className:"shrink-0 w-6 h-6 rounded-full border flex items-center justify-center ".concat(a?"bg-[#E91E63] border-[#E91E63] text-white":"border-gray-300 dark:border-gray-600"),children:a?(0,r.jsx)(c.YrT,{size:14}):null})]})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-6 pb-4 border-b border-gray-100 dark:border-gray-800",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-black dark:text-white",children:"Follow the companies you care about"}),(0,r.jsx)("p",{className:"text-sm text-[#707070] dark:text-[#b0b0b0] mt-1",children:"When they're in the news, their stories move to the top of your feed. You can change this any time."})]}),(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[d?(0,r.jsx)("p",{className:"text-sm text-[#888] py-6 text-center",children:"Finding companiesâ¦"}):j?(0,r.jsx)("p",{className:"text-sm text-[#888] py-4",children:"Nothing to suggest just yet â you can follow companies from any article or tag page later."}):(0,r.jsxs)(r.Fragment,{children:[w.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-[#888]",children:(null==i?void 0:i.employer)?"You work at ".concat(i.employer):"Your company"}),w.map(e=>(0,r.jsx)(N,{entity:e},e.id))]}),y.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-[#888]",children:"Most covered in BTR"}),y.map(e=>(0,r.jsx)(N,{entity:e},e.id))]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{type:"button",onClick:v,disabled:b,className:"w-full py-3 bg-[#E91E63] text-white text-sm font-semibold rounded-lg hover:bg-[#C2185B] transition disabled:opacity-50",children:b?"Saving...":k>0?"Follow ".concat(k," & continue"):"Continue"}),(0,r.jsx)("p",{className:"text-center text-xs text-[#888] mt-2",children:k>0?"You can unfollow any of these later":"You can add these later"})]})]})]})}function b(){let e=(0,n.j)(),{profile:t}=(0,n.G)(e=>
1e.user),[a,x]=(0,s.useState)(null),[h,b]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[v,w]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[C,E]=(0,s.useState)(""),[S,_]=(0,s.useState)([]),[L,R]=(0,s.useState)([]),[P,F]=(0,s.useState)([]),[D,V]=(0,s.useState)([]),[M,I]=(0,s.useState)([]),[A,B]=(0,s.useState)(!1),[z,T]=(0,s.useState)("profile"),H=(0,s.useRef)(!1),q=(0,s.useRef)(!1),U=(0,s.useCallback)(e=>{e&&(e.company_name&&b(String(e.company_name)),e.job_function&&g(String(e.job_function)),e.job_level&&w(String(e.job_level)),e.country&&E(String(e.country)),e.sector&&j(String(e.sector)),e.sector_other&&N(String(e.sector_other)),Array.isArray(e.topics_of_interest)&&_(e.topics_of_interest.map(String).filter(Boolean)))},[]),Y=e=>_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);(0,s.useEffect)(()=>{let e=()=>x(!0);return window.addEventListener("btrnews:profile-incomplete",e),()=>window.removeEventListener("btrnews:profile-incomplete",e)},[]),(0,s.useEffect)(()=>{let t=!1;return!function(){let e=(0,o.Ri)("token");return!!e&&""!==e&&"null"!==e&&"undefined"!==e}()?void x(!1):((async()=>{try{var a;let r=await (0,l.Jt)("users/profile"),s=(null==r||null==(a=r.data)?void 0:a.data)||(null==r?void 0:r.data);if(t||!s||(e((0,i.p)(s)),U(s),H.current))return;x(!1===s.job_profile_complete)}catch(e){t||x(!1)}})(),()=>{t=!0})},[e,U,null==t?void 0:t.id]),(0,s.useEffect)(()=>{if(!0!==a||q.current)return;q.current=!0;let e=async(e,t)=>{try{var a;let r=await (0,l.Jt)(e),s=(null==r||null==(a=r.data)?void 0:a.data)||(null==r?void 0:r.data);Array.isArray(s)&&t(s)}catch(e){}};e("job-function",R),e("job-level",F),e("sector",V),e("topic",I)},[a]),(0,s.useEffect)(()=>{if(!0!==a)return;let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation())};return window.addEventListener("keydown",t,!0),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t,!0)}},[a]);let Z=D.some(e=>e.name===y)?y:"",O=Z.trim(),G=(0,m.n)(Z),W=G?k.trim():"",J=(0,s.useMemo)(()=>h.trim()&&f.trim()&&v.trim()&&O&&(!G||W)&&C.trim()&&S.length>0,[h,f,v,O,G,W,C,S]),K=async t=>{var a,r,s,n,o;if(t.preventDefault(),!J)return void d.oR.error(0===S.length?"Please choose at least one topic of interest.":G&&!W?"Please tell us which sector you work in.":"Please fill in all professional details to continue.");B(!0);try{let t=await (0,l.F6)("users/profile/professional",{company_name:h.trim(),job_function:f.trim(),job_level:v.trim(),sector:O,...G&&{sector_other:W},country:C.trim(),topics_of_interest:S}),r=(null==t||null==(a=t.data)?void 0:a.data)||(null==t?void 0:t.data);r&&e((0,i.p)(r)),d.oR.success("Thanks! Your profile is complete."),H.current=!0,T("follows")}catch(t){let e=(0,u.S)(t)||(null==t||null==(s=t.response)||null==(r=s.data)?void 0:r.error)||(null==t||null==(o=t.response)||null==(n=o.data)?void 0:n.message);d.oR.error("string"==typeof e?e:"Failed to save. Please try again.")}finally{B(!1)}},X=async()=>{try{await (0,l.post)("auth/logout")}catch(e){}e((0,i.WF)()),(0,o.Yj)("token"),x(!1),window.location.href="/"};if(!0!==a)return null;let Q="w-full px-3 py-2.5 text-sm border border-gray-200 dark:border-gray-700 rounded-lg bg-white dark:bg-[#2a2a2a] text-black dark:text-white focus:outline-none focus:border-[#E91E63] focus:ring-1 focus:ring-[#E91E63]/30 appearance-none",$="w-full px-3 py-2.5 text-sm border border-gray-200 dark:border-gray-700 rounded-lg bg-white dark:bg-[#2a2a2a] text-black dark:text-white focus:outline-none focus:border-[#E91E63] focus:ring-1 focus:ring-[#E91E63]/30";return(0,r.jsx)("div",{className:"fixed inset-0 z-[100000] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",role:"dialog","aria-modal":"true",onContextMenu:e=>e.preventDefault(),children:(0,r.jsx)("div",{className:"bg-white dark:bg-[#1e1e1e] rounded-2xl shadow-2xl max-w-lg w-full max-h-[92vh] overflow-y-auto",children:"follows"===z?(0,r.jsx)(p,{onDone:()=>x(!1)}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-6 pb-4 border-b border-gray-100 dark:border-gray-800",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-black dark:text-white",children:"Complete your profile to continue"}),(0,r.jsx)("p",{className:"text-sm text-[#707070] dark:text-[#b0b0b0] mt-1",children:"We've added these details to every account. Fill them in once and your feed is built around your work from here on."})]}),(0,r.jsxs)("form",{onSubmit:K,className:"p-6 space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"sm:col-span-2",children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Company Name ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"text",value:h,onChange:e=>b(e.target.value),placeholder:"Acme Inc.",className:$})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Job Function ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:f,onChange:e=>g(e.target.value),className:Q,children:[(0,r.jsx)("option",{value:"",children:"Select job function"}),L.map(e=>(0,r.jsx)("option",{value:e.name,children:e.name},e.id))]}),(0,r.jsx)(c.fK4,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Job Level ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:v,onCh
1ange:e=>w(e.target.value),className:Q,children:[(0,r.jsx)("option",{value:"",children:"Select job level"}),P.map(e=>(0,r.jsx)("option",{value:e.name,children:e.name},e.id))]}),(0,r.jsx)(c.fK4,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Sector ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:Z,onChange:e=>j(e.target.value),className:Q,children:[(0,r.jsx)("option",{value:"",children:"Select sector"}),D.map(e=>(0,r.jsx)("option",{value:e.name,children:e.name},e.id))]}),(0,r.jsx)(c.fK4,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]}),G&&(0,r.jsx)("input",{type:"text",value:k,onChange:e=>N(e.target.value),maxLength:m.p,placeholder:"Please specify your sector","aria-label":"Your sector",className:"".concat($," mt-2")})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Country ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"text",value:C,onChange:e=>E(e.target.value),placeholder:"United Kingdom",className:$})]}),(0,r.jsxs)("div",{className:"sm:col-span-2",children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-[#555] dark:text-[#aaa] mb-1",children:["Topics of interest ",(0,r.jsx)("span",{className:"text-red-500",children:"*"}),(0,r.jsx)("span",{className:"ml-1 font-normal text-[#888]",children:"(pick at least one â we use these to personalise your feed)"})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2 pt-1",children:M.map(e=>{let t=S.includes(e.name);return(0,r.jsx)("button",{type:"button","aria-pressed":t,onClick:()=>Y(e.name),className:"px-3 py-1.5 text-xs rounded-full border transition ".concat(t?"bg-[#E91E63] border-[#E91E63] text-white":"bg-transparent border-gray-300 dark:border-gray-700 text-[#555] dark:text-[#bbb] hover:border-[#E91E63]"),children:e.name},e.id)})})]})]}),(0,r.jsx)("button",{type:"submit",disabled:A||!J,className:"w-full py-3 bg-[#E91E63] text-white text-sm font-semibold rounded-lg hover:bg-[#C2185B] transition disabled:opacity-50 mt-2",children:A?"Saving...":"Save & Continue"}),(0,r.jsx)("button",{type:"button",onClick:X,disabled:A,className:"w-full text-xs text-[#888] hover:text-[#E91E63] underline transition disabled:opacity-50",children:"Sign out instead"})]})]})})})}},29028:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var r=a(93208),s=a(38494),l=a(35160),n=a(35619),i=a(31477),o=a(17776),d=a(19171);let c=async e=>{try{let r=await (0,o.Jt)("ads");if((null==r?void 0:r.status)===200||(null==r?void 0:r.status)===201){var t,a;let s=null!=(a=null==r||null==(t=r.data)?void 0:t.data)?a:[];e((0,n.bg)(s)),(0,i.UR)(Date.now())}}catch(t){let e=(0,d.S)(t)||"Failed to load ads";l.oR.error(e)}},u=()=>{let e=(0,s.wA)();return(0,r.useEffect)(()=>{let t,a,r=window.requestIdleCallback,s=window.cancelIdleCallback;r?t=r(()=>c(e),{timeout:2e3}):a=setTimeout(()=>c(e),1500);let l=setInterval(()=>{c(e)},72e5);return()=>{void 0!==t&&s&&s(t),a&&clearTimeout(a),clearInterval(l)}},[e]),null}},31897:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var r=a(31892),s=a(93208),l=a(59950),n=a(17776);let i=/bot|crawler|crawling|spider|slurp|mediapartners|adsbot|feedfetcher|facebookexternalhit|facebookcatalog|linkedinbot|twitterbot|whatsapp|telegrambot|discordbot|slackbot|skypeuripreview|embedly|quora link preview|pinterest|redditbot|applebot|petalbot|bingpreview|yandex|baiduspider|duckduckbot|semrush|ahrefs|mj12|dotbot|screaming frog|lighthouse|chrome-lighthouse|headlesschrome|phantomjs|puppeteer|playwright|gtmetrix|pingdom|uptimerobot|monitoring/i,o="btr_app_promo_snoozed_until",d=["/verify-email","/reset-password","/billing","/subscribe","/preview","/profile"];function c(e){try{localStorage.setItem(o,String(Date.now()+864e5*e))}catch(e){}}function u(){let e=(0,l.usePathname)(),t=(0,l.useSearchParams)(),[a,u]=(0,s.use
1State)(null),[m,x]=(0,s.useState)(null),h=(0,s.useRef)(null);(0,s.useEffect)(()=>{if("1"===t.get("web")){c(365),u(null);return}if(d.some(t=>e===t||e.startsWith("".concat(t,"/")))||Date.now()<function(){try{let e=localStorage.getItem(o);return e&&parseInt(e,10)||0}catch(e){return 0}}()||!0===navigator.standalone||"function"==typeof window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches)return;let a=function(){var e;if("undefined"==typeof navigator)return null;let t=navigator.userAgent||"";if(i.test(t))return null;if(/android/i.test(t)&&!/\b(tv|googletv|crkey|nintendo|playstation|xbox)\b/i.test(t))return"android";if(/iphone|ipod|ipad/i.test(t))return"ios";let a=navigator;return/macintosh|mac os x/i.test(t)&&(null!=(e=a.maxTouchPoints)?e:0)>1?"ios":null}();if(!a)return;let r=!1;return(async()=>{try{var e,t,s,l,i,o;let d=await (0,n.Jt)("site-config/public"),c=null!=(i=null!=(l=null==d||null==(e=d.data)?void 0:e.data)?l:null==d?void 0:d.data)?i:{};if(r||"true"!==c["mobile_app:promo_enabled"])return;let m=null==(t="ios"===a?c["mobile_app:ios_url"]:c["mobile_app:android_url"])?void 0:t.trim();if(!m)return;let h=parseInt(null!=(o=c["mobile_app:promo_snooze_days"])?o:"7",10);x(a),u({headline:(null==(s=c["mobile_app:promo_headline"])?void 0:s.trim())||"Read BTR News in the app",storeUrl:m,snoozeDays:Number.isFinite(h)?Math.max(0,h):7})}catch(e){}})(),()=>{r=!0}},[e,t]);let p=(0,s.useCallback)(()=>{a&&c(a.snoozeDays),u(null)},[a]);return((0,s.useEffect)(()=>{var e;if(!a)return;let t=document.body.style.overflow;document.body.style.overflow="hidden",null==(e=h.current)||e.focus();let r=e=>{"Escape"===e.key&&p()};return document.addEventListener("keydown",r),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",r)}},[a,p]),a&&m)?(0,r.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"app-promo-heading",className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/80 backdrop-blur-sm p-5",children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-2xl bg-white dark:bg-[#1e1e1e] p-7 text-center shadow-2xl",children:[(0,r.jsx)("div",{className:"mx-auto mb-5 flex h-16 w-16 items-center justify-center rounded-2xl bg-[#E91E63]",children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"#fff",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:"h-8 w-8",children:[(0,r.jsx)("rect",{x:"6",y:"2",width:"12",height:"20",rx:"2.5"}),(0,r.jsx)("path",{d:"M10.5 18.5h3"})]})}),(0,r.jsx)("h2",{id:"app-promo-heading",className:"mb-2 text-2xl font-bold text-gray-900 dark:text-white",children:a.headline}),(0,r.jsx)("p",{className:"mb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:"Breaking Build to Rent news, research and property listings â faster, with alerts for the stories you follow."}),(0,r.jsxs)("a",{ref:h,href:a.storeUrl,rel:"noopener",onClick:()=>c(90),className:"block w-full rounded-full bg-[#E91E63] px-6 py-3.5 text-base font-bold text-white transition-colors hover:bg-[#c2185b] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#E91E63] focus-visible:ring-offset-2",children:["Get it on the ","ios"===m?"App Store":"Google Play"]}),(0,r.jsx)("button",{type:"button",onClick:p,className:"mt-4 w-full py-2 text-sm font-medium text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200",children:"Continue in browser"})]})}):null}},42076:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,84855,23)),Promise.resolve().then(a.bind(a,55833)),Promise.resolve().then(a.bind(a,70820)),Promise.resolve().then(a.bind(a,48708)),Promise.resolve().then(a.bind(a,61997)),Promise.resolve().then(a.bind(a,69089)),Promise.resolve().then(a.bind(a,51751)),Promise.resolve().then(a.bind(a,31897)),Promise.resolve().then(a.bind(a,96359)),Promise.resolve().then(a.bind(a,81315)),Promise.resolve().then(a.bind(a,76389)),Promise.resolve().then(a.bind(a,78623)),Promise.resolve().then(a.bind(a,27466)),Promise.resolve().then(a.bind(a,88022)),Promise.resolve().then(a.bind(a,29028)),Promise.resolve().then(a.bind(a,17351)),Promise.resolve().then(a.t.bind(a,94632,23)),Promise.resolve().then(a.t.bind(a,38823,23)),Promise.resolve().then(a.t.bind(a,69989,23)),Promise.resolve().then(a.bind(a,35160)),Promise.resolve().then(a.t.bind(a,60897,23))},48708:(e,t,a)=>{"use strict";a.d(t,{default:()=>W});var r=a(31892),s=a(93208),l=a(15841),n=a(82753),i=a(85368),o=a(74646),d=a(55559),c=a(97010),u=a(78479),m=a(1731),x=a(35160),h=a(17776),p=a(39259),b=a(31477),f=a(59950),g=a(47494);
1let v="0x4AAAAAAENROAzqkgSXDqnm",w=!!v,y=(0,s.forwardRef)(function(e,t){let{onVerify:a,onExpire:l}=e,n=(0,s.useRef)(null),i=(0,s.useRef)(null),o=(0,s.useRef)(a),d=(0,s.useRef)(l);(0,s.useEffect)(()=>{o.current=a,d.current=l});let c=(0,s.useCallback)(()=>{window.turnstile&&n.current&&!i.current&&(i.current=window.turnstile.render(n.current,{sitekey:v,callback:e=>o.current(e),"expired-callback":()=>{var e;return null==(e=d.current)?void 0:e.call(d)},"error-callback":()=>{var e;return null==(e=d.current)?void 0:e.call(d)}}))},[]);return((0,s.useImperativeHandle)(t,()=>({reset:()=>{if(window.turnstile){if(i.current)try{window.turnstile.reset(i.current);return}catch(e){i.current=null}c()}}}),[c]),(0,s.useEffect)(()=>{if(!v)return;let e=null;if(window.turnstile)c();else{let t="cf-turnstile-script";(e=document.getElementById(t))||((e=document.createElement("script")).id=t,e.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",e.async=!0,e.defer=!0,document.head.appendChild(e)),e.addEventListener("load",c)}return()=>{if(null==e||e.removeEventListener("load",c),i.current&&window.turnstile){try{window.turnstile.remove(i.current)}catch(e){}i.current=null}}},[c]),v)?(0,r.jsx)("div",{ref:n,className:"my-3 flex justify-center"}):null});var j=a(19171),k=a(43042);let N=e=>{let{isOpen:t,onClose:l,openRegister:n}=e,[v,N]=(0,s.useState)(!1),[C,E]=(0,s.useState)(null),[S,_]=(0,s.useState)(null),L=(0,s.useRef)(null),R=(0,d.j)();(0,f.useRouter)();let P=async()=>{try{let t=await (0,h.Jt)("users/profile");if((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201){var e;R((0,g.p)(null==t||null==(e=t.data)?void 0:e.data))}}catch(t){let e=(0,j.S)(t)||"Failed to Profile data";x.oR.error(e)}},F=e=>{S&&_(null),D.handleChange(e)},D=(0,u.Wx)({initialValues:{email:"",password:""},validationSchema:m.Ik({email:m.Yj().required("Email is required").email("Please enter a valid email address"),password:m.Yj().min(8,"Minimum 8 characters").required("Password is required")}),onSubmit:async(e,t)=>{var r,s,n,i,o,d,u,m,f,g,v,y,k,N,S,F,V,M,I,A;let{setSubmitting:B}=t;if(_(null),w&&!C){let e="Still checking you're human â give it a second and try again.";_(e),x.oR.error(e),B(!1);return}try{let t=await (0,h.post)("auth/login",{...e,email:e.email.trim().toLowerCase(),...C?{turnstile_token:C}:{}}),w={id:null==t||null==(n=t.data)||null==(s=n.data)||null==(r=s.user)?void 0:r.id,username:null==t||null==(d=t.data)||null==(o=d.data)||null==(i=o.user)?void 0:i.username,profile_picture_url:null==t||null==(f=t.data)||null==(m=f.data)||null==(u=m.user)?void 0:u.profile_picture_url};if((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201){(0,p.u3)("token",null==t||null==(v=t.data)||null==(g=v.data)?void 0:g.token);let e=null==t||null==(k=t.data)||null==(y=k.data)?void 0:y.refresh_token;e&&(0,h.setRefreshToken)(e),(0,b.iA)(w),R((0,c.QF)(w)),P(),(0,b.nr)(null==t||null==(F=t.data)||null==(S=F.data)||null==(N=S.user)?void 0:N.email),x.oR.success("Login successful!"),D.setValues({email:"",password:""}),l();let r=null==t||null==(V=t.data)?void 0:V.data;if((null==r?void 0:r.must_change_password)===!0||(null==r||null==(M=r.user)?void 0:M.must_change_password)===!0)return void R((0,c.rV)());try{let e=localStorage.getItem("btrnews_pending_action");if(e){let t=JSON.parse(e);if(localStorage.removeItem("btrnews_pending_action"),"subscribe_premium"===t.action){let{post:e}=await Promise.resolve().then(a.bind(a,17776)),r=await e("billing/subscribe-premium",{returnTo:t.returnTo}),s=(null==r||null==(I=r.data)?void 0:I.data)||(null==r?void 0:r.data);(null==s?void 0:s.checkout_url)&&(window.location.href=s.checkout_url)}}}catch(e){}}}catch(a){let t=(0,j.S)(a)||((null==a?void 0:a.response)?"Login failed. Please try again.":"Network error â please check your connection and try again.");_(t),"Since, we migrated old password won't work. please click on forget password to generate a new password!"===t&&(R((0,c.yo)({email:e.email})),l()),x.oR.error(t),E(null),null==(A=L.current)||A.reset()}finally{B(!1)}}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>
1R((0,c.sC)()),className:"cursor-pointer hover:bg-[#E9E9E9] dark:text-white text-black border border-[#C7C7C7] px-3 md:px-[22px] py-1.5 md:py-2 rounded-full text-xs md:text-sm uppercase font-medium dark:hover:bg-[#272727]",children:"Login"}),t&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:text-white dark:bg-[#121212] w-full max-w-md rounded-md p-5 md:p-10 relative shadow-lg",children:[(0,r.jsxs)("button",{onClick:l,className:"absolute bg-transparent top-7 right-4 w-8 h-8 flex items-center justify-center border border-[#D4D4D4] rounded-full ",children:[(0,r.jsx)(i.WQq,{}),""]}),(0,r.jsxs)("h2",{className:"text-lg md:text-[28px] font-bold mb-3 mt-4 leading-9",children:["LOGIN TO YOUR ",(0,r.jsx)("br",{})," EXISTING ACCOUNT"]}),(0,r.jsxs)("p",{className:"text-sm text-gray-500 mb-6",children:["Donât have an Account?"," ",(0,r.jsx)("button",{type:"button",onClick:n,className:"text-[#E91E63] underline cursor-pointer",children:"Register Here"})]}),(0,r.jsxs)("form",{onSubmit:D.handleSubmit,children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Email"}),(0,r.jsx)("input",{type:"email",name:"email",placeholder:"e.g., [email protected]",className:"w-full border border-[#D4D4D4] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] rounded px-4 py-2 text-sm bg-white",value:D.values.email,onChange:F,onBlur:D.handleBlur}),D.touched.email&&D.errors.email&&(0,r.jsx)("p",{className:"text-sm text-red-600 mt-1",children:D.errors.email})]}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:v?"text":"password",name:"password",placeholder:"Enter your password",className:"w-full border border-[#D4D4D4] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] rounded px-4 py-2 text-sm bg-white",value:D.values.password,onChange:F,onBlur:D.handleBlur}),(0,r.jsx)("button",{type:"button",onClick:()=>N(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:v?(0,r.jsx)(o.rs7,{}):(0,r.jsx)(o.yMb,{})})]}),D.touched.password&&D.errors.password&&(0,r.jsx)("p",{className:"text-sm text-red-600 mt-1",children:D.errors.password})]}),(0,r.jsx)(y,{ref:L,onVerify:E,onExpire:()=>E(null)}),S&&(0,r.jsx)("p",{role:"alert",className:"mb-4 rounded border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-300",children:S}),(0,r.jsx)("button",{type:"submit",disabled:D.isSubmitting||w&&!C,className:"w-full bg-black dark:bg-[#1e1e1e] dark:border-[#2a2a2a] text-white py-2 rounded hover:opacity-90 disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:opacity-60 text-sm font-medium mb-4",children:D.isSubmitting?"Logging in...":w&&!C?"Verifying you're human...":"Login"})]}),(0,r.jsx)("p",{onClick:()=>R((0,c.yo)({email:""})),className:"text-center text-sm cursor-pointer hover:underline",children:"Forgot password?"}),(0,r.jsx)("a",{href:"mailto:".concat(k.env.NEXT_PUBLIC_CONTACT_EMAIL),className:"text-center text-sm mt-4 cursor-pointer hover:underline text-[#E91E63] block",children:"Need Help?"})]})})]})};function C(){let[e,t]=(0,s.useState)(!1),[a,l]=(0,s.useState)(""),[n,i]=(0,s.useState)(!1),[o,u]=(0,s.useState)(""),[m,p]=(0,s.useState)(""),b=(0,d.j)(),f=e=>/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/.test(e),g=async()=>{if(u(""),p(""),!a)return void p("Email is required.");if(!f(a))return void(/[A-Z]/.test(a)?p("Email must be in lowercase."):p("Please enter a valid email address."));i(!0);try{let e=await (0,h.post)("auth/resend-verification",{email:a});((null==e?void 0:e.status)===200||(null==e?void 0:e.status)===201)&&(u("Verification email sent!"),x.oR.success("Verification email sent!"),b((0,c.UV)()),t(!1))}catch(t){let e=(0,j.S)(t)||"Failed to send verification email.";x.oR.error(e),u("Failed to send verification email.")}finally{i(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-center text-sm mt-4 cursor-pointer hover:underline",onClick:()=>t(!0),children:"Resend Email Verification"}),e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:text-white dark:bg-[#121212] w-full max-w-md rounded-md p-5 relative shadow-lg",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Resend Verification"}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("input",{type:"email",placeholder:"Enter your email",value:a,onChange:e=>{l(e.target.value),p("")},className:"w-full border px-4 py-2 rounded text-sm ".concat(m?"border-red-500":"border-[#D8DAE5] dark:border-[#2a2a2a]"," dark:bg-[#1e1e1e] bg-white")}),m&&(0,r.jsx)("p",{className:"text-red-500 text-sm",children:m}),(0,r.jsx)("button",{onClick:g,className:"bg-[#e91e63] text-white px-4 py-2 rounded w-full text-sm",disabled:n,children:n?"Sending...":"Send"})]}),o&&(0,r.jsx)("p",{className:"mt-3 text-sm text-center text-gray-700 dark:text-gray-300",children:o}),(0,r.jsx)("button",{onClick:()=>{t(!1),l(""),u(""),p("")},className:"text-sm text-gray-500 hover:underline mt-4 block mx-auto",children:"Close"})]})})]})}var E=a(43042);let S=e=>{let{isOpen:t,onClose:l,openLogin:n}
1=e,p=(0,d.j)(),[f,g]=(0,s.useState)({password:!1,confirm:!1}),[v,k]=(0,s.useState)(null),[N,S]=(0,s.useState)(null),[_,L]=(0,s.useState)(null),R=(0,s.useRef)(null),P=e=>{g(t=>({...t,[e]:!t[e]}))},F=(0,u.Wx)({initialValues:{username:"",email:"",password:"",confirmPassword:"",first_name:"",last_name:""},validationSchema:m.Ik({username:m.Yj().min(3,"Username must be at least 3 characters").max(60,"Username must be at most 60 characters").matches(/^[a-zA-Z0-9._-]+$/,"Username can only contain letters, numbers, dots, underscores and hyphens").required("Username is required"),email:m.Yj().required("Email is required").email("Please enter a valid email address"),password:m.Yj().min(8,"Password must be at least 8 characters").required("Password is required"),confirmPassword:m.Yj().oneOf([m.KR("password")],"Passwords must match").required("Confirm Password is required"),first_name:m.Yj().required("First name is required"),last_name:m.Yj().required("Last name is required")}),onSubmit:async(e,t)=>{var r,s,n,i,o,d,u,m,f;let{setSubmitting:g,resetForm:y}=t;if(null===v){x.oR.error("Please enter a valid username."),g(!1);return}if(w&&!_){x.oR.error("Please complete the human verification."),g(!1);return}let k={username:e.username,email:e.email.trim().toLowerCase(),password:e.password,first_name:e.first_name,last_name:e.last_name,..._?{turnstile_token:_}:{}};try{let e=await (0,h.post)("auth/signup",k);((null==e?void 0:e.status)===200||(null==e?void 0:e.status)===201)&&(a.e(7045).then(a.bind(a,97045)).then(e=>{let{track:t,flush:a}=e;t("registration"),a()}).catch(()=>{}),x.oR.success((null==e||null==(s=e.data)||null==(r=s.data)?void 0:r.message)||"Registration successful!"),y(),l(),p((0,c.GR)({email:null==e||null==(o=e.data)||null==(i=o.data)||null==(n=i.user)?void 0:n.email})),(0,b.at)({email:null==e||null==(m=e.data)||null==(u=m.data)||null==(d=u.user)?void 0:d.email}),p((0,c.UV)()))}catch(t){let e=(0,j.S)(t)||"Registration failed";x.oR.error(e),L(null),null==(f=R.current)||f.reset()}finally{g(!1)}}});return(0,s.useEffect)(()=>{let e=F.values.username;if(!e||F.errors.username)return void k(null);N&&clearTimeout(N);let t=setTimeout(async()=>{try{var t,a;let r=await (0,h.Jt)("auth/check-username?username=".concat(e));(null==r||null==(a=r.data)||null==(t=a.data)?void 0:t.available)===!0?k(!0):k(null)}catch(e){k(!1)}},500);return S(t),()=>clearTimeout(t)},[F.values.username]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>p((0,c.Ws)()),className:"text-black text-xs md:text-sm uppercase font-medium cursor-pointer dark:text-white",children:"Register"}),t&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:text-white dark:bg-[#121212] w-full max-w-md rounded-md p-5 md:p-10 relative shadow-lg",children:[(0,r.jsxs)("button",{onClick:l,className:"absolute bg-white dark:bg-[#121212] top-7 right-4 w-8 h-8 flex items-center justify-center border border-[#D4D4D4] rounded-full cursor-pointer ",children:[(0,r.jsx)(i.WQq,{}),""]}),(0,r.jsxs)("h2",{className:"text-lg md:text-[28px] font-bold mb-3 mt-4 leading-9",children:["REGISTER FOR ",(0,r.jsx)("br",{})," A FREE ACCOUNT"]}),(0,r.jsxs)("p",{className:"text-sm text-gray-500 mb-6",children:["Already have an Account?"," ",(0,r.jsx)("button",{type:"button",onClick:()=>{l(),n()},className:"text-[#E91E63] underline cursor-pointer",children:"Login Here"})]}),(0,r.jsxs)("form",{onSubmit:F.handleSubmit,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["Username",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",name:"username",placeholder:"ex. johnsmith",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.username,onChange:F.handleChange,onBlur:F.handleBlur}),v&&(0,r.jsx)(o.jh$,{className:"absolute right-3 top-1/2 -translate-y-1/2 text-green-500 text-xl"})]}),F.touched.username&&F.errors.username&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.username}),!1===v&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:"Username is already taken"}),null===v&&F.touched.username&&F.values.username&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:"Please choose a valid username."})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["Company Email",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"email",name:"email",placeholder:"ex. [email protected]",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.email,onChange:F.handleChange,onBlur:F.handleBlur}),F.touched.email&&F.errors.email&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.email})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"w-1/2",children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["First Name",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"text",name:"first_name",placeholder:"ex. John",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.first_name,onChange:F.handleChange,onBlur:F.handleBlur}),F.touched.first_name&&F.errors.first_name&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.first_name})]}),(0,r.jsxs)("div",{className:"w-1/2",children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["Last Name",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"text",name:"last_name",placeholder:"ex. Smith",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.last_name,onChange:F.handleChange,onBlur:F.handleBlur}),F.touched.last_name&&F.errors.last_name&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.last_name})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"w-1/2",children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["Password",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:f.password?"text":"password",name:"password",placeholder:"Password",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.password,onChange:F.handleChange,onBlur:F.handleBlur}),(0,r.jsx)("button",{type:"button",onClick:()=>P("password"),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:f.password?(0,r.jsx)(o.rs7,{}):(0,r.jsx)(o.yMb,{})})]}),F.touched.password&&F.errors.password&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.password})]}),(0,r.jsxs)("div",{className:"w-1/2",children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-1",children:["Confirm Password",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:f.confirm?"text":"password",name:"confirmPassword",placeholder:"Re-enter Password",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:F.values.confirmPassword,onChange:F.handleChange,onBlur:F.handleBlur}),(0,r.jsx)("button",{type:"button",onClick:()=>P("confirm"),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:f.confirm?(0,r.jsx)(o.rs7,{}):(0,r.jsx)(o.yMb,{})})]}),F.touched.confirmPassword&&F.errors.confirmPassword&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:F.errors.confirmPassword})]})]}),(0,r.jsx)(y,{ref:R,onVerify:L,onExpire:()=>L(null)}),(0,r.jsx)("button",{type:"submit",disabled:F.isSubmitting||w&&!_,className:"w-full mt-4 dark:bg-[#1e1e1e] dark:border-[#2a2a2a] bg-black text-white py-2 rounded hover:opacity-90 text-sm font-medium",children:F.isSubmitting?"Registering...":"Register"})]}),(0,r.jsx)(C,{}),(0,r.jsx)("a",{href:"mailto:".concat(E.env.NEXT_PUBLIC_CONTACT_EMAIL),className:"text-center text-sm mt-4 cursor-pointer hover:underline text-[#E91E63] block",children:"Need Help?"})]})})]})};var _=a(75757),L=a.n(_),R=a(85939),P=a(64285);function F(){var e;
1let[t,a]=(0,s.useState)(!1),l=(0,s.useRef)(null),n=(0,f.useRouter)(),i=(0,d.j)(),{profile:o}=(0,d.G)(e=>e.user),u=null==o?void 0:o.profile_picture_url;return(0,s.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&a(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,r.jsxs)("div",{className:"relative inline-block text-left",ref:l,children:[(0,r.jsxs)("button",{onClick:()=>a(e=>!e),className:"flex items-center gap-2 focus:outline-none",children:[(e=>{if(!e||"string"!=typeof e)return!1;let t=/^https?:\/\/.+/.test(e),a=e.toLowerCase().includes("/null")||e.toLowerCase().endsWith("null");return t&&!a})(u)?(0,r.jsx)(P.default,{src:u,alt:"user",width:40,height:40,className:"rounded-full w-[40px] h-[40px] object-cover",onError:e=>{e.currentTarget.style.display="none"}}):(0,r.jsx)("div",{className:"w-[40px] h-[40px] rounded-full bg-gray-300 flex items-center justify-center text-xl font-semibold text-white mx-auto",children:(null==o||null==(e=o.username)?void 0:e.charAt(0).toUpperCase())||"U"}),(0,r.jsx)("span",{className:"hidden font-medium text-[14px] uppercase leading-none align-middle dark:text-white",children:null==o?void 0:o.username}),(0,r.jsx)(R.Vr3,{className:"text-xs mt-0.5 dark:text-white"})]}),t&&(0,r.jsx)("div",{className:"absolute right-0 mt-2 w-44 bg-white dark:bg-[#121212] rounded-md shadow-lg ring-1 ring-black/10 z-50",children:(0,r.jsxs)("ul",{className:"py-1 text-sm text-gray-700 dark:text-white",children:[(0,r.jsx)("li",{children:(0,r.jsx)("button",{className:"w-full text-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-[#1e1e1e]",onClick:()=>{n.push("/profile"),a(!1)},children:"Profile"})}),(0,r.jsx)("li",{children:(0,r.jsx)("button",{className:"w-full text-left px-4 py-2 hover:bg-gray-100 dark:hover:bg-[#1e1e1e]",onClick:()=>i((0,c.vK)()),children:"Logout"})})]})})]})}let D=()=>{let{isVerifyEmailOpen:e,registerInfo:t}=(0,d.G)(e=>e.modal),a=(0,b.qz)(),s=async()=>{let e={email:(null==t?void 0:t.email)||(null==a?void 0:a.email)};try{let t=await (0,h.post)("auth/resend-verification",e);((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201)&&x.oR.success("Verification email resent!")}catch(t){var r,s;let e=(null==t||null==(s=t.response)||null==(r=s.data)?void 0:r.error)||"Verification failed";x.oR.error(e)}};return(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:text-white dark:bg-[#121212] rounded-md p-10 flex flex-col items-center text-center w-[400px] h-[367px] pt-24",children:[(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{"clip-path":"url(#clip0_711_2038)",children:[(0,r.jsx)("path",{d:"M53.48 26.6144V8.23665H14.5216V26.6144L6.64062 33.5104V56.826C6.64062 59.6923 8.96732 62.0244 11.827 62.0244H56.1744C59.034 62.0244 61.3607 59.6923 61.3607 56.826V33.5104L53.48 26.6144ZM58.1739 33.8279L53.48 36.4393V29.7196L58.1739 33.8279ZM51.1454 10.5775V37.7411L42.6667 42.4569L43.7976 44.5015L59.0208 36.0301V56.8265C59.0208 57.1817 58.9369 57.518 58.8179 57.8325L37.5096 44.7835C35.3398 43.4547 32.6479 43.4547 30.4811 44.7835L9.17283 57.8325C9.05379 57.518 8.96992 57.1844 8.96992 56.8265V36.0301L24.1931 44.5015L25.324 42.4569L16.8453 37.7411L16.8507 10.5775H51.1454ZM14.5218 36.4395L9.82794 33.8281L14.5218 29.7198V36.4395ZM34.001 59.6816H11.827C11.5077 59.6816 11.2155 59.5975 10.9287 59.4999L31.7037 46.7764C33.1187 45.9087 34.8826 45.9087 36.2976 46.7764L57.0726 59.4999C56.7858 59.5975 56.4936 59.6816 56.1744 59.6816H34.001Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M24.332 35.0428H42.7993V37.3803H24.332V35.0428Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M33.3285 32.2006C38.4797 32.2006 42.6571 27.9919 42.6571 22.8503C42.6571 17.7086 38.4799 13.5 33.3285 13.5C28.1772 13.5 24 17.6869 24 22.8503C24 28.0137 28.1772 32.2006 33.3285 32.2006ZM31.9866 23.9353L36.64 19.2711L38.2849 20.9198L31.9866 27.2545L28.3721 23.6315L30.017 21.9828L31.9866 23.9353Z",fill:"#E91E63"})]}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"26.5",ry:"4",fill:"#D9D9D9"}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_711_2038",children:(0,r.jsx)("rect",{width:"55.4074",height:"54.1481",fill:"white",transform:"translate(6.29688 8.05556)"})})})]}),(0,r.jsx)("h2",{className:"text-lg md:text-2xl font-bold mb-2 mt-3",children:"VERIFY YOUR EMAIL"}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-[#b0b0b0] mt-3",children:["Weâve sent you a verification email,Please",(0,r.jsx)("br",{}),"click on âVerifyâ to continue"]}),(0,r.jsx)("p",{onClick:()=>s(),className:"text-xs text-center mt-7 text-[#e91e63] cursor-pointer p-5",children:"Resend Email Verification"})]})})})};var V=a(99539);a(27320);var M=a(91787);let I=e=>{let{formData:t}
1=e,[a,l]=(0,s.useState)([]),[n,i]=(0,s.useState)([]),[o,u]=(0,s.useState)(!1),m=(0,d.j)(),{isTopicsInterestOpen:p}=(0,d.G)(e=>e.modal),b=(0,f.useRouter)(),g=e=>{l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},v=async()=>{var e,r,s;if(a.length<1)return void x.oR.error("Please select at least one topics of interest before continuing.");u(!0);let l={company_name:t.company_name||"",job_function:t.job_function||"",job_level:t.job_level||"",sector:t.sector||"",...(0,M.n)(t.sector)&&{sector_other:(null==(e=t.sector_other)?void 0:e.trim())||""},phone:t.phone_number||"",country:t.country||"",topics_of_interest:a};try{let e=await (0,h.F6)("users/profile",l);((null==e?void 0:e.status)===200||(null==e?void 0:e.status)===201)&&(x.oR.success("Profile created successfully!"),m((0,c.HF)()),m((0,c.Up)()),b.push("/"))}catch(t){let e=(null==t||null==(s=t.response)||null==(r=s.data)?void 0:r.error)||"Verification failed";x.oR.error(e)}finally{u(!1)}},w=async()=>{try{let t=await (0,h.Jt)("topic");if((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201){var e;i(null==t||null==(e=t.data)?void 0:e.data)}}catch(t){let e=(0,j.S)(t)||"Failed to fetch Topic posts";x.oR.error(e)}};return(0,s.useEffect)(()=>{w()},[]),(0,r.jsx)(r.Fragment,{children:p&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:text-white dark:bg-[#121212] w-full max-w-3xl rounded-md p-10 relative shadow-lg",children:[(0,r.jsx)("p",{className:"text-sm text-[#E91E63] font-medium mb-1",children:"Complete your profile"}),(0,r.jsxs)("h2",{className:"text-lg md:text-[28px] font-bold mb-3 mt-4 leading-9",children:["LET US KNOW YOUR TOPICS",(0,r.jsx)("br",{}),"OF INTEREST"]}),(0,r.jsx)("p",{className:"text-sm font-medium mb-4",children:"Select 3 or more"}),(0,r.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-8",children:(null==n?void 0:n.length)>0?n.map((e,t)=>(0,r.jsxs)("label",{className:"flex items-center space-x-2 text-sm text-gray-700 dark:text-[#b0b0b0] cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:a.includes(e.name),onChange:()=>g(e.name),className:"accent-black dark:accent-white w-4 h-4"}),(0,r.jsx)("span",{children:e.name})]},t)):(0,r.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400 col-span-full",children:"No topics found."})}),(0,r.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,r.jsx)("button",{onClick:()=>m((0,c.HF)()),className:"bg-white border cursor-pointer text-black py-2 px-6 rounded text-sm hover:bg-gray-100 w-full",children:"Back"}),(0,r.jsx)("button",{className:"bg-black text-white cursor-pointer py-2 px-6 rounded text-sm hover:opacity-90 w-full",onClick:()=>v(),children:o?"Updating...":"Finish"})]})]})})})},A=()=>{let{isJobDetailsOpen:e}=(0,d.G)(e=>e.modal),t=(0,d.j)(),[a,l]=(0,s.useState)([]),[n,i]=(0,s.useState)([]),[o,u]=(0,s.useState)({company_name:"",phone_number:"",job_function:"",job_level:"",sector:"",sector_other:"",country:""}),[m,p]=(0,s.useState)([]),[b,f]=(0,s.useState)({}),g=null==m?void 0:m.map(e=>null==e?void 0:e.name),v=(e,t)=>{u(a=>({...a,[e]:t})),f(t=>({...t,[e]:""}))},w=()=>{let e={};return o.job_function||(e.job_function="Job Function is required"),o.job_level||(e.job_level="Job Level is required"),o.country||(e.country="Country is required"),o.sector&&""!==o.sector.trim()?(0,M.n)(o.sector)&&!o.sector_other.trim()&&(e.sector_other="Please specify your sector"):e.sector="Sector is required",f(e),0===Object.keys(e).length},y=async()=>{try{let t=await (0,h.Jt)("sector");if((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201){var e;p(null==t||null==(e=t.data)?void 0:e.data)}}catch(t){let e=(0,j.S)(t)||"Failed to fetch Sector posts";x.oR.error(e)}},k=async()=>{try{let a=await (0,h.Jt)("job-function");if((null==a?void 0:a.status)===200||(null==a?void 0:a.status)===201){var e,t;let r=null!=(t=null==a||null==(e=a.data)?void 0:e.data)?t:[];l(r.map(e=>e.name))}}catch(e){}},N=async()=>{try{let a=await (0,h.Jt)("job-level");if((null==a?void 0:a.status)===200||(null==a?void 0:a.status)===201){var e,t;let r=null!=(t=null==a||null==(e=a.data)?void 0:e.data)?t:[];i(r.map(e=>e.name))}}catch(e){}};return(0,s.useEffect)(()=>{y(),k(),N()},[]),(0,r.jsxs)(r.Fragment,{children:[e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#F8F8F8] dark:bg-[#121212] dark:text-white w-full max-w-3xl rounded-md p-10 relative shadow-lg",children:[(0,r.jsx)("p",{className:"text-sm text-[#E91E63] font-medium mb-1",children:"Complete your profile"}),(0,r.jsxs)("h2",{className:"text-lg md:text-[28px] font-bold mb-3 mt-4 leading-9",children:["ENTER YOUR JOB ",(0,r.jsx)("br",{})," DETAILS"]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Company Name"}),(0,r.jsx)("input",{type:"text",value:o.company_name,onChange:e=>v("company_name",e.target.value),placeholder:"Acme Inc.",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1",children:"Phone Number"}),(0,r.jsx)(V.Ay,{placeholder:"Enter phone number",value:o.phone_number,onChange:e=>v("phone_number",e||""),defaultCountry:"GB",className:" w-full text-sm rounded px-3 py-2 bg-white border border-[#D4D4D4] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] dark:text-white [&_.PhoneInputCountrySelect]:max-h-[200px] [&_.PhoneInputCountrySelect]:overflow-y-auto [&_.PhoneInputCountrySelect]:bg-white [&_.PhoneInputCountrySelect]:text-black dark:[&_.PhoneInputCountrySelect]:bg-[#1e1e1e] dark:[&_.PhoneInputCountrySelect]:text-white dark:[&_.PhoneInputCountrySelect]:border-[#2a2a2a] "})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"jobFunctions",className:"block text-sm font-medium mb-1",children:["Job Function",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"jobFunctions",value:o.job_function,onChange:e=>v("job_function",e.target.value),className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",children:[(0,r.jsx)("option",{value:"",children:"Select"}),a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),b.job_function&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:b.job_function})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"jobLevels",className:"block text-sm font-medium mb-1",children:["Job Level",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"jobLevels",value:o.job_level,onChange:e=>v("job_level",e.target.value),className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",children:[(0,r.jsx)("option",{value:"",children:"Select"}),n.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),b.job_level&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:b.job_level})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"sectors",className:"block text-sm font-medium mb-1",children:["Sector",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"sectors",value:o.sector,onChange:e=>v("sector",e.target.value),className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",children:[(0,r.jsx)("option",{value:"",children:"Select"}),g.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),b.sector&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:b.sector}),(0,M.n)(o.sector)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{type:"text",value:o.sector_other,onChange:e=>v("sector_other",e.target.value),maxLength:M.p,placeholder:"Please specify your sector","aria-label":"Your sector",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm mt-2"}),b.sector_other&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:b.sector_other})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{htmlFor:"country",className:"block text-sm font-medium mb-1",children:["Country",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("select",{id:"country",value:o.country,onChange:e=>v("country",e.target.value),className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",children:[(0,r.jsx)("option",{value:"",children:"Select"}),["United Kingdom","Ireland","France","Belgium","Netherlands","Germany","Luxembourg","Denmark","Switzerland","Norway","Spain","Portugal","Italy","Austria","Czech Republic","Poland","Sweden","Finland","Iceland","Slovakia","Hungary","Slovenia","Croatia","Bosnia and Herzegovina","Serbia","Montenegro","Albania","North Macedonia","Greece","Bulgaria","Romania","Estonia","Latvia","Lithuania","Ukraine","Moldova","Turkey","Georgia","Armenia","Azerbaijan","Malta","Cyprus","Monaco","San Marino","Liechtenstein","Vatican City","Andorra","Kosovo","Belarus","Russia"].map(e=>(0,r.jsx)("option",{children:e},e))]}),b.country&&(0,r.jsx)("p",{className:"text-red-500 text-xs mt-1",children:b.country})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 justify-end gap-2 mt-5",children:[(0,r.jsx)("div",{className:"w-full"}),(0,r.jsx)("button",{onClick:()=>
1{w()&&t((0,c.RB)())},className:"w-full cursor-pointer mt-6 bg-black text-white py-2 rounded hover:opacity-90 text-sm font-medium",children:"Continue"})]})]})}),(0,r.jsx)(I,{formData:o})]})},B=()=>{let e=(0,d.j)(),t=(0,f.useRouter)(),{isLogoutOpen:a}=(0,d.G)(e=>e.modal),s=async()=>{try{let a=await (0,h.post)("auth/logout");((null==a?void 0:a.status)===200||(null==a?void 0:a.status)===201)&&(e((0,g.WF)()),(0,p.Yj)("token"),e((0,c.tb)()),e((0,c.Vy)()),(0,b.gG)(),x.oR.success("Logout successful!"),t.push("/"))}catch(t){let e=(0,j.S)(t)||"Failed to Logout";x.oR.error(e)}};return(0,r.jsx)(r.Fragment,{children:a&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#f8f8f8] dark:bg-[#121212] dark:text-white rounded-md p-6 md:p-10 flex flex-col items-center text-center w-[400px] h-fit ",children:[(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M27.5 51.9614V47.6281H18.8333V21.6281H27.5V17.2947H16.6667C15.475 17.2947 14.5 18.2697 14.5 19.4614V49.7947C14.5 50.9864 15.475 51.9614 16.6667 51.9614H27.5Z",fill:"currentColor"}),(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M51.7667 17.3381L30.1 13.0047C29.45 12.8747 28.8 13.0481 28.3017 13.4597C27.8033 13.8714 27.5 14.4781 27.5 15.1281V17.2947V21.6281V47.6281V51.9614V54.1281C27.5 54.7781 27.7817 55.3847 28.3017 55.7964C28.6917 56.1214 29.1683 56.2947 29.6667 56.2947C29.8183 56.2947 29.9483 56.2947 30.1 56.2514L51.7667 51.9181C52.785 51.7231 53.5 50.8347 53.5 49.7947V19.4614C53.5 18.4214 52.7633 17.5331 51.7667 17.3381ZM31.8333 51.4847L49.1667 48.0181V21.2381L31.8333 17.7714V51.4847Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M36.1667 32.4623C35.592 32.4623 35.0409 32.6906 34.6346 33.0969C34.2283 33.5032 34 34.0543 34 34.6289C34 35.2036 34.2283 35.7547 34.6346 36.161C35.0409 36.5673 35.592 36.7956 36.1667 36.7956C36.7413 36.7956 37.2924 36.5673 37.6987 36.161C38.1051 35.7547 38.3333 35.2036 38.3333 34.6289C38.3333 34.0543 38.1051 33.5032 37.6987 33.0969C37.2924 32.6906 36.7413 32.4623 36.1667 32.4623Z",fill:"#E91E63"}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"22",ry:"4",fill:"#D9D9D9"})]}),(0,r.jsx)("h2",{className:"text-xl md:text-3xl font-bold mb-2 mt-4 uppercase",children:"log out?"}),(0,r.jsxs)("p",{className:"text-sm text-[#808080] mt-3",children:["Once logged out, Youâll need to enter ",(0,r.jsx)("br",{}),"credentials again to login"]}),(0,r.jsx)("button",{onClick:()=>s(),className:"bg-black w-full p-3 text-white hover:bg-gray-800 text-sm font-medium mt-10",children:"Logout"}),(0,r.jsx)("button",{onClick:()=>e((0,c.Vy)()),className:"bg-transparent w-full p-3 text-black text-sm font-medium mt-1 dark:text-white hover:bg-gray-200 dark:hover:bg-gray-800",children:"Cancel"})]})})})},z=()=>{let{isChangePassword:e,emailData:t}=(0,d.G)(e=>e.modal),a=(0,d.j)(),l=(0,b.Ll)(),n=(0,b.ug)(),i=(0,u.Wx)({initialValues:{email:""},validationSchema:m.Ik({email:m.Yj().required("Email is required").email("Invalid email").matches(/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/,"Email must be in lowercase")}),onSubmit:async(e,t)=>{let{setSubmitting:a}=t;try{await o()}catch(t){let e=(0,j.S)(t)||"Failed to change password";x.oR.error(e)}finally{a(!1)}}}),o=async()=>{try{var e,r,s;let o=(null==n?void 0:n.id)?l:(null==t?void 0:t.trim())?t:null==(e=i.values)?void 0:e.email;if(!(null==o?void 0:o.trim()))return void x.oR.error("Email is required.");let d=await (0,h.post)("auth/forgot-password",{email:o});((null==d?void 0:d.status)===200||(null==d?void 0:d.status)===201)&&(x.oR.success((null==d||null==(s=d.data)||null==(r=s.data)?void 0:r.message)||"Verification success"),a((0,c._Y)()),a((0,c.M_)()),a((0,c.$r)()))}catch(t){let e=(0,j.S)(t)||"Failed to forgot password";x.oR.error(e)}};return(0,s.useEffect)(()=>{!(null==n?void 0:n.id)&&(null==t?void 0:t.trim())&&i.setFieldValue("email",t)},[t,n]),(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#f8f8f8] dark:bg-[#121212] dark:text-white rounded-md p-6 md:p-10 flex flex-col items-center text-center w-[410px] h-fit ",children:[(null==n?void 0:n.id)?(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{"clip-path":"url(#clip0_711_2010)",children:[(0,r.jsx)("path",{d:"M54.9838 11.0537L34.6969 7.36522C34.4808 7.32488 34.2531 7.32488 34.037 7.36522L13.7501 11.0537C12.8741 11.2122 12.2344 11.9759 12.2344 12.8663V33.1532C12.2344 46.3625 21.1326 58.0478 33.8727 61.5696C34.0341 61.6157 34.1984 61.6358 34.3655 61.6358C34.5326 61.6358 34.6969 61.6128 34.8583 61.5696C47.5984 58.0482 56.4966 46.3603 56.4966 33.1532V12.8663C56.4966 11.9759 55.8598 11.2122 54.9809 11.0537H54.9838ZM52.811 33.1532C52.811 44.5389 45.2555 54.627 34.3684 57.8751C23.4814 54.6304 15.9258 44.5389 15.9258 33.1532V14.4051L34.3684 11.0509L52.811 14.4051V33.1532Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M26.9913 25.7761V29.4647C24.9568 29.4647 23.3027 31.1187 23.3027 33.1532V40.5302C23.3027 42.5647 24.9568 44.2188 26.9913 44.2188H41.7454C43.7798 44.2188 45.4339 42.5647 45.4339 40.5302V33.1532C45.4339 31.1187 43.7798 29.4647 41.7454 29.4647V25.7761C41.7454 21.7073 38.4372 18.3991 34.3683 18.3991C30.2994 18.3991 26.9913 21.7073 26.9913 25.7761ZM26.9913 40.5302V33.1532H41.7454V40.5302H26.99
113ZM38.0568 25.7761V29.4647H30.6798V25.7761C30.6798 23.7417 32.3339 22.0876 34.3683 22.0876C36.4028 22.0876 38.0568 23.7417 38.0568 25.7761Z",fill:"#E91E63"})]}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"22",ry:"4",fill:"#D9D9D9"}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_711_2010",children:(0,r.jsx)("rect",{width:"45",height:"54.5902",fill:"white",transform:"translate(11.5 7.33368)"})})})]}):(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{"clip-path":"url(#clip0_788_2617)",children:[(0,r.jsx)("path",{d:"M27.7571 37.145V32.0921C27.7571 28.4828 30.4939 25.5297 33.8389 25.5297C37.1839 25.5297 39.9207 28.4826 39.9207 31.5669V37.1448",stroke:"currentColor","stroke-width":"5.16529"}),(0,r.jsx)("path",{d:"M46.3181 49.6731C46.3181 53.4239 43.2491 56.4933 39.4979 56.4933H28.1766C24.4253 56.4933 21.3563 53.4241 21.3563 49.6731V43.3985C21.3563 39.6473 24.4253 36.5782 28.1766 36.5782H39.4979C43.2489 36.5782 46.3181 39.6473 46.3181 43.3985V49.6731Z",stroke:"currentColor","stroke-width":"5.16529"}),(0,r.jsx)("path",{d:"M56.3778 30.4448C53.93 20.3516 44.8346 12.8563 33.9885 12.8563C23.1422 12.8563 14.047 20.352 11.5992 30.4452V15.5119",stroke:"#E91E63","stroke-width":"5.16529","stroke-linecap":"round","stroke-linejoin":"round"})]}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"22",ry:"4",fill:"#D9D9D9"}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_788_2617",children:(0,r.jsx)("rect",{width:"50",height:"48.9669",fill:"white",transform:"translate(9 10.1455)"})})})]}),(null==n?void 0:n.id)?(0,r.jsx)("h2",{className:"text-xl md:text-3xl font-semibold mb-2 mt-3 uppercase",children:"Change password?"}):(0,r.jsx)("h2",{className:"text-xl md:text-3xl font-semibold mb-2 mt-3 uppercase",children:"FORGOT PASSWORD?"}),(null==n?void 0:n.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-sm text-[#808080] mt-3",children:["An email will be sent to reset your password ",(0,r.jsx)("br",{})," on ",function(e){if("string"!=typeof e)throw Error("Invalid input: email must be a string");let[t,a]=e.split("@");if(!t||!a)throw Error("Invalid email format");let r=Math.max(1,Math.floor(.4*t.length)),s=t.slice(0,r),l="*".repeat(t.length-r);return"".concat(s).concat(l,"@").concat(a)}(l)]}),(0,r.jsx)("button",{onClick:()=>o(),className:"bg-black w-full p-3 text-white hover:bg-gray-800 text-sm font-medium mt-10",children:"Change Password"})]}),!(null==n?void 0:n.id)&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("form",{onSubmit:i.handleSubmit,className:"w-full ",children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-left",children:"Email"}),(0,r.jsx)("input",{type:"email",name:"email",placeholder:"e.g., [email protected]",className:"w-full border border-[#D8DAE5] dark:bg-[#1e1e1e] dark:border-[#2a2a2a] px-4 py-2 rounded bg-white text-sm",value:i.values.email,onChange:i.handleChange,onBlur:i.handleBlur}),i.touched.email&&i.errors.email&&(0,r.jsx)("p",{className:"text-sm text-red-600 mt-1 text-left",children:i.errors.email})]}),(0,r.jsx)("button",{type:"submit",disabled:i.isSubmitting,className:"bg-black w-full p-3 text-white hover:bg-gray-800 text-sm font-medium",children:i.isSubmitting?"Sending email...":"Change Password"})]})}),(0,r.jsx)("button",{onClick:()=>a((0,c.M_)()),className:"bg-transparent w-full p-3 text-black text-sm font-medium mt-1 dark:text-white hover:bg-gray-200 dark:hover:bg-gray-800",children:"Cancel"})]})})})},T=()=>{let{isVerifyPassword:e}=(0,d.G)(e=>e.modal);return(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#f8f8f8] dark:bg-[#121212] dark:text-white rounded-md p-10 flex flex-col items-center text-center w-[400px] h-[367px] pt-24",children:[(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{"clip-path":"url(#clip0_711_2038)",children:[(0,r.jsx)("path",{d:"M53.48 26.6144V8.23665H14.5216V26.6144L6.64062 33.5104V56.826C6.
164062 59.6923 8.96732 62.0244 11.827 62.0244H56.1744C59.034 62.0244 61.3607 59.6923 61.3607 56.826V33.5104L53.48 26.6144ZM58.1739 33.8279L53.48 36.4393V29.7196L58.1739 33.8279ZM51.1454 10.5775V37.7411L42.6667 42.4569L43.7976 44.5015L59.0208 36.0301V56.8265C59.0208 57.1817 58.9369 57.518 58.8179 57.8325L37.5096 44.7835C35.3398 43.4547 32.6479 43.4547 30.4811 44.7835L9.17283 57.8325C9.05379 57.518 8.96992 57.1844 8.96992 56.8265V36.0301L24.1931 44.5015L25.324 42.4569L16.8453 37.7411L16.8507 10.5775H51.1454ZM14.5218 36.4395L9.82794 33.8281L14.5218 29.7198V36.4395ZM34.001 59.6816H11.827C11.5077 59.6816 11.2155 59.5975 10.9287 59.4999L31.7037 46.7764C33.1187 45.9087 34.8826 45.9087 36.2976 46.7764L57.0726 59.4999C56.7858 59.5975 56.4936 59.6816 56.1744 59.6816H34.001Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M24.332 35.0428H42.7993V37.3803H24.332V35.0428Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M33.3285 32.2006C38.4797 32.2006 42.6571 27.9919 42.6571 22.8503C42.6571 17.7086 38.4799 13.5 33.3285 13.5C28.1772 13.5 24 17.6869 24 22.8503C24 28.0137 28.1772 32.2006 33.3285 32.2006ZM31.9866 23.9353L36.64 19.2711L38.2849 20.9198L31.9866 27.2545L28.3721 23.6315L30.017 21.9828L31.9866 23.9353Z",fill:"#E91E63"})]}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"26.5",ry:"4",fill:"#D9D9D9"}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_711_2038",children:(0,r.jsx)("rect",{width:"55.4074",height:"54.1481",fill:"white",transform:"translate(6.29688 8.05556)"})})})]}),(0,r.jsx)("h2",{className:"text-lg md:text-2xl font-bold mb-2 mt-3",children:"Check your email"}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-[#b0b0b0] mt-3",children:["Weâve sent you a confirmation email, You ",(0,r.jsx)("br",{})," can reset your password after confirming"]})]})})})},H=()=>{let e=(0,d.j)(),t=(0,d.G)(e=>e.modal.isForceChangePassword),[a,l]=(0,s.useState)(!1),[n,b]=(0,s.useState)(!1),f=(0,u.Wx)({initialValues:{current_password:"",new_password:"",confirm_password:""},validationSchema:m.Ik({current_password:m.Yj().required("Temporary password is required"),new_password:m.Yj().min(8,"Minimum 8 characters").required("New password is required").notOneOf([m.KR("current_password")],"New password must differ from the temporary one"),confirm_password:m.Yj().oneOf([m.KR("new_password")],"Passwords must match").required("Please confirm your new password")}),onSubmit:async(t,a)=>{let{setSubmitting:r}=a;try{await (0,h.post)("auth/change-password-first",{current_password:t.current_password,new_password:t.new_password}),x.oR.success("Password updated. You're all set."),e((0,c.tB)())}catch(t){var s,l,n,i,o;let e=(null==t||null==(n=t.response)||null==(l=n.data)||null==(s=l.error)?void 0:s.message)||(null==t||null==(o=t.response)||null==(i=o.data)?void 0:i.message)||"Failed to update password";x.oR.error("string"==typeof e?e:"Failed to update password")}finally{r(!1)}}}),g=()=>{(0,p.Yj)("token"),localStorage.removeItem("user-info"),e((0,c.tb)()),e((0,c.tB)()),window.location.reload()};return t?(0,r.jsx)("div",{className:"fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#1e1e1e] w-full max-w-md rounded-md p-6 md:p-8 relative shadow-lg",children:[(0,r.jsx)("button",{type:"button",onClick:g,title:"Sign out",className:"absolute top-4 right-4 w-8 h-8 flex items-center justify-center border border-[#D4D4D4] rounded-full text-black dark:text-white",children:(0,r.jsx)(i.WQq,{})}),(0,r.jsx)("h2",{className:"text-lg md:text-2xl font-bold mb-2 text-black dark:text-white",children:"Set a new password"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-6",children:"An administrator reset your password. Enter the temporary password we emailed you, then choose a new one."}),(0,r.jsxs)("form",{onSubmit:f.handleSubmit,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Temporary password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{name:"current_password",type:a?"text":"password",value:f.values.current_password,onChange:f.handleChange,onBlur:f.handleBlur,className:"w-full h-10 px-3 pr-10 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] text-black dark:text-white focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"}),(0,r.jsx)("button",{type:"button",onClick:()=>l(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",children:a?(0,r.jsx)(o.rs7,{}):(0,r.jsx)(o.yMb,{})})]}),f.touched.current_password&&f.errors.current_password&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:f.errors.current_password})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"New password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{name:"new_password",type:n?"text":"password",value:f.values.new_password,onChange:f.handleChange,onBlur:f.handleBlur,className:"w-full h-10 px-3 pr-10 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] text-black dark:text-white focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"}),(0,r.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",children:n?(0,r.jsx)(o.rs7,{}):(0,r.jsx)(o.yMb,{})})]}),f.touched.new_password&&f.errors.new_password&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:f.errors.new_password})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Confirm new password"}),(0,r.jsx)("input",{name:"confirm_password",type:"password",value:f.values.confirm_password,onChange:f.handleChange,onBlur:f.handleBlur,className:"w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] text-black dark:text-white focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"}),f.touched.confirm_password&&f.errors.confirm_password&&(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:f.errors.confirm_password})]}),(0,r.jsx)("button",{type:"submit",disabled:f.isSubmitting,className:"w-full h-10 bg-[#E91E63] text-white text-sm font-semibold rounded-lg hover:bg-[#C2185B] transition disabled:opacity-60",children:f.isSubmitting?"Updatingâ¦":"Update password"}),(0,r.jsx)("button",{type:"button",onClick:g,className:"w-full text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",children:"Sign out"})]})]})}):null};var q=a(33113),U=a(87351);
1function Y(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=localStorage.getItem("theme"),a=window.matchMedia("(prefers-color-scheme: dark)").matches,r="dark"===e||!e&&a;t(r),document.documentElement.classList.toggle("dark",r)},[]),(0,r.jsx)("button",{onClick:()=>{let a=!e;t(a),document.documentElement.classList.toggle("dark",a),localStorage.setItem("theme",a?"dark":"light")},className:"py-2 md:px-2.5 rounded-full hover:scale-105 transition duration-300","aria-label":"Toggle Dark Mode",children:e?(0,r.jsx)(U.S6x,{className:"text-gray-50 text-xl hover:text-yellow-200 hover:scale-110"}):(0,r.jsx)(q.lAI,{className:"text-gray-800 text-xl hover:text-orange-400 hover:scale-110"})})}let Z=()=>{let{isPasswordChange:e}=(0,d.G)(e=>e.modal);return(0,r.jsx)(r.Fragment,{children:e&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm flex justify-center items-center px-4",children:(0,r.jsxs)("div",{className:"bg-[#f8f8f8] dark:bg-[#121212] dark:text-white rounded-md p-10 flex flex-col items-center text-center w-[400px] h-[367px] pt-24",children:[(0,r.jsxs)("svg",{width:"68",height:"77",className:"text-black dark:text-white",viewBox:"0 0 68 77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M34.1809 8.35037C19.9425 8.35037 8.34961 19.9433 8.34961 34.1817C8.34961 48.4201 19.9425 60.0004 34.1809 60.0004C48.4193 60.0004 59.9996 48.4201 59.9996 34.1817C59.9996 19.9433 48.4193 8.35037 34.1809 8.35037ZM34.1809 12.6549C46.093 12.6549 55.6951 22.2696 55.6951 34.1817C55.6951 46.0937 46.093 55.6959 34.1809 55.6959C22.2688 55.6959 12.6541 46.0937 12.6541 34.1817C12.6541 22.2696 22.2688 12.6549 34.1809 12.6549Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M44.4711 24.2696C44.7251 24.1411 45.002 24.0643 45.2859 24.0437C45.851 24.0018 46.4102 24.1847 46.8415 24.5524C47.2734 24.9254 47.5395 25.4547 47.5813 26.0238C47.6231 26.593 47.4371 27.1554 47.0643 27.5874L32.8938 44.0489C32.6987 44.2756 32.4584 44.4591 32.1883 44.5877C31.9182 44.7164 31.6243 44.7873 31.3253 44.796C31.0262 44.8047 30.7287 44.751 30.4516 44.6383C30.1745 44.5255 29.9239 44.3563 29.7159 44.1413L22.1662 36.3436C21.7696 35.936 21.5505 35.3879 21.5568 34.8192C21.563 34.2505 21.7941 33.7074 22.1995 33.3086C22.4015 33.1094 22.6408 32.9521 22.9037 32.8458C23.1666 32.7394 23.4479 32.686 23.7315 32.6888C24.0151 32.6915 24.2954 32.7502 24.5562 32.8616C24.8171 32.973 25.0533 33.1349 25.2514 33.3379L31.1743 39.4542L43.8062 24.7919C43.9911 24.5755 44.2171 24.398 44.4711 24.2696Z",fill:"#E91E63"}),(0,r.jsx)("ellipse",{cx:"34",cy:"72.5",rx:"26.5",ry:"4",fill:"#D9D9D9"})]}),(0,r.jsx)("h2",{className:"text-lg md:text-2xl font-bold mb-2 mt-3 uppercase",children:"Password CHanged"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-[#b0b0b0] mt-3",children:"You can use the new password to login"})]})})})};var O=a(77178),G=a(88971);let W=()=>{let[e,t]=(0,s.useState)(!1),[a,i]=(0,s.useState)(!1),[o,u]=(0,s.useState)(!1),m=(0,f.useRouter)(),x=(0,f.usePathname)(),h=(0,d.j)(),{isLoginOpen:p,isRegisterOpen:b,loginInfo:g}=(0,d.G)(e=>e.modal),{profile:v}=(0,d.G)(e=>e.user);(0,s.useEffect)(()=>{u(!0)},[]);let w=[{label:"News",path:"/category/btr-news"},{label:"Research",path:"/research"},{label:"Insights",path:"/insights"},{label:"Sponsors",activePaths:["/sponsors","/sponsors-detail"],path:"/sponsors"},{label:"Directory",path:"/directory"},{label:"Events",path:"/events"},{label:"Video Originals",path:"/videos"},{label:"Australia",path:"https://www.btrnews.au/",external:!0}];return(0,r.jsxs)("header",{className:"w-full border-b border-gray-200 dark:border-[#2a2a2a] bg-white dark:bg-[#1e1e1e]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between px-4 2xl:px-0 py-3 md:py-[22px]",children:[(0,r.jsx)("div",{className:"flex items-center space-x-2 cursor-pointer",onClick:()=>m.push("/"),children:(0,r.jsxs)("svg",{width:"111",height:"30",viewBox:"0 0 111 30",className:"text-black dark:text-white",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_451_476)",children:[(0,r.jsx)("path",{d:"M72.3638 11.4088C65.9922 9.84529 61.2749 15.6176 62.7568 21.9565C64.2695 28.4223 71.5289 29.7053 76.4443 26.4265V23.6471L74.6226 24.7218C72.847 25.5035 70.9672 25.9112 69.0653 25.4065C67.0268 24.8647 65.3127 22.86 65.2614 20.6471H77.8955C78.5545 16.5635 76.3743 12.3935 72.3638 11.4088ZM75.2935 18.5294H65.3058C65.0924 18.4765 65.3673 17.46 65.4305 17.2482C66.9039 12.3318 74.2862 12.3247 75.2969 17.4671C75.3294 17.6312 75.5052 18.5294 75.2935 18.5294Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M61.2493 27.7959H58.603V17.6047C58.603 17.0576 58.0549 15.7976 57.7084 15.3529C55.5196 12.5488 50.5787 14.0382 50.5787 17.7812V27.7959H47.9324V11.4723H50.5
1787V14.0312C51.1353 13.2071 51.6099 12.4959 52.4635 11.9647C54.9989 10.3853 58.7174 11.2182 60.2949 13.8265C60.621 14.3647 61.2493 15.9441 61.2493 16.5459V27.7959Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M80.4137 11.4723L84.1698 24.2665L88.6651 11.6188C88.8341 11.3259 89.4983 11.5341 89.8073 11.4653L94.5416 24.2647L98.1286 11.4706H100.946L96.1618 27.7906L93.1877 27.7835L89.2524 16.8529L85.4537 27.7059L82.6332 27.7994L77.7281 11.4706H80.4171L80.4137 11.4723Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M110.334 12.0018V14.9135C109.829 14.6735 109.373 14.3206 108.856 14.1035C107.952 13.7241 107.012 13.5706 106.032 13.6871C104.309 13.8935 103.394 15.8753 104.784 17.1635C106.942 19.1647 111 19.6818 110.998 23.6029C110.998 28.5494 104.656 29.0488 101.454 27.1323V24.2647C101.804 24.4023 102.088 24.7076 102.421 24.8982C103.875 25.7241 106.858 26.3859 107.929 24.6476C108.774 23.2729 107.773 22.2247 106.74 21.4923C104.268 19.7435 100.579 18.7376 101.391 14.7123C102.204 10.6871 107.464 10.5653 110.332 11.9982L110.334 12.0018Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M38.3698 9.88235C38.2059 10.0747 38.0898 10.3535 37.902 10.5V8.20588H28.8533V2.29412L23.2193 3.61765V8.20588H20.2315V10.5C16.5966 6.98118 10.3821 6.67235 7.17065 10.9412V0H0V29.4706L7.17065 29.5588V26.8235C8.33332 28.2459 9.77258 29.3188 11.555 29.7476C15.9376 30.8029 20.3254 28.4753 22.2085 24.3247L23.2193 21.0882V29.5588H28.8533V13.1471H32.2679V29.5588H37.902V16.7206C37.902 16.6041 38.1171 15.8488 38.1769 15.6829C39.1296 13.0306 42.2761 13.1082 44.3898 14.1176V7.94118C42.0251 7.48412 39.9713 8.00118 38.3698 9.88235ZM12.3455 24.2506C9.48063 24.2506 7.15699 21.8506 7.15699 18.8876C7.15699 15.9247 9.48063 13.5229 12.3455 13.5229C15.2103 13.5229 17.5357 15.9247 17.5357 18.8876C17.5357 21.8506 15.212 24.2506 12.3455 24.2506ZM23.2193 16.6765L22.8778 15.3088L22.1078 13.1929L23.2193 13.1471V16.6765Z",fill:"currentColor"}),(0,r.jsx)("rect",{width:"2",height:"29.4922",fill:"#E91E63"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_451_476",children:(0,r.jsx)("rect",{width:"111",height:"30",fill:"white"})})})]})}),(0,r.jsx)("nav",{className:"hidden lg:flex gap-5 2xl:gap-9 items-center",children:null==w?void 0:w.map((e,t)=>{let a=(null==e?void 0:e.activePaths)?null==e?void 0:e.activePaths.includes(x):x===(null==e?void 0:e.path),s="Directory"===e.label,l=e.external,n="text-sm uppercase font-medium tracking-wide whitespace-nowrap hover:text-black transition-colors",i=s?"animated-gradient-text":a?"text-black dark:text-white dark:hover:text-white":"text-[#808080] dark:text-[#b0b0b0] dark:hover:text-white";return l?(0,r.jsx)("a",{href:e.path,target:"_blank",rel:"noopener noreferrer",className:"".concat(n," ").concat(i),children:e.label},t):(0,r.jsx)(L(),{href:e.path,className:"".concat(n," ").concat(i),children:e.label},t)})}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5 2xl:gap-5",children:[(0,r.jsxs)("button",{onClick:()=>i(!0),className:"dark:hover:bg-[#e9e9e918] hover:bg-[#E9E9E9] p-1.5 rounded-full",children:[(0,r.jsx)(G.CKj,{className:"text-black dark:text-white text-lg md:text-[22px]"}),""]}),o&&(null==v?void 0:v.username)?(0,r.jsx)(F,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S,{isOpen:b,onClose:()=>h((0,c.uT)()),openLogin:()=>h((0,c.sC)())}),(0,r.jsx)(N,{isOpen:p,onClose:()=>h((0,c._Y)()),openRegister:()=>h((0,c.Ws)())})]}),(0,r.jsx)(Y,{}),(0,r.jsx)("div",{className:"lg:hidden dark:text-white",children:(0,r.jsx)("button",{onClick:()=>t(!e),children:e?(0,r.jsx)(n.lr4,{size:24,className:"cursor-pointer"}):(0,r.jsx)(l.Gok,{size:24,className:"cursor-pointer"})})})]})]}),e&&(0,r.jsx)("nav",{className:"lg:hidden px-4 pb-4 space-y-3 pt-2 flex flex-col",children:w.map((e,a)=>{let s="Directory"===e.label,l=(null==e?void 0:e.activePaths)?null==e?void 0:e.activePaths.includes(x):x===(null==e?void 0:e.path),n="text-sm uppercase font-medium tracking-wide hover:text-black transition-colors",i=s?"animated-gradient-text":l?"text-black dark:text-white":"text-[#808080] dark:text-[#b0b0b0]";return e.external?(0,r.jsx)("a",{href:e.path,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"".concat(n," ").concat(i),children:e.label},a):(0,r.jsx)(L(),{href:e.path,onClick:()=>t(!1),className:"".concat(n," ").concat(i),children:e.label},a)})}),(0,r.jsx)(D,{}),(0,r.jsx)(A,{}),(0,r.jsx)(B,{}),(0,r.jsx)(z,{}),(0,r.jsx)(T,{}),(0,r.jsx)(Z,{}),(0,r.jsx)(H,{}),(0,r.jsx)(O.A,{isOpen:a,onClose:()=>i(!1)})]})}},50392:(e,t,a)=>{"use strict";a.d(t,{ku:()=>x,sX:()=>m});var r=a(93208),s=a(17776),l=a(39259),n=a(9943);let i=null,o=null,d=new Set,c=()=>
1d.forEach(e=>e());function u(){if("undefined"==typeof document)return!1;let e=(0,l.Ri)("token");return!!e&&""!==e&&"null"!==e&&"undefined"!==e}function m(){i=null,o=null,c()}function x(){let[,e]=(0,r.useReducer)(e=>e+1,0);(0,r.useEffect)(()=>(d.add(e),u()&&null===i&&(o||(o=(async()=>{try{var e,t,a;let r=await (0,s.Jt)("follows"),l=null!=(a=null!=(t=null==r||null==(e=r.data)?void 0:e.data)?t:null==r?void 0:r.data)?a:[];i=new Set(Array.isArray(l)?l.map(e=>e.slug):[])}catch(e){i=new Set}finally{o=null,c()}})())),()=>{d.delete(e)}),[]);let t=(0,r.useCallback)(e=>{var t;return null!=(t=null==i?void 0:i.has(e))&&t},[]),a=(0,r.useCallback)(async e=>{var t;let a=!(null!=(t=null==i?void 0:i.has(e))&&t);i||(i=new Set),a?i.add(e):i.delete(e),c();try{return a?await (0,s.post)("follows/".concat(encodeURIComponent(e))):await (0,s.Fb)("follows/".concat(encodeURIComponent(e))),(0,n.s)(a?"follow":"unfollow",{slug:e}),a}catch(t){throw a?i.delete(e):i.add(e),c(),t}},[]);return{ready:null!==i,signedIn:u(),isFollowing:t,toggle:a}}},51751:(e,t,a)=>{"use strict";a.d(t,{default:()=>u});var r=a(31892),s=a(93208),l=a(64285),n=a(17194),i=a(55559),o=a(35160),d=a(17776),c=a(19171);function u(){let{ads:e}=(0,i.G)(e=>
1e.ads),[t,a]=(0,s.useState)(0),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!0);(0,s.useEffect)(()=>{if(!e.length)return;let t=new Date,a=e.filter(e=>{var a;return e.is_active&&(null==(a=e.position)?void 0:a.slug)==="navigation_top_banner"&&new Date(e.start_date)<=t&&new Date(e.end_date)>=t});if(a.length){let e=Math.min(...a.map(e=>e.priority));m([...a.filter(t=>t.priority===e)].sort(()=>Math.random()-.5))}else m([]);h(!1)},[e]);let p=async e=>{try{var t,a;let r=await (0,d.Jt)("ads/".concat(e.id,"/click")),s=null==r||null==(a=r.data)||null==(t=a.data)?void 0:t.redirect_url;(null==r?void 0:r.status)===200||(null==r?void 0:r.status)===201?window.open(s,"_blank"):o.oR.error("Failed to track ad click.")}catch(t){let e=(0,c.S)(t)||"Failed to fetch Adds!";o.oR.error(e)}};(0,s.useEffect)(()=>{if(u.length<=1)return;let e=setInterval(()=>{a(e=>(e+1)%u.length)},2e4);return()=>clearInterval(e)},[u]);let b=u[t];return(0,r.jsx)(r.Fragment,{children:x?(0,r.jsx)("div",{className:"w-full h-[90px] flex items-center justify-center bg-[#f8f8f8] dark:bg-[#121212]",children:(0,r.jsx)(n.A,{className:"w-[95%] md:w-[70%] h-[65px] md:h-[80px] py-5 rounded-b-md"})}):b?(0,r.jsx)("div",{className:"w-full h-fit bg-[#f8f8f8] dark:bg-[#121212] flex items-center justify-center overflow-hidden cursor-pointer",onClick:()=>p(b),children:"gif"===b.media_type||"image"===b.media_type?(0,r.jsx)("div",{className:"relative w-full",children:(0,r.jsx)(l.default,{src:b.media_url,alt:b.title,width:0,height:0,sizes:"100vw",className:"w-full h-[90px] object-contain",title:b.title,unoptimized:"gif"===b.media_type})}):(0,r.jsx)("p",{className:"text-sm text-[#8F8F8F]",children:b.title})}):(0,r.jsx)("div",{className:"w-full h-[90px] flex items-center justify-center bg-[#f8f8f8] dark:bg-[#121212]",children:(0,r.jsx)("p",{className:"text-sm text-[#8F8F8F]",children:"Advertisement"})})})}},55833:(e,t,a)=>{"use strict";a.d(t,{default:()=>o});var r=a(31892),s=a(39259),l=a(75757),n=a.n(l),i=a(93208);function o(){let[e,t]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{"true"!==(0,s.Ri)("cookieConsent")&&t(!0)},[]),e)?(0,r.jsxs)("div",{className:"bg-white dark:bg-[#1e1e1e] dark:text-white fixed bottom-4 left-4 right-4 z-50 max-w-2xl mx-auto rounded-xl shadow-lg p-4 md:p-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"text-sm ",children:["\uD83C\uDF6A We use cookies to improve your experience. By using our site, you agree to our"," ",(0,r.jsx)(n(),{href:"/cookie-policy",className:"text-[#e91e63] underline hover:text-[#e91e62c0]",children:"privacy policy"}),"."]}),(0,r.jsx)("button",{onClick:()=>{let e=Math.floor(Date.now()/1e3)+31536e3;(0,s.TV)("cookieConsent","true",e),t(!1)},className:"bg-[#e91e63] text-white text-sm font-medium px-4 py-2 rounded-lg shadow hover:bg-[#d81b60] transition",children:"Accept"})]}):null}},61997:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var r=a(31892),s=a(38494),l=a(1175);function n(e){let{children:t}=e;return(0,r.jsx)(s.Kq,{store:l.M,children:t})}},69089:(e,t,a)=>{"use strict";a.d(t,{TokenValidator:()=>x});var r=a(31892),s=a(93208),l=a(39259),n=a(17776),i=a(55559),o=a(1175),d=a(47494),c=a(97010),u=a(31477);function m(){let e=(0,l.Ri)("token");return!!e&&""!==e&&"null"!==e&&"undefined"!==e}function x(e){let{children:t}=e,a=function(){let e=(0,i.j)();return async()=>{(0,l.Yj)("token"),(0,n.setRefreshToken)(null),await o.q.purge(),(0,u.gG)(),e((0,d.WF)()),e((0,c.tb)())}}(),x=(0,s.useRef)(!1),h=(0,i.G)(e=>{var t,a;return!!((null==(t=e.user.profile)?void 0:t.id)||(null==(a=e.user.profile)?void 0:a.username))});return(0,s.useEffect)(()=>{!h||m()||(0,n.ve)()||a()}
1,[h]),(0,s.useEffect)(()=>{if(!m()&&!(0,n.ve)())return;let e=async()=>{if(!x.current){x.current=!0;try{m()||await (0,n.AI)()||await a()}finally{x.current=!1}}},t=()=>{document.hidden||e()},r=()=>{e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",r),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",r)}},[a]),(0,r.jsx)(r.Fragment,{children:t})}},70820:(e,t,a)=>{"use strict";a.d(t,{default:()=>v});var r=a(31892),s=a(32018),l=a.n(s),n=a(93208),i=a(28967),o=a(64285),d=a(59950),c=a(75757),u=a.n(c),m=a(85939),x=a(15841),h=a(55559),p=a(17776),b=a(35160);let f=["Low","Medium","High","Critical"];function g(e){let{open:t,onClose:a}=e,{profile:s}=(0,h.G)(e=>e.user),[l,i]=(0,n.useState)(""),[o,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,g]=(0,n.useState)(""),[v,w]=(0,n.useState)("Medium"),[y,j]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{t&&(i(s?"".concat(s.first_name||""," ").concat(s.last_name||"").trim():""),d((null==s?void 0:s.email)||""),u(""),g(""),w("Medium"))},[t,s]),!t)return null;let k=async e=>{if(e.preventDefault(),!l.trim()||!o.trim()||!c.trim()||!m.trim())return void b.oR.error("Please fill in all required fields.");j(!0);try{var t;let e={name:l.trim(),email:o.trim(),subject:c.trim(),description:m.trim(),severity:v,page_url:window.location.href},r=await (0,p.post)("bug-reports",e);((null==r||null==(t=r.data)?void 0:t.data)||(null==r?void 0:r.data))&&(b.oR.success("Bug report submitted successfully. Thank you!"),a())}catch(e){b.oR.error("Failed to submit bug report. Please try again.")}finally{j(!1)}};return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:a,children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#1e1e1e] rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"p-1.5 rounded-lg bg-[#E91E63]/10",children:(0,r.jsx)(x.f9d,{className:"h-5 w-5 text-[#E91E63]"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold text-black dark:text-white",children:"Report a Bug"})]}),(0,r.jsx)("button",{onClick:a,className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full",children:(0,r.jsx)(x.Mz4,{size:20})})]}),(0,r.jsxs)("form",{onSubmit:k,className:"px-6 py-4 space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Found something wrong? Let us know and we'll fix it."}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Name ",(0,r.jsx)("span",{className:"text-[#E91E63]",children:"*"})]}),(0,r.jsx)("input",{type:"text",required:!0,value:l,onChange:e=>i(e.target.value),className:"w-full h-9 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Email ",(0,r.jsx)("span",{className:"text-[#E91E63]",children:"*"})]}),(0,r.jsx)("input",{type:"email",required:!0,value:o,onChange:e=>d(e.target.value),className:"w-full h-9 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Subject ",(0,r.jsx)("span",{className:"text-[#E91E63]",children:"*"})]}),(0,r.jsx)("input",{type:"text",required:!0,value:c,onChange:e=>u(e.target.value),placeholder:"Brief summary of the issue",className:"w-full h-9 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Description ",(0,r.jsx)("span",{className:"text-[#E91E63]",children:"*"})]}),(0,r.jsx)("textarea",{required:!0,rows:3,value:m,onChange:e=>g(e.target.value),placeholder:"What happened? What did you expect?",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focu
1s:outline-none focus:ring-2 focus:ring-[#E91E63]/40 resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Severity"}),(0,r.jsx)("select",{value:v,onChange:e=>w(e.target.value),className:"w-full h-9 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40",children:f.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),(0,r.jsx)("button",{type:"submit",disabled:y,className:"w-full h-10 mt-2 bg-[#E91E63] text-white font-medium text-sm rounded-lg hover:bg-[#C2185B] transition disabled:opacity-50 flex items-center justify-center gap-2",children:y?(0,r.jsx)("div",{className:"h-4 w-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):"Submit Report"})]})]})})}let v=()=>{let[e,t]=(0,n.useState)(!1),a=[{icon:i.ao$,color:"#E1306C",link:"https://www.instagram.com/btrnews247/"},{icon:m.H1h,color:"#0a66c2",link:"https://www.linkedin.com/company/btr-news"},{icon:i.TCj,color:"#ffff",link:"https://x.com/btrnews247"}],s=(0,d.useRouter)();return(0,r.jsxs)("footer",{className:"bg-black text-[#B1B1B1] text-sm font-inter leading-[140%] pt-10 pb-[56px] px-4 ",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto gap-6 border-b border-[#2D2D2D] pb-10 flex flex-wrap md:flex-nowrap",children:[(0,r.jsx)("div",{className:"w-full md:w-[30%]",children:(0,r.jsx)("div",{onClick:()=>s.push("/"),className:"flex mx-auto md:mx-0 items-center justify-center md:justify-start gap-2 cursor-pointer w-[111px] h-[30px] ",children:(0,r.jsx)(o.default,{src:"https://d2xkmkrj50j6p5.cloudfront.net/static/sponsors-detail/BRT-News-White.svg",alt:"BTR News",title:"BTR News logo",width:111,height:30,className:"w-[111px] h-[30px] cursor-pointer"})})}),(0,r.jsxs)("div",{className:"text-center flex flex-col gap-y-8 text-sm md:text-base w-full md:w-[70%]",children:[(0,r.jsxs)("div",{className:"flex flex-wrap justify-center gap-7 lg:gap-10",children:[(0,r.jsx)(u(),{href:"/about-us",className:"hover:text-white transition",children:"About"}),(0,r.jsx)(u(),{href:"/contact-us",className:"hover:text-white transition",children:"Contact Us"}),(0,r.jsx)(u(),{href:"/acceptable-use-policy",className:"hover:text-white transition",children:"Acceptable Use Policy"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap justify-center gap-7 lg:gap-10",children:[(0,r.jsx)(u(),{href:"/cookie-policy",className:"hover:text-white transition",children:"Cookies"}),(0,r.jsx)(u(),{href:"/terms-and-conditions",className:"hover:text-white transition",children:"Terms & Conditions"}),(0,r.jsx)(u(),{href:"/privacy-policy",className:"hover:text-white transition",children:"Privacy Policy"})]})]}),(0,r.jsx)("div",{className:"flex justify-center md:justify-end gap-4 mt-4 md:mt-0 w-full md:w-[30%]",children:a.map((e,t)=>{let{icon:a,color:s,link:n}=e;return(0,r.jsxs)(u(),{href:n,target:"_blank",rel:"noopener noreferrer",className:"w-10 2xl:w-12 h-10 2xl:h-12 flex items-center justify-center rounded-full border border-[#757575] transition cursor-pointer group",children:[(0,r.jsx)(a,{style:{"--hover-color":s},className:l().dynamic([["647fbe4dc6577f66",[s]]])+" text-base 2xl:text-[20px] transition-colors group-hover:text-[color:var(--hover-color)]"}),(0,r.jsx)(l(),{id:"647fbe4dc6577f66",dynamic:[s],children:"div.__jsx-style-dynamic-selector:hover{border-color:".concat(s,"}")})]},t)})})]}),(0,r.jsxs)("div",{className:"pt-10 flex flex-col items-center gap-2",children:[(0,r.jsxs)("button",{onClick:()=>t(!0),className:"flex items-center gap-1.5 text-xs text-[#757575] hover:text-white transition cursor-pointer",children:[(0,r.jsx)(x.f9d,{className:"h-3.5 w-3.5"}),"Having troubles? Report a bug"]}),(0,r.jsx)("p",{className:"text-xs",children:"\xa9 2026 BTR News. All Rights Reserved."})]}),(0,r.jsx)(g,{open:e,onClose:()=>t(!1)})]})}},76389:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var r=a(31892),s=a(93208),l=a(17776);function n(){let[e,t]=(0,s.useState)(null);if((0,s.useEffect)(()=>{let e=!1,a=async()=>{try{var a;let r=await (0,l.Jt)("maintenance/status"),s=(null==r||null==(a=r.data)?void 0:a.data)||(null==r?void 0:r.data);if(e)return;s&&"boolean"==typeof s.enabled&&t(s)}catch(e){}};a();let r=setInterval(a,3e4);return()=>{e=!0,clearInterval(r)}},[]),!(null==e?void 0:e.enabled))return null;let a=e.message||"BTR News is undergoing scheduled maintenance. Please check back shortly.",n=e.estimated_end_at?new Date(e.estimated_end_at).toLocaleStr
1ing("en-GB",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",timeZone:"Europe/London",timeZoneName:"short"}):null;return(0,r.jsx)("div",{role:"alert","aria-live":"polite",className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/85 backdrop-blur-sm p-6",children:(0,r.jsxs)("div",{className:"max-w-lg w-full bg-white dark:bg-[#1a1a1a] rounded-2xl shadow-2xl p-8 text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[#E91E63]/10 text-[#E91E63]",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",className:"h-7 w-7",children:(0,r.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Weâll be right back"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:a}),n&&(0,r.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Expected back by ",(0,r.jsx)("strong",{children:n})]}),(0,r.jsx)("p",{className:"mt-6 text-[11px] text-gray-400",children:"This page refreshes automatically â you donât need to reload."})]})})}},78623:(e,t,a)=>{"use strict";a.d(t,{default:()=>h});var r=a(31892),s=a(32018),l=a.n(s),n=a(93208),i=a(17776),o=a(35160),d=a(85368),c=a(15841),u=a(55559),m=a(97010);let x="btrnews_newsletter_popup";function h(){let e=(0,u.j)(),[t,a]=(0,n.useState)(!1),[s,h]=(0,n.useState)(!1),[p,b]=(0,n.useState)(!1),[f,g]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[y,j]=(0,n.useState)(""),[k,N]=(0,n.useState)(""),[C,E]=(0,n.useState)(""),[S,_]=(0,n.use
1State)(()=>new Set(["weekly"])),L=e=>{_(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})};(0,n.useEffect)(()=>{let e=()=>w(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let R=(0,n.useCallback)(()=>{let e=localStorage.getItem(x);if(!e)return!0;try{let t=JSON.parse(e);if(t.subscribed)return!1;if(t.dismissedAt)return Date.now()-t.dismissedAt>6048e5}catch(e){}return!0},[]);(0,n.useEffect)(()=>{if(!R())return;let e=setTimeout(()=>a(!0),5e3);return()=>clearTimeout(e)},[R]),(0,n.useEffect)(()=>{let e=()=>{b(!1),h(!1),a(!0)};return window.addEventListener("btr:open-subscribe-popup",e),()=>window.removeEventListener("btr:open-subscribe-popup",e)},[]);let P=()=>{a(!1),h(!0),localStorage.setItem(x,JSON.stringify({dismissedAt:Date.now()}))},F=async t=>{var r,s,l,n;if(t.preventDefault(),!y)return void o.oR.error("Please enter your email address.");if(0===S.size)return void o.oR.error("Choose at least one notification preference.");g(!0);try{let t=await (0,i.post)("subscribers/subscribe",{email:y,first_name:k||void 0,last_name:C||void 0,segments:Array.from(S)});if((null==t?void 0:t.status)===200||(null==t?void 0:t.status)===201){let l=null!=(s=null==t||null==(r=t.data)?void 0:r.data)?s:null==t?void 0:t.data;if(null==l?void 0:l.requiresLogin){o.oR.info("You already have an account â log in to subscribe."),a(!1),h(!1),e((0,m.sC)());return}b(!0),localStorage.setItem(x,JSON.stringify({subscribed:!0})),o.oR.success("Thank you for subscribing!")}}catch(a){let e=null==a||null==(n=a.response)||null==(l=n.data)?void 0:l.error,t="string"==typeof e?e:(null==e?void 0:e.message)||"Subscription failed. Please try again.";o.oR.error(t)}finally{g(!1)}},D=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-[40px] font-extrabold leading-tight",style:{color:"#2d2017",fontFamily:"Georgia, serif"},children:"GET THE LATEST NEWS!"}),(0,r.jsx)("p",{className:"text-[15px] md:text-[16px] mt-3 leading-relaxed max-w-[520px] mx-auto font-medium",style:{color:"#3d3020"},children:"Sign up to receive quick access to our latest news, weekly digest and information from industry leaders and suppliers."})]}),p?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,r.jsx)("h3",{className:"text-xl font-bold",style:{color:"#2d2017"},children:"You're subscribed!"}),(0,r.jsx)("p",{className:"text-base mt-1",style:{color:"#5a5a5a"},children:"Thank you for subscribing!"}),(0,r.jsx)("button",{onClick:()=>{a(!1),h(!1)},className:"mt-5 text-base font-medium underline",style:{color:"#2d2017"},children:"Close"})]}):(0,r.jsxs)("form",{onSubmit:F,className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,r.jsx)("input",{type:"text",placeholder:"First name",value:k,onChange:e=>N(e.target.value),className:"w-full bg-white border border-[#c5bfb6] px-5 py-4 text-[16px] text-[#333] placeholder-[#999] focus:outline-none focus:border-[#999]",style:{borderRadius:"4px"}}),(0,r.jsx)("input",{type:"text",placeholder:"Last name",value:C,onChange:e=>E(e.target.value),className:"w-full bg-white border border-[#c5bfb6] px-5 py-4 text-[16px] text-[#333] placeholder-[#999] focus:outline-none focus:border-[#999]",style:{borderRadius:"4px"}})]}),(0,r.jsx)("input",{type:"email",placeholder:"Your email address",value:y,onChange:e=>j(e.target.value),required:!0,className:"w-full bg-white border border-[#c5bfb6] px-5 py-4 text-[16px] text-[#333] placeholder-[#999] focus:outline-none focus:border-[#999]",style:{borderRadius:"4px"}}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[12px] uppercase tracking-wider mb-2 font-semibold",style:{color:"#2d2017"},children:"Email preferences"}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[{value:"post_notifications",label:"Post notification"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"}].map(e=>{let t=S.has(e.value);return(0,r.jsx)("button",{type:"button",onClick:()=>L(e.value),"aria-pressed":t,className:"px-2 py-3 text-[13px] font-semibold transition border leading-tight",style:{borderRadius:"4px",backgroundColor:t?"#2d2017":"#ffffff",color:t?"#ffffff"
1:"#2d2017",borderColor:t?"#2d2017":"#c5bfb6"},children:e.label},e.value)})}),(0,r.jsx)("p",{className:"text-[11px] mt-1.5",style:{color:"#7a6f60"},children:"Pick any combination â tap again to deselect."})]}),(0,r.jsx)("button",{type:"submit",disabled:f,className:"w-full font-bold text-[16px] tracking-widest py-4 transition disabled:opacity-50",style:{backgroundColor:"#2d2017",color:"#ffffff",borderRadius:"4px",letterSpacing:"0.15em"},children:f?"SUBSCRIBING...":"SUBSCRIBE"}),(0,r.jsxs)("p",{className:"text-[11px] text-center pt-1",style:{color:"#888"},children:["By subscribing you agree to our"," ",(0,r.jsx)("a",{href:"/privacy-policy",className:"underline hover:text-[#555]",children:"Privacy Policy"}),". Unsubscribe anytime."]})]})]});return s&&!p?(0,r.jsx)("button",{onClick:()=>{h(!1),a(!0)},className:"fixed left-0 top-1/2 -translate-y-1/2 z-[9999] bg-[#E91E63] text-white shadow-lg hover:bg-[#C2185B] transition-all group",style:{writingMode:"vertical-rl",textOrientation:"mixed",borderRadius:"0 8px 8px 0",padding:"14px 10px"},"aria-label":"Open subscribe form",children:(0,r.jsxs)("span",{className:"flex items-center gap-2 text-sm font-semibold tracking-wide",children:[(0,r.jsx)(c.FlW,{className:"text-lg rotate-90"}),"Subscribe"]})}):t?v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{onClick:P,className:"jsx-97edbba171cb8516 fixed inset-0 z-[9998] bg-black/40"}),(0,r.jsxs)("div",{style:{backgroundColor:"rgba(234, 227, 216, 1)",borderRadius:"20px 20px 0 0",maxHeight:"92dvh",animationName:"sheetSlideIn",animationDuration:"0.4s",animationFillMode:"both"},className:"jsx-97edbba171cb8516 fixed bottom-0 left-0 right-0 z-[9999] overflow-y-auto",children:[(0,r.jsx)("button",{onClick:P,style:{backgroundColor:"#ede6db",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},"aria-label":"Close",className:"jsx-97edbba171cb8516 absolute top-4 right-4 z-20 w-10 h-10 rounded-full flex items-center justify-center transition hover:scale-105",children:(0,r.jsx)(d.WQq,{className:"text-xl",style:{color:"#3d3d3d"}})}),(0,r.jsx)("div",{className:"jsx-97edbba171cb8516 px-6 pt-8 pb-10",children:D})]}),(0,r.jsx)(l(),{id:"97edbba171cb8516",children:"@-webkit-keyframes sheetSlideIn{from{-webkit-transform:translatey(100%);transform:translatey(100%)}to{-webkit-transform:translatey(0);transform:translatey(0)}}@-moz-keyframes sheetSlideIn{from{-moz-transform:translatey(100%);transform:translatey(100%)}to{-moz-transform:translatey(0);transform:translatey(0)}}@-o-keyframes sheetSlideIn{from{-o-transform:translatey(100%);transform:translatey(100%)}to{-o-transform:translatey(0);transform:translatey(0)}}@keyframes sheetSlideIn{from{-webkit-transform:translatey(100%);-moz-transform:translatey(100%);-o-transform:translatey(100%);transform:translatey(100%)}to{-webkit-transform:translatey(0);-moz-transform:translatey(0);-o-transform:translatey(0);transform:translatey(0)}}"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{onClick:P,className:"jsx-3f52eae28607640b fixed inset-0 z-[9998] bg-black/40"}),(0,r.jsxs)("div",{style:{width:"1200px",height:"1200px",bottom:"-650px",left:"50%",transform:"translateX(-50%)",borderRadius:"1000px",backgroundColor:"rgba(234, 227, 216, 1)",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"80px",paddingLeft:"10px",paddingRight:"10px",animationName:"popupSlideIn",animationDuration:"0.8s",animationDelay:"0.1s",animationFillMode:"both"},className:"jsx-3f52eae28607640b fixed z-[9999] overflow-visible",children:[(0,r.jsx)("button",{onClick:P,style:{to
1p:"38px",right:"280px",backgroundColor:"#ede6db",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},"aria-label":"Close",className:"jsx-3f52eae28607640b absolute z-20 w-12 h-12 rounded-full flex items-center justify-center transition hover:scale-105",children:(0,r.jsx)(d.WQq,{className:"text-xl",style:{color:"#3d3d3d"}})}),(0,r.jsx)("div",{className:"jsx-3f52eae28607640b w-full max-w-[560px]",children:D})]}),(0,r.jsx)(l(),{id:"3f52eae28607640b",children:"@-webkit-keyframes popupSlideIn{from{bottom:-1200px}to{bottom:-650px}}@-moz-keyframes popupSlideIn{from{bottom:-1200px}to{bottom:-650px}}@-o-keyframes popupSlideIn{from{bottom:-1200px}to{bottom:-650px}}@keyframes popupSlideIn{from{bottom:-1200px}to{bottom:-650px}}"})]}):null}},81315:(e,t,a)=>{"use strict";a.d(t,{MaintenanceBanner:()=>i});var r=a(31892),s=a(93208),l=a(15841);let n="btrnews_maintenance_dismissed";function i(){let[e,t]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{"true"===sessionStorage.getItem(n)&&t(!0)},[]),e)?null:(0,r.jsxs)("div",{className:"h-10 w-full bg-[#E91E63] text-white flex items-center justify-center gap-2 px-4 relative overflow-hidden",children:[(0,r.jsxs)("p",{className:"text-[11px] sm:text-sm font-medium text-center leading-tight",children:["We're currently carrying out maintenance and you may experience some disruption.",(0,r.jsxs)("span",{className:"hidden sm:inline",children:[" ","If something isn't working, please log out and log back in."]}),(0,r.jsx)("span",{className:"sm:hidden",children:" If so, please re-login."})]}),(0,r.jsx)("button",{onClick:()=>{t(!0),sessionStorage.setItem(n,"true")},"aria-label":"Dismiss maintenance notice",className:"absolute right-2 p-1 rounded-full hover:bg-white/20 transition",children:(0,r.jsx)(l.Mz4,{size:16})})]})}},84855:()=>{},88022:(e,t,a)=>{"use strict";a.d(t,{SavedPostsProvider:()=>o,y:()=>d});var r=a(31892),s=a(93208),l=a(17776),n=a(55559);let i=(0,s.createContext)({savedIds:new Set,isSaved:()=>!1,toggleSave:async()=>{},isLoading:!1});function o(e){let{children:t}=e,[a,o]=(0,s.useState)(new Set),[d,c]=(0,s.useState)(!1),{profile:u}=(0,n.G)(e=>e.user),m=!!(null==u?void 0:u.username);(0,s.useEffect)(()=>{if(!m)return void o(new Set);(async()=>{c(!0);try{var e;let t=await (0,l.Jt)("posts/saved?limit=200"),a=null==t?void 0:t.data,r=(null==a||null==(e=a.data)?void 0:e.data)||(null==a?void 0:a.data)||a||[],s=Array.isArray(r)?r.map(e=>e.id||e.post_id):[];o(new Set(s))}catch(e){}finally{c(!1)}})()},[m]);let x=(0,s.useCallback)(e=>a.has(e),[a]),h=(0,s.useCallback)(async e=>{if(m){o(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a});try{await (0,l.post)("posts/".concat(e,"/save"),{})}catch(t){o(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})}}},[m]);return(0,r.jsx)(i.Provider,{value:{savedIds:a,isSaved:x,toggleSave:h,isLoading:d},children:t})}function d(){return(0,s.useContext)(i)}},91787:(e,t,a)=>{"use strict";a.d(t,{n:()=>r,p:()=>s});let r=e=>/^other\b/i.test((null!=e?e:"").trim()),s=100},96359:(e,t,a)=>{"use strict";a.d(t,{FeedbackBanner:()=>m});var r=a(31892),s=a(32018),l=a.n(s),n=a(93208),i=a(55559),o=a(17776),d=a(35160),c=a(15841);let u="btrnews_feedback_dismissed";function m(){let{profile:e}=(0,i.G)(e=>
1e.user),[t,a]=(0,n.useState)(!0),[s,m]=(0,n.useState)(!1),[x,h]=(0,n.useState)(0),[p,b]=(0,n.useState)(0),[f,g]=(0,n.useState)(""),[v,w]=(0,n.useState)(""),[y,j]=(0,n.useState)(""),[k,N]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a("true"===sessionStorage.getItem(u))},[]),(0,n.useEffect)(()=>{e&&(w("".concat(e.first_name||""," ").concat(e.last_name||"").trim()),j(e.email||""))},[e]);let C=()=>{a(!0),m(!1),sessionStorage.setItem(u,"true")},E=async t=>{if(t.preventDefault(),0===x)return void d.oR.error("Please select a star rating.");if(!e&&(!v.trim()||!y.trim()))return void d.oR.error("Please fill in your name and email.");N(!0);try{var a;let e={name:v.trim(),email:y.trim(),rating:x,message:f.trim(),page_url:window.location.href},t=await (0,o.post)("feedback",e);((null==t||null==(a=t.data)?void 0:a.data)||(null==t?void 0:t.data))&&(d.oR.success("Thank you for your feedback!"),C())}catch(e){d.oR.error("Failed to submit feedback. Please try again.")}finally{N(!1)}};if(t)return null;let S=!!e;return(0,r.jsxs)("div",{style:{animation:"slideUp 0.3s ease-out"},className:"jsx-2c8bf314faae8ebd fixed bottom-4 right-4 z-40 flex flex-col items-end gap-2 transition-all duration-300 ease-out",children:[s&&(0,r.jsxs)("div",{className:"jsx-2c8bf314faae8ebd bg-white dark:bg-[#1e1e1e] rounded-xl shadow-2xl border border-gray-200 dark:border-gray-700 w-72 overflow-hidden animate-in",children:[(0,r.jsxs)("div",{className:"jsx-2c8bf314faae8ebd flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[(0,r.jsx)("span",{className:"jsx-2c8bf314faae8ebd text-sm font-semibold text-black dark:text-white",children:"Rate your experience"}),(0,r.jsx)("button",{onClick:C,className:"jsx-2c8bf314faae8ebd p-0.5 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full",children:(0,r.jsx)(c.Mz4,{size:16,className:"text-gray-500"})})]}),(0,r.jsxs)("form",{onSubmit:E,className:"jsx-2c8bf314faae8ebd px-4 py-3 space-y-3",children:[(0,r.jsx)("div",{className:"jsx-2c8bf314faae8ebd flex justify-center gap-1",children:[1,2,3,4,5].map(e=>{let t=e<=(p||x);return(0,r.jsx)("button",{type:"button",onClick:()=>h(e),onMouseEnter:()=>b(e),onMouseLeave:()=>b(0),className:"jsx-2c8bf314faae8ebd p-0.5 transition-transform hover:scale-110",children:t?(0,r.jsx)(c.K7t,{className:"h-7 w-7 text-yellow-400"}):(0,r.jsx)(c.sdO,{className:"h-7 w-7 text-gray-300 dark:text-gray-600"})},e)})}),!S&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{type:"text",value:v,onChange:e=>w(e.target.value),placeholder:"Your name",className:"jsx-2c8bf314faae8ebd w-full h-8 px-2.5 text-xs border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"}),(0,r.jsx)("input",{type:"email",value:y,onChange:e=>j(e.target.value),placeholder:"Your email",className:"jsx-2c8bf314faae8ebd w-full h-8 px-2.5 text-xs border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40"})]}),(0,r.jsx)("textarea",{rows:2,value:f,onChange:e=>g(e.target.value),placeholder:"Any additional feedback? (optional)",className:"jsx-2c8bf314faae8ebd w-full px-2.5 py-1.5 text-xs border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-[#2a2a2a] focus:outline-none focus:ring-2 focus:ring-[#E91E63]/40 resize-none"}),(0,r.jsx)("button",{type:"submit",disabled:k,className:"jsx-2c8bf314faae8ebd w-full h-8 bg-[#E91E63] text-white font-medium text-xs rounded-lg hover:bg-[#C2185B] transition disabled:opacity-50 flex items-center justify-center",children:k?(0,r.jsx)("div",{className:"jsx-2c8bf314faae8ebd h-3.5 w-3.5 border-2 border-white border-t-transparent rounded-full animate-spin"}):"Submit"})]})]}),!s&&(0,r.jsxs)("button",{onClick:()=>m(!0),className:"jsx-2c8bf314faae8ebd flex items-center gap-2 px-4 py-2.5 bg-white dark:bg-[#1e1e1e] text-black dark:text-white text-sm font-medium rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl transition-all duration-200 hover:scale-105",children:[(0,r.jsx)(c.sdO,{className:"h-4 w-4 text-yellow-400"}),"Rate your experience"]}),(0,r.jsx)(l(),{id:"2c8bf314faae8ebd",children:"@-webkit-keyframes slideUp{from{opacity:0;-webkit-transform:translatey(20px);transform:translatey(20px)}to{opacity:1;-webkit-transform:translatey(0);transform:translatey(0)}}@-moz-keyframes slideUp{from{opacity:0;-moz-transform:translatey(20px);transform:translatey(20px)}to{opacity:1;-moz-transform:translatey(0);transform:translatey(0)}}@-o-keyframes slideUp{from{opacity:0;-o-transform:translatey(20px);transform:translatey(20px)}to{opacity:1;-o-transform:translatey(0);transform:translatey(0)}}@keyframes slideUp{from{opacity:0;-webkit-transform:translatey(20px);-moz-transform:translatey(20px);-o-transform:translatey(20px);transform:translatey(20px)}to{opacity:1;-webkit-transform:translatey(0);-moz-transform:translatey(0);-o-transform:translatey(0);transform:translatey(0)}}"})]})}}},e=>{var t=t=>e(e.s=t);e.O(0,[8506,7797,1614,6888,9324,2196,8395,3508,7085,2848,9853,8066,4838,5160,3435,50,5757,6113,4154,164,740,7776,6966,9808,1970,2519,7358],()=>t(42076)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.