PageSourceSearch

https://drivesafedrivingschool.com/_next/static/chunks/app/layout-d7eed7b96061df07.js

js drivesafedrivingschool.com collected 2026-10-08 04:09:57 UTC 87,385 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{57454:function(e,t,r){Promise.resolve().then(r.bind(r,15910)),Promise.resolve().then(r.bind(r,43706)),Promise.resolve().then(r.bind(r,50867)),Promise.resolve().then(r.bind(r,7237)),Promise.resolve().then(r.bind(r,14888)),Promise.resolve().then(r.bind(r,98087)),Promise.resolve().then(r.bind(r,47239)),Promise.resolve().then(r.t.bind(r,88003,23)),Promise.resolve().then(r.bind(r,81523)),Promise.resolve().then(r.bind(r,70049)),Promise.resolve().then(r.t.bind(r,59731,23)),Promise.resolve().then(r.bind(r,94242)),Promise.resolve().then(r.t.bind(r,97425,23)),Promise.resolve().then(r.t.bind(r,49608,23)),Promise.resolve().then(r.t.bind(r,2648,23)),Promise.resolve().then(r.bind(r,12157)),Promise.resolve().then(r.bind(r,14272)),Promise.resolve().then(r.bind(r,22409)),Promise.resolve().then(r.bind(r,28452)),Promise.resolve().then(r.bind(r,86755)),Promise.resolve().then(r.bind(r,57534)),Promise.resolve().then(r.bind(r,48855)),Promise.resolve().then(r.bind(r,71629)),Promise.resolve().then(r.bind(r,13848)),Promise.resolve().then(r.bind(r,99742)),Promise.resolve().then(r.bind(r,55433)),Promise.resolve().then(r.bind(r,93890)),Promise.resolve().then(r.t.bind(r,2778,23)),Promise.resolve().then(r.bind(r,81582)),Promise.resolve().then(r.bind(r,3620)),Promise.resolve().then(r.bind(r,77974))},22409:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return s}});var n=r(2265),a=r(16712);function s(){let e=(0,a.d)(e=>e.fetch);return(0,n.useEffect)(()=>{e()},[e]),null}},28452:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return l}});var n=r(2265),a=r(78733),s=r(66410);function l(){let{isAuthenticated:e,isLoading:t}=(0,a.a)(),r=(0,s.x)(e=>e.syncMergeGuestCart),l=(0,s.x)(e=>e.loadFromServer),i=(0,s.x)(e=>e.clearLocalState),o=(0,n.useRef)(null),d=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(t)return;let n=o.current;o.current=e,e?!1===n?(d.current=!0,(async()=>{await r(),await l()})()):null!==n||d.current||(d.current=!0,(async()=>{await r(),await l()})()):!0===n&&(i(),d.current=!1)},[e,t,r,l,i]),null}},86755:function(e,t,r){"use strict";r.d(t,{default:function(){return x}});var n=r(57437),a=r(2265),s=r(99376),l=r(78733);let i=["/my-preparation","/certificate","/car-rental-order","/payment-history","/course-booking","/profile","/car-lesson-booking","/driving-record-order","/road-test-booking"],o="\uD83D\uDC4B Hi! Thinking about a driving course? I can help with pricing, enrollment, or find the right course for you — just ask!";function d(e,t){let r;let a=/(\*\*[^*]+\*\*|https?:\/\/[^\s,)>\]]+|[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g,s=[],l=0;for(;null!==(r=a.exec(e));){r.index>l&&s.push(e.slice(l,r.index));let t=r[0];t.startsWith("**")&&t.endsWith("**")?s.push((0,n.jsx)("strong",{children:t.slice(2,-2)},r.index)):/^https?:\/\//.test(t)?s.push((0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",style:{color:"#1A6FE8",textDecoration:"underline",wordBreak:"break-all"},children:t},r.index)):s.push((0,n.jsx)("a",{href:"mailto:".concat(t),style:{color:"#1A6FE8",textDecoration:"underline"},children:t},r.index)),l=r.index+t.length}return l<e.length&&s.push(e.slice(l)),(0,n.jsx)("span",{children:s},t)}let c=[{label:"Course pricing",q:"What are the course prices?"},{label:"How to enroll",q:"How do I enroll?"}];function x(){let{user:e}=(0,l.a)(),t=(0,s.usePathname)(),r=i.some(e=>null==t?void 0:t.startsWith(e)),[x,h]=(0,a.useState)(!1),[f,p]=(0,a.useState)([{role:"assistant",content:"Hi there! \uD83D\uDC4B I'm the Drive Safe assistant. Ask me anything about our courses, pricing, or enrollment!"}]),[m,g]=(0,a.useState)(""),[b,v]=(0,a.useState)(!1),[y,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)(!1),C=(0,a.useRef)(null),E=(0,a.useRef)(null);async function L(e){let t=(null!=e?e:m).trim();if(!t||b)return;let r=[...f,{role:"user",content:t}];p(r),g(""),v(!0),p(e=>[...e,{role:"assistant",content:""}]);try{let e=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:r})});if(!e.body)throw Error();let t=e.body.getReader(),n=new TextDecoder,a="";for(;;){let{done:e,value:r}=await t.read();if(e)break;a+=n.decode(r),p(e=>[...e.slice(0,-1),{role:"assistant",content:a}])}}catch(e){p(e=>[...e.slice(0,-1),{role:"assistant",content:"Sorry, I couldn't connect. Please call us at **(214) 310-5000** or try again."}])}finally{v(!1)}}(0,a.useEffect)(()=>{var e;null===(e=C.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[f]),(0,a.useEffect)(()=>{x&&setTimeout(()=>{var e;return null===(e=E.current)||void 0===e?void 0:e.focus()},280)},[x]),(0,a.useEffect)(()=>
1{if(e||sessionStorage.getItem("ds-greeted"))return;let t=setTimeout(()=>{N(!0),S(!0),function(){try{let e=window.AudioContext||window.webkitAudioContext;if(!e)return;let t=new e,r=t.createOscillator(),n=t.createGain();r.connect(n),n.connect(t.destination),r.type="sine",r.frequency.setValueAtTime(880,t.currentTime),r.frequency.exponentialRampToValueAtTime(440,t.currentTime+.3),n.gain.setValueAtTime(.28,t.currentTime),n.gain.exponentialRampToValueAtTime(.001,t.currentTime+.45),r.start(t.currentTime),r.stop(t.currentTime+.45)}catch(e){}}()},35e3);return()=>clearTimeout(t)},[e]);let A=1===f.length&&!b;return r?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{children:"\n        @keyframes ds-pop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }\n        @keyframes ds-ring { 0%,100%{transform:scale(1);opacity:.5} 70%{transform:scale(1.55);opacity:0} }\n        @keyframes ds-up { from{opacity:0;transform:translateY(14px) scale(.98)} to{opacity:1;transform:translateY(0) scale(1)} }\n        @keyframes ds-in { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }\n        @keyframes ds-dot { 0%,80%,100%{transform:scale(0.6);opacity:.4} 40%{transform:scale(1);opacity:1} }\n        .ds-window{animation:ds-up .22s cubic-bezier(.34,1.56,.64,1)}\n        .ds-msg{animation:ds-in .18s ease}\n        .ds-fab{transition:transform .18s ease,box-shadow .18s ease}\n        .ds-fab:hover{transform:scale(1.07)!important}\n        .ds-send{transition:all .15s ease}\n        .ds-send:hover:not(:disabled){transform:scale(1.1)}\n        .ds-pill{transition:all .15s ease;cursor:pointer}\n        .ds-pill:hover{background:rgba(26,111,232,0.12)!important;transform:translateY(-1px)}\n        .ds-scroll::-webkit-scrollbar{width:3px}\n        .ds-scroll::-webkit-scrollbar-thumb{background:rgba(26,111,232,0.2);border-radius:99px}\n        .ds-scroll::-webkit-scrollbar-track{background:transparent}\n        /* Force GPU layer — prevents iOS Safari scroll jitter on fixed elements */\n        .ds-fab-wrap,.ds-chat-win{\n          -webkit-transform:translateZ(0);\n          transform:translateZ(0);\n          -webkit-backface-visibility:hidden;\n          backface-visibility:hidden;\n        }\n        /* On mobile, float above the cart button + full-width chat */\n        @media (max-width:1023px){\n          .ds-fab-wrap{bottom:84px!important;right:16px!important}\n          .ds-chat-win{\n            bottom:148px!important;\n            right:0!important;\n            left:0!important;\n            width:100vw!important;\n            max-width:100vw!important;\n            max-height:70dvh!important;\n            border-radius:16px 16px 0 0!important;\n            border-left:none!important;\n            border-right:none!important;\n            border-bottom:none!important;\n          }\n        }\n        @media (min-width:1024px){\n          .ds-chat-win{width:440px!important}\n        }\n        /* Message bubble text wrapping */\n        .ds-bubble{word-break:break-word;overflow-wrap:anywhere;white-space:pre-wrap}\n      "}),(0,n.jsxs)("div",{className:"ds-fab-wrap",style:{position:"fixed",bottom:24,right:24,zIndex:9999},children:[k&&!x&&(0,n.jsxs)("div",{className:"ds-window",style:{position:"absolute",bottom:64,right:0,width:240,background:"#fff",borderRadius:14,padding:"11px 13px",boxShadow:"0 8px 28px rgba(26,111,232,0.18), 0 2px 8px rgba(0,0,0,0.08)",border:"1px solid rgba(26,111,232,0.15)",fontFamily:"var(--font-poppins), Inter, system-ui, sans-serif",fontSize:13,color:"#1e293b",lineHeight:1.5},children:[(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),S(!1),N(!1),sessionStorage.setItem("ds-greeted","1")},style:{position:"absolute",top:6,right:7,width:20,height:20,border:"none",background:"rgba(26,111,232,0.08)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#64748b",fontSize:11},children:"✕"}),(0,n.jsx)("div",{style:{paddingRight:16},children:o}),(0,n.jsx)("div",{style:{position:"absolute",bottom:-7,right:20,width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderTop:"7px solid #fff",filter:"drop-shadow(0 2px 2px rgba(26,111,232,0.1))"}})]}),!x&&(0,n.jsx)("div",{style:{position:"absolute",inset:-2,borderRadius:"50%",background:"rgba(26,111,232,0.3)",animation:"ds-ring 2.4s ease-out infinite",pointerEvents:"none"}}),(0,n.jsxs)("button",{className:"ds-fab",onClick:function(){if(w&&!x){N(!1),S(!1),sessionStorage.setItem("ds-greeted","1"),p(e=>1===e.length?[...e,{role:"assistant",content:o}]:e),h(!0);return}h(e=>!e)},"aria-label":"Chat with Drive Safe",style:{width:54,height:54,borderRadius:"50%",border:"none",background:"linear-gradient(135deg, #1A6FE8 0%, #1552B3 100%)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 6px 20px rgba(26,111,232,0.45)",position:"relative",zIndex:1,transition:"all .18s ease"},children:[x?(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.8",strokeLinecap:"round",children:(0,n.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})}):(0,n.jsx)("svg",{width:"23",height:"23",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),w&&!x&&(0,n.jsx)("span",{style:{position:"absolute",top:-3,right:-3,width:20,height:20,borderRadius:"50%",background:"#EF4444",border:"2px s
1olid #fff",color:"#fff",fontSize:11,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",animation:"ds-pop 1.8s ease-in-out infinite",lineHeight:1},children:"1"})]})]}),x&&(0,n.jsxs)("div",{className:"ds-window ds-chat-win",style:{position:"fixed",bottom:88,right:24,zIndex:9998,width:440,maxHeight:600,display:"flex",flexDirection:"column",borderRadius:18,overflow:"hidden",background:"#ffffff",boxShadow:"0 16px 48px rgba(26,111,232,0.15), 0 4px 16px rgba(0,0,0,0.08)",fontFamily:"var(--font-poppins), Inter, system-ui, sans-serif",border:"1px solid rgba(26,111,232,0.12)"},children:[(0,n.jsxs)("div",{style:{background:"linear-gradient(135deg, #1A6FE8 0%, #1552B3 100%)",padding:"12px 14px 12px 14px",flexShrink:0},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,n.jsx)("div",{style:{width:40,height:40,borderRadius:12,flexShrink:0,background:"rgba(255,255,255,0.2)",border:"1.5px solid rgba(255,255,255,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}),(0,n.jsxs)("div",{style:{flex:1},children:[(0,n.jsx)("div",{style:{color:"#fff",fontWeight:700,fontSize:14,letterSpacing:.1},children:"Drive Safe Assistant"}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,marginTop:2},children:[(0,n.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:"#86EFAC",boxShadow:"0 0 5px #86EFAC"}}),(0,n.jsx)("span",{style:{color:"rgba(255,255,255,0.8)",fontSize:11},children:"Online \xb7 Replies instantly"})]})]}),(0,n.jsx)("button",{onClick:()=>h(!1),style:{width:28,height:28,borderRadius:8,border:"none",background:"rgba(255,255,255,0.15)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background .15s"},onMouseEnter:e=>e.currentTarget.style.background="rgba(255,255,255,0.25)",onMouseLeave:e=>e.currentTarget.style.background="rgba(255,255,255,0.15)",children:(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.8",strokeLinecap:"round",children:(0,n.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),(0,n.jsxs)("div",{style:{marginTop:10,padding:"6px 10px",background:"rgba(255,255,255,0.15)",borderRadius:8,border:"1px solid rgba(255,255,255,0.2)",display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.75)",strokeWidth:"2",strokeLinecap:"round",children:(0,n.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.15 12 19.79 19.79 0 0 1 1.08 3.4 2 2 0 0 1 3.05 1.2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.09 8.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21 16h1v.92z"})}),(0,n.jsx)("span",{style:{color:"rgba(255,255,255,0.8)",fontSize:11},children:"(214) 310-5000 \xb7 [email protected]"})]})]}),(0,n.jsxs)("div",{className:"ds-scroll",style:{flex:1,overflowY:"auto",padding:"14px 12px",background:"#F0F6FF",display:"flex",flexDirection:"column",gap:10},children:[f.map((e,t)=>(0,n.jsxs)("div",{className:"ds-msg",style:{display:"flex",flexDirection:"user"===e.role?"row-reverse":"row",alignItems:"flex-end",gap:8},children:["assistant"===e.role&&(0,n.jsx)("div",{style:{width:26,height:26,borderRadius:"50%",flexShrink:0,background:"linear-gradient(135deg, #1A6FE8, #1552B3)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(26,111,232,0.3)"},children:(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}),(0,n.jsx)("div",{className:"ds-bubble",style:{maxWidth:"80%",padding:"9px 13px",borderRadius:"user"===e.role?"14px 14px 3px 14px":"14px 14px 14px 3px",background:"user"===e.role?"linear-gradient(135deg, #1A6FE8, #1552B3)":"#ffffff",color:"user"===e.role?"#fff":"#1e293b",fontSize:13.5,lineHeight:1.6,boxSh
1adow:"user"===e.role?"0 3px 12px rgba(26,111,232,0.28)":"0 2px 8px rgba(26,111,232,0.08)",border:"assistant"===e.role?"1px solid rgba(26,111,232,0.1)":"none",minWidth:0},children:""===e.content&&b?(0,n.jsx)(u,{}):e.content.split("\n").map((e,t)=>{if(e.trim().startsWith("|"))return null;if(/^[-=]{3,}$/.test(e.trim()))return(0,n.jsx)("div",{style:{height:"4px"}},t);if(/^#{1,3}\s/.test(e)){let r=e.replace(/^#{1,3}\s/,"");return(0,n.jsx)("div",{style:{fontWeight:700,fontSize:13,color:"#1A6FE8",marginTop:6,marginBottom:2},children:d(r,t)},t)}return e.startsWith("- ")||e.startsWith("• ")?(0,n.jsxs)("div",{style:{display:"flex",gap:"8px",marginTop:"3px"},children:[(0,n.jsx)("span",{style:{color:"#1A6FE8",fontWeight:700,flexShrink:0,fontSize:15,lineHeight:"1.4"},children:"\xb7"}),d(e.slice(2),t)]},t):""===e.trim()?(0,n.jsx)("div",{style:{height:"5px"}},t):(0,n.jsx)("div",{children:d(e,t)},t)})})]},t)),A&&(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:2},children:c.map(e=>{let{label:t,q:r}=e;return(0,n.jsx)("button",{className:"ds-pill",onClick:()=>L(r),style:{fontSize:12,padding:"5px 12px",borderRadius:99,border:"1.5px solid rgba(26,111,232,0.3)",background:"#EBF4FF",color:"#1552B3",fontWeight:600,fontFamily:"inherit"},children:t},t)})}),(0,n.jsx)("div",{ref:C})]}),(0,n.jsxs)("div",{style:{padding:"10px 12px 11px",background:"#fff",borderTop:"1px solid rgba(26,111,232,0.1)",flexShrink:0},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,background:"#F0F6FF",borderRadius:12,border:y?"1.5px solid #1A6FE8":"1.5px solid rgba(26,111,232,0.2)",padding:"7px 7px 7px 13px",transition:"border-color .15s, box-shadow .15s",boxShadow:y?"0 0 0 3px rgba(26,111,232,0.1)":"none"},children:[(0,n.jsx)("input",{ref:E,type:"text",value:m,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),L())},onFocus:()=>j(!0),onBlur:()=>j(!1),placeholder:"Ask a question...",disabled:b,style:{flex:1,border:"none",background:"transparent",fontSize:13.5,outline:"none",color:"#1e293b",fontFamily:"inherit"}}),(0,n.jsx)("button",{className:"ds-send",onClick:()=>L(),disabled:b||!m.trim(),style:{width:34,height:34,borderRadius:9,border:"none",flexShrink:0,background:!b&&m.trim()?"linear-gradient(135deg, #1A6FE8, #1552B3)":"rgba(26,111,232,0.12)",color:!b&&m.trim()?"#fff":"rgba(26,111,232,0.35)",cursor:!b&&m.trim()?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:!b&&m.trim()?"0 3px 10px rgba(26,111,232,0.3)":"none",transition:"all .15s ease"},children:(0,n.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,n.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,n.jsx)("div",{style:{textAlign:"center",marginTop:7,fontSize:10.5,color:"#94a3b8"},children:"Drive Safe Driving School \xb7 TDLR #C2759"})]})]})]})}function u(){return(0,n.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center",height:18},children:[0,.18,.36].map((e,t)=>(0,n.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:"#1A6FE8",animation:"ds-dot 1.3s ease-in-out ".concat(e,"s infinite")}},t))})}},55433:function(e,t,r){"use strict";r.r(t);var n=r(2265),a=r(99376),s=r(12490);t.default=()=>{let e=(0,a.useSearchParams)(),t=(0,a.usePathname)(),r=(0,s.y)(e=>e.setRefSlug);return(0,n.useEffect)(()=>{let n=e.get("ref-slug");if(n){let a=new URLSearchParams(e.toString());a.delete("ref-slug"),r(n,t+(a.toString()?"?".concat(a.toString()):""))}},[e,t,r]),null}},93890:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return a}});var n=r(2265);function a(){return(0,n.useEffect)(()=>{let e=()=>{window.scrollTo({top:0,left:0,behavior:"auto"})},t=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];let s=t.apply(this,n);return e(),s},window.history.replaceState=function(){for(var t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];let s=r.apply(this,n);return e(),s},window.addEventListener("popstate",e),()=>{window.history.pushState=t,window.history.replaceState=r,window.removeEventListener("popstate",e)}},[]),null}},12157:function(e,t,r){"use strict";r.d(t,{default:function(){return i}});var n=r(57437),a=r(2265),s=r(15491),l=e=>
1{let{clarityId:t}=e;return(0,a.useEffect)(()=>{if(!t)return;let e=()=>s.Z.init(t);"requestIdleCallback"in window?requestIdleCallback(e,{timeout:4e3}):setTimeout(e,3e3)},[t]),null},i=e=>{let{children:t,clarityId:r}=e;return(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(l,{clarityId:r}),t]})}},14272:function(e,t,r){"use strict";r.r(t);var n=r(2265),a=r(23182);t.default=()=>((0,n.useEffect)(()=>{let e=e=>{let t=e.target.closest('a[href^="tel:"]');if(!t)return;let r=t.href.replace("tel:","");(0,a.VF)(r)};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[]),null)},7725:function(e,t,r){"use strict";r(57437),r(2265)},97202:function(e,t,r){"use strict";r.d(t,{zx:function(){return a}});var n=r(57437);r(2265);var a=e=>{let{label:t,className:r,type:a="button",disabled:s=!1,onClick:l}=e;return(0,n.jsx)("button",{type:a,disabled:s,onClick:e=>{e.stopPropagation(),null==l||l()},className:"text-16 font-medium rounded-[30px] transition-all ".concat(r," ").concat(s?"cursor-not-allowed bg-opacity-30":"cursor-pointer"," "),children:t})};r(99376),r(7725),r(95169)},85697:function(e,t,r){"use strict";var n=r(57437);r(2265),t.Z=e=>{let{title:t,as:r="h2",size:a="default",dividerSize:s="default",className:l=""}=e,i="large"===s?{wrapper:"gap-[10px] md:gap-[12px]",dot:"w-[12px] h-[12px] md:w-[14px] md:h-[14px]",side:"h-[4px] w-[64px] md:w-[84px] xl:w-[96px]",center:"h-[6px] w-[180px] md:w-[240px] xl:w-[280px]"}:{wrapper:"gap-[8px]",dot:"w-[10px] h-[10px]",side:"h-[3px] w-[48px]",center:"h-[5px] w-[160px]"};return(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)(r,{className:"font-lufga font-semibold ".concat("large"===a?"text-[36px] leading-[44px] md:text-[52px] md:leading-[62px] xl:text-[64px] xl:leading-[76px]":"text-[30px] leading-[38px] md:text-[40px] md:leading-[50px] xl:text-[48px] xl:leading-[60px]"," text-black text-center ").concat(l),children:t}),(0,n.jsxs)("div",{className:"flex items-center justify-center ".concat(i.wrapper),children:[(0,n.jsx)("span",{className:"".concat(i.dot," rounded-full bg-primaryStrong/40")}),(0,n.jsx)("span",{className:"".concat(i.side," rounded-full bg-primaryStrong/40")}),(0,n.jsx)("span",{className:"".concat(i.center," rounded-full bg-primaryStrong")}),(0,n.jsx)("span",{className:"".concat(i.side," rounded-full bg-primaryStrong/40")}),(0,n.jsx)("span",{className:"".concat(i.dot," rounded-full bg-primaryStrong/40")})]})]})}},93417:function(e,t,r){"use strict";r.d(t,{HB:function(){return o},eW:function(){return s},zA:function(){return i},H0:function(){return d},eP:function(){return c.Z},pm:function(){return l},xv:function(){return a}});var n=r(57437);r(2265);var a=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h4",{className:"text-16 font-normal leading-[24px] ".concat(r),children:t})},s=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h4",{className:"text-12 font-medium ".concat(r),children:t})},l=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h3",{className:"text-24 md:text-28 xl:text-32 font-semibold ".concat(r),children:t})},i=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h6",{className:"text-16 md:text-20 font-normal ".concat(r),children:t})},o=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h4",{className:"text-12 font-500 leading-s18 ".concat(r),children:t})},d=e=>{let{text:t,className:r=""}=e;return(0,n.jsx)("h4",{className:"text-20 font-semibold ".concat(r),children:t})},c=r(85697)},95169:function(e,t,r){"use strict";r.d(t,{d:function(){return s},U:function(){return l}});var n=r(57437);r(2265);var a=r(88416),s=e=>{let{Icon:t,size:r,className:s}=e;return(0,n.jsx)(a.Z,{component:t,sx:{fontSize:"".concat(r,"px")},className:s})},l=e=>{let{color:t="#1E4245"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("path",{d:"M4 5L16 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M4 12L20 12",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M4 19L12 19",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},57534:function(e,t,r){"use strict";var n=r(57437);r(2265);var a=r(27648),s=r(3620);t.default=e=>{let{children:t}=e,{translator:r}=(0,s.b)();return(0,n.jsx)("div",{className:"relative w-screen flex items-center justify-center h-screen overflow-hidden",children:(0,n.jsxs)("div",{className:"w-full flex flex-row items-center justify-center md:justify-start md:gap-[40px] px-4 md:py-[32px] md:px-[40px] lg:gap-[100px] lg:py-[48px] lg:px-[80px]",children:[(0,n.jsxs)("div",{className:"relative w-full hidden md:block max-w-[639px] aspect-[639/776] max-h-[776px] rounded-br24 overflow-hidden opacity-100",children:[(0,n.jsx)("img",{src:"/auth/auth.png",alt:"Drive Safe Driving School login illustration",loading:"lazy",width:639,height:776,className:"w-full h-full object-cover object-center"}),(0,n.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black"}),(0,n.jsxs)("div",{className:"absolute flex flex-col gap-[17px] left-[44px] bottom-[39px]",children:[(0,n.jsx)(a.default,{href:"/","aria-label":"Go to home page",children:(0,n.jsx)("img",{src:"/auth/full-logo.svg",alt:"Drive Safe Driving School logo",loading:"lazy",width:153,height:38,className:"w-[153px] h-[38px]"})}),(0,n.jsx)("p",{className:"font-lufga font-normal text-[16px] leading-[24px] tracking-normal text-white",children:r("auth.layoutTagline")})]})]}),(0,n.jsxs)("div",{className:"w-full",children:[" ",t]})]})})}},71629:function(e,t,r){"use strict";var n=r(57437),a=r(2265),s=r(27648),l=r(33145),i=r(90191),o=r(95169),d=r(74470),c=r(99376),x=r(69154),u=r(56188),h=r(3620);let f=[{href:"/course",labelKey:"footer.allCourses"},{href:"/parent-taught-drivers-ed",labelKey:"footer.teenDriversEd"},{href:"/adult-drivers-ed",labelKey:"footer.adultDriversEd"},{href:"/defensive-driving",labelKey:"footer.defensiveDriving"},{href:"/road-test",labelKey:"footer.dpsRoadTest"},{href:"/in-car-lesson",labelKey:"footer.inCarLesson"}],p=[{href:"/about-us",labelKey:"footer.aboutUs"},{href:"/help-center",labelKey:"footer.helpCenter"},{href:"/contact-us",labelKey:"footer.contactUs"},{href:"/blog",labelKey:"footer.blog"},{href:"/privacy-policy",labelKey:"footer.privacyPolicy"}],m=["footer.facebook","footer.x","footer.linkedin","footer.youtube"];t.default=()=>{let e=(0,c.useParams)(),t=(0,i.Z)(),r=(0,c.usePathname)(),{selectedBranchName:g}=(0,x.S)(),{translator:b}=(0,h.b)(),v=e.branchId||(null==r?void 0:r.split("/")[1])||t,y=(0,u.O3)(g);return(0,n.jsx)("footer",{className:"w-full bg-[#eafffe] text-black",children:(0,n.jsxs)("div",{className:"content-wrapper px-4 sm:px-10 xl:px-0 pt-6 sm:pt-6 pb-8",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1.3fr_1fr_1fr] gap-10 lg:gap-12",children:[(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)(s.default,{href:"/".concat(v),className:"block w-fit",children:(0,n.jsx)(l.default,{src:"/logo/logo.svg",alt:"Drive Safe Driving School",width:230,height:40})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-lufga font-semibold text-[22px] leading-[30px] text-[#00a5c0]",children:b("footer.exploreCourses")}),(0,n.jsx)("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-[15px] leading-[22px] font-medium text-[#14667C]",children:f.map((e,t)=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)(s.default,{href:e.href,className:"underline hover:text-[#00a5c0]",children:b(e.labelKey)}),t<f.length-1&&(0,n.jsx)("span",{className:"text-[#14667C]/60",children:"|"})]},e.href))})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-4 pt-2",children:[(0,n.jsx)(s.default,{href:"/about-affiliates-program",className:"inline-flex items-center justify-center rounded-full border-2 border-[#00a5c0] px-7 py-3 font-lufga font-semibold text-[16px] text-[#00a5c0] hover:bg-[#00a5c0] hover:text-white transition-colors",children:b("footer.partnerWithUs")}),(0,n.jsx)(s.default,{href:"/refer-a-friend",className:"inline-flex items-center justify-center rounded-full border-2 border-[#00a5c0] px-7 py-3 font-lufga font-semibold text-[16px] text-[#00a5c0] hover:bg-[#00a5c0] hover:text-white transition-colors",children:b("footer.referAFriend")})]})]}),(0,n.jsx)("nav",{className:"flex flex-row flex-wrap gap-x-5 gap-y-3 font-lufga text-[17px] leading-[26px] lg:flex-col lg:gap-4","aria-label":"Footer menu",children:p.map(e=>(0,n.jsx)(s.default,{href:e.href,className:"whitespace-nowrap hover:text-[#00a5c0] hover:underline",children:b(e.labelKey)},e.href))}),(0,n.jsx)("div",{className:"flex flex-row flex-wrap gap-x-5 gap-y-3 font-lufga text-[17px] leading-[26px] lg:flex-col lg:gap-4",children:d.KT.map((e,t)=>(0,n.jsxs)(s.default,{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-3 whitespace-nowrap hover:text-[#00a5c0] hover:underline",children:[(0,n.jsx)("span",{className:"text-[#00a5c0] flex items-center justify-center",children:(0,n.jsx)(o.d,{Icon:e.icon,size:20})}),(0,n.jsx)("span",{children:b(m[t])})]},e.href))})]}),(0,n.jsxs)("div",{className:"pt-4 mt-6 border-t border-[#B8E8F0]",children:[(0,n.jsxs)("div",{className:"mb-8",children:[(0,n.jsx)("h3",{className:"font-lufga font-semibold text-[20px] leading-[28px] text-[#00a5c0]",children:b("footer.supportLocations")}),(0,n.jsx)("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:y.map((e,t)=>(0,n.jsxs)("div",{className:"rounded-xl border border-[#B8E8F0] bg-white/70 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("p",{className:"font-lufga font-semibold text-[15px] leading-[22px] text-black",children:e.name}),(0,n.jsx)("a",{href:"tel:".concat(e.phone.replace(/[^\d+]/g,"")),className:"font-lufga text-[14px] leading-[20px] text-[#00a5c0] hover:underline whitespace-nowrap",children:e.phone})]}),e.address&&(0,n.jsx)("p",{className:"mt-1 font-lufga text-[13px] leading-[19px] text-black/70",children:e.address})]},"".concat(e.name,"-").concat(t)))})]}),(0,n.jsxs)("div",{className:"text-[16px] font-lufga",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-y-3 gap-x-4",children:[(0,n.jsx)(s.default,{href:"/privacy-policy",className:"hover:text-[#00a5c0] hover:underline",children:b("footer.privacyPolicy")}),(0,n.jsx)("span",{children:"|"}),(0,n.jsx)(s.default,{href:"/terms-and-conditions",className:"hover:text-[#00a5c0] hover:underline",children:b("footer.termsAndConditions")})]}),(0,n.jsx)("p",{className:"mt-4",children:b("footer.copyright")}),(0,n.jsxs)("p",{className:"mt-2 text-[14px] text-black/60",children:[b("footer.developedByPrefix")," ",(0,n.jsx)("a",{href:"https://nusabilabs.com/",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[#00a5c0] hover:underline",children:"NusabiLabs"})]})]})]})]})})}},13848:function(e,t,r){"use strict";var n=r(57437),a=r(2265),s=r(27648),l=r(33145),i=r(94242),o=r(67116),d=r(8430),c=r(16725),x=r
1(78733),u=r(475),h=r(69154),f=r(99376),p=r(12490),m=r(30424),g=r(33804),b=r(48239),v=r(40110),y=r(66410),j=r(95169),w=r(98612),N=r(56188),k=r(95268),S=r(3620);let C={"Select Branch":"header.selectBranch","DPS Road Test":"header.dpsRoadTest","Online Courses":"header.onlineCourses","Teen Drivers Ed":"header.teenDriversEd","Adult Drivers Ed":"header.adultDriversEd",Affiliates:"header.affiliates","About Affiliates Program":"header.aboutAffiliatesProgram","Affiliate Registration":"header.affiliateRegistration"},E=[{code:"en",label:"English",short:"EN"},{code:"es",label:"Espa\xf1ol",short:"ES"}];t.default=e=>{var t;let{availableCarLessonLocations:r,availableBranches:L,categories:A,navItems:P,adultCategories:T,teenCategories:R,isDashboard:B,BASE_URL:D,IMAGE_BASE_URL:I}=e,z=(0,f.usePathname)(),{isAuthenticated:F,isLoading:Z,logout:H}=(0,x.a)(),{locale:_,setLocale:M,translator:W}=(0,S.b)(),U=(0,p.y)(e=>e.refSlug),{selectedBranchId:O,setBranch:K,_hasHydrated:G}=(0,h.S)(),V=(0,a.useRef)(null),[X,q]=(0,a.useState)(!1),[J,Y]=(0,a.useState)(null),[$,Q]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),er=(0,a.useRef)(null),[en,ea]=(0,a.useState)(!1),es=(0,a.useRef)(null),el=()=>ea(e=>!e),[ei,eo]=(0,a.useState)(!1),ed=async()=>{try{i.Am.success("Logout Successfully"),setTimeout(async()=>{await H()},1e3)}catch(e){i.Am.error("Logout failed. Please try again.")}},[ec,ex]=(0,a.useState)(null),eu=e=>{ex(t=>t===e?null:e)},[eh,ef]=(0,a.useState)(null),ep=(0,a.useRef)(null),em=e=>{ep.current&&clearTimeout(ep.current),ef(e)},eg=()=>{ep.current=setTimeout(()=>{ef(null)},120)},eb=(0,a.useCallback)(()=>{q(e=>!e)},[]),ev=L.find(e=>e._id===O);(0,a.useEffect)(()=>(Q(!0),()=>{ep.current&&clearTimeout(ep.current)}),[]),(0,a.useEffect)(()=>{if(G&&!O&&L.length>0){let e=L[0];K(e._id,e.location)}},[G,O,L,K]),(0,a.useEffect)(()=>{let e=()=>{window.innerWidth>=1024&&q(!1)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),(0,a.useEffect)(()=>{let e=e=>{V.current&&!V.current.contains(e.target)&&X&&q(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[X]),(0,a.useEffect)(()=>(X?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[X]),(0,a.useEffect)(()=>{if(!en)return;let e=e=>{es.current&&!es.current.contains(e.target)&&ea(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[en]),(0,a.useEffect)(()=>{if(!ei)return;let e=e=>{V.current&&!V.current.contains(e.target)&&eo(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ei]),(0,a.useEffect)(()=>{if(!ee)return;let e=e=>{er.current&&!er.current.contains(e.target)&&et(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ee]);let ey=P.map(e=>"Select Branch"===e.label?{...e,_isBranchSelector:!0,label:ev?ev.location:"Select Branch",subItems:L.map(e=>({label:e.location,href:"#",branchId:e._id}))}:"DPS Road Test"===e.label?{...e,subItems:A.map(e=>({label:e.name,href:"/road-test/".concat(e.slug||e.id)}))}:"Teen Drivers Ed"===e.label?{...e,subItems:R.map(e=>({label:e.categoryName,href:"/in-car-lesson/".concat(e.slug||e.categoryId)}))}:"Adult Drivers Ed"===e.label?{...e,subItems:T.map(e=>({label:e.categoryName,href:"/in-car-lesson/".concat(e.slug||e.categoryId)}))}:e),ej=e=>"/"===e?"/"===z:z.startsWith(e),ew=null==ev?void 0:ev.location;(0,N.O3)(ew);let{companyLogo:eN,companyName:ek}=J||{},eS=(0,y.x)(e=>e.getItemCount()),eC=e=>C[e]?W(C[e]):e;(0,a.useEffect)(()=>{U&&D&&(async()=>{try{let e=await k.Z.getAffiliateCompanyInfo(D,U);Y(e)}catch(e){console.error("Failed to fetch affiliate info:",e)}})()},[U]);let eE=null!==(t=E.find(e=>e.code===_))&&void 0!==t?t:E[0];return(0,n.jsx)("header",{className:"bg-white w-full shadow-sm border-b border-gray-100",children:(0,n.jsxs)("div",{className:"w-full content-wrapper flex items-center justify-between gap-3 px-4 sm:px-10 xl:px-0 py-1 xl:flex-nowrap xl:items-center xl:gap-4",children:[(0,n.jsx)("div",{className:"flex flex-col gap-1 flex-shrink-0",suppressHydrationWarning:!0,children:ek?(0,n.jsx)("span",{className:"text-xl font-bold text-primaryStrong",children:ek}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(s.default,{href:"/",children:[(0,n.jsx)(l.default,{src:c.Z,alt:"logo",width:153,height:38,className:"cursor-pointer w-[80%]"}),!eN&&(0,n.jsxs)("span",{className:"w-[80%] inline-block px-1.5 py-0.2 rounded-full bg-primaryStrong/10 text-primaryStrong font-bold text-[9px] border border-primaryStrong/20 text-center",translate:"no",children:["License No: ",m.f0]})]})})}),(0,n.jsx)("nav",{className:"".concat(U?"hidden":""," hidden xl:flex items-center justify-start content-center gap-x-5 2xl:gap-x-6 flex-1 min-w-0"),children:ey.filter(e=>!e._isBranchSelector).map((e,t,r)=>{let{label:a,href:l,subItems:i}=e,o=t>=r.length-2,d=eC(a);return(0,n.jsxs)("div",{className:"relative flex-shrink-0",onMouseEnter:()=>em(a),onMouseLeave:eg,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 cursor-pointer py-1",children:["#"!==l?(0,n.jsx)(s.default,{href:l,className:"font-lufga font-medium text-[14px] leading-[20px] whitespace-nowrap transition-colors ".concat(ej(l)?"text-primaryStrong":"text-[#0a0a0a] hover:text-primaryStrong"),children:d}):(0,n.jsx)("span",{className:"font-lufga font-medium text-[14px] leading-[20px] whitespace-nowrap text-[#0a0a0a] hover:text-primaryStrong transition-colors",children:d}),i&&(0,n.jsx)(w.Z,{className:"transition-transform duration-200 ".concat(eh===a?"rotate-180":""),sx:{fontSize:16,color:"#0a0a0a"}})]}),i&&eh===a&&(0,n.jsx)("div",{className:"absolute top-full mt-1 bg-white shadow-xl rounded-xl w-56 z-50 overflow-hidden border border-gray-100 py-1 ".concat(o?"right-0":"left-0"),children:i.map(e=>{let t=e.label,r=e.href,a=e.branchId;return a?(0,n.jsx)("button",{onClick:()=>{K(a,t),ef(null)},className:"w-full text-left px-4 py-2 hover:bg-primaryStrong/10 hover:text-primaryStrong transition-all text-14 whitespace-nowrap overflow-hidden text-ellipsis cursor-pointer ".concat(O===a?"text-primaryStrong font-semibold":"text-[#0a0a0a]"),children:t},a):(0,n.jsx)(s.default,{href:r,className:"block px-4 py-2 hover:bg-primaryStrong/10 hover:text-primaryStrong transition-all text-14 whitespace-nowrap overflow-hidden text-ellipsis cursor-pointer text-[#0a0a0a]",children:eC(t)},r)})})]},t)})}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,n.jsx)("div",{className:"xl:hidden cursor-pointer",onClick:eb,children:(0,n.jsx)(j.U,{color:"#00a5c0"})}),(0,n.jsxs)("div",{className:"hidden xl:flex relative",ref:er,translate:"no",children:[(0,n.jsxs)("button",{className:"flex items-center gap-[5px] px-3 py-[6px] rounded-full border border-[#00a5c0] bg-[#eafffe] cursor-pointer hover:bg-[#00a5c0]/20 transition-colors",onClick:()=>et(e=>!e),children:[(0,n.jsx)("span",{className:"font-lufga font-medium text-[14px] leading-[20px] text-[#00a5c0] whitespace-nowrap",children:eE.short}),(0,n.jsx)(w.Z,{sx:{fontSize:16,color:"#00a5c0"},className:"transition-transform duration-200 ".concat(ee?"rotate-180":"")})]}),ee&&(0,n.jsxs)("div",{className:"absolute top-full right-0 mt-2 bg-white shadow-xl rounded-xl w-44 z-50 overflow-hidden border border-gray-100 pt-2",translate:"no",children:[(0,n.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-[#00a5c0] border-b border-gray-100 bg-[#eafffe] text-center",children:W("header.selectLanguage")}),E.map(e=>(0,n.jsxs)("button",{onClick:()=>{M(e.code),et(!1)},className:"w-full text-left px-4 py-2.5 flex items-center justify-between gap-3 hover:bg-[#00a5c0]/10 hover:text-[#00a5c0] transition-all text-sm cursor-pointer ".concat(_===e.code?"text-[#00a5c0] font-semibold bg-[#eafffe]":"text-[#0a0a0a]"),children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:e.label}),(0,n.jsx)("span",{className:"text-xs opacity-60",children:e.short})]},e.code))]})]}),!eN&&(0,n.jsxs)(s.default,{href:"/cart",className:"hidden xl:flex relative items-center justify-center",children:[(0,n.jsx)("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border border-primaryStrong bg-[#eafffe] hover:bg-primaryStrong/20 transition-colors",children:(0,n.jsx)(v.Z,{sx:{fontSize:16,color:"#00a5c0"}})}),$&&eS>0&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 rounded-full bg-[#1A6FE8] text-white text-[10px] font-bold flex items-center justify-center leading-none",children:eS>99?"99+":eS})]}),Z?(0,n.jsx)("div",{className:"hidden xl:block w-[72px] h-[32px] rounded-full bg-gray-100 animate-pulse","aria-hidden":"true"}):F?B?(0,n.jsxs)("div",{className:"hidden xl:flex items-center gap-2 relative",ref:es,children:[(0,n.jsxs)("button",{onClick:el,className:"flex items-center gap-1 rounded-full px-3 py-[6px] transition focus:outline-none border ".concat(en?"border-primaryStrong bg-primaryStrong text-white":"border-primaryStrong text-primaryStrong bg-[#eafffe] hover:bg-primaryStrong hover:text-white"),title:"Account menu",children:[(0,n.jsx)(o.Z,{sx:{width:20,height:20,bgcolor:"transparent",color:"inherit"},children:(0,n.jsx)(g.Z,{sx:{fontSize:15}})}),(0,n.jsx)(w.Z,{sx:{fontSize:16},className:"transition-transform duration-200 ".concat(en?"rotate-180":"")})]}),en&&(0,n.jsx)(u.Z,{menuRef:es,handleToggleModal:el,useOwnPositioning:!0})]}):(0,n.jsx)(s.default,{href:"/my-preparation",className:"hidden xl:flex",children:(0,n.jsxs)("button",{className:"flex items-center gap-1 rounded-full px-3 py-[6px] transition focus:outline-none border border-primaryStrong text-primaryStrong bg-[#eafffe] hover:bg-primaryStrong hover:text-white",children:[(0,n.jsx)(o.Z,{sx:{width:20,height:20,bgcolor:"transparent",color:"inherit"},children:(0,n.jsx)(g.Z,{sx:{fontSize:15}})}),(0,n.jsx)("span",{className:"text-[13px] font-medium",children:W("header.myAccount")}
1)]})}):(0,n.jsx)(n.Fragment,{children:!eN&&(0,n.jsx)(s.default,{href:"/login",className:"hidden xl:block",children:(0,n.jsxs)("button",{className:"flex items-center gap-[5px] bg-primaryStrong rounded-full px-3 py-[6px] text-white hover:bg-primaryStrong/90 transition-colors",children:[(0,n.jsx)(b.Z,{sx:{fontSize:16,color:"white"}}),(0,n.jsx)("span",{className:"font-lufga font-medium text-[13px] leading-[20px] text-white whitespace-nowrap",children:W("header.login")})]})})})]}),X&&(0,n.jsx)("div",{className:"fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300 opacity-100 xl:hidden",onClick:()=>q(!1)}),(0,n.jsxs)("div",{ref:V,className:"fixed top-0 right-0 z-50 w-[85vw] sm:w-[360px] h-full bg-white text-dark shadow-2xl rounded-l-br24 transform transition-transform duration-300 ease-in-out flex flex-col overflow-hidden ".concat(X?"translate-x-0":"translate-x-full"),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100 flex-shrink-0",children:[(0,n.jsx)(s.default,{href:"/",onClick:()=>q(!1),children:(0,n.jsx)(l.default,{src:c.Z,alt:"logo",width:140,height:35,className:"cursor-pointer"})}),(0,n.jsx)("button",{onClick:eb,className:"flex items-center justify-center w-9 h-9 rounded-full border border-gray-200 hover:border-primaryStrong hover:bg-primaryStrong/10 transition-all",children:(0,n.jsx)(j.d,{Icon:d.Z,size:20})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 py-3",children:[F&&(0,n.jsx)("div",{className:"mb-3",children:B?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:()=>eo(e=>!e),className:"flex items-center gap-3 w-full px-4 py-3 rounded-xl border transition-all text-left ".concat(ei?"border-primaryStrong bg-primaryStrong/10 text-primaryStrong":"border-gray-200 text-dark hover:border-primaryStrong hover:bg-primaryStrong/5"),children:[(0,n.jsx)(o.Z,{sx:{width:32,height:32,bgcolor:"#00A5C0",color:"white"},children:(0,n.jsx)(g.Z,{sx:{fontSize:18}})}),(0,n.jsx)("span",{className:"flex-1 font-medium text-14",children:W("header.myAccount")}),(0,n.jsx)(w.Z,{sx:{fontSize:18},className:"transition-transform duration-200 ".concat(ei?"rotate-180 text-primaryStrong":"text-secondary")})]}),ei&&(0,n.jsxs)("div",{className:"mt-1 bg-surface rounded-xl border border-gray-100 overflow-hidden",children:[[{href:"/my-preparation",labelKey:"header.myPreparation"},{href:"/driving-record-order",labelKey:"header.drivingRecord"},{href:"/car-rental-order",labelKey:"header.carRental"},{href:"/profile",labelKey:"header.profile"},{href:"/profile/change-password",labelKey:"header.changePassword"},{href:"/payment-history",labelKey:"header.paymentHistory"}].map(e=>{let{href:t,labelKey:r}=e;return(0,n.jsx)(s.default,{href:t,onClick:()=>{q(!1),eo(!1)},className:"block px-4 py-2.5 text-14 text-dark hover:bg-primaryStrong/10 hover:text-primaryStrong transition-all border-b border-gray-100 last:border-none",children:W(r)},t)}),(0,n.jsx)("div",{className:"border-t border-gray-100"}),(0,n.jsx)("button",{onClick:()=>{q(!1),eo(!1),ed()},className:"w-full text-left px-4 py-2.5 text-14 text-red hover:bg-red/10 transition-all",children:W("header.logOut")})]})]}):(0,n.jsxs)(s.default,{href:"/my-preparation",onClick:()=>q(!1),className:"flex items-center gap-3 w-full px-4 py-3 rounded-xl border border-gray-200 text-dark hover:border-primaryStrong hover:bg-primaryStrong/5 transition-all text-left",children:[(0,n.jsx)(o.Z,{sx:{width:32,height:32,bgcolor:"#00A5C0",color:"white"},children:(0,n.jsx)(g.Z,{sx:{fontSize:18}})}),(0,n.jsx)("span",{className:"flex-1 font-medium text-14",children:W("header.myAccount")})]})}),!eN&&(0,n.jsxs)(s.default,{href:"/cart",onClick:()=>q(!1),className:"flex items-center justify-between px-4 py-3 rounded-xl border border-gray-200 hover:border-primaryStrong hover:bg-primaryStrong/5 transition-all mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-full bg-primaryStrong/10 flex items-center justify-center",children:(0,n.jsx)(v.Z,{sx:{fontSize:18,color:"#00a5c0"}})}),(0,n.jsx)("span",{className:"font-medium text-14 text-dark",children:W("header.myCart")})]}),$&&eS>0&&(0,n.jsx)("span",{className:"min-w-[22px] h-[22px] px-1.5 rounded-full bg-[#1A6FE8] text-white text-[11px] font-bold flex items-center justify-center",children:eS>99?"99+":eS})]}),(0,n.jsx)("nav",{className:"".concat(eN?"hidden":"block"," flex flex-col gap-0.5"),children:ey.map((e,t)=>{let{label:r,href:a,subItems:l}=e,i=eC(r);return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"flex items-center",children:l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>eu(r),className:"flex-1 text-left text-14 font-medium py-2.5 px-3 rounded-lg transition-all ".concat(ec===r?"bg-primaryStrong/10 text-primaryStrong":"text-dark hover:bg-primaryStrong/5 hover:text-primaryStrong"),children:i}),(0,n.jsx)("button",{onClick:()=>eu(r),className:"px-2 py-2.5",children:(0,n.jsx)(w.Z,{sx:{fontSize:18},className:"transition-transform duration-200 ".concat(ec===r?"rotate-180 text-primaryStrong":"text-secondary")})})]}):(0,n.jsx)(s.default,{href:a,onClick:()=>q(!1),className:"flex-1 text-14 font-medium py-2.5 px-3 rounded-lg transition-all ".concat(ej(a)?"bg-primaryStrong/10 text-primaryStrong":"text-dark hover:bg-primaryStrong/5 hover:text-primaryStrong"),children:i})}),l&&ec===r&&(0,n.jsxs)("div",{className:"ml-3 mt-0.5 mb-1 bg-primaryStrong/5 rounded-xl border border-primaryStrong/10 overflow-hidden",children:[r===(ev?ev.location:"Select Branch")&&(0,n.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-primaryStrong bg-primaryStrong/10 border-b border-primaryStrong/10 text-center",children:W("header.selectBranch")}),l.map(e=>{let t=e.label,r=e.href,a=e.branchId;return a?(0,n.jsx)("button",{onClick:()=>{K(a,t),q(!1)},className:"w-full text-left px-4 py-2.5 text-14 transition-all border-b border-primaryStrong/5 last:border-none ".concat(O===a?"text-primaryStrong font-semibold bg-primaryStrong/10":"text-dark hover:bg-primaryStrong/10 hover:text-primaryStrong"),children:t},a):(0,n.jsx)(s.default,{href:r,onClick:()=>q(!1),className:"block px-4 py-2.5 text-14 text-dark hover:bg-primaryStrong/10 hover:text-primaryStrong transition-all border-b border-primaryStrong/5 last:border-none",children:eC(t)},r)})]})]},t)})}),(0,n.jsx)("div",{className:"border-t border-gray-100 my-2"}),(0,n.jsxs)("div",{translate:"no",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsxs)("button",{onClick:()=>eu("Language"),className:"flex-1 text-left text-14 font-medium py-2.5 px-3 rounded-lg transition-all flex items-center gap-2 ".concat("Language"===ec?"bg-primaryStrong/10 text-primaryStrong":"text-dark hover:bg-primaryStrong/5 hover:text-primaryStrong"),children:[(0,n.jsx)("span",{className:"text-primaryStrong text-14",children:"\uD83C\uDF10"}
1),W("header.language"),(0,n.jsx)("span",{className:"ml-auto text-xs font-semibold text-primaryStrong bg-primaryStrong/10 px-2 py-0.5 rounded-full",children:eE.short})]}),(0,n.jsx)("button",{onClick:()=>eu("Language"),className:"px-2 py-2.5",children:(0,n.jsx)(w.Z,{sx:{fontSize:18},className:"transition-transform duration-200 ".concat("Language"===ec?"rotate-180 text-primaryStrong":"text-secondary")})})]}),"Language"===ec&&(0,n.jsxs)("div",{className:"ml-3 mt-0.5 mb-1 bg-primaryStrong/5 rounded-xl border border-primaryStrong/10 overflow-hidden",children:[(0,n.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-primaryStrong bg-primaryStrong/10 border-b border-primaryStrong/10 text-center",children:W("header.selectLanguage")}),E.map(e=>(0,n.jsxs)("button",{onClick:()=>{M(e.code),q(!1),ex(null)},className:"w-full flex items-center justify-between px-4 py-2.5 text-14 transition-all border-b border-primaryStrong/5 last:border-none ".concat(_===e.code?"text-primaryStrong font-semibold bg-primaryStrong/10":"text-dark hover:bg-primaryStrong/10 hover:text-primaryStrong"),children:[(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("span",{className:"text-xs opacity-60",children:e.short})]},e.code))]})]}),!Z&&F&&(0,n.jsx)("div",{className:"pt-3 pb-1",children:(0,n.jsxs)("button",{onClick:()=>{q(!1),ed()},className:"flex items-center justify-center gap-2 w-full border border-red text-red rounded-full py-3 font-medium text-14 hover:bg-red/10 transition-colors",children:[(0,n.jsx)(b.Z,{sx:{fontSize:20,transform:"scaleX(-1)"}}),W("header.logOut")]})})]}),!Z&&!F&&!eN&&(0,n.jsx)("div",{className:"px-4 py-4 border-t border-gray-100 flex-shrink-0",children:(0,n.jsx)(s.default,{href:"/login",onClick:()=>q(!1),children:(0,n.jsxs)("button",{className:"flex items-center justify-center gap-2 w-full bg-primaryStrong text-white rounded-full py-3 font-medium text-14 hover:bg-primaryStrong/90 transition-colors",children:[(0,n.jsx)(b.Z,{sx:{fontSize:20}}),W("header.login")]})})})]})]})})}},99742:function(e,t,r){"use strict";r.d(t,{default:function(){return _}});var n=r(57437),a=r(2265),s=r(13848),l=r(71629),i=r(74470),o=r(99376),d=r(12490),c=r(57534);r(475);var x=r(27648),u=r(3620),h=r(33145);r(7821);var f=r(48855),p=r(42746);let m=["/login","/signup","/register","/reset-password","/forgot-password","/verify-email"],g=["/my-preparation","/road-test-booking","/course-booking","/driving-record-order","/car-rental-order","/car-lesson-booking","/profile","/payment-history","/certificate","/payment/invoice"];var b=()=>(0,n.jsx)("div",{className:"w-full bg-[#eafffe] border-t border-[#B8E8F0]",children:(0,n.jsxs)("div",{className:"max-w-[1280px] mx-auto px-4 sm:px-10 xl:px-0 py-10 sm:py-12",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-8",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-[#B8E8F0]"}),(0,n.jsx)("span",{className:"text-[11px] font-semibold tracking-widest uppercase text-[#00a5c0]",children:"State Resources"}),(0,n.jsx)("div",{className:"flex-1 h-px bg-[#B8E8F0]"})]}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-center justify-center",children:[(0,n.jsxs)("a",{href:"https://impacttexasdrivers.dps.texas.gov/ITTD/",target:"_blank",rel:"noopener noreferrer",className:"flex flex-col items-center gap-3 group p-4 rounded-2xl transition-all duration-200",style:{background:"rgba(255,255,255,0.6)",border:"1px solid #B8E8F0"},children:[(0,n.jsx)("div",{className:"rounded-xl overflow-hidden shadow-md",children:(0,n.jsx)(h.default,{src:"/footer/ITTD_button.png",alt:"Impact Texas Teen Drivers",width:180,height:60,className:"group-hover:scale-105 transition-transform duration-200 block"})}),(0,n.jsx)("span",{className:"text-[12px] font-semibold text-center text-[#00a5c0]",children:"Impact Texas Teen Drivers"})]}),(0,n.jsxs)("a",{href:"https://impacttexasdrivers.dps.texas.gov/ITAD/",target:"_blank",rel:"noopener noreferrer",className:"flex flex-col items-center gap-3 group p-4 rounded-2xl transition-all duration-200",style:{background:"rgba(255,255,255,0.6)",border:"1px solid #B8E8F0"},children:[(0,n.jsx)("div",{className:"rounded-xl overflow-hidden shadow-md",children:(0,n.jsx)(h.default,{src:"/footer/ITAD_button.png",alt:"Impact Texas Adult Drivers",width:180,height:60,className:"group-hover:scale-105 transition-transform duration-200 block"})}),(0,n.jsx)("span",{className:"text-[12px] font-semibold text-center text-[#00a5c0]",children:"Impact Texas Adult Drivers"})]})]})]})}),v=r(95268),y=e=>{let{BASE_URL:t,refSlug:r}=e,[s,l]=(0,a.useState)(null),[i,o]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>
1{if(r&&t)try{o(!0);let e=await v.Z.getAffiliateCompanyInfo(t,r);l(e)}catch(e){}finally{o(!1)}else o(!1)})()},[r,t]);let{companyName:d,webUrl:c}=s||{},x=d?(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",style:{background:"linear-gradient(135deg, #00a5c0 0%, #0A1628 100%)"},children:(0,n.jsx)("span",{className:"text-white font-bold text-[15px] leading-none tracking-wide select-none",children:d.split(" ").slice(0,2).map(e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.toUpperCase()}).join("")})}),(0,n.jsx)("div",{className:"flex flex-col gap-0",children:(0,n.jsx)("span",{className:"font-bold text-[15px] sm:text-[17px] leading-tight tracking-tight",style:{color:"#0A1628"},children:d})})]}):null;return(0,n.jsx)("header",{className:"w-full bg-white",style:{borderBottom:"1px solid rgba(26,111,232,0.15)",boxShadow:"0 2px 12px rgba(10,22,40,0.07)"},children:(0,n.jsx)("div",{className:"max-w-[1280px] mx-auto w-full px-4 sm:px-10 xl:px-0 py-3 flex items-center justify-between",children:(0,n.jsx)("div",{className:"flex items-center gap-3",children:i?(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gray-100 animate-pulse"}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("div",{className:"w-32 h-4 rounded-md bg-gray-100 animate-pulse"}),(0,n.jsx)("div",{className:"w-24 h-2.5 rounded-md bg-gray-100 animate-pulse"})]})]}):c?(0,n.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80 transition-opacity",children:x}):x})})})},j=e=>{let{children:t,BASE_URL:r,refSlug:a}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{BASE_URL:r,refSlug:a}),(0,n.jsx)("main",{className:"flex-grow w-full",children:t}),(0,n.jsx)(b,{})]})},w=r(45319),N=r(32405),k=e=>{let{BASE_URL:t,refSlug:r,backLabel:s="Continue Shopping"}=e,l=(0,o.useRouter)(),i=(0,d.y)(e=>e.refLandingPage),[c,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{r&&t&&v.Z.getAffiliateCompanyInfo(t,r).then(x).catch(()=>{})},[r,t]);let u=(null==c?void 0:c.companyName)?(0,n.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",style:{background:"linear-gradient(135deg, #00a5c0 0%, #0A1628 100%)"},children:(0,n.jsx)("span",{className:"text-white font-bold text-[13px] leading-none tracking-wide select-none",children:c.companyName.split(" ").slice(0,2).map(e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.toUpperCase()}).join("")})}),(0,n.jsx)("div",{className:"flex flex-col gap-0",children:(0,n.jsx)("span",{className:"font-bold text-[14px] sm:text-[16px] leading-tight tracking-tight",style:{color:"#0A1628"},children:c.companyName})})]}):null;return(0,n.jsx)("header",{className:"bg-white w-full border-b border-[rgba(26,111,232,0.15)] shadow-[0_2px_8px_rgba(0,0,0,0.06)]",children:(0,n.jsxs)("div",{className:"content-wrapper flex items-center justify-between px-4 sm:px-10 xl:px-0 py-1",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{i?l.push(i):l.back()},className:"flex items-center gap-2 font-poppins font-medium text-[14px] leading-[20px] text-[#0a0a0a] hover:text-[#00a5c0] transition-colors shrink-0",children:[(0,n.jsx)(w.Z,{sx:{fontSize:18},"aria-hidden":"true"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:s})]}),(0,n.jsx)("div",{className:"flex items-center shrink-0",children:u?(null==c?void 0:c.webUrl)?(0,n.jsx)("a",{href:c.webUrl,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80 transition-opacity",children:u}):u:(0,n.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("div",{className:"w-9 h-9 rounded-xl bg-gray-100 animate-pulse"}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("div",{className:"w-28 h-3.5 rounded bg-gray-100 animate-pulse"}),(0,n.jsx)("div",{className:"w-20 h-2.5 rounded bg-gray-100 animate-pulse"})]})]})}),(0,n.jsxs)("a",{href:"tel:+12143105000",className:"inline-flex items-center gap-[5px] sm:gap-[7px] bg-[#eafffe] border border-[#9effff] rounded-full px-3 py-1 sm:px-4 sm:py-1 font-poppins font-medium text-[13px] sm:text-[16
1px] leading-[24px] text-[#00a5c0] hover:bg-[#d4f9fb] transition-colors shrink-0",children:[(0,n.jsx)(N.default,{sx:{fontSize:20},"aria-hidden":"true"}),(0,n.jsx)("span",{children:"(214) 310-5000"})]})]})})},S=r(16725),C=e=>{let{backHref:t,backLabel:r}=e,a=(0,o.useRouter)();return(0,n.jsx)("header",{className:"bg-white w-full border-b border-[#e5e5e5]",children:(0,n.jsxs)("div",{className:"content-wrapper flex items-center justify-between px-4 sm:px-10 xl:px-0 py-1",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{t?a.push(t):a.push("/cart")},className:"flex items-center gap-2 font-lufga font-medium text-[14px] leading-[20px] text-[#0a0a0a] hover:text-[#00a5c0] transition-colors shrink-0",children:[(0,n.jsx)(w.Z,{sx:{fontSize:18},"aria-hidden":"true"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:null!=r?r:"Back to cart"})]}),(0,n.jsx)(x.default,{href:"/",className:"shrink-0",children:(0,n.jsx)(h.default,{src:S.Z,alt:"Drive Safe Driving School",width:153,height:38,className:"w-[110px] h-auto sm:w-[153px]",priority:!0})}),(0,n.jsxs)("a",{href:"tel:+12143105000",className:"inline-flex items-center gap-[5px] sm:gap-[7px] bg-[#eafffe] border border-[#00a5c0] rounded-full px-3 py-1 sm:px-4 sm:py-1 font-lufga font-medium text-[13px] sm:text-[16px] leading-[24px] text-[#00a5c0] hover:bg-[#d4f9fb] transition-colors shrink-0",children:[(0,n.jsx)(N.default,{sx:{fontSize:20},"aria-hidden":"true"}),(0,n.jsx)("span",{children:"(214) 310-5000"})]})]})})},E=r(69154);let L=e=>{if(!e)return null;let[t]=e.split("/").filter(Boolean);return t?decodeURIComponent(t).trim():null},A=(e,t)=>{if(!t)return;let r=t.trim().toLowerCase();return e.find(e=>{var t,n;let a=null===(t=e._id)||void 0===t?void 0:t.trim().toLowerCase(),s=null===(n=e.slug)||void 0===n?void 0:n.trim().toLowerCase();return a===r||s===r})},P={"irving-driving-school":"irving","coppell-driving-school":"coppell","plano-driving-school":"plano","valley-ranch-driving-school":"valley-ranch","teen-drivers-ed-irving-tx":"irving","teen-drivers-ed-coppell-tx":"coppell","teen-drivers-ed-plano-tx":"plano","teen-drivers-ed-valley-ranch-tx":"valley-ranch","adult-drivers-ed-irving-tx":"irving","adult-drivers-ed-coppell-tx":"coppell","adult-drivers-ed-plano-tx":"plano","adult-drivers-ed-valley-ranch-tx":"valley-ranch","dps-road-test-irving-tx":"irving","dps-road-test-coppell-tx":"coppell","dps-road-test-plano-tx":"plano","dps-road-test-valley-ranch-tx":"valley-ranch","defensive-driving-irving-tx":"irving","defensive-driving-coppell-tx":"coppell","defensive-driving-plano-tx":"plano","defensive-driving-valley-ranch-tx":"valley-ranch","in-car-lesson-irving-tx":"irving","in-car-lesson-coppell-tx":"coppell","in-car-lesson-plano-tx":"plano","in-car-lesson-valley-ranch-tx":"valley-ranch"};var T=e=>{let{availableBranches:t,initialBranchIdentifier:r}=e,n=(0,o.usePathname)(),{setBranch:s}=(0,E.S)(),l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=L(n),a=(e?P[e]:void 0)||r||e,i="".concat(n||"",":").concat(a||"");if(!n||l.current===i)return;let o=A(t,a);o&&s(o._id,o.location),l.current=i},[t,r,n,s]),null},R=r(40110),B=r(66410);let D=["/cart","/checkout","/payment"];var I=()=>{let e=(0,o.usePathname)(),t=(0,B.x)(e=>e.getItemCount());return D.some(t=>e.startsWith(t))?null:(0,n.jsxs)(x.default,{href:"/cart","aria-label":"Open cart",className:"fixed bottom-5 right-4 z-[60] inline-flex h-12 w-12 items-center justify-center rounded-full border border-[#00a5c0] bg-white text-[#00a5c0] shadow-lg transition hover:bg-[#f0fcff] lg:hidden",children:[(0,n.jsx)(R.Z,{sx:{fontSize:22}}),t>0?(0,n.jsx)("span",{className:"absolute -right-1 -top-1 inline-flex min-h-5 min-w-5 items-center justify-center rounded-full bg-[#00a5c0] px-1 text-[10px] font-semibold text-white",children:t>99?"99+":t}):null]})};let z={days:0,hours:0,minutes:0,seconds:0};function F(e){let t=new Date(e).getTime()-Date.now();return t<=0||Number.isNaN(t)?z:{days:Math.floor(t/864e5),hours:Math.floor(t%864e5/36e5),minutes:Math.floor(t%36e5/6e4),seconds:Math.floor(t%6e4/1e3)}}let Z=e=>{let{value:t,label:r}=e;return(0,n.jsxs)("div",{className:"bg-white/15 border border-white/20 rounded-md flex items-baseline gap-1 px-2 py-[3px]",children:[(0,n.jsx)("span",{className:"font-lufga font-bold text-[15px] leading-none text-accent tabular-nums",children:String(t).padStart(2,"0")}),(0,n.jsx)("span",{className:"font-lufga font-semibold text-[10px] uppercase text-white/60 tracking-wide",children:r})]})};var H=e=>{let{initialPromoBanner:t=null}=e,{translator:r}=(0,u.b)(),[s,l]=(0,a.useState)(t),[i,o]=(0,a.useState)(()=>(null==t?void 0:t.endsAt)?F(t.endsAt):z);return((0,a.useEffect)(()=>
1{if(!(null==s?void 0:s.endsAt))return;let e=()=>{let e=F(s.endsAt);if(0===e.days&&0===e.hours&&0===e.minutes&&0===e.seconds){l(null),o(z);return}o(e)};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[null==s?void 0:s.endsAt]),s)?(0,n.jsxs)("div",{className:"relative w-full overflow-hidden bg-primary",children:[(0,n.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute -left-20 top-1/2 -translate-y-1/2 w-48 h-48 rounded-full bg-primaryStrong/20 blur-3xl"}),(0,n.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute -right-20 top-1/2 -translate-y-1/2 w-48 h-48 rounded-full bg-accent/10 blur-3xl"}),(0,n.jsxs)("div",{className:"relative content-wrapper flex items-center justify-between gap-3 px-4 sm:px-8 xl:px-0 py-2",children:[(0,n.jsxs)("p",{className:"font-lufga font-semibold text-[12px] sm:text-[13px] text-white leading-none whitespace-nowrap overflow-hidden text-ellipsis",children:[(0,n.jsx)("span",{className:"text-accent font-bold",children:s.highlightText}),(0,n.jsxs)("span",{className:"hidden xs:inline",children:[" ",s.messageText]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,n.jsx)("span",{className:"font-lufga text-[11px] text-white/60 uppercase tracking-wider whitespace-nowrap hidden sm:block",children:r("promoBanner.countdownLabel")}),(0,n.jsx)(Z,{value:i.days,label:r("promoBanner.days")}),(0,n.jsx)(Z,{value:i.hours,label:r("promoBanner.hrs")}),(0,n.jsx)(Z,{value:i.minutes,label:r("promoBanner.min")}),(0,n.jsx)(Z,{value:i.seconds,label:r("promoBanner.sec")})]})]})]}):null},_=e=>{let{availableCarLessonLocations:t,children:r,availableBranches:a,initialBranchIdentifier:x,roadTests:h,adultCategories:b,teenCategories:v,BASE_URL:y,IMAGE_BASE_URL:w,dashboardNavVisibility:N={courseBooking:!0,drivingRecord:!0,drivingGuides:!0,carRental:!0,carLesson:!0,roadTest:!0},initialPromoBanner:S=null}=e,E=(0,o.usePathname)(),L=(0,d.y)(e=>e.refSlug),{translator:A}=(0,u.b)(),P=m.includes(E),R=g.some(e=>E.startsWith(e)),B=E.endsWith("/purchase"),D=E.endsWith("/checkout"),z="/cart"===E;if(P)return(0,n.jsx)(c.default,{children:r});if(L)return z||B||D?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(k,{BASE_URL:y,refSlug:L,backLabel:A(z?"cart.continueShopping":"cart.backToCart")}),(0,n.jsx)("main",{className:"flex-grow w-full",children:r})]}):(0,n.jsx)(j,{BASE_URL:y,refSlug:L,children:r});if(z)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C,{backHref:"/",backLabel:A("cart.continueShopping")}),(0,n.jsx)("main",{className:"flex-grow w-full",children:r})]});if(B||D)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C,{}),(0,n.jsx)("main",{className:"flex-grow w-full",children:r})]});let F=(0,p.PX)(h);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(T,{availableBranches:a,initialBranchIdentifier:x}),R?(0,n.jsx)(f.default,{dashboardNavVisibility:N,children:r}):(0,n.jsxs)(n.Fragment,{children:[!E.startsWith("/payment")&&(0,n.jsx)("div",{className:"sticky top-0 z-50",children:(0,n.jsx)(H,{initialPromoBanner:S})}),(0,n.jsx)(s.default,{navItems:i.te,categories:F,availableCarLessonLocations:t,availableBranches:a,adultCategories:b,teenCategories:v,BASE_URL:y,IMAGE_BASE_URL:w}),(0,n.jsx)(I,{}),(0,n.jsx)("main",{className:"flex-grow w-full",children:r}),(0,n.jsx)(l.default,{})]})]})}},48855:function(e,t,r){"use strict";r.d(t,{default:function(){return N}});var n=r(57437),a=r(2265),s=r(54887),l=r(33145),i=r(27648),o=r(8430),d=r(16725),c=r(97202),x=r(95169),u=r(99376),h=r(78733),f=r(67116),p=r(94242),m=r(98612),g=r(48239),b=r(69154),v=r(475),y=r(3620);let j=(0,a.memo)(e=>{var t,r,j,w,N,k;let{availableCarLessonLocations:S,availableBranches:C,categories:E,navItems:L,adultCategories:A,teenCategories:P,hasDrivingRecordOrders:T=!1}=e,R=(0,u.usePathname)(),B=(0,u.useParams)(),{translator:D}=(0,y.b)(),{isAuthenticated:I,isLoading:z,logout:F,user:Z}=(0,h.a)(),{selectedBranchId:H,setBranch:_}=(0,b.S)(),M=(0,a.useRef)(null),[W,U]=(0,a.useState)(!1),[O,K]=(0,a.useState)(!1),G=(0,a.useRef)(null),V=()=>{K(e=>!e)},[X,q]=(0,a.useState)(!1),[J,Y]=(0,a.useState)(null),$=(0,a.useRef)(null),Q=e=>{Y(t=>t===e?null:e)},ee=async()=>{try{p.Am.success(D("dashHeader.logoutSuccess")),setTimeout(async()=>{await F()},1e3)}catch(e){p.Am.error(D("dashHeader.logoutFailed"))}},[et,er]=(0,a.useState)(null),en=(0,a.useCallback)(()=>{U(e=>!e)},[]),ea=B.branchId||(null==R?void 0:R.split("/")[1])||(null===(t=C[0])||void 0===t?void 0:t._id),es=C.find(e=>e._id===H);(0,a.useEffect)(()=>
1{if(ea&&ea!==H){let e=C.find(e=>e._id===ea);e&&_(e._id,e.location)}},[ea,H,C,_]),(0,a.useEffect)(()=>{let e=()=>{window.innerWidth>=1024&&U(!1)};return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),(0,a.useEffect)(()=>{let e=e=>{M.current&&!M.current.contains(e.target)&&W&&U(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[W]),(0,a.useEffect)(()=>(W?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[W]),(0,a.useEffect)(()=>{if(!O)return;let e=e=>{G.current&&!G.current.contains(e.target)&&K(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[O]),(0,a.useEffect)(()=>{if(!X)return;let e=e=>{M.current&&!M.current.contains(e.target)&&q(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[X]);let el=L.some(e=>"My Preparation"===e.label),ei=el?L:L.map(e=>"Select Branch"===e.label?{...e,label:es?es.location:D("dashHeader.selectBranch"),subItems:C.map(e=>({label:e.location,href:"/".concat(e._id)}))}:"DPS Road Test"===e.label?{...e,subItems:E.map(e=>({label:e.name,href:"/road-test/".concat(e.slug||e.id)}))}:"Teen Drivers Ed"===e.label?{...e,subItems:P.map(e=>({label:e.categoryName,href:"/in-car-lesson/".concat(e.slug||e.categoryId)}))}:"Adult Drivers Ed"===e.label?{...e,subItems:A.map(e=>({label:e.categoryName,href:"/in-car-lesson/".concat(e.slug||e.categoryId)}))}:e),eo={Home:D("dashHeader.navHome"),"Course Booking":D("dashHeader.navCourseBooking"),"Driving Record":D("dashHeader.navDrivingRecord"),"Car Rental":D("dashHeader.navCarRental"),"Car Lesson":D("dashHeader.navCarLesson"),"Road Test":D("dashHeader.navRoadTest"),"Driving Guides":D("dashHeader.navDrivingGuides"),Certificate:D("dashHeader.navCertificate"),"Payment History":D("dashHeader.navPaymentHistory"),Help:D("dashHeader.navHelp"),Rewards:D("dashHeader.navRewards"),"Parent Behind-the-wheel Guide":D("dashHeader.subParentGuide"),"Behind the-wheel Practice Log (Printable version)":D("dashHeader.subBtwLog"),"New Driver Manual":D("dashHeader.subNewDriverManual"),"Permission Application Checklist":D("dashHeader.subPermitChecklist"),"Provisional License Application Checklist":D("dashHeader.subProvisionalChecklist"),"7 + 7 Behind-the-Wheel Log":D("dashHeader.sub7x7Log")},ed=e=>{var t;return null!==(t=eo[e])&&void 0!==t?t:e},ec=e=>"/"===e?"/"===R:R.startsWith(e),ex=e=>/^https?:\/\//i.test(e);H||null===(r=C[0])||void 0===r||r._id;let eu=(null!==(k=null!==(N=null==Z?void 0:null===(j=Z.firstName)||void 0===j?void 0:j[0])&&void 0!==N?N:null==Z?void 0:null===(w=Z.email)||void 0===w?void 0:w[0])&&void 0!==k?k:"U").toUpperCase();return(0,n.jsx)("header",{className:"bg-white border-b border-gray-200 shadow-sm backdrop-blur-sm bg-opacity-95 w-full px-4 sm:px-16 relative z-50",children:(0,n.jsxs)("div",{className:"max-w-full mx-auto w-full py-3 lg:py-4 flex items-center justify-between",children:[(0,n.jsx)(i.default,{href:"/",children:(0,n.jsx)(l.default,{src:d.Z,alt:"logo",width:153,height:38,className:"cursor-pointer"})}),(0,n.jsx)("nav",{className:"hidden xl:flex items-center gap-1 flex-1 justify-end pr-2",children:ei.map((e,t)=>{let{label:r,href:a,subItems:s}=e;return(0,n.jsxs)("div",{className:"relative submenu-parent",onMouseEnter:()=>er(r),onMouseLeave:()=>er(null),children:["#"!==a?(0,n.jsxs)(i.default,{href:a,className:"flex items-center gap-1 cursor-pointer px-3 py-2 rounded-lg transition-all duration-200 ".concat(ec(a)?"bg-accent/20 shadow-md":"hover:bg-blue-100 hover:shadow-sm"),children:[(0,n.jsx)("div",{className:"relative xl:text-14 text-12 font-medium whitespace-nowrap overflow-hidden text-ellipsis px-1\n                        ".concat(ec(a)?"text-primary after:absolute after:left-1/2 after:-translate-x-1/2 after:bottom-[-8px] after:h-[3px] after:w-8 after:bg-accent after:rounded-full font-semibold":"text-black hover:text-primary after:opacity-0","\n                        "),children:ed(r)}),s&&(0,n.jsx)(m.Z,{className:"text-black transition-transform duration-200 ".concat(et===r?"rotate-180":"")})]}):(0,n.jsxs)("div",{onClick:()=>{s&&er(e=>e===r?null:r)},className:"flex items-center gap-1 cursor-pointer px-3 py-2 rounded-lg transition-all duration-200 ".concat(ec(a)?"bg-accent/20 shadow-md":"hover:bg-blue-100 hover:shadow-sm"),children:[(0,n.jsx)("div",{className:"relative xl:text-14 text-12 font-medium whitespace-nowrap overflow-hidden text-ellipsis px-1\n                        ".concat(ec(a)?"text-primary after:absolute after:left-1/2 after:-translate-x-1/2 after:bottom-[-8px] after:h-[3px] after:w-8 after:bg-accent after:rounded-full font-semibold":"text-black hover:text-primary after:opacity-0","\n                       "),children:ed(r)}),s&&(0,n.jsx)(m.Z,{className:"text-black transition-transform duration-200 ".concat(et===r?"rotate-180":"")})]}),s&&et===r&&(0,n.jsxs)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 bg-white text-gray-700 shadow-xl rounded-xl w-80 z-50 overflow-hidden border border-gray-200 pt-2",children:[r===(es?es.location:"Select Branch")&&(0,n.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-gray-600 cursor-default select-none border-b border-gray-200 bg-gray-50 text-center",children:D("dashHeader.selectBranch")}),s.map(e=>{let{label:t,href:r}=e;return ex(r)?(0,n.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"block px-4 py-2 hover:bg-primary hover:text-white transition-all text-14 leading-snug whitespace-normal cursor-pointer",children:ed(t)},r):(0,n.jsx)(i.default,{href:r,className:"block px-4 py-2 hover:bg-primary hover:text-white transition-all text-14 leading-snug whitespace-normal cursor-pointer",children:ed(t)},r)})]})]},t)})}),(0,n.jsxs)("div",{className:"flex items-center gap-x-3",children:[(0,n.jsx)("div",{className:"xl:hidden cursor-pointer",onClick:en,children:(0,n.jsx)(x.U,{color:"#374151"})}),z?(0,n.jsx)("div",{className:"hidden xl:block w-[44px] h-[44px] rounded-full bg-gray-100 animate-pulse","aria-hidden":"true"}):I?(0,n.jsxs)("div",{className:"hidden xl:flex items-center gap-2 relative z-[9999]",ref:G,children:[(0,n.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),V()},className:"flex items-center gap-1 rounded-full p-1 transition focus:outline-none min-w-[44px] border\n                    ".concat(O?"border-accent bg-accent text-primary shadow-md":"border-gray-300 text-gray-700 hover:border-accent hover:bg-accent hover:text-primary hover:shadow-md","\n                  "),title:"Account menu",children:[(0,n.jsx)(f.Z,{className:"bg-light text-primary font-semibold",children:eu}),(0,n.jsxs)("div",{className:"flex flex-col items-start leading-tight",children:[(0,n.jsx)("span",{className:"text-xs font-semibold text-gray-800",children:"Account"}),(0,n.jsx)("span",{className:"text-[10px] text-gray-500",children:"Menu"})]}),(0,n.jsx)(m.Z,{className:"text-inherit transition-transform duration-200 ".concat(O?"rotate-180":"")})]}),O&&(0,n.jsx)("div",{className:"absolute right-0 top-full mt-2 z-[9999]",children:(0,n.jsx)(v.Z,{menuRef:G,handleToggleModal:V,useOwnPositioning:!1,hasDrivingRecordOrders:T})})]}):(0,n.jsx)(i.default,{href:"/login",children:(0,n.jsx)(c.zx,{label:D("dashHeader.login"),className:"border border-primary text-primary hover:text-white hover:border-accent hover:bg-accent xl:block rounded-full px-[24px] py-[12px] transition-all shadow-sm"})})]}),W&&(0,s.createPortal)((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300 opacity-100 xl:hidden",onClick:()=>U(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999998}}
1),(0,n.jsxs)("div",{ref:M,className:"fixed top-0 right-0 w-3/4 sm:w-1/2 md:w-1/3 h-screen bg-white text-gray-700 p-4 shadow-2xl rounded-l-2xl transform transition-transform duration-300 ease-in-out ".concat(W?"translate-x-0":"translate-x-full"," flex flex-col"),style:{maxWidth:400,position:"fixed",top:0,right:0,zIndex:9999999},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between flex-shrink-0",children:[(0,n.jsx)(i.default,{href:"/",children:(0,n.jsx)(l.default,{src:d.Z,alt:"logo",width:180,height:36,className:"cursor-pointer"})}),(0,n.jsx)("button",{onClick:en,className:"text-2xl text-black hover:bg-gray-100 rounded-full p-2 transition-all duration-200 hover:scale-110",children:(0,n.jsx)(x.d,{Icon:o.Z,size:32})})]}),(0,n.jsxs)("div",{className:"space-y-4 flex-1 overflow-y-auto",children:[el&&(0,n.jsxs)("div",{className:"mb-3 pb-2 border-b border-primary/20 bg-gradient-to-r from-primary/5 to-accent/5 p-2 rounded-md",children:[(0,n.jsx)("h2",{className:"text-base font-bold text-primary mb-1",children:D("dashHeader.userDashboard")}),(0,n.jsx)("p",{className:"text-xs text-black leading-tight",children:D("dashHeader.userDashboardDesc")})]}),ei.map((e,t)=>{let{label:r,href:a,subItems:s}=e;return(0,n.jsxs)("div",{className:"submenu-parent",children:[s?(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)("button",{onClick:()=>Q(r),className:"relative text-left w-full text-16 font-medium transition-all flex-1 py-2 px-2 rounded-lg text-black ".concat(J===r?"bg-accent/20 shadow-sm":"hover:bg-blue-100 focus:bg-blue-100"),children:ed(r)}),(0,n.jsx)("span",{onClick:()=>Q(r),className:"flex items-center px-2",children:(0,n.jsx)(m.Z,{className:"transition-transform duration-300 text-black ".concat(J===r?"rotate-180":"")})})]}):(0,n.jsx)(i.default,{href:a,onClick:()=>U(!1),className:"relative text-16 font-medium transition-all flex-1 py-2 px-2 rounded-lg text-black block ".concat(ec(a)?"bg-accent/20 shadow-sm":"hover:bg-blue-100"),children:ed(r)}),s&&J===r&&(0,n.jsxs)("div",{ref:$,className:"mt-2 flex flex-col gap-1 bg-blue-50 p-2 rounded-lg shadow animate-fade-in-down",style:{animation:"fade-in-down 0.2s"},children:[r===(es?es.location:"Select Branch")&&(0,n.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-black cursor-default select-none border-b border-blue-200 bg-blue-100 text-center",children:"Select Branch"}),s.map(e=>{let{label:t,href:r}=e;return ex(r)?(0,n.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:()=>U(!1),className:"block px-4 py-2 rounded hover:text-primary hover:bg-accent/20 transition-all text-black",children:ed(t)},r):(0,n.jsx)(i.default,{href:r,onClick:()=>U(!1),className:"block px-4 py-2 rounded hover:text-primary hover:bg-accent/20 transition-all text-black",children:ed(t)},r)})]})]},t)}),(0,n.jsx)("div",{className:"pt-2 border-t border-gray-200",children:(0,n.jsxs)("button",{onClick:()=>{U(!1),ee()},className:"flex items-center gap-3 w-full py-2 px-2 rounded-lg text-red-500 hover:bg-red-50 transition-all font-medium text-16",children:[(0,n.jsx)(g.Z,{sx:{fontSize:22,transform:"scaleX(-1)",color:"#ef4444"}}),D("dashHeader.logout")]})})]})]})]}),document.body)]})})});var w=r(74470),N=e=>{let{children:t,dashboardNavVisibility:r={courseBooking:!0,drivingRecord:!0,drivingGuides:!0,carRental:!0,carLesson:!0,roadTest:!0}}=e,a=(0,u.usePathname)().includes("/chapters"),s=new Set;r.courseBooking||s.add("/course-booking"),r.drivingRecord||s.add("/driving-record-order"),r.carRental||s.add("/car-rental-order"),r.carLesson||s.add("/car-lesson-booking"),r.roadTest||s.add("/road-test-booking");let l=w.w3.filter(e=>!s.has(e.href)&&(!!r.drivingGuides||"Driving Guides"!==e.label)),i=w.kJ.filter(e=>!s.has(e.href)&&(!!r.drivingGuides||"Driving Guides"!==e.label));return(0,n.jsxs)("div",{className:"h-screen w-full bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-100 flex flex-col overflow-hidden",children:[(0,n.jsx)("div",{className:"block lg:hidden flex-shrink-0",children:(0,n.jsx)(j,{availableCarLessonLocations:[],availableBranches:[],categories:[],navItems:l,adultCategories:[],teenCategories:[],hasDrivingRecordOrders:r.drivingRecord})}),(0,n.jsx)("div",{className:"hidden lg:block flex-shrink-0",children:(0,n.jsx)(j,{availableCarLessonLocations:[],availableBranches:[],categories:[],navItems:i,adultCategories:[],teenCategories:[],hasDrivingRecordOrders:r.drivingRecord})}),(0,n.jsx)("div",{className:"flex flex-1 w-full max-w-full overflow-hidden",children:(0,n.jsx)("main",{className:"flex-1 ".concat(a?"overflow-hidden":"overflow-y-auto"),children:(0,n.jsx)("div",{className:a?"w-full h-full":"w-full bg-white px-4 py-4 sm:px-6 md:px-8 xl:px-10 min-h-full",children:t})})})]})}},475:function(e,t,r){"use strict";var n=r(57437);r(2265);var a=r(99376),s=r(27648),l=r(8430),i=r(39167),o=r(50572),d=r(83103),c=r(93417),x=r(78733),u=r(94242),h=r(3620);t.Z=e=>{var t,r,f,p,m,g,b;let{menuRef:v,handleToggleModal:y,useOwnPositioning:j=!1}=e,w=(0,a.usePathname)(),{translator:N}=(0,h.b)(),{user:k,logout:S}=(0,x.a)(),C=[{href:"/refer-a-friend",label:N("profileMenu.referralTitle"),description:N("profileMenu.referralDesc")},{href:"/course",label:N("profileMenu.buyCoursesTitle"),description:N("profileMenu.buyCoursesDesc")},{href:"/payment-history",label:N("profileMenu.myOrdersTitle"),description:N("profileMenu.myOrdersDesc")}],E=[{href:"/terms-and-conditions",label:N("profileMenu.termsConditions")}],L=e=>w===e,A="".concat(null!==(f=null==k?void 0:k.firstName)&&void 0!==f?f:""," ").concat(null!==(p=null==k?void 0:k.lastName)&&void 0!==p?p:"").trim()||N("profileMenu.userFallback"),P=(null!==(g=null!==(m=null==k?void 0:null===(t=k.firstName)||void 0===t?void 0:t[0])&&void 0!==m?m:null==k?void 0:null===(r=k.email)||void 0===r?void 0:r[0])&&void 0!==g?g:"U").toUpperCase(),T=async()=>{try{u.Am.success(N("profileMenu.logoutSuccess")),setTimeout(async()=>{await S()},1e3)}catch(e){u.Am.error(N("profileMenu.logoutFailed"))}};return(0,n.jsxs)("div",{ref:v,className:"text-primary bg-white shadow-2xl min-w-[380px] max-w-[380px] rounded-2xl border border-accent/10 animate-fade-in-down ".concat(j?"absolute right-0 top-[70px] lg:top-[90px] z-[999]":"relative"),children:[(0,n.jsx)("div",{className:"absolute w-2 lg:w-8 h-2 lg:h-8 bg-white border-t border-l border-accent/10 rotate-45 right-[40px] lg:right-8 top-[-6px] lg:top-[-16px]"}),(0,n.jsxs)("div",{className:"flex flex-col min-h-[320px] w-full justify-between",children:[(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsxs)("div",{className:"relative w-full px-6 py-5 border-b border-accent/10 bg-accent/5 rounded-t-2xl",children:[(0,n.jsxs)("div",{onClick:y,className:"absolute right-4 top-4 lg:hidden cursor-pointer flex items-center gap-2 pl-2 pr-1 py-1 border border-primary rounded-full text-12 font-normal",children:[(0,n.jsx)("p",{children:N("profileMenu.close")}),(0,n.jsx)("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center p-1",children:(0,n.jsx)(l.Z,{className:"text-white text-[14px]"})})]}
1),(0,n.jsx)("div",{className:"mx-auto w-14 h-14 rounded-full bg-primary text-white text-30 font-semibold flex items-center justify-center",children:P}),(0,n.jsxs)("div",{className:"mt-3 text-center",children:[(0,n.jsx)(c.H0,{className:"text-[24px]",text:A}),(0,n.jsx)(c.eW,{className:"text-[16px]",text:null!==(b=null==k?void 0:k.email)&&void 0!==b?b:""})]}),(0,n.jsxs)("div",{className:"mt-4 pt-3 border-t border-accent/10 flex items-center justify-center gap-5",children:[(0,n.jsxs)(s.default,{href:"/profile/edit",onClick:y,className:"flex items-center gap-2 text-14 font-semibold text-[#0b8ea5] hover:text-[#087d91] transition-colors",children:[(0,n.jsx)(i.Z,{className:"text-[12px]"}),(0,n.jsx)("span",{children:N("profileMenu.editProfile")})]}),(0,n.jsxs)(s.default,{href:"/profile/change-password",onClick:y,className:"flex items-center gap-2 text-14 font-semibold text-[#0b8ea5] hover:text-[#087d91] transition-colors",children:[(0,n.jsx)(o.Z,{className:"text-[12px]"}),(0,n.jsx)("span",{children:N("profileMenu.updatePassword")})]})]})]}),(0,n.jsx)("div",{className:"flex flex-col",children:C.map((e,t)=>(0,n.jsxs)(s.default,{href:e.href,onClick:y,className:"group flex items-center justify-between gap-3 px-6 py-4 transition-all text-left border-b border-accent/10 hover:bg-accent/10 focus:bg-accent/10 focus:outline-none ".concat(L(e.href)?"bg-accent/10":""),children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-16 leading-[1.3] font-semibold text-primary ".concat(L(e.href)?"text-accent":""),children:e.label}),(0,n.jsx)("p",{className:"mt-0.5 text-14 leading-[1.4] text-primary/80",children:e.description})]}),(0,n.jsx)(d.Z,{className:"shrink-0 text-[28px] text-primary/65 transition-colors group-hover:text-accent ".concat(L(e.href)?"text-accent":"")})]},t))}),(0,n.jsx)("div",{className:"border-t border-accent/10",children:E.map(e=>(0,n.jsxs)(s.default,{href:e.href,onClick:y,className:"group flex items-center justify-between gap-3 px-6 py-4 transition-all text-left border-b border-accent/10 hover:bg-accent/10 focus:bg-accent/10 focus:outline-none ".concat(L(e.href)?"bg-accent/10":""),children:[(0,n.jsx)("p",{className:"text-16 leading-[1.3] font-semibold text-primary ".concat(L(e.href)?"text-accent":""),children:e.label}),(0,n.jsx)(d.Z,{className:"shrink-0 text-[28px] text-primary/65 transition-colors group-hover:text-accent ".concat(L(e.href)?"text-accent":"")})]},e.href))})]}),(0,n.jsx)("button",{onClick:T,type:"button",className:"w-full bg-white text-red-600 font-semibold flex items-center justify-center gap-2 p-4 border-t border-accent/10 rounded-b-2xl hover:bg-accent/10 transition-all",children:N("profileMenu.logOut")})]})]})}},95268:function(e,t,r){"use strict";var n=r(26305);let a=async(e,t)=>{var r;let a=await (0,n.ZS)("".concat(e,"/api/affiliations/").concat(t),{method:"GET"});if(!(null==a?void 0:a.data))throw Error("Affiliate company not found");return{_id:a.data._id,companyName:a.data.companyName,companyLogo:a.data.companyLogo||"",slug:t||"",webUrl:a.data.webUrl||"",coursePrice:(null!==(r=a.data.coursePrice)&&void 0!==r?r:[]).map(e=>({courseId:String(e.courseId),sellPrice:Number(e.sellPrice)}))}};t.Z={getAffiliateCompanyInfo:a}},81582:function(e,t,r){"use strict";var n=r(57437);r(2265);var a=r(78733);t.default=e=>{let{children:t,initialUser:r}=e;return(0,n.jsx)(a.H,{initialUser:r,children:t})}},77974:function(e,t,r){"use strict";r.d(t,{default:function(){return o}});var n=r(57437),a=r(93062),s=r(2450),l=r(84588);let i=(0,s.Z)({palette:{primary:{main:"#1E4245"},secondary:{main:"#666666"},accent:{main:"#D0F900"},background:{default:"#EAEEE9"}},typography:{fontFamily:"var(--font-poppins), sans-serif"}});function o(e){let{children:t}=e;return(0,n.jsxs)(l.Z,{theme:i,children:[(0,n.jsx)(a.ZP,{}),t]})}},16712:function(e,t,r){"use strict";r.d(t,{d:function(){return s}});var n=r(3011),a=r(30424);let s=(0,n.U)((e,t)=>({availability:[],hasFetched:!1,fetch:async()=>{if(!t().hasFetched)try{var r;let t=await fetch("".concat(a.tx,"/v1/api/branch/service-availability"));if(!t.ok)return;let n=await t.json(),s=null!==(r=null==n?void 0:n.data)&&void 0!==r?r:[];e({availability:s,hasFetched:!0})}catch(t){e({hasFetched:!0})}},isServiceAvailable:(e,r)=>{let{availability:n}=t(),a=n.find(t=>t.branchId===e);return!a||!1!==a.services[r]}}))},12490:function(e,t,r){"use strict";r.d(t,{y:function(){return s}});var n=r(3011),a=r(89134);let s=(0,n.U)()((0,a.tJ)((e,t)=>({refSlug:null,refSlugSetAt:null,refLandingPage:null,setRefSlug:(t,r)=>e({refSlug:t,refSlugSetAt:t?Date.now():null,...t&&r?{refLandingPage:r}:{},...t?{}
1:{refLandingPage:null}}),getRefSlug:()=>{let{refSlug:r,refSlugSetAt:n}=t();return r&&n?Date.now()-n>2592e6?(e({refSlug:null,refSlugSetAt:null,refLandingPage:null}),null):r:null}}),{name:"ref-slug-store",partialize:e=>({refSlug:e.refSlug,refSlugSetAt:e.refSlugSetAt,refLandingPage:e.refLandingPage})}))},56188:function(e,t,r){"use strict";r.d(t,{$_:function(){return n},O3:function(){return a},mB:function(){return s}});let n=[{name:"Irving, TX",phone:"(214) 310-5000",address:"2214 W Walnut Hill Ln, Irving TX 75038",email:"[email protected]",mapQuery:"https://share.google/cY3upRdVx2n0lng3z"},{name:"Valley ranch, TX",phone:"(214) 230-7900",address:"780 S MacArthur Blvd Suite 130, Valley ranch TX 75019",email:"[email protected]",mapQuery:"https://maps.app.goo.gl/B1J5JvvbX7Uc1fSdA"},{name:"Coppell, TX",phone:"(945) 358-4500",address:"780 S MacArthur Blvd Suite 130, Valley ranch TX 75019",email:"[email protected]",mapQuery:"https://maps.app.goo.gl/B1J5JvvbX7Uc1fSdA"}],a=e=>{if(!e)return n;let t=n.find(t=>t.name.toLowerCase()===e.toLowerCase());return t?[t,...n.filter(t=>t.name.toLowerCase()!==e.toLowerCase())]:n},s=e=>n.find(t=>t.name.toLowerCase()===e.toLowerCase())},42746:function(e,t,r){"use strict";r.d(t,{PX:function(){return o},TS:function(){return i},aS:function(){return a},gi:function(){return l},jD:function(){return n},xG:function(){return s}});let n=e=>e.replace(/^\s+|\s+$/g,""),a=(e,t)=>e.length>t?e.slice(0,t)+"...":e,s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r="number"==typeof e?e:Number(null!=e?e:0);return Number.isNaN(r)?Number(0).toFixed(t):r.toFixed(t)},l=e=>"string"==typeof e?e.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()):"",i=e=>{let t=new DOMParser().parseFromString(e,"text/html");return Array.from(t.getElementsByTagName("audio")).forEach(e=>{e.setAttribute("controls","true"),e.setAttribute("preload","metadata")}),t.body.innerHTML},o=e=>{if(!(null==e?void 0:e.length))return[];let t=new Set,r=[];return e.forEach(e=>{var n;let a=(null===(n=e.category)||void 0===n?void 0:n.id)||"";a&&!t.has(a)&&(r.push({name:e.category.name||e.categoryName,id:a,slug:e.category.slug||""}),t.add(a))}),r}},7821:function(e,t,r){"use strict";r.d(t,{wC:function(){return s},aL:function(){return n},j:function(){return a},qR:function(){return l}});var n={src:"/_next/static/media/download.51891afc.svg",height:24,width:24,blurWidth:0,blurHeight:0},a={src:"/_next/static/media/quiz-icon.9fe0c5ec.svg",height:14,width:13,blurWidth:0,blurHeight:0},s={src:"/_next/static/media/correct.34b8d85b.svg",height:34,width:34,blurWidth:0,blurHeight:0},l={src:"/_next/static/media/wrong.4c00eb95.svg",height:32,width:32,blurWidth:0,blurHeight:0}},2778:function(){},16725:function(e,t){"use strict";t.Z={src:"/_next/static/media/logo.b3195e58.svg",height:38,width:153,blurWidth:0,blurHeight:0}}},function(e){e.O(0,[3534,2461,2434,4242,8672,7648,3145,4674,4196,3620,4470,3691,2971,2117,1744],function(){return e(e.s=57454)}),_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.