@freightos/fusion-location-input 2.2.6-a691267e → 2.2.6-bc16a4e0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  "main.js": "/main.bundle.js",
4
4
  "main.js.map": "/main.bundle.js.map",
5
5
  "index.html": "/index.html",
6
- "precache-manifest.8683c88704824a60a179e34a02fe54c3.js": "/precache-manifest.8683c88704824a60a179e34a02fe54c3.js",
6
+ "precache-manifest.2d64aba97df920dd09400fecaf28c339.js": "/precache-manifest.2d64aba97df920dd09400fecaf28c339.js",
7
7
  "service-worker.js": "/service-worker.js"
8
8
  },
9
9
  "entrypoints": [
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):"function"===typeof define&&define.amd?define("FusionLocationInput",["react","@freightos/design-system","styled-components","@freightos/freightos-i18n","@freightos/http-client","lodash"],e):"object"===typeof exports?exports.FusionLocationInput=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):t.FusionLocationInput=e(t.React,t["@freightos/design-system"],t["styled-components"],t["@freightos/freightos-i18n"],t["@freightos/http-client"],t.lodash)}(this,(function(t,e,n,r,o,a){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="http://ship.freightos.local:8800/FusionLocationInput/",n(n.s=7)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(8)},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=a},function(t,e,n){t.exports=n(9)},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(L){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),i=new x(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(L){return{type:"throw",arg:L}}}t.wrap=u;var s={};function d(){}function f(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,h=v&&v(v(E([])));h&&h!==e&&n.call(h,o)&&(m=h);var y=p.prototype=d.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"===typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(d).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function E(t){if(t){var e=t[o];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=p,c(y,"constructor",p),c(p,"constructor",f),f.displayName=c(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=r}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.r(e);var r=n(2),o=n.n(r);function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){if(t){if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function c(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(l){return void n(l)}c.done?e(u):Promise.resolve(u).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){u(a,r,o,i,c,"next",t)}function c(t){u(a,r,o,i,c,"throw",t)}i(void 0)}))}}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(u){o=!0,a=u}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}(t,e)||i(t,e)||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(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var f,p=n(0),m=n.n(p),v=n(1),h=n(4),y=n(6);function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b="airport",w="seaport",S="fulfillment_center",O="address_book",x="last_mile_address",E="address",k=(g(f={},b,{label:"Airports",key:b,icon:"mode-air"}),g(f,w,{label:"Ports",key:w,icon:"mode-ship"}),g(f,S,{label:"Fulfillment centers",key:S,icon:"fulfillment-center"}),g(f,O,{key:O,groupedBy:"address"}),g(f,x,{key:x,groupedBy:"address"}),g(f,E,{label:"Address",key:E,icon:"location"}),f),L="single",_="multiple",C="origin",T="destination";function j(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=i(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var A={XXLARGE:v.tokens.fdsComponentSpacingXxl,XLARGE:v.tokens.fdsComponentSpacingXl,LARGE:v.tokens.fdsComponentSpacingLg,MEDIUM:v.tokens.fdsComponentSpacingMd,SMALL:v.tokens.fdsComponentSpacingSm,XSMALL:v.tokens.fdsComponentSpacingXs,XXSMALL:v.tokens.fdsComponentSpacingXxs,NONE:0},F="vertical",R="horizontal";function M(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var U,N,z,D,V,$,W,G,X,B,q,K=n(3),J=n.n(K),H=J.a.div(U||(U=M(["\n\tdisplay: flex;\n\tflex-direction: ",";\n\tflex-wrap: ",";\n\talign-items: ",";\n\tjustify-content: ",";\n\tbox-sizing: border-box;\n\n\t","\n\t",";\n"])),(function(t){return t.$direction===F?"column":"row"}),(function(t){return t.$wrap?"wrap":"nowrap"}),(function(t){return t.$alignItems}),(function(t){return t.$justifyContent}),(function(t){return t.$fullWidth&&Object(K.css)(N||(N=M(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(t){var e=t.$direction,n=t.$spacing;return e===F?Object(K.css)(z||(z=M(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ",";\n\t\t\t\t\t}\n\t\t\t "])),n):Object(K.css)(D||(D=M(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ",";\n\t\t\t\t\t}\n\t\t\t "])),n)})),Y=["direction","alignItems","spacing","wrap","justifyContent","fullWidth"],Z=function(t){var e=t.direction,n=void 0===e?R:e,r=t.alignItems,o=void 0===r?"start":r,a=t.spacing,i=void 0===a?A.NONE:a,c=t.wrap,u=t.justifyContent,l=t.fullWidth,s=d(t,Y);return m.a.createElement(H,Object.assign({},s,{$direction:n,$alignItems:o,$spacing:i,$wrap:c,$justifyContent:u,$fullWidth:l}),s.children)},Q=n(5),tt=n.n(Q),et=function(){var t=l(o.a.mark((function t(e,n,r){var a,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a=e.reduce((function(t,e){return I(I({},t),{},g({},k[e].key,I(I({type:e.toUpperCase()},(null===r||void 0===r?void 0:r.code)?{searchTerm:r.name}:{}),k[e].groupedBy?{groupedBy:k[e].groupedBy}:{})))}),{}),t.next=4,tt.a.post("/geocoder/api/v3/geocoder/locations",{query:n,limit:5,sources:a});case 4:return i=t.sent,t.abrupt("return",i.data);case 8:return t.prev=8,t.t0=t.catch(0),console.error("Error fetching locations:",t.t0),t.abrupt("return",{results:{}});case 12:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e,n,r){return t.apply(this,arguments)}}(),nt=Object(K.createGlobalStyle)(V||(V=M(["\n .ant-select-dropdown {\n .ant-select-dropdown-menu {\n max-height: 400px;\n padding: 0 !important;\n margin-top: 0 !important;\n }\n }\n"]))),rt=J()(v.Select)($||($=M(["\n\t.ant-select-selection__rendered {\n\t\tmin-width: 100% !important;\n\t}\n\n\tli.ant-select-selection__choice {\n\t\tborder-radius: ",";\n\t\tborder: none;\n\t\tborder-color: ",";\n\t\tcolor: ",";\n\t\tbackground-color: ",";\n\t\tline-height: 10px !important;\n\t\tmargin-right: ",";\n\t\twidth: fit-content;\n\t\tmax-width: 90px;\n\t\theight: "," !important;\n\t\t","\n\n\t\t.ant-select-selection__choice__remove {\n\t\t\tcolor: ",";\n\t\t\tmargin-top: "," !important;\n\t\t}\n\n\t\t.ant-select-selection__choice__content {\n\t\t\tline-height: "," !important;\n\t\t\theight: "," !important;\n\t\t}\n\t}\n\n\tli.ant-select-selection__choice__disabled {\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\tpadding-left: 0;\n\t\twidth: fit-content;\n\t}\n\n\t.ant-select-dropdown .ant-select-not-found {\n\t\tcursor: pointer !important;\n\t}\n\n\t.ant-select-selection-selected-value {\n\t\tmax-width: 280px !important;\n\t}\n\n\tli.ant-select-search.ant-select-search--inline {\n\t\tmargin-left: -1px !important;\n\t}\n\t.ant-select-search__field {\n\t\tcolor: "," !important;\n\t}\n\t","\n"])),v.tokens.fdsBorderRadiusXl,v.tokens.fdsColorPrimaryBlue,v.tokens.fdsColorPrimaryBlue,v.tokens.fdsColorPrimaryBlue10,v.tokens.fdsComponentSpacingXxs,v.tokens.fdsSizeMd,(function(t){return"large"===t.size?"\n\t\t\tmargin-top: ".concat(v.tokens.fdsComponentSpacingSm," !important;\n\t\t"):"\n\t\t\tmargin-top: 5px !important;\n\t\t"}),v.tokens.fdsColorPrimaryBlue,v.tokens.fdsComponentSpacingXs,v.tokens.fdsSizeMd,v.tokens.fdsSizeMd,v.tokens.fdsColorPrimaryGray80,(function(t){return t.$hasError&&"\n\t\t.ant-select-selection {\n\t\t\tcolor: ".concat(v.tokens.fdsColorSemanticRed,";\n \t\tborder: 1px solid ").concat(v.tokens.fdsColorSemanticRed,";\n \t\tbackground-color: ").concat(v.tokens.fdsColorSemanticRed10,";\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ").concat(v.tokens.fdsColorSemanticRed,";\n\t\t}\n\t")})),ot=J.a.span(W||(W=M(["\n\tfont-size: "," !important;\n"])),v.tokens.fdsFontSizeSm),at=J.a.div(G||(G=M(["\n\tfont-size: "," !important;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 2;\n\t-webkit-box-orient: vertical;\n"])),v.tokens.fdsFontSizeSm),it=J()(v.Menu)(X||(X=M(["\n\tcursor: pointer !important;\n\n\t.ant-menu-item-group-title {\n\t\tpadding: 0;\n\t\tcolor: ",";\n\t}\n\n\t.ant-menu-item {\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t\tline-height: normal;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f5f5f5;\n\t\t}\n\t}\n"])),v.tokens.fdsBodyTextColorDisabled),ct=J.a.div(B||(B=M(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),v.tokens.fdsFontSizeSm,v.tokens.fdsSizeSm,v.tokens.fdsHeadingsFontFamily);J()(v.Icon)(q||(q=M(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"])));function ut(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var lt,st,dt,ft,pt,mt,vt,ht,yt,gt,bt,wt,St=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"isProduction",value:function(){return"prod"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isTest",value:function(){return"test"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isLocal",value:function(){return"dev"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}}],(n=null)&&ut(e.prototype,n),r&&ut(e,r),t}(),Ot=["address"],xt=function(t){return(t||"").trim().toUpperCase()},Et=function(t){var e=function(t){try{return"string"===typeof t?JSON.parse(t):null}catch(e){return null}}(null===t||void 0===t?void 0:t.key);return xt((null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.selectedValue))},kt=function(t){var e=[];JSON.stringify(t,(function(t,n){return e.push(t),n}));var n=Array.from(new Set(e)).sort();return JSON.stringify(t,n)},Lt=function(t){var e=t||{},n=e.displayLabel,r=e.selectedValue,o=e.formattedNameOrAddress,a=e.code,i=e.countryCode,c=e.stateOrProvince,u=e.city,l=e.latitude,s=e.longitude,d=e.postalOrZipCode,f=e.sourceType,p=e.locationType,m=e.type;return{displayLabel:n,selectedValue:r||a,formattedNameOrAddress:o,code:a||r,country:i,countryName:e.countryName,stateOrProvince:null!==c&&void 0!==c?c:null,city:null!==u&&void 0!==u?u:null,latitude:null!==l&&void 0!==l?l:null,longitude:null!==s&&void 0!==s?s:null,postalOrZipCode:null!==d&&void 0!==d?d:null,sourceType:null!==f&&void 0!==f?f:null,locationType:null!==p&&void 0!==p?p:null,type:null!==m&&void 0!==m?m:f}},_t=function(t){try{var e="string"===typeof(null===t||void 0===t?void 0:t.key)?JSON.parse(Rt(t.key)):t;return kt(Lt(e))}catch(n){return kt(Lt(t))}},Ct=function(t){var e=function(t){return function(t){if(t){var e,n=t.label||t.selectedValue;return{key:_t(t),label:n?m.a.createElement(m.a.Fragment,null,m.a.createElement(v.Icon,{type:t.sourceType?null===(e=k[t.sourceType])||void 0===e?void 0:e.icon:"location",size:"tiny"}),"\xa0",m.a.createElement(ot,null,n)):void 0}}}(t)};return Array.isArray(t)?t.map(e):e(t)},Tt=function(t){var e=I({},t),n=t[E].filter((function(t){return t.sourceType===S}));if(n.length>0){var r,o=e,a=o.address;e=I(I({},d(o,Ot)),{},(g(r={},S,n),g(r,"address",a.filter((function(t){return t.type!==S}))),r))}return e},jt=function(t,e,n){return function(){var r=l(o.a.mark((function r(a){var i,c,u;return o.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a){r.next=2;break}return r.abrupt("return",[]);case 2:return i=""!==t?[t]:e,r.next=5,et(i,a,n);case 5:return c=r.sent,(u=c.results)[E]&&(u=Tt(u)),r.abrupt("return",Object.keys(u).map((function(t){var e;return{label:(null===(e=k[t])||void 0===e?void 0:e.label)||t,options:u[t].map((function(t){return I(I({},t),{},{type:t.sourceType})}))}})));case 9:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()},Pt=function(){var t=l(o.a.mark((function t(e,n){var r,a;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Array.isArray(e)?e:[e],t.next=3,Promise.all(r.map(function(){var t=l(o.a.mark((function t(e){var n,r,a;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=null===e||void 0===e?void 0:e.key,r=Rt(n),a=JSON.parse(r),t.abrupt("return",I({key:r},a));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",void 0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()));case 3:a=t.sent,n(a.filter(Boolean));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),It=function(t,e,n,r,o){if(e===_){var a=Array.isArray(t)?t:[];if(a.length<=n)r(a),Pt(a,o);else{var i,c,u=(null===(i=JSON.parse(null===(c=a[0])||void 0===c?void 0:c.key))||void 0===i?void 0:i.sourceType)===b?n>1?"airports":"airport":n>1?"ports":"port";v.Message.danger(m.a.createElement(m.a.Fragment,null,m.a.createElement(h.TranslatableText,{stringId:"You cannot enter more than"})," "," ",n," "," ",m.a.createElement(h.TranslatableText,{stringId:u})))}}else r(t),Pt(t,o)},At=function(t){var e,n,r,o=null;try{if("string"===typeof(null===t||void 0===t?void 0:t.key)){var a=JSON.parse(t.key);o=(null===a||void 0===a?void 0:a.code)||(null===a||void 0===a?void 0:a.selectedValue)||null}}catch(i){}return((null!==(e=null!==(n=null!==(r=o)&&void 0!==r?r:null===t||void 0===t?void 0:t.code)&&void 0!==n?n:null===t||void 0===t?void 0:t.selectedValue)&&void 0!==e?e:"")||"").trim().toUpperCase()},Ft=function(t){return t&&(t===E||t===x||t===O||t===S)},Rt=function(t){return"string"===typeof t?t.replace(/&quot;/g,'"').replace(/&#34;/g,'"').replace(/&amp;/g,"&"):t},Mt=/^[^-]*-\s*(.+?),/,Ut=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Nt=function(t,e){var n=t[E]||[],r=t[S]||[];return[].concat(c(n),c(r)).filter((function(t){return function(t,e){if(!t.displayLabel)return!1;var n=t.displayLabel.match(Mt);if(!(null===n||void 0===n?void 0:n[1]))return!1;var r=n[1].trim(),o=e.trim().split(/\s+/).map(Ut);return new RegExp("\\b".concat(o.join("\\s+"),"\\b"),"i").test(r)}(t,e)}))},zt=function(t,e){return 0===t.length?null:1!==t.length&&e&&t.find((function(t){var n;return(null===(n=t.countryCode)||void 0===n?void 0:n.toLowerCase())===e.toLowerCase()}))||t[0]},Dt=function(t,e){var n=t[b]||[],r=t[w]||[],o=xt(e);return[].concat(c(n),c(r)).find((function(t){return xt(null===t||void 0===t?void 0:t.code)===o}))},Vt=function(t){var e=t.selectedValue||t.displayLabel||t.code,n=I(I({},t),{},{selectedValue:e,displayLabel:t.displayLabel||e,country:t.countryCode||t.country,type:t.type||t.sourceType});return n.country&&delete n.countryCode,{key:JSON.stringify(n),label:e}},$t=function(){var t=l(o.a.mark((function t(e){var n,r,a,i,c,u,l,s,d,f,p;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.autofillLocationAddress,r=e.autofillLocationCode,a=e.supportedLocationModes,i=e.customer,c=e.userCountryCode,n||r){t.next=3;break}return t.abrupt("return",null);case 3:if(u=null,!n){t.next=12;break}return t.next=7,et(a,n,i);case 7:l=t.sent,s=l.results,d=Nt(void 0===s?{}:s,n),u=zt(d,c);case 12:if(u||!r){t.next=19;break}return t.next=15,et(a,r,i);case 15:f=t.sent,p=f.results,u=Dt(void 0===p?{}:p,r);case 19:return t.abrupt("return",u?Vt(u):null);case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Wt="totalShipment",Gt="unitsShipment",Xt="containerPackages",Bt="celsius",qt="fahrenheit",Kt="COL",Jt="ERT",Ht="CRT",Yt=(g(pt={},"FRO",(g(lt={},Bt,"-10\xbaC or below"),g(lt,qt,"14\xbaF or below"),lt)),g(pt,Kt,(g(st={},Bt,"From +2\xbaC To +8\xbaC"),g(st,qt,"From 35.6\xbaF To 46.4\xbaF"),st)),g(pt,Jt,(g(dt={},Bt,"From +2\xbaC To +25\xbaC"),g(dt,qt,"From 35.6\xbaF To 77\xbaF"),dt)),g(pt,Ht,(g(ft={},Bt,"From +15\xbaC To +25\xbaC"),g(ft,qt,"From 59\xbaF To 77\xbaF"),ft)),pt),Zt="quotation",Qt="units",te="totals",ee="container",ne="CBM",re="CFT",oe="kg",ae="box",ie="uld",ce=function(){var t=l(o.a.mark((function t(e){var n,r,a,i,u,l,s,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.method,r=e.url,a=void 0===r?"":r,i=e.data,u=void 0===i?{}:i,l=e.options,s=void 0===l?{}:l,d=function(){if("get"===n)return[Object.keys(u).length?"".concat(a,"?").concat(new URLSearchParams(u).toString()):a,s];if("post"===n){var t=I(I({},null===s||void 0===s?void 0:s.headers),{},{accept:"application/json","content-type":"multipart/form-data"});return[a,u,I(I({},s),{},{headers:t})]}return[a,u,s]}(),t.next=4,tt.a[n].apply(tt.a,c(d));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ue=function(){var t=l(o.a.mark((function t(e){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ce({method:"put",url:"".concat("/webcargo-alpha","/backend/api.php"),options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:e}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),le=J.a.div(mt||(mt=M(["\n\tcolor: ",";\n\tfont-size: ",";\n\tfont-weight: ",";\n\tmargin-bottom: ",";\n\ti {\n\t\tmargin-right: ",";\n\t}\n\n"])),v.tokens.fdsColorPrimaryGray60,v.tokens.fdsSizeXs,v.tokens.fdsFontWeightRegular,v.tokens.fdsComponentSpacingSm,v.tokens.fdsComponentSpacingSm),se=J()(Z)(vt||(vt=M(["\n\tpadding-left: 0 !important;\n"]))),de=J()(v.Icon)(ht||(ht=M(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),fe=J.a.span(yt||(yt=M(["\n\twhite-space: nowrap;\n\tmin-width: 0;\n\tcolor: ",";\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\t","\n\t",";\n"])),v.tokens.fdsColorPrimaryGray80,(function(t){return!t.$isLocationLabel&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}),(function(t){var e=t.$isPort;if(void 0!==e)return"min-width: ".concat(e?"65px":"55px",";")})),pe=J()(v.Avatar)(gt||(gt=M(["\n\tborder: 1px solid ",";\n\twidth: ",";\n\theight: ",";\n"])),v.tokens.fdsColorPrimaryGray20,v.tokens.fdsSizeSm,v.tokens.fdsSizeSm),me=J()(Z)(bt||(bt=M(["\n\toverflow: hidden !important;\n\tfont-size: 10px; //TODO: FSN-145\n\tline-height: 15px;\n\tflex: 1;\n\tmin-width: 0;\n"]))),ve=J()(Z)(wt||(wt=M(["\n\t:last-child {\n\t\tpadding-bottom: 0 !important;\n\t}\n"]))),he=function(t){return t?t.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0"},ye=function(t){var e=t.reduce((function(t,e){var n=e.country;return t[n]||(t[n]=[]),t[n].push(e),t}),{});return Object.keys(e).forEach((function(t){e[t].sort((function(t,e){return t.selectedValue.localeCompare(e.selectedValue)}))})),e},ge=function(t){var e=t.text,n=void 0===e?"":e,r=t.testId,o=t.isPort,a=void 0===o?void 0:o,i=t.isLocationLabel,c=void 0!==i&&i,u=t.children,l=void 0===u?null:u,d=Object(p.useRef)(null),f=s(Object(p.useState)(!1),2),h=f[0],y=f[1];Object(p.useEffect)((function(){!function(){if(d.current){var t=d.current,e=t.scrollWidth>t.clientWidth;y(e)}}()}),[n]);var g=m.a.createElement(fe,{ref:d,"data-test-id":r,$isLocationLabel:c,$isPort:a},l||n);return h?m.a.createElement(v.Tooltip,{title:n,"data-test-id":"".concat(r,"-tooltip")},m.a.createElement(fe,{ref:d,"data-test-id":r,$isLocationLabel:c,$isPort:a},l||n)):g},be=function(t){var e=t.search,n=t.index,r=t.dataTestId,o=e.origin.length>1,a=e.destination.length>1,i=o?ye(e.origin):g({},e.origin[0].country,e.origin),c=a?ye(e.destination):g({},e.destination[0].country,e.destination);return m.a.createElement(Z,{alignItems:"center",spacing:A.XSMALL,fullWidth:!0},Object.keys(i).map((function(t){var e=i[t].map((function(t){return t.selectedValue})).join(", ");return m.a.createElement(ge,{key:t,text:e,isLocationLabel:!0,testId:"".concat(r,"-origin-").concat(n),isPort:i[t][0].type===w},m.a.createElement(pe,{type:"flag",country:t,size:"small","data-test-id":"".concat(r,"-origin-flag-").concat(n),style:{marginRight:"4px"}}),e)})),m.a.createElement(v.Icon,{type:"arrow-forward",style:{marginRight:0,color:v.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(c).map((function(t){var e=c[t].map((function(t){return t.selectedValue})).join(", ");return m.a.createElement(ge,{key:t,text:e,isLocationLabel:!0,testId:"".concat(r,"-destination-").concat(n),isPort:c[t][0].type===w},m.a.createElement(pe,{type:"flag",country:t,size:"small","data-test-id":"".concat(r,"-destination-flag-").concat(n),style:{marginRight:"4px"}}),e)})))},we=function(t){var e,n,r,o=t.search,a=t.index,i=t.dataTestId,c=o.platform_type,u=function(t){var e=t.shipment_details.type;if(e===te)return["box-total"];if(e===Qt){var n=t.shipment_details[Gt];return(null===n||void 0===n?void 0:n.packageType)===ae?n.boxPackages.reduce((function(t,e){var n,r,o=null===(n=e.type)||void 0===n||null===(r=n.value)||void 0===r?void 0:r.icon;return t.includes(o)||t.push(o),t}),[]):(null===n||void 0===n?void 0:n.packageType)===ie?["uld"]:["box"]}return e===ee?["container"]:["box"]}(o),l=Object(p.useMemo)((function(){return function(t){var e=t.shipment_details.type;if(t.platform_type===Zt)return{units:0,volume:0,weight:0,weightUnit:oe,volumeUnit:ne};switch(e){case ee:var n,r=0,o=0;return null===(n=t.shipment_details[Xt])||void 0===n||n.forEach((function(t){var e=Number(t.units)||0;if(e>0){r+=e;var n=parseInt(t.dimensions.value,10);o+=e*(n/20)}})),{units:r,volume:o,weight:null,weightUnit:null,volumeUnit:"TEU"};case Qt:var a=t.shipment_details[Gt],i=(null===a||void 0===a?void 0:a.volumeUnit)===re?1728:1e6;if((null===a||void 0===a?void 0:a.packageType)===ae){var c=he(null===a||void 0===a?void 0:a.boxPackages.reduce((function(t,e){return t+parseFloat(e.width||"0")*parseFloat(e.height||"0")*parseFloat(e.length||"0")*parseFloat(e.units||"0")/i}),0)),u=he(a.boxPackages.reduce((function(t,e){return t+parseFloat(e.weight||"0")}),0));return{units:a.boxPackages.reduce((function(t,e){return t+parseFloat(e.units||"0")}),0),volume:c,weight:u,weightUnit:a.weightUnit,volumeUnit:a.volumeUnit}}if((null===a||void 0===a?void 0:a.packageType)===ie){var l=he(a.uldPackages.reduce((function(t,e){return t+parseFloat(e.volume||"0")}),0)),s=he(a.uldPackages.reduce((function(t,e){return t+parseFloat(e.weight||"0")}),0));return{units:a.uldPackages.length,volume:l,weight:s,weightUnit:a.weightUnit,volumeUnit:a.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:oe,volumeUnit:ne};case te:var d,f,p,m,v,h=he(parseFloat((null===(d=t.shipment_details[Wt])||void 0===d?void 0:d.volume)||"0")),y=he(parseFloat((null===(f=t.shipment_details[Wt])||void 0===f?void 0:f.weight)||"0"));return{units:(null===(p=t.shipment_details[Wt])||void 0===p?void 0:p.units)||0,volume:h,weight:y,weightUnit:(null===(m=t.shipment_details[Wt])||void 0===m?void 0:m.weightUnit)||oe,volumeUnit:(null===(v=t.shipment_details[Wt])||void 0===v?void 0:v.volumeUnit)||ne};default:return{units:0,volume:0,weight:0,weightUnit:oe,volumeUnit:ne}}}(o)}),[o]),s=l.units,d=l.volume,f=l.weight,h=l.weightUnit,y=l.volumeUnit,g=1===o.commodity.length&&o.commodity[0].is_temperature,b=(null===(e=o.commodity_temperature)||void 0===e?void 0:e.tempRange)&&g?Yt[null===(n=o.commodity_temperature)||void 0===n?void 0:n.tempRange][null===(r=o.commodity_temperature)||void 0===r?void 0:r.temperatureSystem]:"";return m.a.createElement(Z,{spacing:A.XSMALL,alignItems:"center",fullWidth:!0,key:a},c===Zt?m.a.createElement(me,{alignItems:"center",spacing:A.SMALL,style:{flex:1}},u.map((function(t,e){return m.a.createElement(de,{type:t,key:"".concat(a,"-").concat(e),size:"tiny","data-test-id":"".concat(i,"rs-package-icon-").concat(a,"-").concat(e)})})),m.a.createElement(ge,{text:o.commodity.map((function(t){return t.label})).join(", "),testId:"".concat(i,"rs-commodity-").concat(a)})):m.a.createElement(me,{alignItems:"center",spacing:A.SMALL},m.a.createElement(Z,{alignItems:"center",spacing:A.XSMALL,"data-test-id":"rs-".concat(a,"-units")},s,"\xa0",u.map((function(t,e){return m.a.createElement(de,{type:t,key:"".concat(a,"-").concat(e),size:"tiny","data-test-id":"".concat(i,"rs-package-icon-").concat(a,"-").concat(e)})}))),m.a.createElement("span",{"data-test-id":"".concat(i,"rs-volume-").concat(a)},d,"\xa0",y),f&&m.a.createElement("span",{"data-test-id":"".concat(i,"rs-weight-").concat(a)},f,"\xa0",h),m.a.createElement(ge,{text:o.commodity.map((function(t){return t.label})).join(", "),testId:"".concat(i,"rs-commodity-").concat(a)}),g&&m.a.createElement(Z,{alignItems:"center",spacing:A.XSMALL,"data-test-id":"".concat(i,"rs-temperature-").concat(a)},m.a.createElement(v.Icon,{type:"temperature-low",size:"tiny","data-test-id":"".concat(i,"rs-temperature-icon-").concat(a)}),m.a.createElement("span",{style:{whiteSpace:"nowrap"}},b))))},Se=function(t){var e=t.search,n=t.index,r=t.setIsOpen,a=t.dataTestId,i=t.onRecentSearchSelect,c=function(){var t=l(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i(e),t.prev=1,t.next=4,ue(e.id);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.error(t.t0);case 9:r(!1);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}();return m.a.createElement(se,{direction:F,fullWidth:!0,spacing:A.XSMALL,key:e.id,style:{padding:v.tokens.fdsComponentSpacingSm},"data-test-id":"".concat(a,"rs-card-").concat(n),onClick:function(){c()}},m.a.createElement(be,{search:e,index:n,dataTestId:a}),m.a.createElement(we,{search:e,index:n,dataTestId:a}))},Oe=function(t){var e=t.recentSearches,n=t.setIsOpen,r=t.dataTestId,o=t.onRecentSearchSelect,a=t.initialValues,i=e?function(t){return c(t).sort((function(t,e){if(t.is_saved!==e.is_saved)return t.is_saved?-1:1;if(t.is_saved&&e.is_saved){var n=new Date(t.saved_update_date).getTime();return new Date(e.saved_update_date).getTime()-n}var r=new Date(Math.max(new Date(t.last_time_used_date).getTime(),new Date(t.saved_update_date||0).getTime())).getTime();return new Date(Math.max(new Date(e.last_time_used_date).getTime(),new Date(e.saved_update_date||0).getTime())).getTime()-r})).slice(0,6)}(e):[];return m.a.createElement(it,null,m.a.createElement(le,null,m.a.createElement(v.Icon,{"data-test-id":"".concat(r,"rs-icon"),color:v.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),m.a.createElement(h.TranslatableText,{stringId:"Recent searches"})),m.a.createElement(ve,{direction:F,fullWidth:!0},i.map((function(t,e){return m.a.createElement(Se,{onRecentSearchSelect:o,initialValues:a,search:t,index:e,key:t.id,setIsOpen:n,dataTestId:r})}))))},xe=function(t){var e=t.isLoading,n=t.recentSearches,r=t.searchKey,o=t.dataTestId,a=t.setIsOpen,i=t.onRecentSearchSelect,c=t.initialValues;return r||n&&0!==n.length?e?m.a.createElement(v.Spin,{size:"small"}):(null===n||void 0===n?void 0:n.length)>0&&!r.trim()?m.a.createElement(Oe,{recentSearches:n,dataTestId:o,setIsOpen:a,onRecentSearchSelect:i,initialValues:c}):r.trim()?m.a.createElement(ct,null,m.a.createElement(h.TranslatableText,{stringId:"No matching results",module:h.TRANSLATION_MODULES.SearchAndBook})):null:null},Ee=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode","defaultLocation","onChange"],ke=function(t){var e=t.fetchOptions,n=t.renderedOptions,r=t.recentSearches,a=void 0===r?[]:r,i=t.hasError,c=t.mode,u=t.dataTestId,f=t.value,h=t.debounceTimeout,g=void 0===h?800:h,b=t.activeLocationMode,w=t.defaultLocation,S=t.onChange,O=d(t,Ee),x=s(Object(p.useState)([]),2),E=x[0],_=x[1],C=s(Object(p.useState)(!1),2),T=C[0],j=C[1],P=s(Object(p.useState)(""),2),I=P[0],A=P[1],F=Object(p.useRef)(0),R=s(Object(p.useState)(!1),2),M=R[0],U=R[1],N=Object(p.useRef)();Object(p.useEffect)((function(){f&&0!==f.length||M||(_([]),A(""))}),[f,M]),Object(p.useEffect)((function(){return""!==b&&_((function(t){return t.filter((function(t){return t.label===k[b].label}))})),U(!1),N.current&&clearTimeout(N.current),N.current=setTimeout((function(){document.activeElement.blur(),document.body.click();var t=document.querySelector(".ant-select-focused");t&&t.classList.remove("ant-select-focused")}),100),function(){N.current&&clearTimeout(N.current)}}),[b]);var z=Object(p.useMemo)((function(){var t=function(){var t=l(o.a.mark((function t(n){var r,a,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return A(n),F.current+=1,r=F.current,_([]),j(!0),a=null,t.prev=6,t.next=9,e(n);case 9:i=t.sent,r===F.current&&(_(i),a=i),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(6),console.error("Error fetching options:",t.t0),r===F.current&&v.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."});case 17:if(t.prev=17,r!==F.current){t.next=21;break}return j(!1),t.abrupt("return",a);case 21:return t.finish(17);case 22:case"end":return t.stop()}}),t,null,[[6,13,17,22]])})));return function(e){return t.apply(this,arguments)}}();return Object(y.debounce)(t,g)}),[e,g]);Object(p.useEffect)((function(){(null===w||void 0===w?void 0:w.code)&&function(){var t=l(o.a.mark((function t(){var n,r,a,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,_([]),j(!0),t.next=5,e(w.code);case 5:if(n=t.sent,_(n),n&&0!==n.length){t.next=9;break}return t.abrupt("return");case 9:r=null,w.type&&(null===(a=n.find((function(t){var e;return t.label.toLowerCase()===(null===(e=k[w.type])||void 0===e?void 0:e.label.toLowerCase())})))||void 0===a?void 0:a.options)&&(r=a.options.find((function(t){return t.code.toLowerCase()===w.code.toLowerCase()||t.selectedValue.toLowerCase()===w.code.toLowerCase()}))),r||(r=n.map((function(t){return t.options})).flat().find((function(t){return t.code.toLowerCase()===w.code.toLowerCase()||t.selectedValue.toLowerCase()===w.code.toLowerCase()}))),r&&S&&(i=Vt(r),S([i])),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),St.isLocal()&&console.error("Error loading default location:",t.t0);case 18:return t.prev=18,j(!1),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[0,15,18,21]])})));return function(){return t.apply(this,arguments)}}()()}),[null===w||void 0===w?void 0:w.code,null===w||void 0===w?void 0:w.type]);var D=T||I.trim()||(null===a||void 0===a?void 0:a.length)>0,V=M&&D?2:3;return m.a.createElement(m.a.Fragment,null,m.a.createElement(nt,null),m.a.createElement(rt,Object.assign({maxTagCount:V,onSearch:z,$hasError:i,loading:T,options:E,filterOption:!1,notFoundContent:m.a.createElement(xe,{isLoading:T,recentSearches:a,searchKey:I,dataTestId:u,setIsOpen:U,onRecentSearchSelect:O.onRecentSearchSelect,initialValues:O.initialValues}),mode:c,"data-test-id":"".concat(u,"-selector"),allowClear:c===L,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(t){U(t),_([]),A("")},open:M&&(T||I.trim()||(null===a||void 0===a?void 0:a.length)>0),value:f,onChange:S},O),n(E)))},Le=function(t){var e=t.omittedPorts,n=t.dataTestId,r=e.map((function(t){var e;return null===(e=JSON.parse(t.key))||void 0===e?void 0:e.selectedValue}));return m.a.createElement(v.Tooltip,{title:r.join(",")},m.a.createElement(ot,{"data-test-id":"".concat(n,"-extra-ports")},"+".concat(e.length)))},_e=["value","onChange","hasError","dataTestId","isOriginLocation","maxPorts","supportedLocationModes","customer","defaultLocation","autofillLocationAddress","autofillLocationCode","userCountryCode"];e.default=function(t){var e=t.value,n=t.onChange,r=t.hasError,a=t.dataTestId,i=void 0===a?"location-input":a,u=t.isOriginLocation,f=void 0===u||u,y=t.maxPorts,g=void 0===y?1:y,b=t.supportedLocationModes,w=t.customer,x=t.defaultLocation,E=t.autofillLocationAddress,P=t.autofillLocationCode,I=t.userCountryCode,F=d(t,_e),R=s(Object(p.useState)(e),2),M=R[0],U=R[1],N=s(Object(p.useState)(1===b.length?b[0]:""),2),z=N[0],D=N[1],V=s(Object(p.useState)(Ft(z)||""===z?L:_),2),$=V[0],W=V[1],G=Object(p.useRef)(e),X=Object(p.useRef)(null);Object(p.useEffect)((function(){Ft(z)?W(L):W(_)}),[z]),Object(p.useEffect)((function(){U(e),G.current=e,Array.isArray(e)&&e.length>0?D(e[0].type):(null===x||void 0===x?void 0:x.type)?D(x.type):D("")}),[e,null===x||void 0===x?void 0:x.type]);var B=Object(p.useRef)({onChange:n,selectionMode:$,maxPorts:g});return Object(p.useEffect)((function(){B.current={onChange:n,selectionMode:$,maxPorts:g}}),[n,$,g]),Object(p.useEffect)((function(){var t="".concat(E||"","::").concat(P||"");if((E||P)&&t!==X.current){var e=G.current,n=B.current,r=n.selectionMode,a=n.maxPorts,i=r===_&&"number"===typeof a&&a>1&&Array.isArray(e)&&e.length<a;if(!function(t){return!!t&&(Array.isArray(t)?t.length>0:Object.keys(t).length>0)}(e)||i)(function(){var e=l(o.a.mark((function e(){var n,r,a,i,u,l,s,d,f,p,m;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,$t({autofillLocationAddress:E,autofillLocationCode:P,supportedLocationModes:b,customer:w,userCountryCode:I});case 3:if(n=e.sent){e.next=6;break}return e.abrupt("return");case 6:if(r=B.current,a=r.onChange,i=r.selectionMode,u=r.maxPorts,l=G.current,!(i===_&&"number"===typeof u&&u>1&&Array.isArray(l))){e.next=19;break}if(s=Et(n),d=new Set((l||[]).map((function(t){return xt((null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue))}))),s&&!d.has(s)){e.next=13;break}return e.abrupt("return");case 13:f=Ct(l)||[],p=Array.isArray(f)?f.filter(Boolean):[],m=[].concat(c(p),[n]).slice(0,u),It(m,i,u,U,a),e.next=20;break;case 19:It(i===_?[n]:n,i,u,U,a);case 20:X.current=t,e.next=26;break;case 23:e.prev=23,e.t0=e.catch(0),console.error("Error performing autofill:",e.t0);case 26:case"end":return e.stop()}}),e,null,[[0,23]])})));return function(){return e.apply(this,arguments)}})()()}}),[E,P,b,w,I]),m.a.createElement(ke,Object.assign({mode:$,dataTestId:i,hasError:r,placeholder:m.a.createElement(h.TranslatableText,{style:{fontSize:v.tokens.fdsFontSizeBase},stringId:"Select ".concat(f?C:T)}),value:Ct(M),fetchOptions:jt(z,b,w),renderedOptions:function(t){return function(t,e){if((t||[]).some((function(t){var e;return(null===t||void 0===t||null===(e=t.options)||void 0===e?void 0:e.length)>0})))return t.map((function(t){var n,r=Object.values(k).find((function(e){return e.label===t.label})),o=null===r||void 0===r?void 0:r.icon;return m.a.createElement(v.Select.OptGroup,{label:m.a.createElement("span",{style:{fontFamily:"Open Sans"}},m.a.createElement(v.Icon,{size:"tiny",type:o}),"\xa0 \xa0",t.label),key:t.label,"data-test-id":"".concat(e,"-group-").concat(t.label)},null===(n=t.options)||void 0===n?void 0:n.map((function(n){var r=n.countryCode,a=n.selectedValue,i=n.displayLabel,c=n.type;return m.a.createElement(v.Option,{value:_t(n),title:a,"data-test-id":"".concat(e,"-").concat(t.label,"-").concat(a),style:{paddingLeft:"8px"},label:m.a.createElement(m.a.Fragment,null,m.a.createElement(v.Icon,{type:o,size:"tiny"}),"\xa0",m.a.createElement(ot,null,a)),key:n.code},m.a.createElement(Z,{fullWidth:!0,justifyContent:"space-between"},m.a.createElement(Z,{spacing:A.XSMALL},m.a.createElement("span",null,m.a.createElement(v.Avatar,{type:"flag",country:r,size:"small",style:{width:v.tokens.fdsSizeSm,height:v.tokens.fdsSizeSm}})),m.a.createElement(at,null,i)),c===S&&m.a.createElement(v.Icon,{type:"amazon",size:"small"}),c===O&&m.a.createElement(v.Chip,{type:"neutral",iconType:"address-book"})))})))}))}(t,i)},onChange:function(t){var e=null!==t&&void 0!==t?t:[],r=$===_&&Array.isArray(e)&&e.length>0?function(t,e){var n,r=new Map,o=j(Array.isArray(e)?e:[]);try{for(o.s();!(n=o.n()).done;){var a,i=n.value,c=At(i);c&&r.set(c,(null!==(a=r.get(c))&&void 0!==a?a:0)+1)}}catch(O){o.e(O)}finally{o.f()}var u,l=new Map,d=j(t);try{for(d.s();!(u=d.n()).done;){var f,p=u.value,m=At(p);m&&l.set(m,(null!==(f=l.get(m))&&void 0!==f?f:0)+1)}}catch(O){d.e(O)}finally{d.f()}var v,h=j(l);try{for(h.s();!(v=h.n()).done;){var y,g=s(v.value,2),b=g[0],w=g[1],S=null!==(y=r.get(b))&&void 0!==y?y:0;if(w>S&&S>0)return b}}catch(O){h.e(O)}finally{h.f()}return null}(e,M):null;null!==r?function(t,e,n,r){var o=(Array.isArray(e)?e:[]).filter((function(e){return At(e)!==t}));n(o),Pt(o,r)}(r,M,U,n):It(e,$,g,U,n),D("")},activeLocationMode:z,maxTagPlaceholder:function(t){return m.a.createElement(Le,{omittedPorts:t,dataTestId:i})},defaultLocation:x},F))}}])}));
1
+ !function(u,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):"function"===typeof define&&define.amd?define("FusionLocationInput",["react","@freightos/design-system","styled-components","@freightos/freightos-i18n","@freightos/http-client","lodash"],t):"object"===typeof exports?exports.FusionLocationInput=t(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):u.FusionLocationInput=t(u.React,u["@freightos/design-system"],u["styled-components"],u["@freightos/freightos-i18n"],u["@freightos/http-client"],u.lodash)}(this,(function(u,t,e,n,r,D){return function(u){var t={};function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return u[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=u,e.c=t,e.d=function(u,t,n){e.o(u,t)||Object.defineProperty(u,t,{enumerable:!0,get:n})},e.r=function(u){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},e.t=function(u,t){if(1&t&&(u=e(u)),8&t)return u;if(4&t&&"object"===typeof u&&u&&u.__esModule)return u;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:u}),2&t&&"string"!=typeof u)for(var r in u)e.d(n,r,function(t){return u[t]}.bind(null,r));return n},e.n=function(u){var t=u&&u.__esModule?function(){return u.default}:function(){return u};return e.d(t,"a",t),t},e.o=function(u,t){return Object.prototype.hasOwnProperty.call(u,t)},e.p="http://ship.freightos.local:8800/FusionLocationInput/",e(e.s=7)}([function(t,e){t.exports=u},function(u,e){u.exports=t},function(u,t,e){u.exports=e(8)},function(u,t){u.exports=e},function(u,t){u.exports=n},function(u,t){u.exports=r},function(u,t){u.exports=D},function(u,t,e){u.exports=e(9)},function(u,t,e){var n=function(u){"use strict";var t=Object.prototype,e=t.hasOwnProperty,n="function"===typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",D=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function a(u,t,e){return Object.defineProperty(u,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),u[t]}try{a({},"")}catch(w){a=function(u,t,e){return u[t]=e}}function i(u,t,e,n){var r=t&&t.prototype instanceof s?t:s,D=Object.create(r.prototype),o=new y(n||[]);return D._invoke=function(u,t,e){var n="suspendedStart";return function(r,D){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw D;return b()}for(e.method=r,e.arg=D;;){var o=e.delegate;if(o){var a=v(o,e);if(a){if(a===l)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var i=c(u,t,e);if("normal"===i.type){if(n=e.done?"completed":"suspendedYield",i.arg===l)continue;return{value:i.arg,done:e.done}}"throw"===i.type&&(n="completed",e.method="throw",e.arg=i.arg)}}}(u,e,o),D}function c(u,t,e){try{return{type:"normal",arg:u.call(t,e)}}catch(w){return{type:"throw",arg:w}}}u.wrap=i;var l={};function s(){}function F(){}function d(){}var C={};a(C,r,(function(){return this}));var E=Object.getPrototypeOf,A=E&&E(E(g([])));A&&A!==t&&e.call(A,r)&&(C=A);var f=d.prototype=s.prototype=Object.create(C);function p(u){["next","throw","return"].forEach((function(t){a(u,t,(function(u){return this._invoke(t,u)}))}))}function m(u,t){var n;this._invoke=function(r,D){function o(){return new t((function(n,o){!function n(r,D,o,a){var i=c(u[r],u,D);if("throw"!==i.type){var l=i.arg,s=l.value;return s&&"object"===typeof s&&e.call(s,"__await")?t.resolve(s.__await).then((function(u){n("next",u,o,a)}),(function(u){n("throw",u,o,a)})):t.resolve(s).then((function(u){l.value=u,o(l)}),(function(u){return n("throw",u,o,a)}))}a(i.arg)}(r,D,n,o)}))}return n=n?n.then(o,o):o()}}function v(u,t){var e=u.iterator[t.method];if(void 0===e){if(t.delegate=null,"throw"===t.method){if(u.iterator.return&&(t.method="return",t.arg=void 0,v(u,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(e,u.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var r=n.arg;return r?r.done?(t[u.resultName]=r.value,t.next=u.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function B(u){var t={tryLoc:u[0]};1 in u&&(t.catchLoc=u[1]),2 in u&&(t.finallyLoc=u[2],t.afterLoc=u[3]),this.tryEntries.push(t)}function h(u){var t=u.completion||{};t.type="normal",delete t.arg,u.completion=t}function y(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(B,this),this.reset(!0)}function g(u){if(u){var t=u[r];if(t)return t.call(u);if("function"===typeof u.next)return u;if(!isNaN(u.length)){var n=-1,D=function t(){for(;++n<u.length;)if(e.call(u,n))return t.value=u[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return D.next=D}}return{next:b}}function b(){return{value:void 0,done:!0}}return F.prototype=d,a(f,"constructor",d),a(d,"constructor",F),F.displayName=a(d,o,"GeneratorFunction"),u.isGeneratorFunction=function(u){var t="function"===typeof u&&u.constructor;return!!t&&(t===F||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,d):(u.__proto__=d,a(u,o,"GeneratorFunction")),u.prototype=Object.create(f),u},u.awrap=function(u){return{__await:u}},p(m.prototype),a(m.prototype,D,(function(){return this})),u.AsyncIterator=m,u.async=function(t,e,n,r,D){void 0===D&&(D=Promise);var o=new m(i(t,e,n,r),D);return u.isGeneratorFunction(e)?o:o.next().then((function(u){return u.done?u.value:o.next()}))},p(f),a(f,o,"Generator"),a(f,r,(function(){return this})),a(f,"toString",(function(){return"[object Generator]"})),u.keys=function(u){var t=[];for(var e in u)t.push(e);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in u)return e.value=n,e.done=!1,e}return e.done=!0,e}},u.values=g,y.prototype={constructor:y,reset:function(u){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(h),!u)for(var t in this)"t"===t.charAt(0)&&e.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if("throw"===u.type)throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var t=this;function n(e,n){return o.type="throw",o.arg=u,t.next=e,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var D=this.tryEntries[r],o=D.completion;if("root"===D.tryLoc)return n("end");if(D.tryLoc<=this.prev){var a=e.call(D,"catchLoc"),i=e.call(D,"finallyLoc");if(a&&i){if(this.prev<D.catchLoc)return n(D.catchLoc,!0);if(this.prev<D.finallyLoc)return n(D.finallyLoc)}else if(a){if(this.prev<D.catchLoc)return n(D.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return n(D.finallyLoc)}}}},abrupt:function(u,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&e.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var D=r;break}}D&&("break"===u||"continue"===u)&&D.tryLoc<=t&&t<=D.finallyLoc&&(D=null);var o=D?D.completion:{};return o.type=u,o.arg=t,D?(this.method="next",this.next=D.finallyLoc,l):this.complete(o)},complete:function(u,t){if("throw"===u.type)throw u.arg;return"break"===u.type||"continue"===u.type?this.next=u.arg:"return"===u.type?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):"normal"===u.type&&t&&(this.next=t),l},finish:function(u){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===u)return this.complete(e.completion,e.afterLoc),h(e),l}},catch:function(u){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===u){var n=e.completion;if("throw"===n.type){var r=n.arg;h(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(u,t,e){return this.delegate={iterator:g(u),resultName:t,nextLoc:e},"next"===this.method&&(this.arg=void 0),l}},u}(u.exports);try{regeneratorRuntime=n}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(u,t,e){"use strict";e.r(t);var n=e(2),r=e.n(n);function D(u,t){(null==t||t>u.length)&&(t=u.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=u[e];return n}function o(u,t){if(u){if("string"===typeof u)return D(u,t);var e=Object.prototype.toString.call(u).slice(8,-1);return"Object"===e&&u.constructor&&(e=u.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?D(u,t):void 0}}function a(u){return function(u){if(Array.isArray(u))return D(u)}(u)||function(u){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(u))return Array.from(u)}(u)||o(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(u,t,e,n,r,D,o){try{var a=u[D](o),i=a.value}catch(c){return void e(c)}a.done?t(i):Promise.resolve(i).then(n,r)}function c(u){return function(){var t=this,e=arguments;return new Promise((function(n,r){var D=u.apply(t,e);function o(u){i(D,n,r,o,a,"next",u)}function a(u){i(D,n,r,o,a,"throw",u)}o(void 0)}))}}function l(u,t){return function(u){if(Array.isArray(u))return u}(u)||function(u,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(u)){var e=[],n=!0,r=!1,D=void 0;try{for(var o,a=u[Symbol.iterator]();!(n=(o=a.next()).done)&&(e.push(o.value),!t||e.length!==t);n=!0);}catch(i){r=!0,D=i}finally{try{n||null==a.return||a.return()}finally{if(r)throw D}}return e}}(u,t)||o(u,t)||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 s(u,t){if(null==u)return{};var e,n,r=function(u,t){if(null==u)return{};var e,n,r={},D=Object.keys(u);for(n=0;n<D.length;n++)e=D[n],t.indexOf(e)>=0||(r[e]=u[e]);return r}(u,t);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(u);for(n=0;n<D.length;n++)e=D[n],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(u,e)&&(r[e]=u[e])}return r}var F,d=e(0),C=e.n(d),E=e(1),A=e(4),f=e(6);function p(u,t,e){return t in u?Object.defineProperty(u,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):u[t]=e,u}var m="airport",v="seaport",B="fulfillment_center",h="address_book",y="last_mile_address",g="address",b=(p(F={},m,{label:"Airports",key:m,icon:"mode-air"}),p(F,v,{label:"Ports",key:v,icon:"mode-ship"}),p(F,B,{label:"Fulfillment centers",key:B,icon:"fulfillment-center"}),p(F,h,{key:h,groupedBy:"address"}),p(F,y,{key:y,groupedBy:"address"}),p(F,g,{label:"Address",key:g,icon:"location"}),F),w="single",x="multiple",S="origin",O="destination";function k(u){if("undefined"===typeof Symbol||null==u[Symbol.iterator]){if(Array.isArray(u)||(u=o(u))){var t=0,e=function(){};return{s:e,n:function(){return t>=u.length?{done:!0}:{done:!1,value:u[t++]}},e:function(u){throw u},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,r,D=!0,a=!1;return{s:function(){n=u[Symbol.iterator]()},n:function(){var u=n.next();return D=u.done,u},e:function(u){a=!0,r=u},f:function(){try{D||null==n.return||n.return()}finally{if(a)throw r}}}}function L(u,t){var e=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(u,t).enumerable}))),e.push.apply(e,n)}return e}function _(u){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?L(Object(e),!0).forEach((function(t){p(u,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(e)):L(Object(e)).forEach((function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))}))}return u}var T={XXLARGE:E.tokens.fdsComponentSpacingXxl,XLARGE:E.tokens.fdsComponentSpacingXl,LARGE:E.tokens.fdsComponentSpacingLg,MEDIUM:E.tokens.fdsComponentSpacingMd,SMALL:E.tokens.fdsComponentSpacingSm,XSMALL:E.tokens.fdsComponentSpacingXs,XXSMALL:E.tokens.fdsComponentSpacingXxs,NONE:0},j="vertical",P="horizontal";function I(u,t){return t||(t=u.slice(0)),Object.freeze(Object.defineProperties(u,{raw:{value:Object.freeze(t)}}))}var M,R,N,z,U,V,$,W,G,X,q,K=e(3),J=e.n(K),H=J.a.div(M||(M=I(["\n\tdisplay: flex;\n\tflex-direction: ",";\n\tflex-wrap: ",";\n\talign-items: ",";\n\tjustify-content: ",";\n\tbox-sizing: border-box;\n\n\t","\n\t",";\n"])),(function(u){return u.$direction===j?"column":"row"}),(function(u){return u.$wrap?"wrap":"nowrap"}),(function(u){return u.$alignItems}),(function(u){return u.$justifyContent}),(function(u){return u.$fullWidth&&Object(K.css)(R||(R=I(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(u){var t=u.$direction,e=u.$spacing;return t===j?Object(K.css)(N||(N=I(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ",";\n\t\t\t\t\t}\n\t\t\t "])),e):Object(K.css)(z||(z=I(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ",";\n\t\t\t\t\t}\n\t\t\t "])),e)})),Z=["direction","alignItems","spacing","wrap","justifyContent","fullWidth"],Y=function(u){var t=u.direction,e=void 0===t?P:t,n=u.alignItems,r=void 0===n?"start":n,D=u.spacing,o=void 0===D?T.NONE:D,a=u.wrap,i=u.justifyContent,c=u.fullWidth,l=s(u,Z);return C.a.createElement(H,Object.assign({},l,{$direction:e,$alignItems:r,$spacing:o,$wrap:a,$justifyContent:i,$fullWidth:c}),l.children)},Q=e(5),uu=e.n(Q),tu=function(){var u=c(r.a.mark((function u(t,e,n){var D,o;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(u.prev=0,D=(t||[]).filter((function(u){return b[u]})).reduce((function(u,t){return _(_({},u),{},p({},b[t].key,_(_({type:t.toUpperCase()},(null===n||void 0===n?void 0:n.code)?{searchTerm:n.name}:{}),b[t].groupedBy?{groupedBy:b[t].groupedBy}:{})))}),{}),0!==Object.keys(D).length){u.next=4;break}return u.abrupt("return",{results:{}});case 4:return u.next=6,uu.a.post("/geocoder/api/v3/geocoder/locations",{query:e,limit:5,sources:D});case 6:return o=u.sent,u.abrupt("return",o.data);case 10:return u.prev=10,u.t0=u.catch(0),console.error("Error fetching locations:",u.t0),u.abrupt("return",{results:{}});case 14:case"end":return u.stop()}}),u,null,[[0,10]])})));return function(t,e,n){return u.apply(this,arguments)}}(),eu=Object(K.createGlobalStyle)(U||(U=I(["\n .ant-select-dropdown {\n .ant-select-dropdown-menu {\n max-height: 400px;\n padding: 0 !important;\n margin-top: 0 !important;\n }\n }\n"]))),nu=J()(E.Select)(V||(V=I(["\n\t.ant-select-selection__rendered {\n\t\tmin-width: 100% !important;\n\t}\n\n\tli.ant-select-selection__choice {\n\t\tborder-radius: ",";\n\t\tborder: none;\n\t\tborder-color: ",";\n\t\tcolor: ",";\n\t\tbackground-color: ",";\n\t\tline-height: 10px !important;\n\t\tmargin-right: ",";\n\t\twidth: fit-content;\n\t\tmax-width: 90px;\n\t\theight: "," !important;\n\t\t","\n\n\t\t.ant-select-selection__choice__remove {\n\t\t\tcolor: ",";\n\t\t\tmargin-top: "," !important;\n\t\t}\n\n\t\t.ant-select-selection__choice__content {\n\t\t\tline-height: "," !important;\n\t\t\theight: "," !important;\n\t\t}\n\t}\n\n\tli.ant-select-selection__choice__disabled {\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\tpadding-left: 0;\n\t\twidth: fit-content;\n\t}\n\n\t.ant-select-dropdown .ant-select-not-found {\n\t\tcursor: pointer !important;\n\t}\n\n\t.ant-select-selection-selected-value {\n\t\tmax-width: 280px !important;\n\t}\n\n\tli.ant-select-search.ant-select-search--inline {\n\t\tmargin-left: -1px !important;\n\t}\n\t.ant-select-search__field {\n\t\tcolor: "," !important;\n\t}\n\t","\n"])),E.tokens.fdsBorderRadiusXl,E.tokens.fdsColorPrimaryBlue,E.tokens.fdsColorPrimaryBlue,E.tokens.fdsColorPrimaryBlue10,E.tokens.fdsComponentSpacingXxs,E.tokens.fdsSizeMd,(function(u){return"large"===u.size?"\n\t\t\tmargin-top: ".concat(E.tokens.fdsComponentSpacingSm," !important;\n\t\t"):"\n\t\t\tmargin-top: 5px !important;\n\t\t"}),E.tokens.fdsColorPrimaryBlue,E.tokens.fdsComponentSpacingXs,E.tokens.fdsSizeMd,E.tokens.fdsSizeMd,E.tokens.fdsColorPrimaryGray80,(function(u){return u.$hasError&&"\n\t\t.ant-select-selection {\n\t\t\tcolor: ".concat(E.tokens.fdsColorSemanticRed,";\n \t\tborder: 1px solid ").concat(E.tokens.fdsColorSemanticRed,";\n \t\tbackground-color: ").concat(E.tokens.fdsColorSemanticRed10,";\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ").concat(E.tokens.fdsColorSemanticRed,";\n\t\t}\n\t")})),ru=J.a.span($||($=I(["\n\tfont-size: "," !important;\n"])),E.tokens.fdsFontSizeSm),Du=J.a.div(W||(W=I(["\n\tfont-size: "," !important;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 2;\n\t-webkit-box-orient: vertical;\n"])),E.tokens.fdsFontSizeSm),ou=J()(E.Menu)(G||(G=I(["\n\tcursor: pointer !important;\n\n\t.ant-menu-item-group-title {\n\t\tpadding: 0;\n\t\tcolor: ",";\n\t}\n\n\t.ant-menu-item {\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t\tline-height: normal;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f5f5f5;\n\t\t}\n\t}\n"])),E.tokens.fdsBodyTextColorDisabled),au=J.a.div(X||(X=I(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),E.tokens.fdsFontSizeSm,E.tokens.fdsSizeSm,E.tokens.fdsHeadingsFontFamily);J()(E.Icon)(q||(q=I(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"])));function iu(u,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(u,n.key,n)}}var cu,lu,su,Fu,du,Cu,Eu,Au,fu,pu,mu,vu,Bu=function(){function u(){!function(u,t){if(!(u instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u)}var t,e,n;return t=u,n=[{key:"isProduction",value:function(){return"prod"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isTest",value:function(){return"test"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isLocal",value:function(){return"dev"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}}],(e=null)&&iu(t.prototype,e),n&&iu(t,n),u}(),hu=["address"],yu=function(u){return(u||"").trim().toUpperCase()},gu=function(u){var t=function(u){try{return"string"===typeof u?JSON.parse(u):null}catch(t){return null}}(null===u||void 0===u?void 0:u.key);return yu((null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue))},bu=function(u){var t=[];JSON.stringify(u,(function(u,e){return t.push(u),e}));var e=Array.from(new Set(t)).sort();return JSON.stringify(u,e)},wu=function(u){var t=u||{},e=t.displayLabel,n=t.selectedValue,r=t.formattedNameOrAddress,D=t.code,o=t.countryCode,a=t.stateOrProvince,i=t.city,c=t.latitude,l=t.longitude,s=t.postalOrZipCode,F=t.sourceType,d=t.locationType,C=t.type;return{displayLabel:e,selectedValue:n||D,formattedNameOrAddress:r,code:D||n,country:o,countryName:t.countryName,stateOrProvince:null!==a&&void 0!==a?a:null,city:null!==i&&void 0!==i?i:null,latitude:null!==c&&void 0!==c?c:null,longitude:null!==l&&void 0!==l?l:null,postalOrZipCode:null!==s&&void 0!==s?s:null,sourceType:null!==F&&void 0!==F?F:null,locationType:null!==d&&void 0!==d?d:null,type:null!==C&&void 0!==C?C:F}},xu=function(u){try{var t="string"===typeof(null===u||void 0===u?void 0:u.key)?JSON.parse(Pu(u.key)):u;return bu(wu(t))}catch(e){return bu(wu(u))}},Su=function(u){var t=function(u){return function(u){if(u){var t,e=u.label||u.selectedValue;return{key:xu(u),label:e?C.a.createElement(C.a.Fragment,null,C.a.createElement(E.Icon,{type:u.sourceType?null===(t=b[u.sourceType])||void 0===t?void 0:t.icon:"location",size:"tiny"}),"\xa0",C.a.createElement(ru,null,e)):void 0}}}(u)};return Array.isArray(u)?u.map(t):t(u)},Ou=function(u){var t=_({},u),e=u[g].filter((function(u){return u.sourceType===B}));if(e.length>0){var n,r=t,D=r.address;t=_(_({},s(r,hu)),{},(p(n={},B,e),p(n,"address",D.filter((function(u){return u.type!==B}))),n))}return t},ku=function(u,t,e){return function(){var n=c(r.a.mark((function n(D){var o,a,i;return r.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(D){n.next=2;break}return n.abrupt("return",[]);case 2:return o=""!==u?[u]:t,n.next=5,tu(o,D,e);case 5:return a=n.sent,(i=a.results)[g]&&(i=Ou(i)),n.abrupt("return",Object.keys(i).map((function(u){var t;return{label:(null===(t=b[u])||void 0===t?void 0:t.label)||u,options:i[u].map((function(u){return _(_({},u),{},{type:u.sourceType})}))}})));case 9:case"end":return n.stop()}}),n)})));return function(u){return n.apply(this,arguments)}}()},Lu=function(){var u=c(r.a.mark((function u(t,e){var n,D;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return n=Array.isArray(t)?t:[t],u.next=3,Promise.all(n.map(function(){var u=c(r.a.mark((function u(t){var e,n,D;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=null===t||void 0===t?void 0:t.key,n=Pu(e),D=JSON.parse(n),u.abrupt("return",_({key:n},D));case 7:return u.prev=7,u.t0=u.catch(0),u.abrupt("return",void 0);case 10:case"end":return u.stop()}}),u,null,[[0,7]])})));return function(t){return u.apply(this,arguments)}}()));case 3:D=u.sent,e(D.filter(Boolean));case 5:case"end":return u.stop()}}),u)})));return function(t,e){return u.apply(this,arguments)}}(),_u=function(u,t,e,n,r){if(t===x){var D=Array.isArray(u)?u:[];if(D.length<=e)n(D),Lu(D,r);else{var o,a,i=(null===(o=JSON.parse(null===(a=D[0])||void 0===a?void 0:a.key))||void 0===o?void 0:o.sourceType)===m?e>1?"airports":"airport":e>1?"ports":"port";E.Message.danger(C.a.createElement(C.a.Fragment,null,C.a.createElement(A.TranslatableText,{stringId:"You cannot enter more than"})," "," ",e," "," ",C.a.createElement(A.TranslatableText,{stringId:i})))}}else n(u),Lu(u,r)},Tu=function(u){var t,e,n,r=null;try{if("string"===typeof(null===u||void 0===u?void 0:u.key)){var D=JSON.parse(u.key);r=(null===D||void 0===D?void 0:D.code)||(null===D||void 0===D?void 0:D.selectedValue)||null}}catch(o){}return((null!==(t=null!==(e=null!==(n=r)&&void 0!==n?n:null===u||void 0===u?void 0:u.code)&&void 0!==e?e:null===u||void 0===u?void 0:u.selectedValue)&&void 0!==t?t:"")||"").trim().toUpperCase()},ju=function(u){return u&&(u===g||u===y||u===h||u===B)},Pu=function(u){return"string"===typeof u?u.replace(/&quot;/g,'"').replace(/&#34;/g,'"').replace(/&amp;/g,"&"):u},Iu=function(u){return(u||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/(?:(?![0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])[\s\S])+/g," ").trim()},Mu=function(u){return Iu(u).split(" ").filter(Boolean)},Ru=/^(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])+(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])?$/,Nu=function(u,t,e,n){var r=new Set(Mu(function(u){return[null===u||void 0===u?void 0:u.formattedNameOrAddress,null===u||void 0===u?void 0:u.displayLabel,null===u||void 0===u?void 0:u.selectedValue].filter(Boolean).join(" ")}(u)));if(0===r.size)return 0;if(n){var D=a(e),o=D.indexOf(Iu(null===u||void 0===u?void 0:u.postalOrZipCode));if(-1!==o&&D.splice(o,1),0===D.length)return 0;if(!D.every((function(u){return r.has(u)})))return 0}return t.filter((function(u){return r.has(u)})).length/t.length},zu=function(u,t){var e=u[g]||[],n=u[B]||[],r=Mu(t);if(0===r.length)return[];var D=r.filter((function(u){return Ru.test(u)}));return[].concat(a(e),a(n)).map((function(u){return{address:u,score:Nu(u,r,D,(null===u||void 0===u?void 0:u.sourceType)!==B)}})).filter((function(u){return u.score>=.5})).sort((function(u,t){return t.score-u.score}))},Uu=function(u,t){if(0===u.length)return null;var e=u[0].score,n=u.filter((function(u){return u.score===e})).map((function(u){return u.address}));if(1===n.length||!t)return n[0];var r=t.toLowerCase();return n.find((function(u){return(u.countryCode||u.country||"").toLowerCase()===r}))||n[0]},Vu=function(u,t){var e=u[m]||[],n=u[v]||[],r=yu(t);return[].concat(a(e),a(n)).find((function(u){return yu(null===u||void 0===u?void 0:u.code)===r}))},$u=function(u){var t=u.selectedValue||u.displayLabel||u.code,e=_(_({},u),{},{selectedValue:t,displayLabel:u.displayLabel||t,country:u.countryCode||u.country,type:u.type||u.sourceType});return e.country&&delete e.countryCode,{key:JSON.stringify(e),label:t}},Wu=function(u){return(u||[]).some(ju)},Gu=function(){var u=c(r.a.mark((function u(t){var e,n,D,o,a,i,c;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return e=t.query,n=t.supportedLocationModes,D=t.customer,o=t.userCountryCode,u.next=3,tu(n,e,D);case 3:return a=u.sent,i=a.results,c=void 0===i?{}:i,u.abrupt("return",Uu(zu(c,e),o));case 7:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),Xu=function(){var u=c(r.a.mark((function u(t){var e,n,D,o,a,i,c,s,F,d,C,E,A,f;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(e=t.autofillLocationAddress,n=t.autofillLocationCode,D=t.supportedLocationModes,o=t.customer,a=t.userCountryCode,e||n){u.next=3;break}return u.abrupt("return",null);case 3:if(i=null,!e||!Wu(D)){u.next=14;break}return c=(e||"").split(",")[0].trim(),s=c&&c!==e.trim(),u.next=9,Promise.all([Gu({query:e,supportedLocationModes:D,customer:o,userCountryCode:a}),s?Gu({query:c,supportedLocationModes:D,customer:o,userCountryCode:a}).catch((function(){return null})):null]);case 9:F=u.sent,d=l(F,2),C=d[0],E=d[1],i=C||E;case 14:if(i||!n){u.next=21;break}return u.next=17,tu(D,n,o);case 17:A=u.sent,f=A.results,i=Vu(void 0===f?{}:f,n);case 21:return u.abrupt("return",i?$u(i):null);case 22:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),qu="totalShipment",Ku="unitsShipment",Ju="containerPackages",Hu="celsius",Zu="fahrenheit",Yu="COL",Qu="ERT",ut="CRT",tt=(p(du={},"FRO",(p(cu={},Hu,"-10\xbaC or below"),p(cu,Zu,"14\xbaF or below"),cu)),p(du,Yu,(p(lu={},Hu,"From +2\xbaC To +8\xbaC"),p(lu,Zu,"From 35.6\xbaF To 46.4\xbaF"),lu)),p(du,Qu,(p(su={},Hu,"From +2\xbaC To +25\xbaC"),p(su,Zu,"From 35.6\xbaF To 77\xbaF"),su)),p(du,ut,(p(Fu={},Hu,"From +15\xbaC To +25\xbaC"),p(Fu,Zu,"From 59\xbaF To 77\xbaF"),Fu)),du),et="quotation",nt="units",rt="totals",Dt="container",ot="CBM",at="CFT",it="kg",ct="box",lt="uld",st=function(){var u=c(r.a.mark((function u(t){var e,n,D,o,i,c,l,s;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return e=t.method,n=t.url,D=void 0===n?"":n,o=t.data,i=void 0===o?{}:o,c=t.options,l=void 0===c?{}:c,s=function(){if("get"===e)return[Object.keys(i).length?"".concat(D,"?").concat(new URLSearchParams(i).toString()):D,l];if("post"===e){var u=_(_({},null===l||void 0===l?void 0:l.headers),{},{accept:"application/json","content-type":"multipart/form-data"});return[D,i,_(_({},l),{},{headers:u})]}return[D,i,l]}(),u.next=4,uu.a[e].apply(uu.a,a(s));case 4:return u.abrupt("return",u.sent);case 5:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),Ft=function(){var u=c(r.a.mark((function u(t){return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,st({method:"put",url:"".concat("/webcargo-alpha","/backend/api.php"),options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:t}});case 2:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),dt=J.a.div(Cu||(Cu=I(["\n\tcolor: ",";\n\tfont-size: ",";\n\tfont-weight: ",";\n\tmargin-bottom: ",";\n\ti {\n\t\tmargin-right: ",";\n\t}\n\n"])),E.tokens.fdsColorPrimaryGray60,E.tokens.fdsSizeXs,E.tokens.fdsFontWeightRegular,E.tokens.fdsComponentSpacingSm,E.tokens.fdsComponentSpacingSm),Ct=J()(Y)(Eu||(Eu=I(["\n\tpadding-left: 0 !important;\n"]))),Et=J()(E.Icon)(Au||(Au=I(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),At=J.a.span(fu||(fu=I(["\n\twhite-space: nowrap;\n\tmin-width: 0;\n\tcolor: ",";\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\t","\n\t",";\n"])),E.tokens.fdsColorPrimaryGray80,(function(u){return!u.$isLocationLabel&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}),(function(u){var t=u.$isPort;if(void 0!==t)return"min-width: ".concat(t?"65px":"55px",";")})),ft=J()(E.Avatar)(pu||(pu=I(["\n\tborder: 1px solid ",";\n\twidth: ",";\n\theight: ",";\n"])),E.tokens.fdsColorPrimaryGray20,E.tokens.fdsSizeSm,E.tokens.fdsSizeSm),pt=J()(Y)(mu||(mu=I(["\n\toverflow: hidden !important;\n\tfont-size: 10px; //TODO: FSN-145\n\tline-height: 15px;\n\tflex: 1;\n\tmin-width: 0;\n"]))),mt=J()(Y)(vu||(vu=I(["\n\t:last-child {\n\t\tpadding-bottom: 0 !important;\n\t}\n"]))),vt=function(u){return u?u.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0"},Bt=function(u){var t=u.reduce((function(u,t){var e=t.country;return u[e]||(u[e]=[]),u[e].push(t),u}),{});return Object.keys(t).forEach((function(u){t[u].sort((function(u,t){return(u.selectedValue||"").localeCompare(t.selectedValue||"")}))})),t},ht=function(u){var t=u.text,e=void 0===t?"":t,n=u.testId,r=u.isPort,D=void 0===r?void 0:r,o=u.isLocationLabel,a=void 0!==o&&o,i=u.children,c=void 0===i?null:i,s=Object(d.useRef)(null),F=l(Object(d.useState)(!1),2),A=F[0],f=F[1];Object(d.useEffect)((function(){!function(){if(s.current){var u=s.current,t=u.scrollWidth>u.clientWidth;f(t)}}()}),[e]);var p=C.a.createElement(At,{ref:s,"data-test-id":n,$isLocationLabel:a,$isPort:D},c||e);return A?C.a.createElement(E.Tooltip,{title:e,"data-test-id":"".concat(n,"-tooltip")},C.a.createElement(At,{ref:s,"data-test-id":n,$isLocationLabel:a,$isPort:D},c||e)):p},yt=function(u){var t=u.search,e=u.index,n=u.dataTestId,r=t.origin.length>1,D=t.destination.length>1,o=r?Bt(t.origin):p({},t.origin[0].country,t.origin),a=D?Bt(t.destination):p({},t.destination[0].country,t.destination);return C.a.createElement(Y,{alignItems:"center",spacing:T.XSMALL,fullWidth:!0},Object.keys(o).map((function(u){var t=o[u].map((function(u){return u.selectedValue})).join(", ");return C.a.createElement(ht,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-origin-").concat(e),isPort:o[u][0].type===v},C.a.createElement(ft,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-origin-flag-").concat(e),style:{marginRight:"4px"}}),t)})),C.a.createElement(E.Icon,{type:"arrow-forward",style:{marginRight:0,color:E.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(a).map((function(u){var t=a[u].map((function(u){return u.selectedValue})).join(", ");return C.a.createElement(ht,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-destination-").concat(e),isPort:a[u][0].type===v},C.a.createElement(ft,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-destination-flag-").concat(e),style:{marginRight:"4px"}}),t)})))},gt=function(u){var t,e,n,r=u.search,D=u.index,o=u.dataTestId,a=r.platform_type,i=function(u){var t=u.shipment_details.type;if(t===rt)return["box-total"];if(t===nt){var e=u.shipment_details[Ku];return(null===e||void 0===e?void 0:e.packageType)===ct?e.boxPackages.reduce((function(u,t){var e,n,r=null===(e=t.type)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.icon;return u.includes(r)||u.push(r),u}),[]):(null===e||void 0===e?void 0:e.packageType)===lt?["uld"]:["box"]}return t===Dt?["container"]:["box"]}(r),c=Object(d.useMemo)((function(){return function(u){var t=u.shipment_details.type;if(u.platform_type===et)return{units:0,volume:0,weight:0,weightUnit:it,volumeUnit:ot};switch(t){case Dt:var e,n=0,r=0;return null===(e=u.shipment_details[Ju])||void 0===e||e.forEach((function(u){var t=Number(u.units)||0;if(t>0){n+=t;var e=parseInt(u.dimensions.value,10);r+=t*(e/20)}})),{units:n,volume:r,weight:null,weightUnit:null,volumeUnit:"TEU"};case nt:var D=u.shipment_details[Ku],o=(null===D||void 0===D?void 0:D.volumeUnit)===at?1728:1e6;if((null===D||void 0===D?void 0:D.packageType)===ct){var a=vt(null===D||void 0===D?void 0:D.boxPackages.reduce((function(u,t){return u+parseFloat(t.width||"0")*parseFloat(t.height||"0")*parseFloat(t.length||"0")*parseFloat(t.units||"0")/o}),0)),i=vt(D.boxPackages.reduce((function(u,t){return u+parseFloat(t.weight||"0")}),0));return{units:D.boxPackages.reduce((function(u,t){return u+parseFloat(t.units||"0")}),0),volume:a,weight:i,weightUnit:D.weightUnit,volumeUnit:D.volumeUnit}}if((null===D||void 0===D?void 0:D.packageType)===lt){var c=vt(D.uldPackages.reduce((function(u,t){return u+parseFloat(t.volume||"0")}),0)),l=vt(D.uldPackages.reduce((function(u,t){return u+parseFloat(t.weight||"0")}),0));return{units:D.uldPackages.length,volume:c,weight:l,weightUnit:D.weightUnit,volumeUnit:D.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:it,volumeUnit:ot};case rt:var s,F,d,C,E,A=vt(parseFloat((null===(s=u.shipment_details[qu])||void 0===s?void 0:s.volume)||"0")),f=vt(parseFloat((null===(F=u.shipment_details[qu])||void 0===F?void 0:F.weight)||"0"));return{units:(null===(d=u.shipment_details[qu])||void 0===d?void 0:d.units)||0,volume:A,weight:f,weightUnit:(null===(C=u.shipment_details[qu])||void 0===C?void 0:C.weightUnit)||it,volumeUnit:(null===(E=u.shipment_details[qu])||void 0===E?void 0:E.volumeUnit)||ot};default:return{units:0,volume:0,weight:0,weightUnit:it,volumeUnit:ot}}}(r)}),[r]),l=c.units,s=c.volume,F=c.weight,A=c.weightUnit,f=c.volumeUnit,p=1===r.commodity.length&&r.commodity[0].is_temperature,m=(null===(t=r.commodity_temperature)||void 0===t?void 0:t.tempRange)&&p?tt[null===(e=r.commodity_temperature)||void 0===e?void 0:e.tempRange][null===(n=r.commodity_temperature)||void 0===n?void 0:n.temperatureSystem]:"";return C.a.createElement(Y,{spacing:T.XSMALL,alignItems:"center",fullWidth:!0,key:D},a===et?C.a.createElement(pt,{alignItems:"center",spacing:T.SMALL,style:{flex:1}},i.map((function(u,t){return C.a.createElement(Et,{type:u,key:"".concat(D,"-").concat(t),size:"tiny","data-test-id":"".concat(o,"rs-package-icon-").concat(D,"-").concat(t)})})),C.a.createElement(ht,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(o,"rs-commodity-").concat(D)})):C.a.createElement(pt,{alignItems:"center",spacing:T.SMALL},C.a.createElement(Y,{alignItems:"center",spacing:T.XSMALL,"data-test-id":"rs-".concat(D,"-units")},l,"\xa0",i.map((function(u,t){return C.a.createElement(Et,{type:u,key:"".concat(D,"-").concat(t),size:"tiny","data-test-id":"".concat(o,"rs-package-icon-").concat(D,"-").concat(t)})}))),C.a.createElement("span",{"data-test-id":"".concat(o,"rs-volume-").concat(D)},s,"\xa0",f),F&&C.a.createElement("span",{"data-test-id":"".concat(o,"rs-weight-").concat(D)},F,"\xa0",A),C.a.createElement(ht,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(o,"rs-commodity-").concat(D)}),p&&C.a.createElement(Y,{alignItems:"center",spacing:T.XSMALL,"data-test-id":"".concat(o,"rs-temperature-").concat(D)},C.a.createElement(E.Icon,{type:"temperature-low",size:"tiny","data-test-id":"".concat(o,"rs-temperature-icon-").concat(D)}),C.a.createElement("span",{style:{whiteSpace:"nowrap"}},m))))},bt=function(u){var t=u.search,e=u.index,n=u.setIsOpen,D=u.dataTestId,o=u.onRecentSearchSelect,a=function(){var u=c(r.a.mark((function u(){return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return o(t),u.prev=1,u.next=4,Ft(t.id);case 4:u.next=9;break;case 6:u.prev=6,u.t0=u.catch(1),console.error(u.t0);case 9:n(!1);case 10:case"end":return u.stop()}}),u,null,[[1,6]])})));return function(){return u.apply(this,arguments)}}();return C.a.createElement(Ct,{direction:j,fullWidth:!0,spacing:T.XSMALL,key:t.id,style:{padding:E.tokens.fdsComponentSpacingSm},"data-test-id":"".concat(D,"rs-card-").concat(e),onClick:function(){a()}},C.a.createElement(yt,{search:t,index:e,dataTestId:D}),C.a.createElement(gt,{search:t,index:e,dataTestId:D}))},wt=function(u){var t=u.recentSearches,e=u.setIsOpen,n=u.dataTestId,r=u.onRecentSearchSelect,D=u.initialValues,o=t?function(u){return a(u).sort((function(u,t){if(u.is_saved!==t.is_saved)return u.is_saved?-1:1;if(u.is_saved&&t.is_saved){var e=new Date(u.saved_update_date).getTime();return new Date(t.saved_update_date).getTime()-e}var n=new Date(Math.max(new Date(u.last_time_used_date).getTime(),new Date(u.saved_update_date||0).getTime())).getTime();return new Date(Math.max(new Date(t.last_time_used_date).getTime(),new Date(t.saved_update_date||0).getTime())).getTime()-n})).slice(0,6)}(t):[];return C.a.createElement(ou,null,C.a.createElement(dt,null,C.a.createElement(E.Icon,{"data-test-id":"".concat(n,"rs-icon"),color:E.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),C.a.createElement(A.TranslatableText,{stringId:"Recent searches"})),C.a.createElement(mt,{direction:j,fullWidth:!0},o.map((function(u,t){return C.a.createElement(bt,{onRecentSearchSelect:r,initialValues:D,search:u,index:t,key:u.id,setIsOpen:e,dataTestId:n})}))))},xt=function(u){var t=u.isLoading,e=u.recentSearches,n=u.searchKey,r=u.dataTestId,D=u.setIsOpen,o=u.onRecentSearchSelect,a=u.initialValues;return n||e&&0!==e.length?t?C.a.createElement(E.Spin,{size:"small"}):(null===e||void 0===e?void 0:e.length)>0&&!n.trim()?C.a.createElement(wt,{recentSearches:e,dataTestId:r,setIsOpen:D,onRecentSearchSelect:o,initialValues:a}):n.trim()?C.a.createElement(au,null,C.a.createElement(A.TranslatableText,{stringId:"No matching results",module:A.TRANSLATION_MODULES.SearchAndBook})):null:null},St=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode","defaultLocation","onChange"],Ot=function(u){var t=u.fetchOptions,e=u.renderedOptions,n=u.recentSearches,D=void 0===n?[]:n,o=u.hasError,a=u.mode,i=u.dataTestId,F=u.value,A=u.debounceTimeout,p=void 0===A?800:A,m=u.activeLocationMode,v=u.defaultLocation,B=u.onChange,h=s(u,St),y=l(Object(d.useState)([]),2),g=y[0],x=y[1],S=l(Object(d.useState)(!1),2),O=S[0],k=S[1],L=l(Object(d.useState)(""),2),_=L[0],T=L[1],j=Object(d.useRef)(0),P=l(Object(d.useState)(!1),2),I=P[0],M=P[1],R=Object(d.useRef)();Object(d.useEffect)((function(){F&&0!==F.length||I||(x([]),T(""))}),[F,I]),Object(d.useEffect)((function(){return""!==m&&x((function(u){return u.filter((function(u){return u.label===b[m].label}))})),M(!1),R.current&&clearTimeout(R.current),R.current=setTimeout((function(){document.activeElement.blur(),document.body.click();var u=document.querySelector(".ant-select-focused");u&&u.classList.remove("ant-select-focused")}),100),function(){R.current&&clearTimeout(R.current)}}),[m]);var N=Object(d.useMemo)((function(){var u=function(){var u=c(r.a.mark((function u(e){var n,D,o;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return T(e),j.current+=1,n=j.current,x([]),k(!0),D=null,u.prev=6,u.next=9,t(e);case 9:o=u.sent,n===j.current&&(x(o),D=o),u.next=17;break;case 13:u.prev=13,u.t0=u.catch(6),console.error("Error fetching options:",u.t0),n===j.current&&E.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."});case 17:if(u.prev=17,n!==j.current){u.next=21;break}return k(!1),u.abrupt("return",D);case 21:return u.finish(17);case 22:case"end":return u.stop()}}),u,null,[[6,13,17,22]])})));return function(t){return u.apply(this,arguments)}}();return Object(f.debounce)(u,p)}),[t,p]);Object(d.useEffect)((function(){(null===v||void 0===v?void 0:v.code)&&function(){var u=c(r.a.mark((function u(){var e,n,D,o;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,x([]),k(!0),u.next=5,t(v.code);case 5:if(e=u.sent,x(e),e&&0!==e.length){u.next=9;break}return u.abrupt("return");case 9:n=null,v.type&&(null===(D=e.find((function(u){var t;return u.label.toLowerCase()===(null===(t=b[v.type])||void 0===t?void 0:t.label.toLowerCase())})))||void 0===D?void 0:D.options)&&(n=D.options.find((function(u){return u.code.toLowerCase()===v.code.toLowerCase()||u.selectedValue.toLowerCase()===v.code.toLowerCase()}))),n||(n=e.map((function(u){return u.options})).flat().find((function(u){return u.code.toLowerCase()===v.code.toLowerCase()||u.selectedValue.toLowerCase()===v.code.toLowerCase()}))),n&&B&&(o=$u(n),B([o])),u.next=18;break;case 15:u.prev=15,u.t0=u.catch(0),Bu.isLocal()&&console.error("Error loading default location:",u.t0);case 18:return u.prev=18,k(!1),u.finish(18);case 21:case"end":return u.stop()}}),u,null,[[0,15,18,21]])})));return function(){return u.apply(this,arguments)}}()()}),[null===v||void 0===v?void 0:v.code,null===v||void 0===v?void 0:v.type]);var z=O||_.trim()||(null===D||void 0===D?void 0:D.length)>0,U=I&&z?2:3;return C.a.createElement(C.a.Fragment,null,C.a.createElement(eu,null),C.a.createElement(nu,Object.assign({maxTagCount:U,onSearch:N,$hasError:o,loading:O,options:g,filterOption:!1,notFoundContent:C.a.createElement(xt,{isLoading:O,recentSearches:D,searchKey:_,dataTestId:i,setIsOpen:M,onRecentSearchSelect:h.onRecentSearchSelect,initialValues:h.initialValues}),mode:a,"data-test-id":"".concat(i,"-selector"),allowClear:a===w,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(u){M(u),x([]),T("")},open:I&&(O||_.trim()||(null===D||void 0===D?void 0:D.length)>0),value:F,onChange:B},h),e(g)))},kt=function(u){var t=u.omittedPorts,e=u.dataTestId,n=t.map((function(u){var t;return null===(t=JSON.parse(u.key))||void 0===t?void 0:t.selectedValue}));return C.a.createElement(E.Tooltip,{title:n.join(",")},C.a.createElement(ru,{"data-test-id":"".concat(e,"-extra-ports")},"+".concat(t.length)))},Lt=["value","onChange","hasError","dataTestId","isOriginLocation","maxPorts","supportedLocationModes","customer","defaultLocation","autofillLocationAddress","autofillLocationCode","userCountryCode"];t.default=function(u){var t=u.value,e=u.onChange,n=u.hasError,D=u.dataTestId,o=void 0===D?"location-input":D,i=u.isOriginLocation,F=void 0===i||i,f=u.maxPorts,p=void 0===f?1:f,m=u.supportedLocationModes,v=u.customer,y=u.defaultLocation,g=u.autofillLocationAddress,L=u.autofillLocationCode,_=u.userCountryCode,j=s(u,Lt),P=l(Object(d.useState)(t),2),I=P[0],M=P[1],R=l(Object(d.useState)(1===m.length?m[0]:""),2),N=R[0],z=R[1],U=l(Object(d.useState)(ju(N)||""===N?w:x),2),V=U[0],$=U[1],W=Object(d.useRef)(t),G=Object(d.useRef)(null);Object(d.useEffect)((function(){ju(N)?$(w):$(x)}),[N]),Object(d.useEffect)((function(){M(t),W.current=t,Array.isArray(t)&&t.length>0?z(t[0].type):(null===y||void 0===y?void 0:y.type)?z(y.type):z("")}),[t,null===y||void 0===y?void 0:y.type]);var X=Object(d.useRef)({onChange:e,selectionMode:V,maxPorts:p});return Object(d.useEffect)((function(){X.current={onChange:e,selectionMode:V,maxPorts:p}}),[e,V,p]),Object(d.useEffect)((function(){var u="".concat(g||"","::").concat(L||"");if((g||L)&&u!==G.current){var t=W.current,e=X.current,n=e.selectionMode,D=e.maxPorts,o=n===x&&"number"===typeof D&&D>1&&Array.isArray(t)&&t.length<D;if(!function(u){return!!u&&(Array.isArray(u)?u.length>0:Object.keys(u).length>0)}(t)||o)(function(){var t=c(r.a.mark((function t(){var e,n,D,o,i,c,l,s,F,d,C;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Xu({autofillLocationAddress:g,autofillLocationCode:L,supportedLocationModes:m,customer:v,userCountryCode:_});case 3:if(e=t.sent){t.next=6;break}return t.abrupt("return");case 6:if(n=X.current,D=n.onChange,o=n.selectionMode,i=n.maxPorts,c=W.current,!(o===x&&"number"===typeof i&&i>1&&Array.isArray(c))){t.next=19;break}if(l=gu(e),s=new Set((c||[]).map((function(u){return yu((null===u||void 0===u?void 0:u.code)||(null===u||void 0===u?void 0:u.selectedValue))}))),l&&!s.has(l)){t.next=13;break}return t.abrupt("return");case 13:F=Su(c)||[],d=Array.isArray(F)?F.filter(Boolean):[],C=[].concat(a(d),[e]).slice(0,i),_u(C,o,i,M,D),t.next=20;break;case 19:_u(o===x?[e]:e,o,i,M,D);case 20:G.current=u,t.next=26;break;case 23:t.prev=23,t.t0=t.catch(0),console.error("Error performing autofill:",t.t0);case 26:case"end":return t.stop()}}),t,null,[[0,23]])})));return function(){return t.apply(this,arguments)}})()()}}),[g,L,m,v,_]),C.a.createElement(Ot,Object.assign({mode:V,dataTestId:o,hasError:n,placeholder:C.a.createElement(A.TranslatableText,{style:{fontSize:E.tokens.fdsFontSizeBase},stringId:"Select ".concat(F?S:O)}),value:Su(I),fetchOptions:ku(N,m,v),renderedOptions:function(u){return function(u,t){if((u||[]).some((function(u){var t;return(null===u||void 0===u||null===(t=u.options)||void 0===t?void 0:t.length)>0})))return u.map((function(u){var e,n=Object.values(b).find((function(t){return t.label===u.label})),r=null===n||void 0===n?void 0:n.icon;return C.a.createElement(E.Select.OptGroup,{label:C.a.createElement("span",{style:{fontFamily:"Open Sans"}},C.a.createElement(E.Icon,{size:"tiny",type:r}),"\xa0 \xa0",u.label),key:u.label,"data-test-id":"".concat(t,"-group-").concat(u.label)},null===(e=u.options)||void 0===e?void 0:e.map((function(e){var n=e.countryCode,D=e.selectedValue,o=e.displayLabel,a=e.type;return C.a.createElement(E.Option,{value:xu(e),title:D,"data-test-id":"".concat(t,"-").concat(u.label,"-").concat(D),style:{paddingLeft:"8px"},label:C.a.createElement(C.a.Fragment,null,C.a.createElement(E.Icon,{type:r,size:"tiny"}),"\xa0",C.a.createElement(ru,null,D)),key:e.code},C.a.createElement(Y,{fullWidth:!0,justifyContent:"space-between"},C.a.createElement(Y,{spacing:T.XSMALL},C.a.createElement("span",null,C.a.createElement(E.Avatar,{type:"flag",country:n,size:"small",style:{width:E.tokens.fdsSizeSm,height:E.tokens.fdsSizeSm}})),C.a.createElement(Du,null,o)),a===B&&C.a.createElement(E.Icon,{type:"amazon",size:"small"}),a===h&&C.a.createElement(E.Chip,{type:"neutral",iconType:"address-book"})))})))}))}(u,o)},onChange:function(u){var t=null!==u&&void 0!==u?u:[],n=V===x&&Array.isArray(t)&&t.length>0?function(u,t){var e,n=new Map,r=k(Array.isArray(t)?t:[]);try{for(r.s();!(e=r.n()).done;){var D,o=e.value,a=Tu(o);a&&n.set(a,(null!==(D=n.get(a))&&void 0!==D?D:0)+1)}}catch(h){r.e(h)}finally{r.f()}var i,c=new Map,s=k(u);try{for(s.s();!(i=s.n()).done;){var F,d=i.value,C=Tu(d);C&&c.set(C,(null!==(F=c.get(C))&&void 0!==F?F:0)+1)}}catch(h){s.e(h)}finally{s.f()}var E,A=k(c);try{for(A.s();!(E=A.n()).done;){var f,p=l(E.value,2),m=p[0],v=p[1],B=null!==(f=n.get(m))&&void 0!==f?f:0;if(v>B&&B>0)return m}}catch(h){A.e(h)}finally{A.f()}return null}(t,I):null;null!==n?function(u,t,e,n){var r=(Array.isArray(t)?t:[]).filter((function(t){return Tu(t)!==u}));e(r),Lu(r,n)}(n,I,M,e):_u(t,V,p,M,e),z("")},activeLocationMode:N,maxTagPlaceholder:function(u){return C.a.createElement(kt,{omittedPorts:u,dataTestId:o})},defaultLocation:y},j))}}])}));
2
2
  //# sourceMappingURL=main.bundle.js.map