PageSourceSearch

https://my.dnb.com/src_components_pages_DUNSApplicationFormPage_Fo…opdownCountries_tsx.44f9604666187e57771b.js

js dnb.com collected 2026-09-24 09:08:35 UTC 7,040 bytes, 2 lines download raw bytes

1/*! For license information please see src_components_pages_DUNSApplicationFormPage_FormFieldDropdownCountries_tsx.44f9604666187e57771b.js.LICENSE.txt */
2"use strict";(self.webpackChunkmarketplace_portal_ui=self.webpackChunkmarketplace_portal_ui||[]).push([["src_components_pages_DUNSApplicationFormPage_FormFieldDropdownCountries_tsx"],{19752(e,r,t){t.d(r,{FormFieldDropdownCountries:()=>h});var n=t(96540),o=t(88084),a=t(16876),i=t(74848),u=["label","isRequired","className"],l=["onChange","value","onBlur"],c=["onChange","value"];function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,i,u=[],l=!0,c=!1;try{if(a=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(u.push(n.value),u.length!==r);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}}(e,r)||function(e,r){if(e){if("string"==typeof e)return d(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function m(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function y(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach(function(r){b(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function b(e,r,t){return(r=function(e){var r=function(e){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var v=a.FS.map(function(e){var r=e.countryName.replace(/\./g,"").toLowerCase(),t=e.countryCode.toLowerCase(),n=r.split(/\s+/).map(function(e){return e[0]}).join("");return y(y({},e),{},{normalizedName:r,normalizedCode:t,acronym:n})}),h=function(e){var r=e.label,t=e.isRequired,s=void 0===t||t,d=e.className,p=m(e,u),b=f((0,o.Mt)(p),3),h=b[0],g=b[1],w=b[2],x=f((0,n.useState)(!1),2),C=x[0],j=x[1],O=f((0,n.useState)(""),2),N=O[0],S=O[1],k=f((0,n.useState)(-1),2),D=k[0],P=k[1],z=(0,n.useRef)(null),A="".concat(p.id||p.name,"-listbox");(0,n.useEffect)(function(){var e=a.FS.find(function(e){return e.countryCode===h.value});S(e?e.countryName:"")},[h.value]),(0,n.useEffect)(function(){if(C&&D>=0&&z.current){var e=z.current.children[D];e&&e.scrollIntoView({block:"nearest"})}},[D,C]);var F=(0,n.useMemo)(function(){var e=N.replace(/\./g,"").toLowerCase();return e?v.filter(function(r){return r.normalizedName.includes(e)||r.normalizedCode.includes(e)||r.acronym.startsWith(e)||"uk"===e&&"gb"===r.normalizedCode}).sort(function(r,t){var n=r.normalizedName.startsWith(e)||r.normalizedCode.startsWith(e)||r.acronym.startsWith(e)||"uk"===e&&"gb"===r.normalizedCode,o=t.normalizedName.startsWith(e)||t.normalizedCode.startsWith(e)||t.acronym.startsWith(e)||"uk"===e&&"gb"===t.normalizedCode;return n&&!o?-1:!n&&o?1:r.normalizedName.localeCompare(t.normalizedName)}):v},[N]),E=function(e,r){w.setValue(e,!0),w.setTouched(!0,!1),w.setError(void 0),S(r),j(!1),P(-1)},_=(h.onChange,h.value,h.onBlur),W=m(h,l),I=(p.onChange,p.value,m(p,c));return(0,i.jsx)("div",{className:"mt-6 w-full max-w-498p relative",children:(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{htmlFor:p.id||p.name,children:[(0,i.jsx)("span",{className:"text-base font-550 leading-6 tracking-[0.1px] text-dnb-cpl-box-shadow",children:r}),s&&(0,i.jsx)("strong",{children:"*"})]}),(0,i.jsx)("input",y(y(y({},I),W),{}
2,{value:N,onChange:function(e){S(e.target.value),j(!0),P(-1),e.target.value||w.setValue("")},onFocus:function(){return j(!0)},onBlur:function(e){_(e),j(!1),P(-1);var r=a.FS.find(function(e){return e.countryCode===h.value});S(r?r.countryName:"")},onKeyDown:function(e){if(!C&&("ArrowDown"===e.key||"ArrowUp"===e.key))return j(!0),void P("ArrowDown"===e.key?0:F.length-1);if(C)switch(e.key){case"ArrowDown":e.preventDefault(),P(function(e){return e<F.length-1?e+1:e});break;case"ArrowUp":e.preventDefault(),P(function(e){return e>0?e-1:0});break;case"Enter":if(e.preventDefault(),D>=0&&D<F.length){var r=F[D];E(r.countryCode,r.countryName)}break;case"Escape":e.preventDefault(),j(!1),P(-1);var t=a.FS.find(function(e){return e.countryCode===h.value});S(t?t.countryName:"")}},autoComplete:"off",role:"combobox","aria-expanded":C,"aria-controls":A,"aria-autocomplete":"list","aria-activedescendant":D>=0&&C&&F[D]?"".concat(A,"-option-").concat(F[D].countryCode):void 0,className:g.touched&&g.error?"hover:border-launch-text ".concat(d||""," !border-counter-ending-font text-base leading-6 tracking-[0.1px]"):"hover:border-launch-text ".concat(d||""," text-base leading-6 tracking-[0.1px]")})),C&&(0,i.jsx)("ul",{id:A,ref:z,role:"listbox",className:"absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1 max-h-60 overflow-auto shadow-lg list-none p-0 m-0",children:F.length>0?F.map(function(e,r){return(0,i.jsx)("li",{id:"".concat(A,"-option-").concat(e.countryCode),role:"option","aria-selected":h.value===e.countryCode,className:"px-3 py-2 cursor-pointer text-base ".concat(D===r?"bg-gray-100":"hover:bg-gray-100"),onMouseDown:function(r){r.preventDefault(),E(e.countryCode,e.countryName)},children:e.countryName},e.countryCode)}):(0,i.jsx)("li",{role:"option","aria-selected":!1,className:"px-3 py-2 text-gray-500",children:"No countries found"})}),g.error&&g.touched?(0,i.jsx)("span",{className:"text-counter-ending-font font-avenirProLight text-xs font-normal leading-4 tracking-[0.2px] block mt-1",children:g.error}):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.