1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[190,4631],{94772:function(e,t){t.Z={src:"/_next/static/media/ChevronDown_black.622c7068.svg",height:24,width:24,blurWidth:0,blurHeight:0}},73133:function(e,t){t.Z={src:"/_next/static/media/crop_protection.c2ce61d9.svg",height:96,width:96,blurWidth:0,blurHeight:0}},58569:function(e,t){t.Z={src:"/_next/static/media/freight_logistic.73176ad3.svg",height:96,width:96,blurWidth:0,blurHeight:0}},26320:function(e,t){t.Z={src:"/_next/static/media/vehicles.c321957c.svg",height:96,width:96,blurWidth:0,blurHeight:0}},54631:function(e,t,n){n.r(t);var r=n(85893),s=n(25675),l=n.n(s),a=n(67294),c=n(49883),i=n(73408),o=n(94772);let u=(e,t)=>e||("interactive-chart"===t?"h-[100%] p-[5px]":"h-[54px] px-4"),d=e=>{let{isCompact:t,parentPadding:n,from:s,imageBaseUrl:a,countryName:c,callingCode:i,placeholder:d,onClick:h}=e,m=(0,r.jsx)(l(),{src:o.Z,alt:"down",width:24,height:24});return(0,r.jsxs)("div",{className:`flex w-full cursor-pointer items-center ${t?"justify-start":"justify-between"} rounded-md border-[0.5px] border-Neutrals-500 bg-white ${u(n,s)} text-sm`,onClick:h,children:[(0,r.jsxs)("div",{className:`flex items-center ${t?"gap-1":"gap-2"}`,children:[c?(0,r.jsx)("span",{children:(0,r.jsx)(l(),{loading:"lazy",src:`${a}/flags/${c.toLowerCase()}.svg`,alt:c,width:24,height:24})}):(0,r.jsx)("span",{children:"\uD83C\uDF10"}),t?m:null,(0,r.jsx)("span",{children:i?`${t?"+":"+ "}${i}`:d})]}),t?null:m]})};t.default=(0,a.memo)(e=>{let{field:t,id:n,onFocus:s,defaultValue:o,placeholder:u,customWidth:h="md:w-[200%]",parentPadding:m="",from:g,variant:f="default"}=e,[x,p]=(0,a.useState)(!1),y=(0,a.useRef)(null);(0,a.useEffect)(()=>{x&&y.current&&y.current.focus()},[x]);let[v,b]=(0,a.useState)(""),[w,_]=(0,a.useState)(i.rZ),[j,C]=(0,a.useState)(i.rZ),N=(0,a.useRef)(null);(0,a.useEffect)(()=>{C(w.filter(e=>e.country_name.toLowerCase().includes(v.toLowerCase())||e.calling_code.includes(v.includes("+")?v.slice(1):v)))},[v]);let $=e=>{t.onChange(e.country_name),p(!1),b("")};(0,a.useEffect)(()=>{if(o){let e=w.find(e=>e.country_name===o);e&&t.onChange(e.country_name)}},[o,w]),(0,a.useEffect)(()=>{let e=e=>{N.current&&!N.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let k=w.find(e=>e.country_name===t.value),E=async()=>{try{let e=await (0,c.lv)();Array.isArray(e)?(C(e),_(e)):console.error("Invalid country list:",e)}catch(e){console.error("country list unavailable, using bundled list",e)}};(0,a.useEffect)(()=>{E()},[]);let Z="https://s3.mordorintelligence.com";return(0,r.jsxs)("div",{id:n,className:`relative ${x?"z-50":"z-0"}`,ref:N,children:[(0,r.jsx)(d,{isCompact:"compact"===f,parentPadding:m,from:g,imageBaseUrl:Z,countryName:null==k?void 0:k.country_name,callingCode:null==k?void 0:k.calling_code,placeholder:u,onClick:()=>p(!x)}),x&&(0,r.jsxs)("div",{"data-country-menu":"",className:`custom-scrollbar absolute z-50 mt-2 max-h-[200px] w-full overflow-y-auto rounded-md border border-gray-300 bg-white shadow-lg xl:max-h-[170px] ${h}`,children:[(0,r.jsx)("input",{ref:y,type:"text",placeholder:"Search",onFocus:s,value:v,onChange:e=>b(e.target.value),className:"sticky top-0 w-full border-b px-4 py-2 text-sm outline-none"}),j.map(e=>(0,r.jsxs)("div",{onClick:()=>$(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),$(e))},role:"button",tabIndex:0,className:"flex cursor-pointer items-center gap-2 px-4 py-2 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none",children:[(0,r.jsx)("span",{children:(0,r.jsx)(l(),{src:`${Z}/flags/${e.country_name.toLowerCase()}.svg`,alt:e.country_name,width:24,height:24})}),(0,r.jsxs)("span",{className:"flex-1",children:[e.country_name," (+",e.calling_code,")"]})]},`${e.country_name}-${e.calling_code}`)),0===j.length&&(0,r.jsx)("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No matches found"})]})]})})}}]);
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.