1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6071],{6071:(e,l,t)=>{t.d(l,{R:()=>u});var n=t(95155),i=t(12115),r=t(73038),a=t(81408),s=t(16031),o=t(15239),c=t(75992);function u(e){let{selectedCountryId:l,selectedRegionId:t,onCountryChange:u,onRegionChange:d,countryPlaceholder:h="Select Country",regionPlaceholder:m,className:f="",countryClassName:p="min-w-[160px]",regionClassName:v="min-w-[160px]",disabled:x=!1,showRegion:b=!0,countryError:g,regionError:w,required:j=!1,layout:y="row"}=e,{data:C,loading:N}=(0,r.D)(),k=(0,i.useId)(),S=(0,i.useMemo)(()=>C&&C.uncountries?Object.values(C.uncountries).map(e=>({id:String(e.id),label:e.location_name||e.title||"",icon:(0,n.jsx)(s.A,{countryId:String(e.id),className:"w-4 h-4"})})).sort((e,l)=>e.label.localeCompare(l.label)):[],[C]),L=(0,i.useMemo)(()=>S.find(e=>e.id===l)||null,[S,l]),{regionOptions:E,regionFixed:_}=(0,i.useMemo)(()=>{if(!b||!l||!(null==C?void 0:C.locations))return{regionOptions:[],regionFixed:!1};let e=Number(l),t=Object.values(C.locations).filter(l=>l.country_id===e);return 0===t.length?{regionOptions:[],regionFixed:!0}:{regionOptions:t.map(e=>{let l=e.featured_img,t=l?(0,n.jsx)(o.default,{className:"w-4 h-4 object-cover rounded-full bg-gray-200",src:"".concat("https://mtp.travel","/files/preview?uuid=").concat(l,"&size=medium"),height:16,width:16,alt:e.location_name||e.title||""}):void 0;return{id:String(e.id),label:e.location_name||e.title||"",icon:t}}).sort((e,l)=>e.label.localeCompare(l.label)),regionFixed:!1}},[b,l,null==C?void 0:C.locations]),F=(0,i.useMemo)(()=>t&&E.find(e=>e.id===t)||null,[E,t]),z=(0,i.useCallback)(e=>{if((null==e?void 0:e.id)!==l){var t;u(null!=(t=null==e?void 0:e.id)?t:null),d&&d(null)}},[l,u,d]),I=(0,i.useCallback)(e=>{if(d&&(null==e?void 0:e.id)!==t){var l;d(null!=(l=null==e?void 0:e.id)?l:null)}},[t,d]),M=l?"Select Region":"Select Country first";return(0,n.jsxs)("div",{className:"row"===y?"flex gap-4 ".concat(f):"flex flex-col gap-4 ".concat(f),children:[(0,n.jsx)("div",{className:p,children:(0,n.jsx)(a.z,{id:"".concat(k,"-country"),title:"Country",label:"column"===y?"Country":void 0,options:S,value:L,onChange:z,placeholder:h,placeholderIcon:"column"===y?(0,n.jsx)(c.A,{}):void 0,reserveMessageSpace:"column"===y,disabled:x,isLoading:N,error:g,required:j,className:"row"===y?"md:h-10 rounded-full":""})}),b&&(0,n.jsx)("div",{className:v,children:(0,n.jsx)(a.z,{id:"".concat(k,"-region"),title:"Region",label:"column"===y?"Region":void 0,options:E,value:F,onChange:I,placeholder:m||M,placeholderIcon:"column"===y?(0,n.jsx)(c.A,{}):void 0,reserveMessageSpace:"column"===y,disabled:x||!l||_,showClearButton:!_,isLoading:N,error:w,required:j,className:"row"===y?"md:h-10 rounded-full":""})})]})}},16031:(e,l,t)=>{t.d(l,{A:()=>s});var n=t(95155),i=t(15239),r=t(73952),a=t(55186);function s(e){let{countryId:l,name:t,className:s,height:o,width:c}=e;return(0,n.jsx)("div",{className:(0,r.cn)("shrink-0 rounded-full w-[18px] h-[18px] overflow-hidden shadow-[0px_0px_3px_-1px_#292C33]",s),children:(0,n.jsx)(i.default,{className:"h-full min-w-full object-cover",src:(0,a.rI)(l),height:null!=o?o:18,width:null!=c?c:34,alt:null!=t?t:"Flag"})})}},55186:(e,l,t)=>{function n(e){let{imageUrl:l,imageUUID:t,size:n}=e;if("string"==typeof l&&l.trim().length>0)return l.trim();if("string"==typeof t&&t.trim().length>0){let e=new URL("/files/preview","https://mtp.travel".replace(/\/$/,""));return e.searchParams.set("uuid",t.trim()),void 0!==n&&e.searchParams.set("size",String(n)),e.toString()}return""}function i(e,l){let t=l;return"tccs"===l&&(t="tcc"),"unps"===l&&(t="uncountries"),"/badges/".concat(t,"/").concat(e>4?4:e,".svg")}function r(e){return"".concat("https://mtp.travel","/flags/").concat(e)}t.d(l,{Lb:()=>n,Wg:()=>i,rI:()=>r})},73038:(e,l,t)=>{t.d(l,{C:()=>s,ChecklistProvider:()=>c,D:()=>o});var n=t(95155),i=t(46378),r=t(12115),a=t(91453);let s=(0,r.createContext)(void 0);function o(){let e=(0,r.useContext)(s);if(!e)throw Error("useChecklists must be used within <ChecklistProvider>");return e}function c(e){let{children:l}=e,[t,o]=(0,r.useState)(null),[c,u]=(0,r.useState)(!0),[d,h]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{u(!0);try{let e=await Promise.all(a.R6.map(async e=>{var l;let t=e.code,n=(0,i.i)("/checklists/".concat(t)),r=await fetch(n,{method:"GET"});if(!r.ok){let e=await r.text().catch(()=>"");throw Error("Checklists fetch failed for ".concat(t,": ").concat(r.status," ").concat(e))}let a=await r.json();return{type:t,data:null!=(l=null==a?void 0:a.data)?l:{}}}));o(Object.fromEntries(e.map(e=>[e.type,e.data])))}catch(e){console.error(e),h(e instanceof Error?e.message:"string"==typeof e?e:"Unknown error")}finally{u(!1)}})()},[]);let m=(0,r.useCallback)(e=>{var l;return null==t||null==(l=t.uncountries)?void 0:l[e]},[t]),f=(0,r.useCallback)((e,l)=>{var n;return null==t||null==(n=t[e])?void 0:n[l]},[t]),p=(0,r.useMemo)(()=>({data:t,getLocation:f,getUncountry:m,loading:c,error:d}),[t,f,m,c,d]);return(0,n.jsx)(s.Provider,{value:p,children:l})}},78146:(e,l,t)=>{t.d(l,{I:()=>i});var n=t(12115);function i(){let e=arguments.length>
10&&void 0!==arguments[0]?arguments[0]:768,[l,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{t(window.innerWidth<e);let l=window.matchMedia("(max-width: ".concat(e-1,"px)")),n=e=>t(e.matches);return t(l.matches),l.addEventListener("change",n),()=>l.removeEventListener("change",n)},[e]),l}},81408:(e,l,t)=>{t.d(l,{z:()=>u});var n=t(95155),i=t(12115),r=t(82148),a=t(82987),s=t(78146),o=t(73952),c=t(5729);function u(e){var l;let{title:t,...r}=e,o=(0,s.I)(),c=(0,i.useId)(),u=null!=(l=r.id)?l:c;return o?(0,n.jsx)(d,{...r,id:u,title:t}):(0,n.jsx)(a.G,{...r,id:u,minChars:0,showOnFocus:!0})}function d(e){var l,t,a;let{id:s,name:u,title:d,label:h,placeholder:m="Select...",disabled:f,required:p,helperText:v,error:x,value:b,onChange:g,options:w=[],isLoading:j=!1,placeholderIcon:y,showClearButton:C=!0,reserveMessageSpace:N=!0,className:k}=e,[S,L]=(0,i.useState)(!1),[E,_]=(0,i.useState)(""),F=(0,i.useRef)(null),z=(0,i.useRef)(null),I="string"==typeof x&&x?x:v,M=E.trim().toLowerCase().split(/\s+/).filter(Boolean),R=w.filter(e=>M.every(l=>e.label.toLowerCase().includes(l)));(0,i.useEffect)(()=>{f&&L(!1)},[f]),(0,i.useEffect)(()=>{if(!S)return;let e=window.visualViewport;if(!e)return;let l=()=>{z.current&&(z.current.style.height="".concat(e.height,"px"),z.current.style.top="".concat(e.offsetTop,"px"))};l();let t=requestAnimationFrame(l);return e.addEventListener("resize",l),e.addEventListener("scroll",l),()=>{cancelAnimationFrame(t),e.removeEventListener("resize",l),e.removeEventListener("scroll",l)}},[S]);let A=e=>{g(e),L(!1)};return(0,n.jsxs)("div",{className:(0,o.cn)("w-full",k),children:[h&&(0,n.jsxs)("label",{htmlFor:s,className:"mb-1 block text-sm font-normal",children:[h,p&&(0,n.jsx)("span",{className:"text-error",children:"*"})]}),(0,n.jsxs)("button",{id:s,type:"button",disabled:f,"aria-label":h?void 0:d,"aria-haspopup":"dialog","aria-expanded":S,"aria-describedby":I?"".concat(s,"-desc"):void 0,"aria-busy":j||void 0,className:(0,o.cn)("flex min-h-12 w-full items-center gap-2 rounded-lg border bg-white px-3 py-2.5 text-left text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50",x?"border-error":"border-gray-300"),onClick:()=>{_(""),L(!0)},children:[((null==b?void 0:b.icon)||!b&&y)&&(0,n.jsx)("span",{className:"shrink-0","aria-hidden":"true",children:null!=(l=null==b?void 0:b.icon)?l:y}),(0,n.jsx)("span",{className:(0,o.cn)("min-w-0 flex-1 truncate",!b&&"text-mtp-dark-600"),children:null!=(t=null==b?void 0:b.label)?t:m}),(0,n.jsx)(c.A,{width:20,height:20})]}),(N||I)&&(0,n.jsx)("p",{id:"".concat(s,"-desc"),className:(0,o.cn)("mt-1 text-xs",x?"text-error":"text-gray-500"),children:I||"\xa0"}),u&&(0,n.jsx)("input",{type:"hidden",name:u,value:null!=(a=null==b?void 0:b.id)?a:""}),(0,n.jsx)(r.lG,{open:S,onClose:()=>L(!1),initialFocus:F,className:"relative z-[2100]",children:(0,n.jsxs)(r.Lj,{ref:z,className:"fixed inset-x-0 top-0 flex h-dvh flex-col overflow-hidden bg-white pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",children:[(0,n.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b border-gray-200 px-4 py-2",children:[(0,n.jsx)(r.L3,{className:"text-lg font-semibold",children:d}),(0,n.jsx)("button",{ref:F,type:"button",className:"min-h-12 min-w-12 rounded-lg px-3 focus-visible:ring-2 focus-visible:ring-blue-500",onClick:()=>L(!1),"aria-label":"Close ".concat(d.toLowerCase()," picker"),children:"Close"})]}),(0,n.jsxs)("div",{className:"shrink-0 space-y-2 p-4",children:[(0,n.jsxs)("label",{htmlFor:"".concat(s,"-search"),className:"sr-only",children:["Search ",d.toLowerCase()]}),(0,n.jsx)("input",{id:"".concat(s,"-search"),type:"search",inputMode:"search",autoComplete:"off",autoCapitalize:"none",spellCheck:!1,value:E,onChange:e=>_(e.target.value),placeholder:"Search ".concat(d.toLowerCase(),"..."),className:"min-h-12 w-full rounded-lg border border-gray-300 px-3 text-base outline-none focus:ring-2 focus:ring-blue-500"}),b&&C&&!p&&(0,n.jsx)("button",{type:"button",className:"min-h-12 w-full rounded-lg text-left text-blue-600 focus-visible:ring-2",onClick:()=>A(null),children:"Clear selection"})]}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-4","aria-busy":j,children:j?(0,n.jsx)("p",{role:"status",className:"py-4 text-gray-500",children:"Loadingâ¦"}):0===R.length?(0,n.jsx)("p",{role:"status",className:"py-4 text-gray-500",children:E.trim()?"No results found. Try a different search.":"No options available."}):(0,n.jsx)("ul",{"aria-label":d,children:R.map(e=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","aria-pressed":(null==b?void 0:b.id)===e.id,className:(0,o.cn)("flex min-h-12 w-full items-center gap-3 rounded-lg px-3 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",(null==b?void 0:b.id)===e.id?"bg-blue-50 font-medium text-blue-900":"text-gray-900 active:bg-gray-100"),onClick:()=>A(e),children:[e.icon&&(0,n.jsx)("span",{className:"shrink-0","aria-hidden":"true",children:e.icon}),(0,n.jsx)("span",{className:"flex-1",children:e.label}),(null==b?void 0:b.id)===e.id&&(0,n.jsx)("span",{"aria-hidden":"true",className:"text-blue-600",children:"â"})]})},e.id))})})]})})]})}}}]);
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.