1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6987],{96987:function(e,t,a){a.r(t),a.d(t,{default:function(){return Z}});var s=a(57437),i=a(2265),n=a(33145),l=a(99376),r=a(52345),o=a(78595),c=a(46381),d=a(16275),m=a(54159),u=a(54001),h=a(14822),x=a(98420),g=a(54802),p=a(15051),f=a(82431),b=a(51817),w=a(32660),v=a(94942),k=a(48614),y=a(82023),j=a(73247),N=a(39721);function S(){let e=(0,l.useRouter)(),{t,lang:a,isRTL:n}=(0,v.$G)(),r="ar"===a,[c,d]=(0,i.useState)(""),[m,u]=(0,i.useState)({state:"idle"}),h=(0,i.useRef)(null),x=(0,i.useCallback)((t,a)=>{(0,N.p)(t,a,null),e.push(t.route)},[e]),g=(0,i.useCallback)(async e=>{null==e||e.preventDefault();let t=c.trim();if(!t||"thinking"===m.state)return;u({state:"thinking"});let a=await (0,N.N)(t,{allowModel:!0});if(!a)return u({state:"nomatch"});let{decision:s,targets:i}=a;return"route"===s.kind&&i[0]?x(i[0],t):"ambiguous"===s.kind&&i.length>1?u({state:"choose",options:i}):void u({state:"nomatch"})},[c,m.state,x]),p="thinking"===m.state;return(0,s.jsxs)("div",{className:"w-full max-w-2xl mx-auto",children:[(0,s.jsxs)("form",{onSubmit:g,className:"relative",children:[(0,s.jsx)("label",{htmlFor:"sector-ask",className:"sr-only",children:t("Ø§ÙØªØ¨ Ù
ا ØªØØªØ§Ø¬Ù","Tell us what you need")}),(0,s.jsxs)("div",{className:"relative flex items-center gap-2 rounded-2xl bg-white dark:bg-white/10 ring-1 ring-violet-200 dark:ring-white/30 focus-within:ring-violet-400 dark:focus-within:ring-white/60 transition-shadow px-3 py-2",children:[(0,s.jsx)(y.Z,{className:"w-5 h-5 text-violet-600 dark:text-amber-200 shrink-0","aria-hidden":"true"}),(0,s.jsx)("input",{id:"sector-ask",ref:h,value:c,onChange:e=>{d(e.target.value),"idle"!==m.state&&u({state:"idle"})},disabled:p,autoComplete:"off",placeholder:t("Ù
ثاÙ: أبغ٠بÙÙÙÙ Ù٠٥٠شخص⦠أ٠ØÙÙØ¨ ÙØ®Ø¨Ø²","e.g. a buffet for 50 guests⦠or milk and bread"),className:"flex-1 min-w-0 bg-transparent text-slate-900 dark:text-white placeholder:text-slate-500 dark:placeholder:text-white/60 text-sm sm:text-base py-2 outline-none disabled:opacity-70"}),(0,s.jsx)("button",{type:"submit","aria-label":p?t("Ø¬Ø§Ø±Ù ØªØØ¯Ùد اÙÙØ³Ù
","Finding a section"):t("اعثر عÙ٠اÙÙØ³Ù
اÙÙ
ÙØ§Ø³Ø¨","Find the right section"),disabled:p||!c.trim(),className:"shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-xl bg-violet-700 text-white dark:bg-white dark:text-slate-900 text-sm font-bold disabled:opacity-40 disabled:cursor-not-allowed hover:bg-violet-800 dark:hover:bg-amber-100 transition-colors",children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z,{className:"w-4 h-4 animate-spin"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:t("ÙØ¨ØØ«â¦","Findingâ¦")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:t("Ø§Ø°ÙØ¨","Go")})]})})]})]}),(0,s.jsxs)(k.M,{mode:"wait",children:["choose"===m.state&&(0,s.jsxs)(o.E.div,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},className:"mt-3 rounded-2xl bg-white dark:bg-white/10 backdrop-blur-md ring-1 ring-violet-200 dark:ring-white/20 p-4",children:[(0,s.jsx)("p",{className:"text-sm text-slate-700 dark:text-white/90 mb-3",children:t("ÙØ°Ø§ Ø§ÙØ·Ùب ÙØ®ØµÙ Ø£ÙØ«Ø± Ù
Ù ÙØ³Ù
â ÙÙÙ ØªØØ¨ ÙØ¨Ø¯Ø£Ø","That fits more than one section â where should we start?")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:m.options.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>x(e,c.trim()),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-white/90 text-slate-900 text-sm font-bold hover:bg-white transition-colors",children:[r?e.nameAr:e.nameEn,(0,s.jsx)(w.Z,{className:"w-3.5 h-3.5 ".concat(n?"":"rotate-180"),"aria-hidden":"true"})]},e.slug))})]},"choose"),"nomatch"===m.state&&(0,s.jsx)(o.E.p,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"mt-3 text-sm text-slate-600 dark:text-white/75 text-center",children:t("Ù
ا ÙØ¯Ø±Øª Ø£ØØ¯Ø¯ اÙÙØ³Ù
Ù
Ù ÙØ§ÙجÙ
ÙØ© â Ø§Ø®ØªØ± Ù
Ù Ø§ÙØ£ÙساÙ
ØªØØª ÙØ¨ÙÙÙ
Ù Ù
ع٠ÙÙØ§Ù.","I couldn't place that one â pick a section below and we'll carry on there.")},"nomatch")]})]})}let C={plane:c.Z,"shopping-cart":d.Z,pill:m.Z,key:u.Z,cpu:h.Z,building:x.Z,"party-popper":g.Z},E={travel:"/api/uploads/heroes/hero-travel.webp",supermarket:"/images/welcome/groceries.jpg",events:"/images/welcome/events.jpg",pharmacy:"/api/uploads/heroes/pharmacy-card.webp",rental:"/api/uploads/heroes/rental-card.webp",electronics:"/api/uploads/heroes/electronics-card.webp"};function Z(){let e=(0,l.useRouter)(),{t,lang:a,isRTL:c}=(0,v.$G)(),d="ar"===a,m=(0,r.J)(),[u,h]=(0,i.useState)(!1),[g,k]=(0,i.useState)(0),[y,j]=(0,i.useState)(!1);(0,i.useEffect)(()=>{"deleted"===new URLSearchParams(window.location.search).get("account")&&j(!0)},[]);let[N,Z]=(0,i.useState)(null),[_,T]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1,t=new AbortController,a=setTimeout(()=>t.abort(),15e3);return h(!1),Z(null),fetch("/api/sectors",{signal:t.signal}).then(e=>{if(!e.ok)throw Error("Sector request failed");return e.json()}).then(t=>{if(!e){if(!Array.isArray(t.items))throw Error("Invalid sector response");Z(t.items)}}).catch(()=>{e||h(!0)}).finally(()=>clearTimeout(a)),()=>{e=!0,clearTimeout(a),t.abort()}},[g]),(0,s.jsx)("main",{className:"relative isolate overflow-hidden bg-[#f7f5fa] dark:bg-[#181426] px-4 py-8 sm:px-8 sm:py-12",dir:c?"rtl":"ltr",children:(0,s.jsxs)("div",{className:"mx-auto max-w-6xl",children:[y&&(0,s.jsx)("p",{role:"status",className:"mb-6 rounded-xl bg-emerald-50 dark:bg-emerald-950/40 ring-1 ring-emerald-200 dark:ring-emerald-900/50 px-4 py-3 text-sm text-emerald-900 dark:text-emerald-200",children:t("تÙ
ØØ°Ù ØØ³Ø§Ø¨Ù ÙØ¨ÙØ§ÙØ§ØªÙ Ø§ÙØ´Ø®ØµÙØ©.","Your account and personal data have been deleted.")}),(0,s.jsxs)("header",{className:"mb-7 grid gap-3 sm:mb-8 md:grid-cols-[1.2fr_1fr] md:items-end md:gap-x-12",children:[(0,s.jsx)("span",{className:"text-xs font-semibold tracking-wide text-violet-700 dark:text-violet-300 md:col-span-2",children:t("TMXI \xb7 ÙÙØÙØ§Ø© اÙÙÙÙ
ÙØ© ÙÙØØ¸Ø§ØªÙ Ø§ÙÙ
Ù
ÙØ²Ø©","TMXI \xb7 Everyday life. Special occasions.")}),(0,s.jsx)("h1",{className:"text-3xl font-bold leading-tight tracking-tight text-slate-900 dark:text-white sm:text-4xl",children:t("ÙÙÙ
٠أسÙÙ. Ù
ÙØ§Ø³Ø¨ØªÙ أجÙ
Ù.","Everyday ease. Memorable occasions.")}),(0,s.jsx)("p",{className:"text-sm leading-7 text-slate-600 dark:text-slate-300 sm:text-base",children:t("Ù
Ù Ù
Ø´ØªØ±ÙØ§ØªÙ اÙÙÙÙ
ÙØ© Ø¥Ù٠تجÙÙØ² Ù
ÙØ§Ø³Ø¨ØªÙ. اختر ÙØ³Ù
ÙØ ÙØ§ØªØ±Ù ÙÙØ§ تسÙÙÙ Ø§ÙØ¨Ø§ÙÙ.","From everyday shopping to your next celebration. Choose a section and let us make it simpler.")})]}),(0,s.jsxs)("section",{"aria-labelledby":"sector-heading",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3 text-slate-900 dark:text-white",children:[(0,s.jsx)("h2",{id:"sector-heading",className:"text-base font-bold",children:t("اختر ÙØ¬ÙتÙ","Choose your destination")}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400",children:[(0,s.jsx)(p.Z,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),t("Ø¨Ø¯Ø§ÙØ© Ø¨Ø³ÙØ·Ø©Ø Ø®ÙØ§Ø±Ø§Øª Ø£ÙØ«Ø±","One place, more possibilities")]})]}),u?(0,s.jsxs)("div",{role:"alert",className:"rounded-3xl border border-violet-200 dark:border-white/15 bg-white dark:bg-white/5 p-10 text-center text-slate-900 dark:text-white",children:[(0,s.jsx)("p",{className:"font-semibold",children:t("ØªØ¹Ø°ÙØ± تØÙ
ÙÙ Ø§ÙØ£ÙساÙ
","Unable to load sections")}),(0,s.jsx)("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:t("تØÙÙ Ù
٠اتصاÙÙ ÙØØ§ÙÙ Ù
رة أخرÙ.","Check your connection and try again.")}),(0,s.jsxs)("button",{onClick:()=>k(e=>e+1),className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-xl bg-white px-5 font-semibold text-indigo-950",children:[(0,s.jsx)(f.Z,{className:"h-4 w-4"}),t("إعادة اÙÙ
ØØ§ÙÙØ©","Try again")]})]}):null===N?(0,s.jsx)("div",{role:"status",className:"grid gap-5 sm:grid-cols-2","aria-label":t("جار٠تØÙ
ÙÙ Ø§ÙØ£ÙساÙ
","Loading sections"),children:[0,1].map(e=>(0,s.jsx)("div",{className:"flex h-72 items-center justify-center rounded-3xl border border-violet-200 dark:border-white/10 bg-white dark:bg-white/5",children:(0,s.jsx)(b.Z,{className:"h-6 w-6 animate-spin text-violet-700 dark:text-violet-300 motion-reduce:animate-none"})},e))}):0===N.length?(0,s.jsx)("p",{className:"rounded-3xl border border-violet-200 dark:border-white/10 bg-white dark:bg-white/5 p-12 text-center text-slate-600 dar
1k:text-slate-300",children:t("ÙØ§ ØªÙØ¬Ø¯ Ø£ÙØ³Ø§Ù
Ù
ØªØ§ØØ© ØØ§ÙÙØ§Ù. ÙØ±Ø¬Ù Ø§ÙØ¹Ùدة ÙØ§ØÙاÙ.","No sections are available right now. Please check back later.")}):(0,s.jsx)("div",{className:"grid gap-5 ".concat(1===N.length?"mx-auto max-w-xl":"sm:grid-cols-2"," ").concat(N.length>4?"lg:grid-cols-3":""),children:N.map(a=>{let i=a.icon&&C[a.icon]||x.Z,l=_===a.slug,r="supermarket"===a.slug,u="events"===a.slug,h=d?r&&"Supermarket"===a.nameAr?"Ø§ÙØ³ÙبرÙ
Ø§Ø±ÙØª":a.nameAr:a.nameEn,g=(d?a.descriptionAr:a.descriptionEn)||(r?t("Ø¨ÙØ§Ùت٠اÙÙÙÙ
ÙØ©Ø Ù
ÙØªØ¬Ø§Øª Ù
تÙÙØ¹Ø© ÙÙ
ÙØ§Ø±ÙØ© أسعار بÙ٠اÙÙ
تاجر.","Everyday groceries, more choice and prices across stores."):t("Ø§ÙØªØ´Ù Ø§ÙØ®Ø¯Ù
ات اÙÙ
ØªØ§ØØ© ÙØ§Ø®ØªØ± Ù
ا ÙÙØ§Ø³Ø¨Ù.","Explore available services and find what suits you."));return(0,s.jsxs)(o.E.button,{type:"button",initial:!1,whileHover:m?void 0:{y:-4},onClick:()=>(function(t){if(!_){var a;T(t.slug),a=t.slug,"undefined"!=typeof document&&(document.cookie="".concat("tmxi_sector","=").concat(encodeURIComponent(a),"; max-age=").concat(7776e3,"; path=/; samesite=lax")),e.push(t.route)}})(a),disabled:null!==_,"aria-label":h,"aria-busy":l,className:"group relative flex min-h-[290px] flex-col overflow-hidden rounded-2xl bg-slate-800 text-start shadow-lg focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-violet-300 disabled:cursor-wait sm:min-h-[370px]",children:[E[a.slug]?(0,s.jsx)(n.default,{src:E[a.slug],alt:"",fill:!0,priority:r||u,sizes:"(max-width: 639px) 100vw, (max-width: 1200px) 50vw, 560px",className:"object-cover transition-transform duration-500 motion-safe:group-hover:scale-105"}):(0,s.jsx)("div",{"aria-hidden":"true",className:"absolute inset-0 bg-gradient-to-br from-indigo-800 to-violet-950"}),(0,s.jsx)("div",{"aria-hidden":"true",className:"absolute inset-0 bg-gradient-to-t from-black/95 via-black/40 to-black/5"}),(0,s.jsx)("span",{className:"relative m-5 flex h-10 w-10 items-center justify-center rounded-full bg-white text-slate-900 shadow-sm",children:(0,s.jsx)(i,{"aria-hidden":"true",className:"h-5 w-5"})}),(0,s.jsxs)("div",{className:"relative mt-auto w-full p-5 pt-12 sm:p-7 sm:pt-16",children:[(0,s.jsx)("h3",{className:"text-2xl font-bold text-white sm:text-3xl",children:h}),(0,s.jsx)("p",{className:"mt-2 max-w-md text-sm leading-6 text-white/90",children:g}),(0,s.jsxs)("span",{className:"mt-5 inline-flex min-h-11 items-center gap-5 rounded-lg bg-white px-4 text-sm font-bold text-slate-900 transition-colors group-hover:bg-violet-100",children:[l?t("Ø¬Ø§Ø±Ù Ø§ÙØ§ÙØªÙØ§Ùâ¦","Openingâ¦"):r?t("ابدأ Ø§ÙØªØ³ÙÙ","Start shopping"):u?t("جÙÙØ² Ù
ÙØ§Ø³Ø¨ØªÙ","Plan your event"):t("Ø§Ø³ØªÙØ´Ù اÙÙØ³Ù
","Explore section"),l?(0,s.jsx)(b.Z,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(w.Z,{"aria-hidden":"true",className:"h-4 w-4 ".concat(c?"":"rotate-180")})]})]})]},a.id)})})]}),N&&N.length>1&&(0,s.jsxs)("section",{className:"mt-7 grid items-center gap-4 border-t border-violet-200 dark:border-white/15 pt-6 md:grid-cols-[1fr_1.4fr] md:gap-8","aria-labelledby":"ask-heading",children:[(0,s.jsxs)("div",{className:"text-start",children:[(0,s.jsx)("h2",{id:"ask-heading",className:"font-bold text-slate-900 dark:text-white",children:t("Ù
Ù Ù
ØªØ£ÙØ¯ Ø£Ù ÙØ³Ù
تختارØ","Not sure where to start?")}),(0,s.jsx)("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:t("ÙÙ ÙÙØ§ ÙØ´ ØªØØªØ§Ø¬Ø ÙÙÙØµÙÙÙ ÙÙÙØ³Ù
اÙÙ
ÙØ§Ø³Ø¨.","Tell us what you need. We will guide you to the right section.")})]}),(0,s.jsx)(S,{})]}),(0,s.jsx)("p",{className:"mt-5 text-center text-xs leading-6 text-slate-500 dark:text-slate-400",children:t("ØªÙØ¯Ø± تغÙÙØ± اÙÙØ³Ù
Ù٠أ٠ÙÙØª Ù
٠اÙÙØ§Ø¦Ù
Ø© Ø§ÙØ¹ÙÙÙØ©.","You can switch sections anytime from the top menu.")})]})})}},67894:function(e,t,a){a.d(t,{mj:function(){return s}});function s(e){"undefined"!=typeof document&&e&&(document.cookie="".concat("tmxi_sector","=").concat(encodeURIComponent(e),"; max-age=").concat(7776e3,"; path=/; samesite=lax"))}},39721:function(e,t,a){a.d(t,{N:function(){return n},p:function(){return l}});var s=a(67894),i=a(16529);async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=String(e||"").trim();if(!a)return null;try{var s;let e=await fetch("/api/sector/route",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,from:null!==(s=t.from)&&void 0!==s?s:null,allowModel:!0===t.allowModel}),signal:t.signal});if(!e.ok)return null;let i=await e.json();if(!(null==i?void 0:i.ok)||!(null==i?void 0:i.decision))return null;return{decision:i.decision,targets:i.targets||[]}}catch(e){return null}}function l(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,i.NM)(t,e.slug,a),(0,s.mj)(e.slug)}},94942:function(e,t,a){a.d(t,{$G:function(){return c},A2:function(){return o},_R:function(){return l}});var s=a(2265),i=a(59625),n=a(64131);let l=(0,s.createContext)(null);function r(e){"undefined"!=typeof document&&(document.documentElement.setAttribute("lang",e),document.documentElement.setAttribute("dir","ar"===e?"rtl":"ltr"))}let o=(0,i.Ue)((e,t)=>({lang:"ar",setLang:t=>{n.Z.set("tmxi_lang",t,{expires:365,path:"/",sameSite:"lax"}),r(t),e({lang:t})},initLanguage:()=>{let t=n.Z.get("tmxi_lang"),a="ar"===t||"en"===t?t:"ar";r(a),e({lang:a})},t:(e,a)=>"en"===t().lang?a:e}));function c(){let e=(0,s.useContext)(l),t=o(e=>e.lang),a=null!=e?e:t,i=(0,s.useCallback)((e,t)=>"en"===a?t:e,[a]);return{lang:a,t:i,isRTL:"ar"===a}}},16529:function(e,t,a){a.d(t,{NM:function(){return i},zL:function(){return n}});let s="tmxi_sector_handoff";function i(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=String(e||"").trim();if(i&&t)try{let e={message:i.slice(0,600),to:t,from:a,at:Date.now()};window.sessionStorage.setItem(s,JSON.stringify(e))}catch(e){}}function n(e){let t=function(){try{let e=window.sessionStorage.getItem(s);if(!e)return null;let t=JSON.parse(e);if(!t||"string"!=typeof t.message||"string"!=typeof t.to)return null;return t}catch(e){return null}}();return t&&t.to===e?(!function(){try{window.sessionStorage.removeItem(s)}catch(e){}}(),Date.now()-Number(t.at||0)>3e5)?null:t:null}}}]);
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.