@freightos/fusion-location-input 2.2.7-FSN1749.2 → 2.2.8-test

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.
@@ -1,10 +1,8 @@
1
1
  {
2
2
  "files": {
3
3
  "main.js": "/main.bundle.js",
4
- "main.js.map": "/main.bundle.js.map",
5
4
  "index.html": "/index.html",
6
- "precache-manifest.9ac5c08a257a3f9e47392b510dcb6baf.js": "/precache-manifest.9ac5c08a257a3f9e47392b510dcb6baf.js",
7
- "service-worker.js": "/service-worker.js"
5
+ "main.bundle.js.map": "/main.bundle.js.map"
8
6
  },
9
7
  "entrypoints": [
10
8
  "main.bundle.js"
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Fusion location input</title></head></html><script src="http://ship.freightos.local:8800/FusionLocationInput/main.bundle.js"></script>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Fusion location input</title><script defer="defer" src="http://ship.freightos.local:8800/FusionLocationInput/main.bundle.js"></script></head></html>
@@ -1,2 +1,152 @@
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=m(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 v(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 m(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,m(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(v.prototype),a(v.prototype,D,(function(){return this})),u.AsyncIterator=v,u.async=function(t,e,n,r,D){void 0===D&&(D=Promise);var o=new v(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){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(u))return Array.from(u)}function a(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 i(u){return function(u){if(Array.isArray(u))return D(u)}(u)||o(u)||a(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 c(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 l(u){return function(){var t=this,e=arguments;return new Promise((function(n,r){var D=u.apply(t,e);function o(u){c(D,n,r,o,a,"next",u)}function a(u){c(D,n,r,o,a,"throw",u)}o(void 0)}))}}function s(u){if(Array.isArray(u))return u}function F(){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(u,t){return s(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)||a(u,t)||F()}function C(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 E,A=e(0),f=e.n(A),p=e(1),v=e(4),m=e(6);function B(u,t,e){return t in u?Object.defineProperty(u,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):u[t]=e,u}var h="airport",y="seaport",g="fulfillment_center",b="address_book",w="last_mile_address",x="address",S=(B(E={},h,{label:"Airports",key:h,icon:"mode-air"}),B(E,y,{label:"Ports",key:y,icon:"mode-ship"}),B(E,g,{label:"Fulfillment centers",key:g,icon:"fulfillment-center"}),B(E,b,{key:b,groupedBy:"address"}),B(E,w,{key:w,groupedBy:"address"}),B(E,x,{label:"Address",key:x,icon:"location"}),E),O="single",k="multiple",L="origin",_="destination";function T(u){return s(u)||o(u)||a(u)||F()}function j(u){if("undefined"===typeof Symbol||null==u[Symbol.iterator]){if(Array.isArray(u)||(u=a(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,o=!1;return{s:function(){n=u[Symbol.iterator]()},n:function(){var u=n.next();return D=u.done,u},e:function(u){o=!0,r=u},f:function(){try{D||null==n.return||n.return()}finally{if(o)throw r}}}}function P(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 I(u){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?P(Object(e),!0).forEach((function(t){B(u,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(e)):P(Object(e)).forEach((function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))}))}return u}var M={XXLARGE:p.tokens.fdsComponentSpacingXxl,XLARGE:p.tokens.fdsComponentSpacingXl,LARGE:p.tokens.fdsComponentSpacingLg,MEDIUM:p.tokens.fdsComponentSpacingMd,SMALL:p.tokens.fdsComponentSpacingSm,XSMALL:p.tokens.fdsComponentSpacingXs,XXSMALL:p.tokens.fdsComponentSpacingXxs,NONE:0},z="vertical",R="horizontal";function N(u,t){return t||(t=u.slice(0)),Object.freeze(Object.defineProperties(u,{raw:{value:Object.freeze(t)}}))}var U,V,$,W,G,X,q,K,J,H,Z,Y=e(3),Q=e.n(Y),uu=Q.a.div(U||(U=N(["\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===z?"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(Y.css)(V||(V=N(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(u){var t=u.$direction,e=u.$spacing;return t===z?Object(Y.css)($||($=N(["\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(Y.css)(W||(W=N(["\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)})),tu=["direction","alignItems","spacing","wrap","justifyContent","fullWidth"],eu=function(u){var t=u.direction,e=void 0===t?R:t,n=u.alignItems,r=void 0===n?"start":n,D=u.spacing,o=void 0===D?M.NONE:D,a=u.wrap,i=u.justifyContent,c=u.fullWidth,l=C(u,tu);return f.a.createElement(uu,Object.assign({},l,{$direction:e,$alignItems:r,$spacing:o,$wrap:a,$justifyContent:i,$fullWidth:c}),l.children)},nu=e(5),ru=e.n(nu),Du=function(){var u=l(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 S[u]})).reduce((function(u,t){return I(I({},u),{},B({},S[t].key,I(I({type:t.toUpperCase()},(null===n||void 0===n?void 0:n.code)?{searchTerm:n.name}:{}),S[t].groupedBy?{groupedBy:S[t].groupedBy}:{})))}),{}),0!==Object.keys(D).length){u.next=4;break}return u.abrupt("return",{results:{}});case 4:return u.next=6,ru.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)}}(),ou=Object(Y.createGlobalStyle)(G||(G=N(["\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"]))),au=Q()(p.Select)(X||(X=N(["\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"])),p.tokens.fdsBorderRadiusXl,p.tokens.fdsColorPrimaryBlue,p.tokens.fdsColorPrimaryBlue,p.tokens.fdsColorPrimaryBlue10,p.tokens.fdsComponentSpacingXxs,p.tokens.fdsSizeMd,(function(u){return"large"===u.size?"\n\t\t\tmargin-top: ".concat(p.tokens.fdsComponentSpacingSm," !important;\n\t\t"):"\n\t\t\tmargin-top: 5px !important;\n\t\t"}),p.tokens.fdsColorPrimaryBlue,p.tokens.fdsComponentSpacingXs,p.tokens.fdsSizeMd,p.tokens.fdsSizeMd,p.tokens.fdsColorPrimaryGray80,(function(u){return u.$hasError&&"\n\t\t.ant-select-selection {\n\t\t\tcolor: ".concat(p.tokens.fdsColorSemanticRed,";\n \t\tborder: 1px solid ").concat(p.tokens.fdsColorSemanticRed,";\n \t\tbackground-color: ").concat(p.tokens.fdsColorSemanticRed10,";\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ").concat(p.tokens.fdsColorSemanticRed,";\n\t\t}\n\t")})),iu=Q.a.span(q||(q=N(["\n\tfont-size: "," !important;\n"])),p.tokens.fdsFontSizeSm),cu=Q.a.div(K||(K=N(["\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"])),p.tokens.fdsFontSizeSm),lu=Q()(p.Menu)(J||(J=N(["\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"])),p.tokens.fdsBodyTextColorDisabled),su=Q.a.div(H||(H=N(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),p.tokens.fdsFontSizeSm,p.tokens.fdsSizeSm,p.tokens.fdsHeadingsFontFamily);Q()(p.Icon)(Z||(Z=N(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"])));function Fu(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 du,Cu,Eu,Au,fu,pu,vu,mu,Bu,hu,yu,gu,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)&&Fu(t.prototype,e),n&&Fu(t,n),u}(),wu=["address"],xu=function(u){return(u||"").trim().toUpperCase()},Su=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 xu((null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue))},Ou=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)},ku=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}},Lu=function(u){try{var t="string"===typeof(null===u||void 0===u?void 0:u.key)?JSON.parse(Ru(u.key)):u;return Ou(ku(t))}catch(e){return Ou(ku(u))}},_u=function(u){var t=function(u){return function(u){if(u){var t,e=u.label||u.selectedValue;return{key:Lu(u),label:e?f.a.createElement(f.a.Fragment,null,f.a.createElement(p.Icon,{type:u.sourceType?null===(t=S[u.sourceType])||void 0===t?void 0:t.icon:"location",size:"tiny"}),"\xa0",f.a.createElement(iu,null,e)):void 0}}}(u)};return Array.isArray(u)?u.map(t):t(u)},Tu=function(u){var t=I({},u),e=u[x].filter((function(u){return u.sourceType===g}));if(e.length>0){var n,r=t,D=r.address;t=I(I({},C(r,wu)),{},(B(n={},g,e),B(n,"address",D.filter((function(u){return u.type!==g}))),n))}return t},ju=function(u,t,e){return function(){var n=l(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,Du(o,D,e);case 5:return a=n.sent,(i=a.results)[x]&&(i=Tu(i)),n.abrupt("return",Object.keys(i).map((function(u){var t;return{label:(null===(t=S[u])||void 0===t?void 0:t.label)||u,options:i[u].map((function(u){return I(I({},u),{},{type:u.sourceType})}))}})));case 9:case"end":return n.stop()}}),n)})));return function(u){return n.apply(this,arguments)}}()},Pu=function(){var u=l(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=l(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=Ru(e),D=JSON.parse(n),u.abrupt("return",I({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)}}(),Iu=function(u,t,e,n,r){if(t===k){var D=Array.isArray(u)?u:[];if(D.length<=e)n(D),Pu(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)===h?e>1?"airports":"airport":e>1?"ports":"port";p.Message.danger(f.a.createElement(f.a.Fragment,null,f.a.createElement(v.TranslatableText,{stringId:"You cannot enter more than"})," "," ",e," "," ",f.a.createElement(v.TranslatableText,{stringId:i})))}}else n(u),Pu(u,r)},Mu=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()},zu=function(u){return u&&(u===x||u===w||u===b||u===g)},Ru=function(u){return"string"===typeof u?u.replace(/&quot;/g,'"').replace(/&#34;/g,'"').replace(/&amp;/g,"&"):u},Nu=function(u){return function(u){return(u||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[\u00df\u1e9e]/g,"ss").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()}(u).split(" ").filter(Boolean)},Uu=/^(?:[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])?$/,Vu=function(u){return(u||"").split(",")[0].trim()},$u=[/\b\d{5}\s?-\s?\d{4}\b/g,/\b\d{4}\s?-\s?\d{3}\b/g,/\b\d{3}\s?-\s?\d{4}\b/g,/\b\d{4}\s?[a-z]{2}\b/gi,/\b[a-z]{1,2}\d[a-z\d]?\s?\d[a-z]{2}\b/gi,/\b\d{4,6}\b/g],Wu=function(u){var t=T((u||"").split(",")),e=t[0],n=t.slice(1);if(0===n.length)return"";var r=n.map((function(u){return $u.reduce((function(u,t){return u.replace(t," ")}),u)})).map((function(u){return u.replace(/\s+/g," ").trim()})).filter(Boolean);return[e.trim()].concat(i(r)).join(", ")},Gu=function(u){var t=(u||"").trim();return Array.from(new Set([t,Vu(t),Wu(t)].filter(Boolean)))},Xu=function(u,t,e,n,r){var D=new Set(Nu(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===D.size)return 0;var o=Nu(null===u||void 0===u?void 0:u.postalOrZipCode);if(r.size>0&&o.length>0&&!o.some((function(u){return r.has(u)})))return 0;var a=function(u){return[].concat(i(Nu(null===u||void 0===u?void 0:u.city)),i(Nu((null===u||void 0===u?void 0:u.stateOrProvince)||(null===u||void 0===u?void 0:u.state))),i(Nu(null===u||void 0===u?void 0:u.postalOrZipCode)))}(u);if(a.length>0&&!a.some((function(u){return e.has(u)})))return 0;if(n){var c=function(u){var t=Nu(null===u||void 0===u?void 0:u.formattedNameOrAddress).filter((function(u){return Uu.test(u)}));return Nu(null===u||void 0===u?void 0:u.postalOrZipCode).forEach((function(u){var e=t.indexOf(u);-1!==e&&t.splice(e,1)})),t}(u);if(c.length>0&&!c.some((function(u){return e.has(u)})))return 0}return t.filter((function(u){return D.has(u)})).length/t.length},qu=function(u){var t=new Map;return u.forEach((function(u){var e=(null===u||void 0===u?void 0:u.code)||(null===u||void 0===u?void 0:u.selectedValue)||(null===u||void 0===u?void 0:u.formattedNameOrAddress);e&&!t.has(e)&&t.set(e,u)})),Array.from(t.values())},Ku=function(u,t){var e=Nu(t);if(0===e.length)return[];var n=new Set(e),r=function(u){var t=T((u||"").split(",")).slice(1).join(","),e=$u.reduce((function(u,e){return u.concat(t.match(e)||[])}),[]);return new Set(e.reduce((function(u,t){return u.concat(Nu(t))}),[]))}(t);return u.map((function(u){return{address:u,score:Xu(u,e,n,(null===u||void 0===u?void 0:u.sourceType)!==g,r)}})).filter((function(u){return u.score>=.5})).sort((function(u,t){return t.score-u.score}))},Ju=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]},Hu=function(u,t){var e=u[h]||[],n=u[y]||[],r=xu(t);return[].concat(i(e),i(n)).find((function(u){return xu(null===u||void 0===u?void 0:u.code)===r}))},Zu=function(u){var t=u.selectedValue||u.displayLabel||u.code,e=I(I({},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}},Yu=function(u){return(u||[]).some(zu)},Qu=function(){var u=l(r.a.mark((function u(t){var e,n,D,o,a,c,l;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.address,D=t.supportedLocationModes,o=t.customer,a=t.userCountryCode,u.next=3,Promise.all(Gu(n).map((function(u){return Du(D,u,o).then((function(u){return t=null===u||void 0===u?void 0:u.results,[].concat(i((null===t||void 0===t?void 0:t[x])||[]),i((null===t||void 0===t?void 0:t[g])||[]));var t})).catch((function(){return[]}))})));case 3:return c=u.sent,l=qu((e=[]).concat.apply(e,i(c))),u.abrupt("return",Ju(Ku(l,n),a));case 6:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),ut=function(){var u=l(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: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,!n){u.next=9;break}return u.next=7,Du(D,n,o).catch((function(){return null}));case 7:c=u.sent,i=Hu((null===c||void 0===c?void 0:c.results)||{},n);case 9:if(i||!e||!Yu(D)){u.next=13;break}return u.next=12,Qu({address:e,supportedLocationModes:D,customer:o,userCountryCode:a});case 12:i=u.sent;case 13:return u.abrupt("return",i?Zu(i):null);case 14:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),tt="totalShipment",et="unitsShipment",nt="containerPackages",rt="celsius",Dt="fahrenheit",ot="COL",at="ERT",it="CRT",ct=(B(fu={},"FRO",(B(du={},rt,"-10\xbaC or below"),B(du,Dt,"14\xbaF or below"),du)),B(fu,ot,(B(Cu={},rt,"From +2\xbaC To +8\xbaC"),B(Cu,Dt,"From 35.6\xbaF To 46.4\xbaF"),Cu)),B(fu,at,(B(Eu={},rt,"From +2\xbaC To +25\xbaC"),B(Eu,Dt,"From 35.6\xbaF To 77\xbaF"),Eu)),B(fu,it,(B(Au={},rt,"From +15\xbaC To +25\xbaC"),B(Au,Dt,"From 59\xbaF To 77\xbaF"),Au)),fu),lt="quotation",st="units",Ft="totals",dt="container",Ct="CBM",Et="CFT",At="kg",ft="box",pt="uld",vt=function(){var u=l(r.a.mark((function u(t){var e,n,D,o,a,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,a=void 0===o?{}:o,c=t.options,l=void 0===c?{}:c,s=function(){if("get"===e)return[Object.keys(a).length?"".concat(D,"?").concat(new URLSearchParams(a).toString()):D,l];if("post"===e){var u=I(I({},null===l||void 0===l?void 0:l.headers),{},{accept:"application/json","content-type":"multipart/form-data"});return[D,a,I(I({},l),{},{headers:u})]}return[D,a,l]}(),u.next=4,ru.a[e].apply(ru.a,i(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)}}(),mt=function(){var u=l(r.a.mark((function u(t){return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,vt({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)}}(),Bt=Q.a.div(pu||(pu=N(["\n\tcolor: ",";\n\tfont-size: ",";\n\tfont-weight: ",";\n\tmargin-bottom: ",";\n\ti {\n\t\tmargin-right: ",";\n\t}\n\n"])),p.tokens.fdsColorPrimaryGray60,p.tokens.fdsSizeXs,p.tokens.fdsFontWeightRegular,p.tokens.fdsComponentSpacingSm,p.tokens.fdsComponentSpacingSm),ht=Q()(eu)(vu||(vu=N(["\n\tpadding-left: 0 !important;\n"]))),yt=Q()(p.Icon)(mu||(mu=N(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),gt=Q.a.span(Bu||(Bu=N(["\n\twhite-space: nowrap;\n\tmin-width: 0;\n\tcolor: ",";\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\t","\n\t",";\n"])),p.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",";")})),bt=Q()(p.Avatar)(hu||(hu=N(["\n\tborder: 1px solid ",";\n\twidth: ",";\n\theight: ",";\n"])),p.tokens.fdsColorPrimaryGray20,p.tokens.fdsSizeSm,p.tokens.fdsSizeSm),wt=Q()(eu)(yu||(yu=N(["\n\toverflow: hidden !important;\n\tfont-size: 10px; //TODO: FSN-145\n\tline-height: 15px;\n\tflex: 1;\n\tmin-width: 0;\n"]))),xt=Q()(eu)(gu||(gu=N(["\n\t:last-child {\n\t\tpadding-bottom: 0 !important;\n\t}\n"]))),St=function(u){return u?u.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0"},Ot=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},kt=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,l=Object(A.useRef)(null),s=d(Object(A.useState)(!1),2),F=s[0],C=s[1];Object(A.useEffect)((function(){!function(){if(l.current){var u=l.current,t=u.scrollWidth>u.clientWidth;C(t)}}()}),[e]);var E=f.a.createElement(gt,{ref:l,"data-test-id":n,$isLocationLabel:a,$isPort:D},c||e);return F?f.a.createElement(p.Tooltip,{title:e,"data-test-id":"".concat(n,"-tooltip")},f.a.createElement(gt,{ref:l,"data-test-id":n,$isLocationLabel:a,$isPort:D},c||e)):E},Lt=function(u){var t=u.search,e=u.index,n=u.dataTestId,r=t.origin.length>1,D=t.destination.length>1,o=r?Ot(t.origin):B({},t.origin[0].country,t.origin),a=D?Ot(t.destination):B({},t.destination[0].country,t.destination);return f.a.createElement(eu,{alignItems:"center",spacing:M.XSMALL,fullWidth:!0},Object.keys(o).map((function(u){var t=o[u].map((function(u){return u.selectedValue})).join(", ");return f.a.createElement(kt,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-origin-").concat(e),isPort:o[u][0].type===y},f.a.createElement(bt,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-origin-flag-").concat(e),style:{marginRight:"4px"}}),t)})),f.a.createElement(p.Icon,{type:"arrow-forward",style:{marginRight:0,color:p.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(a).map((function(u){var t=a[u].map((function(u){return u.selectedValue})).join(", ");return f.a.createElement(kt,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-destination-").concat(e),isPort:a[u][0].type===y},f.a.createElement(bt,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-destination-flag-").concat(e),style:{marginRight:"4px"}}),t)})))},_t=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===Ft)return["box-total"];if(t===st){var e=u.shipment_details[et];return(null===e||void 0===e?void 0:e.packageType)===ft?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)===pt?["uld"]:["box"]}return t===dt?["container"]:["box"]}(r),c=Object(A.useMemo)((function(){return function(u){var t=u.shipment_details.type;if(u.platform_type===lt)return{units:0,volume:0,weight:0,weightUnit:At,volumeUnit:Ct};switch(t){case dt:var e,n=0,r=0;return null===(e=u.shipment_details[nt])||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 st:var D=u.shipment_details[et],o=(null===D||void 0===D?void 0:D.volumeUnit)===Et?1728:1e6;if((null===D||void 0===D?void 0:D.packageType)===ft){var a=St(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=St(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)===pt){var c=St(D.uldPackages.reduce((function(u,t){return u+parseFloat(t.volume||"0")}),0)),l=St(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:At,volumeUnit:Ct};case Ft:var s,F,d,C,E,A=St(parseFloat((null===(s=u.shipment_details[tt])||void 0===s?void 0:s.volume)||"0")),f=St(parseFloat((null===(F=u.shipment_details[tt])||void 0===F?void 0:F.weight)||"0"));return{units:(null===(d=u.shipment_details[tt])||void 0===d?void 0:d.units)||0,volume:A,weight:f,weightUnit:(null===(C=u.shipment_details[tt])||void 0===C?void 0:C.weightUnit)||At,volumeUnit:(null===(E=u.shipment_details[tt])||void 0===E?void 0:E.volumeUnit)||Ct};default:return{units:0,volume:0,weight:0,weightUnit:At,volumeUnit:Ct}}}(r)}),[r]),l=c.units,s=c.volume,F=c.weight,d=c.weightUnit,C=c.volumeUnit,E=1===r.commodity.length&&r.commodity[0].is_temperature,v=(null===(t=r.commodity_temperature)||void 0===t?void 0:t.tempRange)&&E?ct[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 f.a.createElement(eu,{spacing:M.XSMALL,alignItems:"center",fullWidth:!0,key:D},a===lt?f.a.createElement(wt,{alignItems:"center",spacing:M.SMALL,style:{flex:1}},i.map((function(u,t){return f.a.createElement(yt,{type:u,key:"".concat(D,"-").concat(t),size:"tiny","data-test-id":"".concat(o,"rs-package-icon-").concat(D,"-").concat(t)})})),f.a.createElement(kt,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(o,"rs-commodity-").concat(D)})):f.a.createElement(wt,{alignItems:"center",spacing:M.SMALL},f.a.createElement(eu,{alignItems:"center",spacing:M.XSMALL,"data-test-id":"rs-".concat(D,"-units")},l,"\xa0",i.map((function(u,t){return f.a.createElement(yt,{type:u,key:"".concat(D,"-").concat(t),size:"tiny","data-test-id":"".concat(o,"rs-package-icon-").concat(D,"-").concat(t)})}))),f.a.createElement("span",{"data-test-id":"".concat(o,"rs-volume-").concat(D)},s,"\xa0",C),F&&f.a.createElement("span",{"data-test-id":"".concat(o,"rs-weight-").concat(D)},F,"\xa0",d),f.a.createElement(kt,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(o,"rs-commodity-").concat(D)}),E&&f.a.createElement(eu,{alignItems:"center",spacing:M.XSMALL,"data-test-id":"".concat(o,"rs-temperature-").concat(D)},f.a.createElement(p.Icon,{type:"temperature-low",size:"tiny","data-test-id":"".concat(o,"rs-temperature-icon-").concat(D)}),f.a.createElement("span",{style:{whiteSpace:"nowrap"}},v))))},Tt=function(u){var t=u.search,e=u.index,n=u.setIsOpen,D=u.dataTestId,o=u.onRecentSearchSelect,a=function(){var u=l(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,mt(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 f.a.createElement(ht,{direction:z,fullWidth:!0,spacing:M.XSMALL,key:t.id,style:{padding:p.tokens.fdsComponentSpacingSm},"data-test-id":"".concat(D,"rs-card-").concat(e),onClick:function(){a()}},f.a.createElement(Lt,{search:t,index:e,dataTestId:D}),f.a.createElement(_t,{search:t,index:e,dataTestId:D}))},jt=function(u){var t=u.recentSearches,e=u.setIsOpen,n=u.dataTestId,r=u.onRecentSearchSelect,D=u.initialValues,o=t?function(u){return i(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 f.a.createElement(lu,null,f.a.createElement(Bt,null,f.a.createElement(p.Icon,{"data-test-id":"".concat(n,"rs-icon"),color:p.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),f.a.createElement(v.TranslatableText,{stringId:"Recent searches"})),f.a.createElement(xt,{direction:z,fullWidth:!0},o.map((function(u,t){return f.a.createElement(Tt,{onRecentSearchSelect:r,initialValues:D,search:u,index:t,key:u.id,setIsOpen:e,dataTestId:n})}))))},Pt=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?f.a.createElement(p.Spin,{size:"small"}):(null===e||void 0===e?void 0:e.length)>0&&!n.trim()?f.a.createElement(jt,{recentSearches:e,dataTestId:r,setIsOpen:D,onRecentSearchSelect:o,initialValues:a}):n.trim()?f.a.createElement(su,null,f.a.createElement(v.TranslatableText,{stringId:"No matching results",module:v.TRANSLATION_MODULES.SearchAndBook})):null:null},It=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode","defaultLocation","onChange"],Mt=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,c=u.value,s=u.debounceTimeout,F=void 0===s?800:s,E=u.activeLocationMode,v=u.defaultLocation,B=u.onChange,h=C(u,It),y=d(Object(A.useState)([]),2),g=y[0],b=y[1],w=d(Object(A.useState)(!1),2),x=w[0],k=w[1],L=d(Object(A.useState)(""),2),_=L[0],T=L[1],j=Object(A.useRef)(0),P=d(Object(A.useState)(!1),2),I=P[0],M=P[1],z=Object(A.useRef)();Object(A.useEffect)((function(){c&&0!==c.length||I||(b([]),T(""))}),[c,I]),Object(A.useEffect)((function(){return""!==E&&b((function(u){return u.filter((function(u){return u.label===S[E].label}))})),M(!1),z.current&&clearTimeout(z.current),z.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(){z.current&&clearTimeout(z.current)}}),[E]);var R=Object(A.useMemo)((function(){var u=function(){var u=l(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,b([]),k(!0),D=null,u.prev=6,u.next=9,t(e);case 9:o=u.sent,n===j.current&&(b(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&&p.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(m.debounce)(u,F)}),[t,F]);Object(A.useEffect)((function(){(null===v||void 0===v?void 0:v.code)&&function(){var u=l(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,b([]),k(!0),u.next=5,t(v.code);case 5:if(e=u.sent,b(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=S[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=Zu(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 N=x||_.trim()||(null===D||void 0===D?void 0:D.length)>0,U=I&&N?2:3;return f.a.createElement(f.a.Fragment,null,f.a.createElement(ou,null),f.a.createElement(au,Object.assign({maxTagCount:U,onSearch:R,$hasError:o,loading:x,options:g,filterOption:!1,notFoundContent:f.a.createElement(Pt,{isLoading:x,recentSearches:D,searchKey:_,dataTestId:i,setIsOpen:M,onRecentSearchSelect:h.onRecentSearchSelect,initialValues:h.initialValues}),mode:a,"data-test-id":"".concat(i,"-selector"),allowClear:a===O,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(u){M(u),b([]),T("")},open:I&&(x||_.trim()||(null===D||void 0===D?void 0:D.length)>0),value:c,onChange:B},h),e(g)))},zt=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 f.a.createElement(p.Tooltip,{title:n.join(",")},f.a.createElement(iu,{"data-test-id":"".concat(e,"-extra-ports")},"+".concat(t.length)))},Rt=["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,a=u.isOriginLocation,c=void 0===a||a,s=u.maxPorts,F=void 0===s?1:s,E=u.supportedLocationModes,m=u.customer,B=u.defaultLocation,h=u.autofillLocationAddress,y=u.autofillLocationCode,w=u.userCountryCode,x=C(u,Rt),T=d(Object(A.useState)(t),2),P=T[0],I=T[1],z=d(Object(A.useState)(1===E.length?E[0]:""),2),R=z[0],N=z[1],U=d(Object(A.useState)(zu(R)||""===R?O:k),2),V=U[0],$=U[1],W=Object(A.useRef)(t),G=Object(A.useRef)(null);Object(A.useEffect)((function(){zu(R)?$(O):$(k)}),[R]),Object(A.useEffect)((function(){I(t),W.current=t,Array.isArray(t)&&t.length>0?N(t[0].type):(null===B||void 0===B?void 0:B.type)?N(B.type):N("")}),[t,null===B||void 0===B?void 0:B.type]);var X=Object(A.useRef)({onChange:e,selectionMode:V,maxPorts:F});return Object(A.useEffect)((function(){X.current={onChange:e,selectionMode:V,maxPorts:F}}),[e,V,F]),Object(A.useEffect)((function(){var u="".concat(h||"","::").concat(y||"");if((h||y)&&u!==G.current){var t=W.current,e=X.current,n=e.selectionMode,D=e.maxPorts,o=n===k&&"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=l(r.a.mark((function t(){var e,n,D,o,a,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,ut({autofillLocationAddress:h,autofillLocationCode:y,supportedLocationModes:E,customer:m,userCountryCode:w});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,a=n.maxPorts,c=W.current,!(o===k&&"number"===typeof a&&a>1&&Array.isArray(c))){t.next=19;break}if(l=Su(e),s=new Set((c||[]).map((function(u){return xu((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=_u(c)||[],d=Array.isArray(F)?F.filter(Boolean):[],C=[].concat(i(d),[e]).slice(0,a),Iu(C,o,a,I,D),t.next=20;break;case 19:Iu(o===k?[e]:e,o,a,I,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)}})()()}}),[h,y,E,m,w]),f.a.createElement(Mt,Object.assign({mode:V,dataTestId:o,hasError:n,placeholder:f.a.createElement(v.TranslatableText,{style:{fontSize:p.tokens.fdsFontSizeBase},stringId:"Select ".concat(c?L:_)}),value:_u(P),fetchOptions:ju(R,E,m),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(S).find((function(t){return t.label===u.label})),r=null===n||void 0===n?void 0:n.icon;return f.a.createElement(p.Select.OptGroup,{label:f.a.createElement("span",{style:{fontFamily:"Open Sans"}},f.a.createElement(p.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 f.a.createElement(p.Option,{value:Lu(e),title:D,"data-test-id":"".concat(t,"-").concat(u.label,"-").concat(D),style:{paddingLeft:"8px"},label:f.a.createElement(f.a.Fragment,null,f.a.createElement(p.Icon,{type:r,size:"tiny"}),"\xa0",f.a.createElement(iu,null,D)),key:e.code},f.a.createElement(eu,{fullWidth:!0,justifyContent:"space-between"},f.a.createElement(eu,{spacing:M.XSMALL},f.a.createElement("span",null,f.a.createElement(p.Avatar,{type:"flag",country:n,size:"small",style:{width:p.tokens.fdsSizeSm,height:p.tokens.fdsSizeSm}})),f.a.createElement(cu,null,o)),a===g&&f.a.createElement(p.Icon,{type:"amazon",size:"small"}),a===b&&f.a.createElement(p.Chip,{type:"neutral",iconType:"address-book"})))})))}))}(u,o)},onChange:function(u){var t=null!==u&&void 0!==u?u:[],n=V===k&&Array.isArray(t)&&t.length>0?function(u,t){var e,n=new Map,r=j(Array.isArray(t)?t:[]);try{for(r.s();!(e=r.n()).done;){var D,o=e.value,a=Mu(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,l=j(u);try{for(l.s();!(i=l.n()).done;){var s,F=i.value,C=Mu(F);C&&c.set(C,(null!==(s=c.get(C))&&void 0!==s?s:0)+1)}}catch(h){l.e(h)}finally{l.f()}var E,A=j(c);try{for(A.s();!(E=A.n()).done;){var f,p=d(E.value,2),v=p[0],m=p[1],B=null!==(f=n.get(v))&&void 0!==f?f:0;if(m>B&&B>0)return v}}catch(h){A.e(h)}finally{A.f()}return null}(t,P):null;null!==n?function(u,t,e,n){var r=(Array.isArray(t)?t:[]).filter((function(t){return Mu(t)!==u}));e(r),Pu(r,n)}(n,P,I,e):Iu(t,V,F,I,e),N("")},activeLocationMode:R,maxTagPlaceholder:function(u){return f.a.createElement(zt,{omittedPorts:u,dataTestId:o})},defaultLocation:B},x))}}])}));
1
+ /*! For license information please see main.bundle.js.LICENSE.txt */
2
+ !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("@freightos/design-system"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash"),require("react"),require("styled-components")):"function"===typeof define&&define.amd?define("FusionLocationInput",["@freightos/design-system","@freightos/freightos-i18n","@freightos/http-client","lodash","react","styled-components"],t):"object"===typeof exports?exports.FusionLocationInput=t(require("@freightos/design-system"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash"),require("react"),require("styled-components")):e.FusionLocationInput=t(e["@freightos/design-system"],e["@freightos/freightos-i18n"],e["@freightos/http-client"],e.lodash,e.React,e["styled-components"])}(globalThis,(e,t,o,n,r,i)=>(()=>{"use strict";var s={926(t){t.exports=e},906(e){e.exports=t},570(e){e.exports=o},96(e){e.exports=n},12(e){e.exports=r},230(e){e.exports=i}};const a={};function l(e){const t=a[e];if(void 0!==t)return t.exports;const o=a[e]={exports:{}};return s[e](o,o.exports,l),o.exports}l.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.cw=e=>{var t;return()=>{if(e){var o=e;e=0,t={exports:{}},o.call(t.exports,t,t.exports)}return t.exports}},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let d={};l.r(d),l.d(d,{default:()=>Je});var c=l.cw(function(e,t){var o=p(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,o){var r,l={},d=null,c=null;for(r in void 0!==o&&(d=""+o),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,r)&&!a.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:n,type:e,key:d,ref:c,props:l,_owner:s.current}}t.Fragment=r,t.jsx=l,t.jsxs=l}),u=l.cw(function(e,t){e.exports=c()}),p=()=>l(12);p();var m=l(926),f=l(906),h=l(96);const g="airport",y="seaport",v="fulfillment_center",x="address_book",S="last_mile_address",b="address",w={[g]:{label:"Airports",key:g,icon:"mode-air"},[y]:{label:"Ports",key:y,icon:"mode-ship"},[v]:{label:"Fulfillment centers",key:v,icon:"fulfillment-center"},[x]:{key:x,groupedBy:"address"},[S]:{key:S,groupedBy:"address"},[b]:{label:"Address",key:b,icon:"location"}},$="single",C="multiple",L="origin",k="destination",j={XXLARGE:m.tokens.fdsComponentSpacingXxl,XLARGE:m.tokens.fdsComponentSpacingXl,LARGE:m.tokens.fdsComponentSpacingLg,MEDIUM:m.tokens.fdsComponentSpacingMd,SMALL:m.tokens.fdsComponentSpacingSm,XSMALL:m.tokens.fdsComponentSpacingXs,XXSMALL:m.tokens.fdsComponentSpacingXxs,NONE:0},T={VERTICAL:"vertical",HORIZONTAL:"horizontal"};var _=l(230),O=l.n(_);const I=O().div`
3
+ display: flex;
4
+ flex-direction: ${e=>{let{$direction:t}=e;return t===T.VERTICAL?"column":"row"}};
5
+ flex-wrap: ${e=>{let{$wrap:t}=e;return t?"wrap":"nowrap"}};
6
+ align-items: ${e=>{let{$alignItems:t}=e;return t}};
7
+ justify-content: ${e=>{let{$justifyContent:t}=e;return t}};
8
+ box-sizing: border-box;
9
+
10
+ ${e=>{let{$fullWidth:t}=e;return t&&_.css`
11
+ width: 100%;
12
+ `}}
13
+ ${e=>{let{$direction:t,$spacing:o}=e;return t===T.VERTICAL?_.css`
14
+ > *:not(:first-child) {
15
+ margin-top: ${o};
16
+ }
17
+ `:_.css`
18
+ > *:not(:first-child) {
19
+ margin-left: ${o};
20
+ }
21
+ `}};
22
+ `;u();const A=e=>{let{direction:t=T.HORIZONTAL,alignItems:o="start",spacing:n=j.NONE,wrap:r,justifyContent:i,fullWidth:s,...a}=e;return(0,c().jsx)(I,{...a,$direction:t,$alignItems:o,$spacing:n,$wrap:r,$justifyContent:i,$fullWidth:s,children:a.children})};var P=l(570),F=l.n(P);const R=async(e,t,o)=>{try{const n=(e||[]).filter(e=>w[e]).reduce((e,t)=>({...e,[w[t].key]:{type:t.toUpperCase(),...null!==o&&void 0!==o&&o.code?{searchTerm:o.name}:{},...w[t].groupedBy?{groupedBy:w[t].groupedBy}:{}}}),{});if(0===Object.keys(n).length)return{results:{}};return(await F().post("/geocoder/api/v3/geocoder/locations",{query:t,limit:5,sources:n})).data}catch(n){return console.error("Error fetching locations:",n),{results:{}}}},z=_.createGlobalStyle`
23
+ .ant-select-dropdown {
24
+ .ant-select-dropdown-menu {
25
+ max-height: 400px;
26
+ padding: 0 !important;
27
+ margin-top: 0 !important;
28
+ }
29
+ }
30
+ `,E=O()(m.Select)`
31
+ .ant-select-selection__rendered {
32
+ min-width: 100% !important;
33
+ }
34
+
35
+ li.ant-select-selection__choice {
36
+ border-radius: ${m.tokens.fdsBorderRadiusXl};
37
+ border: none;
38
+ border-color: ${m.tokens.fdsColorPrimaryBlue};
39
+ color: ${m.tokens.fdsColorPrimaryBlue};
40
+ background-color: ${m.tokens.fdsColorPrimaryBlue10};
41
+ line-height: 10px !important;
42
+ margin-right: ${m.tokens.fdsComponentSpacingXxs};
43
+ width: fit-content;
44
+ max-width: 90px;
45
+ height: ${m.tokens.fdsSizeMd} !important;
46
+ ${e=>{let{size:t}=e;return"large"===t?`\n\t\t\tmargin-top: ${m.tokens.fdsComponentSpacingSm} !important;\n\t\t`:"\n\t\t\tmargin-top: 5px !important;\n\t\t"}}
47
+
48
+ .ant-select-selection__choice__remove {
49
+ color: ${m.tokens.fdsColorPrimaryBlue};
50
+ margin-top: ${m.tokens.fdsComponentSpacingXs} !important;
51
+ }
52
+
53
+ .ant-select-selection__choice__content {
54
+ line-height: ${m.tokens.fdsSizeMd} !important;
55
+ height: ${m.tokens.fdsSizeMd} !important;
56
+ }
57
+ }
58
+
59
+ li.ant-select-selection__choice__disabled {
60
+ border: none;
61
+ background-color: transparent;
62
+ padding: 0;
63
+ padding-left: 0;
64
+ width: fit-content;
65
+ }
66
+
67
+ .ant-select-dropdown .ant-select-not-found {
68
+ cursor: pointer !important;
69
+ }
70
+
71
+ .ant-select-selection-selected-value {
72
+ max-width: 280px !important;
73
+ }
74
+
75
+ li.ant-select-search.ant-select-search--inline {
76
+ margin-left: -1px !important;
77
+ }
78
+ .ant-select-search__field {
79
+ color: ${m.tokens.fdsColorPrimaryGray80} !important;
80
+ }
81
+ ${e=>{let{$hasError:t}=e;return t&&`\n\t\t.ant-select-selection {\n\t\t\tcolor: ${m.tokens.fdsColorSemanticRed};\n \t\tborder: 1px solid ${m.tokens.fdsColorSemanticRed};\n \t\tbackground-color: ${m.tokens.fdsColorSemanticRed10};\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ${m.tokens.fdsColorSemanticRed};\n\t\t}\n\t`}}
82
+ `,M=O().span`
83
+ font-size: ${m.tokens.fdsFontSizeSm} !important;
84
+ `,N=O().div`
85
+ font-size: ${m.tokens.fdsFontSizeSm} !important;
86
+ overflow: hidden;
87
+ text-overflow: ellipsis;
88
+ display: -webkit-box;
89
+ -webkit-line-clamp: 2;
90
+ -webkit-box-orient: vertical;
91
+ `,U=O()(m.Menu)`
92
+ cursor: pointer !important;
93
+
94
+ .ant-menu-item-group-title {
95
+ padding: 0;
96
+ color: ${m.tokens.fdsBodyTextColorDisabled};
97
+ }
98
+
99
+ .ant-menu-item {
100
+ padding: 0;
101
+ white-space: normal;
102
+ line-height: normal;
103
+
104
+ &:hover {
105
+ background-color: #f5f5f5;
106
+ }
107
+ }
108
+ `,V=O().div`
109
+ font-size: ${m.tokens.fdsFontSizeSm};
110
+ line-height: ${m.tokens.fdsSizeSm};
111
+ font-family: ${m.tokens.fdsHeadingsFontFamily};
112
+ `;O()(m.Icon)`
113
+ margin-right: 0 !important;
114
+ vertical-align: bottom;
115
+ `;const B=e=>(e||"").trim().toUpperCase(),X=e=>{const t=(e=>{try{return"string"===typeof e?JSON.parse(e):null}catch{return null}})(null===e||void 0===e?void 0:e.key);return B((null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue))},D=e=>{const t=[];JSON.stringify(e,(e,o)=>(t.push(e),o));const o=Array.from(new Set(t)).sort();return JSON.stringify(e,o)},q=e=>{const{displayLabel:t,selectedValue:o,formattedNameOrAddress:n,code:r,countryCode:i,stateOrProvince:s,city:a,latitude:l,longitude:d,postalOrZipCode:c,sourceType:u,locationType:p,type:m,countryName:f}=e||{};return{displayLabel:t,selectedValue:o||r,formattedNameOrAddress:n,code:r||o,country:i,countryName:f,stateOrProvince:null!==s&&void 0!==s?s:null,city:null!==a&&void 0!==a?a:null,latitude:null!==l&&void 0!==l?l:null,longitude:null!==d&&void 0!==d?d:null,postalOrZipCode:null!==c&&void 0!==c?c:null,sourceType:null!==u&&void 0!==u?u:null,locationType:null!==p&&void 0!==p?p:null,type:null!==m&&void 0!==m?m:u}},G=e=>{try{const t="string"===typeof(null===e||void 0===e?void 0:e.key)?JSON.parse(Q(e.key)):e;return D(q(t))}catch{return D(q(e))}},W=e=>{const t=e=>(e=>{if(e){var t;const o=e.label||e.selectedValue;return{key:G(e),label:o?(0,c().jsxs)(c().Fragment,{children:[(0,c().jsx)(m.Icon,{type:e.sourceType?null===(t=w[e.sourceType])||void 0===t?void 0:t.icon:"location",size:"tiny"}),"\xa0",(0,c().jsx)(M,{children:o})]}):void 0}}})(e);return Array.isArray(e)?e.map(t):t(e)},J=(e,t,o)=>async n=>{if(!n)return[];const r=""!==e?[e]:t;let i=(await R(r,n,o)).results;return i[b]&&(i=(e=>{let t={...e};const o=e[b].filter(e=>e.sourceType===v);if(o.length>0){const{address:e,...n}=t;t={...n,[v]:o,address:e.filter(e=>e.type!==v)}}return t})(i)),Object.keys(i).map(e=>{var t;return{label:(null===(t=w[e])||void 0===t?void 0:t.label)||e,options:i[e].map(e=>({...e,type:e.sourceType}))}})},Z=async(e,t)=>{const o=Array.isArray(e)?e:[e];t((await Promise.all(o.map(async e=>{try{const t=null===e||void 0===e?void 0:e.key,o=Q(t);return{key:o,...JSON.parse(o)}}catch(t){return}}))).filter(Boolean))},H=(e,t,o,n,r)=>{if(t===C){const t=Array.isArray(e)?e:[];if(t.length<=o)n(t),Z(t,r);else{var i,s;const e=(null===(i=JSON.parse(null===(s=t[0])||void 0===s?void 0:s.key))||void 0===i?void 0:i.sourceType)===g?o>1?"airports":"airport":o>1?"ports":"port";m.Message.danger((0,c().jsxs)(c().Fragment,{children:[(0,c().jsx)(f.TranslatableText,{stringId:"You cannot enter more than"})," "," ",o," "," ",(0,c().jsx)(f.TranslatableText,{stringId:e})]}))}}else n(e),Z(e,r)},K=e=>{var t,o,n;let r=null;try{if("string"===typeof(null===e||void 0===e?void 0:e.key)){const t=JSON.parse(e.key);r=(null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue)||null}}catch{}return((null!==(t=null!==(o=null!==(n=r)&&void 0!==n?n:null===e||void 0===e?void 0:e.code)&&void 0!==o?o:null===e||void 0===e?void 0:e.selectedValue)&&void 0!==t?t:"")||"").trim().toUpperCase()},Y=e=>e&&(e===b||e===S||e===x||e===v),Q=e=>"string"===typeof e?e.replace(/&quot;/g,'"').replace(/&#34;/g,'"').replace(/&amp;/g,"&"):e,ee=e=>(e=>(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[\u00df\u1e9e]/g,"ss").replace(/[^\p{L}\p{N}]+/gu," ").trim())(e).split(" ").filter(Boolean),te=/^\p{Nd}+\p{L}?$/u,oe=e=>(e||"").split(",")[0].trim(),ne=[/\b\d{5}\s?-\s?\d{4}\b/g,/\b\d{4}\s?-\s?\d{3}\b/g,/\b\d{3}\s?-\s?\d{4}\b/g,/\b\d{4}\s?[a-z]{2}\b/gi,/\b[a-z]{1,2}\d[a-z\d]?\s?\d[a-z]{2}\b/gi,/\b\d{4,6}\b/g],re=e=>{const[t,...o]=(e||"").split(",");if(0===o.length)return"";const n=o.map(e=>ne.reduce((e,t)=>e.replace(t," "),e)).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean);return[t.trim(),...n].join(", ")},ie=(e,t,o,n,r)=>{const i=new Set(ee((e=>[null===e||void 0===e?void 0:e.formattedNameOrAddress,null===e||void 0===e?void 0:e.displayLabel,null===e||void 0===e?void 0:e.selectedValue].filter(Boolean).join(" "))(e)));if(0===i.size)return 0;const s=ee(null===e||void 0===e?void 0:e.postalOrZipCode);if(r.size>0&&s.length>0&&!s.some(e=>r.has(e)))return 0;const a=(e=>[...ee(null===e||void 0===e?void 0:e.city),...ee((null===e||void 0===e?void 0:e.stateOrProvince)||(null===e||void 0===e?void 0:e.state)),...ee(null===e||void 0===e?void 0:e.postalOrZipCode)])(e);if(a.length>0&&!a.some(e=>o.has(e)))return 0;if(n){const t=(e=>{const t=ee(null===e||void 0===e?void 0:e.formattedNameOrAddress).filter(e=>te.test(e));return ee(null===e||void 0===e?void 0:e.postalOrZipCode).forEach(e=>{const o=t.indexOf(e);-1!==o&&t.splice(o,1)}),t})(e);if(t.length>0&&!t.some(e=>o.has(e)))return 0}return t.filter(e=>i.has(e)).length/t.length},se=(e,t)=>{const o=ee(t);if(0===o.length)return[];const n=new Set(o),r=(e=>{const[,...t]=(e||"").split(","),o=t.join(","),n=ne.reduce((e,t)=>e.concat(o.match(t)||[]),[]);return new Set(n.reduce((e,t)=>e.concat(ee(t)),[]))})(t);return e.map(e=>({address:e,score:ie(e,o,n,(null===e||void 0===e?void 0:e.sourceType)!==v,r)})).filter(e=>{let{score:t}=e;return t>=.5}).sort((e,t)=>t.score-e.score)},ae=e=>{const t=e.selectedValue||e.displayLabel||e.code,o={...e,selectedValue:t,displayLabel:e.displayLabel||t,country:e.countryCode||e.country,type:e.type||e.sourceType};return o.country&&delete o.countryCode,{key:JSON.stringify(o),label:t}},le=async e=>{let{address:t,supportedLocationModes:o,customer:n,userCountryCode:r}=e;const i=await Promise.all((e=>{const t=(e||"").trim();return Array.from(new Set([t,oe(t),re(t)].filter(Boolean)))})(t).map(e=>R(o,e,n).then(e=>{return[...(null===(t=null===e||void 0===e?void 0:e.results)||void 0===t?void 0:t[b])||[],...(null===t||void 0===t?void 0:t[v])||[]];var t}).catch(()=>[]))),s=(e=>{const t=new Map;return e.forEach(e=>{const o=(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.selectedValue)||(null===e||void 0===e?void 0:e.formattedNameOrAddress);o&&!t.has(o)&&t.set(o,e)}),Array.from(t.values())})([].concat(...i));return((e,t)=>{if(0===e.length)return null;const o=e[0].score,n=e.filter(e=>{let{score:t}=e;return t===o}).map(e=>{let{address:t}=e;return t});if(1===n.length||!t)return n[0];const r=t.toLowerCase();return n.find(e=>(e.countryCode||e.country||"").toLowerCase()===r)||n[0]})(se(s,t),r)},de=async e=>{let{autofillLocationAddress:t,autofillLocationCode:o,supportedLocationModes:n,customer:r,userCountryCode:i}=e;if(!t&&!o)return null;let s=null;if(o){const e=await R(n,o,r).catch(()=>null);s=((e,t)=>{const o=e[g]||[],n=e[y]||[],r=B(t);return[...o,...n].find(e=>B(null===e||void 0===e?void 0:e.code)===r)})((null===e||void 0===e?void 0:e.results)||{},o)}return!s&&t&&(e=>(e||[]).some(Y))(n)&&(s=await le({address:t,supportedLocationModes:n,customer:r,userCountryCode:i})),s?ae(s):null},ce="totalShipment",ue="unitsShipment",pe="containerPackages",me="celsius",fe="fahrenheit",he="FRO",ge="COL",ye="ERT",ve="CRT",xe={[he]:{[me]:"-10\xbaC or below",[fe]:"14\xbaF or below"},[ge]:{[me]:"From +2\xbaC To +8\xbaC",[fe]:"From 35.6\xbaF To 46.4\xbaF"},[ye]:{[me]:"From +2\xbaC To +25\xbaC",[fe]:"From 35.6\xbaF To 77\xbaF"},[ve]:{[me]:"From +15\xbaC To +25\xbaC",[fe]:"From 59\xbaF To 77\xbaF"}},Se="quotation",be="units",we="totals",$e="container",Ce="CBM",Le="CFT",ke="kg",je="box",Te="uld";const _e=async e=>{await(async e=>{let{method:t,url:o="",data:n={},options:r={}}=e;const i=(()=>{if("get"===t)return[Object.keys(n).length?`${o}?${new URLSearchParams(n).toString()}`:o,r];if("post"===t){const e={...null===r||void 0===r?void 0:r.headers,accept:"application/json","content-type":"multipart/form-data"};return[o,n,{...r,headers:e}]}return[o,n,r]})();return await F()[t](...i)})({method:"put",url:"/webcargo-alpha/backend/api.php",options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:e}})},Oe=O().div`
116
+ color: ${m.tokens.fdsColorPrimaryGray60};
117
+ font-size: ${m.tokens.fdsSizeXs};
118
+ font-weight: ${m.tokens.fdsFontWeightRegular};
119
+ margin-bottom: ${m.tokens.fdsComponentSpacingSm};
120
+ i {
121
+ margin-right: ${m.tokens.fdsComponentSpacingSm};
122
+ }
123
+
124
+ `,Ie=O()(A)`
125
+ padding-left: 0 !important;
126
+ `,Ae=O()(m.Icon)`
127
+ margin-right: 0 !important;
128
+ vertical-align: bottom;
129
+ `,Pe=O().span`
130
+ white-space: nowrap;
131
+ min-width: 0;
132
+ color: ${m.tokens.fdsColorPrimaryGray80};
133
+ overflow: hidden;
134
+ text-overflow: ellipsis;
135
+ ${e=>{let{$isLocationLabel:t}=e;return!t&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}}
136
+ ${e=>{let{$isPort:t}=e;if(void 0!==t)return`min-width: ${t?"65px":"55px"};`}};
137
+ `,Fe=O()(m.Avatar)`
138
+ border: 1px solid ${m.tokens.fdsColorPrimaryGray20};
139
+ width: ${m.tokens.fdsSizeSm};
140
+ height: ${m.tokens.fdsSizeSm};
141
+ `,Re=O()(A)`
142
+ overflow: hidden !important;
143
+ font-size: 10px; //TODO: FSN-145
144
+ line-height: 15px;
145
+ flex: 1;
146
+ min-width: 0;
147
+ `,ze=O()(A)`
148
+ :last-child {
149
+ padding-bottom: 0 !important;
150
+ }
151
+ `,Ee=e=>e?e.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0",Me=e=>{const t=e.reduce((e,t)=>{const o=t.country;return e[o]||(e[o]=[]),e[o].push(t),e},{});return Object.keys(t).forEach(e=>{t[e].sort((e,t)=>(e.selectedValue||"").localeCompare(t.selectedValue||""))}),t},Ne=e=>{let{text:t="",testId:o,isPort:n,isLocationLabel:r=!1,children:i=null}=e;const s=(0,p().useRef)(null),[a,l]=(0,p().useState)(!1);(0,p().useEffect)(()=>{(()=>{if(s.current){const e=s.current,t=e.scrollWidth>e.clientWidth;l(t)}})()},[t]);const d=(0,c().jsx)(Pe,{ref:s,"data-test-id":o,$isLocationLabel:r,$isPort:n,children:i||t});return a?(0,c().jsx)(m.Tooltip,{title:t,"data-test-id":`${o}-tooltip`,children:(0,c().jsx)(Pe,{ref:s,"data-test-id":o,$isLocationLabel:r,$isPort:n,children:i||t})}):d},Ue=e=>{let{search:t,index:o,dataTestId:n}=e;const r=t.origin.length>1,i=t.destination.length>1,s=r?Me(t.origin):{[t.origin[0].country]:t.origin},a=i?Me(t.destination):{[t.destination[0].country]:t.destination};return(0,c().jsxs)(A,{alignItems:"center",spacing:j.XSMALL,fullWidth:!0,children:[Object.keys(s).map(e=>{const t=s[e].map(e=>e.selectedValue).join(", ");return(0,c().jsxs)(Ne,{text:t,isLocationLabel:!0,testId:`${n}-origin-${o}`,isPort:s[e][0].type===y,children:[(0,c().jsx)(Fe,{type:"flag",country:e,size:"small","data-test-id":`${n}-origin-flag-${o}`,style:{marginRight:"4px"}}),t]},e)}),(0,c().jsx)(m.Icon,{type:"arrow-forward",style:{marginRight:0,color:m.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(a).map(e=>{const t=a[e].map(e=>e.selectedValue).join(", ");return(0,c().jsxs)(Ne,{text:t,isLocationLabel:!0,testId:`${n}-destination-${o}`,isPort:a[e][0].type===y,children:[(0,c().jsx)(Fe,{type:"flag",country:e,size:"small","data-test-id":`${n}-destination-flag-${o}`,style:{marginRight:"4px"}}),t]},e)})]})},Ve=e=>{var t,o,n;let{search:r,index:i,dataTestId:s}=e;const a=r.platform_type,l=(e=>{const t=e.shipment_details.type;if(t===we)return["box-total"];if(t===be){const t=e.shipment_details[ue];return(null===t||void 0===t?void 0:t.packageType)===je?t.boxPackages.reduce((e,t)=>{var o,n;const r=null===(o=t.type)||void 0===o||null===(n=o.value)||void 0===n?void 0:n.icon;return e.includes(r)||e.push(r),e},[]):(null===t||void 0===t?void 0:t.packageType)===Te?["uld"]:["box"]}return t===$e?["container"]:["box"]})(r),{units:d,volume:u,weight:f,weightUnit:h,volumeUnit:g}=(0,p().useMemo)(()=>(e=>{const t=e.shipment_details.type;if(e.platform_type===Se)return{units:0,volume:0,weight:0,weightUnit:ke,volumeUnit:Ce};switch(t){case $e:{var o;let t=0,n=0;return null===(o=e.shipment_details[pe])||void 0===o||o.forEach(e=>{const o=Number(e.units)||0;if(o>0){t+=o;const r=parseInt(e.dimensions.value,10);n+=o*(r/20)}}),{units:t,volume:n,weight:null,weightUnit:null,volumeUnit:"TEU"}}case be:{const t=e.shipment_details[ue],o=(null===t||void 0===t?void 0:t.volumeUnit)===Le?1728:1e6;if((null===t||void 0===t?void 0:t.packageType)===je){const e=Ee(null===t||void 0===t?void 0:t.boxPackages.reduce((e,t)=>e+parseFloat(t.width||"0")*parseFloat(t.height||"0")*parseFloat(t.length||"0")*parseFloat(t.units||"0")/o,0)),n=Ee(t.boxPackages.reduce((e,t)=>e+parseFloat(t.weight||"0"),0));return{units:t.boxPackages.reduce((e,t)=>e+parseFloat(t.units||"0"),0),volume:e,weight:n,weightUnit:t.weightUnit,volumeUnit:t.volumeUnit}}if((null===t||void 0===t?void 0:t.packageType)===Te){const e=Ee(t.uldPackages.reduce((e,t)=>e+parseFloat(t.volume||"0"),0)),o=Ee(t.uldPackages.reduce((e,t)=>e+parseFloat(t.weight||"0"),0));return{units:t.uldPackages.length,volume:e,weight:o,weightUnit:t.weightUnit,volumeUnit:t.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:ke,volumeUnit:Ce}}case we:{var n,r,i,s,a;const t=Ee(parseFloat((null===(n=e.shipment_details[ce])||void 0===n?void 0:n.volume)||"0")),o=Ee(parseFloat((null===(r=e.shipment_details[ce])||void 0===r?void 0:r.weight)||"0"));return{units:(null===(i=e.shipment_details[ce])||void 0===i?void 0:i.units)||0,volume:t,weight:o,weightUnit:(null===(s=e.shipment_details[ce])||void 0===s?void 0:s.weightUnit)||ke,volumeUnit:(null===(a=e.shipment_details[ce])||void 0===a?void 0:a.volumeUnit)||Ce}}default:return{units:0,volume:0,weight:0,weightUnit:ke,volumeUnit:Ce}}})(r),[r]),y=1===r.commodity.length&&r.commodity[0].is_temperature,v=null!==(t=r.commodity_temperature)&&void 0!==t&&t.tempRange&&y?xe[null===(o=r.commodity_temperature)||void 0===o?void 0:o.tempRange][null===(n=r.commodity_temperature)||void 0===n?void 0:n.temperatureSystem]:"";return(0,c().jsx)(A,{spacing:j.XSMALL,alignItems:"center",fullWidth:!0,children:a===Se?(0,c().jsxs)(Re,{alignItems:"center",spacing:j.SMALL,style:{flex:1},children:[l.map((e,t)=>(0,c().jsx)(Ae,{type:e,size:"tiny","data-test-id":`${s}rs-package-icon-${i}-${t}`},`${i}-${t}`)),(0,c().jsx)(Ne,{text:r.commodity.map(e=>e.label).join(", "),testId:`${s}rs-commodity-${i}`})]}):(0,c().jsxs)(Re,{alignItems:"center",spacing:j.SMALL,children:[(0,c().jsxs)(A,{alignItems:"center",spacing:j.XSMALL,"data-test-id":`rs-${i}-units`,children:[d,"\xa0",l.map((e,t)=>(0,c().jsx)(Ae,{type:e,size:"tiny","data-test-id":`${s}rs-package-icon-${i}-${t}`},`${i}-${t}`))]}),(0,c().jsxs)("span",{"data-test-id":`${s}rs-volume-${i}`,children:[u,"\xa0",g]}),f&&(0,c().jsxs)("span",{"data-test-id":`${s}rs-weight-${i}`,children:[f,"\xa0",h]}),(0,c().jsx)(Ne,{text:r.commodity.map(e=>e.label).join(", "),testId:`${s}rs-commodity-${i}`}),y&&(0,c().jsxs)(A,{alignItems:"center",spacing:j.XSMALL,"data-test-id":`${s}rs-temperature-${i}`,children:[(0,c().jsx)(m.Icon,{type:"temperature-low",size:"tiny","data-test-id":`${s}rs-temperature-icon-${i}`}),(0,c().jsx)("span",{style:{whiteSpace:"nowrap"},children:v})]})]})},i)},Be=e=>{let{search:t,index:o,setIsOpen:n,dataTestId:r,onRecentSearchSelect:i}=e;return(0,c().jsxs)(Ie,{direction:T.VERTICAL,fullWidth:!0,spacing:j.XSMALL,style:{padding:m.tokens.fdsComponentSpacingSm},"data-test-id":`${r}rs-card-${o}`,onClick:()=>{(async()=>{i(t);try{await _e(t.id)}catch(e){console.error(e)}n(!1)})()},children:[(0,c().jsx)(Ue,{search:t,index:o,dataTestId:r}),(0,c().jsx)(Ve,{search:t,index:o,dataTestId:r})]},t.id)},Xe=e=>{let{recentSearches:t,setIsOpen:o,dataTestId:n,onRecentSearchSelect:r,initialValues:i}=e;const s=t?(e=>[...e].sort((e,t)=>{if(e.is_saved!==t.is_saved)return e.is_saved?-1:1;if(e.is_saved&&t.is_saved){const o=new Date(e.saved_update_date).getTime();return new Date(t.saved_update_date).getTime()-o}const o=new Date(Math.max(new Date(e.last_time_used_date).getTime(),new Date(e.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()-o}).slice(0,6))(t):[];return(0,c().jsxs)(U,{children:[(0,c().jsxs)(Oe,{children:[(0,c().jsx)(m.Icon,{"data-test-id":`${n}rs-icon`,color:m.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),(0,c().jsx)(f.TranslatableText,{stringId:"Recent searches"})]}),(0,c().jsx)(ze,{direction:T.VERTICAL,fullWidth:!0,children:s.map((e,t)=>(0,c().jsx)(Be,{onRecentSearchSelect:r,initialValues:i,search:e,index:t,setIsOpen:o,dataTestId:n},e.id))})]})},De=e=>{let{isLoading:t,recentSearches:o,searchKey:n,dataTestId:r,setIsOpen:i,onRecentSearchSelect:s,initialValues:a}=e;return n||o&&0!==o.length?t?(0,c().jsx)(m.Spin,{size:"small"}):(null===o||void 0===o?void 0:o.length)>0&&!n.trim()?(0,c().jsx)(Xe,{recentSearches:o,dataTestId:r,setIsOpen:i,onRecentSearchSelect:s,initialValues:a}):n.trim()?(0,c().jsx)(V,{children:(0,c().jsx)(f.TranslatableText,{stringId:"No matching results",module:f.TRANSLATION_MODULES.SearchAndBook})}):null:null};class qe{static isProduction(){return!1}static isTest(){return!1}static isLocal(){return!1}}const Ge=e=>{let{fetchOptions:t,renderedOptions:o,recentSearches:n=[],hasError:r,mode:i,dataTestId:s,value:a,debounceTimeout:l=800,activeLocationMode:d,defaultLocation:u,onChange:f,...g}=e;const[y,v]=(0,p().useState)([]),[x,S]=(0,p().useState)(!1),[b,C]=(0,p().useState)(""),L=(0,p().useRef)(0),[k,j]=(0,p().useState)(!1),T=(0,p().useRef)();(0,p().useEffect)(()=>{a&&0!==a.length||k||(v([]),C(""))},[a,k]),(0,p().useEffect)(()=>(""!==d&&v(e=>e.filter(e=>e.label===w[d].label)),j(!1),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{document.activeElement.blur(),document.body.click();const e=document.querySelector(".ant-select-focused");e&&e.classList.remove("ant-select-focused")},100),()=>{T.current&&clearTimeout(T.current)}),[d]);const _=(0,p().useMemo)(()=>(0,h.debounce)(async e=>{C(e),L.current+=1;const o=L.current;v([]),S(!0);let n=null;try{const r=await t(e);o===L.current&&(v(r),n=r)}catch(r){console.error("Error fetching options:",r),o===L.current&&m.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."})}finally{if(o===L.current)return S(!1),n}},l),[t,l]);(0,p().useEffect)(()=>{if(null===u||void 0===u||!u.code)return;(async()=>{try{v([]),S(!0);const e=await t(u.code);if(v(e),!e||0===e.length)return;let o=null;if(u.type){const t=e.find(e=>{var t;return e.label.toLowerCase()===(null===(t=w[u.type])||void 0===t?void 0:t.label.toLowerCase())});null!==t&&void 0!==t&&t.options&&(o=t.options.find(e=>e.code.toLowerCase()===u.code.toLowerCase()||e.selectedValue.toLowerCase()===u.code.toLowerCase()))}if(o||(o=e.map(e=>e.options).flat().find(e=>e.code.toLowerCase()===u.code.toLowerCase()||e.selectedValue.toLowerCase()===u.code.toLowerCase())),o&&f){const e=ae(o);f([e])}}catch(e){qe.isLocal()&&console.error("Error loading default location:",e)}finally{S(!1)}})()},[null===u||void 0===u?void 0:u.code,null===u||void 0===u?void 0:u.type]);const O=x||b.trim()||(null===n||void 0===n?void 0:n.length)>0,I=k&&O?2:3;return(0,c().jsxs)(c().Fragment,{children:[(0,c().jsx)(z,{}),(0,c().jsx)(E,{maxTagCount:I,onSearch:_,$hasError:r,loading:x,options:y,filterOption:!1,notFoundContent:(0,c().jsx)(De,{isLoading:x,recentSearches:n,searchKey:b,dataTestId:s,setIsOpen:j,onRecentSearchSelect:g.onRecentSearchSelect,initialValues:g.initialValues}),mode:i,"data-test-id":`${s}-selector`,allowClear:i===$,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:e=>{j(e),v([]),C("")},open:k&&(x||b.trim()||(null===n||void 0===n?void 0:n.length)>0),value:a,onChange:f,...g,children:o(y)})]})},We=e=>{let{omittedPorts:t,dataTestId:o}=e;const n=t.map(e=>{var t;return null===(t=JSON.parse(e.key))||void 0===t?void 0:t.selectedValue});return(0,c().jsx)(m.Tooltip,{title:n.join(","),children:(0,c().jsx)(M,{"data-test-id":`${o}-extra-ports`,children:`+${t.length}`})})},Je=e=>{let{value:t,onChange:o,hasError:n,dataTestId:r="location-input",isOriginLocation:i=!0,maxPorts:s=1,supportedLocationModes:a,customer:l,defaultLocation:d,autofillLocationAddress:u,autofillLocationCode:h,userCountryCode:g,...y}=e;const[S,b]=(0,p().useState)(t),[T,_]=(0,p().useState)(1===a.length?a[0]:""),[O,I]=(0,p().useState)(Y(T)||""===T?$:C),P=(0,p().useRef)(t),F=(0,p().useRef)(null);(0,p().useEffect)(()=>{Y(T)?I($):I(C)},[T]),(0,p().useEffect)(()=>{b(t),P.current=t,Array.isArray(t)&&t.length>0?_(t[0].type):null!==d&&void 0!==d&&d.type?_(d.type):_("")},[t,null===d||void 0===d?void 0:d.type]);const R=(0,p().useRef)({onChange:o,selectionMode:O,maxPorts:s});return(0,p().useEffect)(()=>{R.current={onChange:o,selectionMode:O,maxPorts:s}},[o,O,s]),(0,p().useEffect)(()=>{const e=`${u||""}::${h||""}`;if(!u&&!h)return;if(e===F.current)return;const t=P.current,{selectionMode:o,maxPorts:n}=R.current,r=o===C&&"number"===typeof n&&n>1&&Array.isArray(t)&&t.length<n;if((e=>!!e&&(Array.isArray(e)?e.length>0:Object.keys(e).length>0))(t)&&!r)return;(async()=>{try{const t=await de({autofillLocationAddress:u,autofillLocationCode:h,supportedLocationModes:a,customer:l,userCountryCode:g});if(!t)return;const{onChange:o,selectionMode:n,maxPorts:r}=R.current,i=P.current;if(n===C&&"number"===typeof r&&r>1&&Array.isArray(i)){const e=X(t),s=new Set((i||[]).map(e=>B((null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.selectedValue))));if(!e||s.has(e))return;const a=W(i)||[],l=[...Array.isArray(a)?a.filter(Boolean):[],t].slice(0,r);H(l,n,r,b,o)}else H(n===C?[t]:t,n,r,b,o);F.current=e}catch(t){console.error("Error performing autofill:",t)}})()},[u,h,a,l,g]),(0,c().jsx)(Ge,{mode:O,dataTestId:r,hasError:n,placeholder:(0,c().jsx)(f.TranslatableText,{style:{fontSize:m.tokens.fdsFontSizeBase},stringId:`Select ${i?L:k}`}),value:W(S),fetchOptions:J(T,a,l),renderedOptions:e=>((e,t)=>{if((e||[]).some(e=>{var t;return(null===e||void 0===e||null===(t=e.options)||void 0===t?void 0:t.length)>0}))return e.map(e=>{var o;const n=Object.values(w).find(t=>t.label===e.label),r=null===n||void 0===n?void 0:n.icon;return(0,c().jsx)(m.Select.OptGroup,{label:(0,c().jsxs)("span",{style:{fontFamily:"Open Sans"},children:[(0,c().jsx)(m.Icon,{size:"tiny",type:r}),"\xa0 \xa0",e.label]}),"data-test-id":`${t}-group-${e.label}`,children:null===(o=e.options)||void 0===o?void 0:o.map(o=>{const{countryCode:n,selectedValue:i,displayLabel:s,type:a}=o;return(0,c().jsx)(m.Option,{value:G(o),title:i,"data-test-id":`${t}-${e.label}-${i}`,style:{paddingLeft:"8px"},label:(0,c().jsxs)(c().Fragment,{children:[(0,c().jsx)(m.Icon,{type:r,size:"tiny"}),"\xa0",(0,c().jsx)(M,{children:i})]}),children:(0,c().jsxs)(A,{fullWidth:!0,justifyContent:"space-between",children:[(0,c().jsxs)(A,{spacing:j.XSMALL,children:[(0,c().jsx)("span",{children:(0,c().jsx)(m.Avatar,{type:"flag",country:n,size:"small",style:{width:m.tokens.fdsSizeSm,height:m.tokens.fdsSizeSm}})}),(0,c().jsx)(N,{children:s})]}),a===v&&(0,c().jsx)(m.Icon,{type:"amazon",size:"small"}),a===x&&(0,c().jsx)(m.Chip,{type:"neutral",iconType:"address-book"})]})},o.code)})},e.label)})})(e,r),onChange:e=>{const t=null!==e&&void 0!==e?e:[],n=O===C&&Array.isArray(t)&&t.length>0?((e,t)=>{const o=new Map;for(const a of Array.isArray(t)?t:[]){var n;const e=K(a);e&&o.set(e,(null!==(n=o.get(e))&&void 0!==n?n:0)+1)}const r=new Map;for(const a of e){var i;const e=K(a);e&&r.set(e,(null!==(i=r.get(e))&&void 0!==i?i:0)+1)}for(const[a,l]of r){var s;const e=null!==(s=o.get(a))&&void 0!==s?s:0;if(l>e&&e>0)return a}return null})(t,S):null;null!==n?((e,t,o,n)=>{const r=(Array.isArray(t)?t:[]).filter(t=>K(t)!==e);o(r),Z(r,n)})(n,S,b,o):H(t,O,s,b,o),_("")},activeLocationMode:T,maxTagPlaceholder:e=>(0,c().jsx)(We,{omittedPorts:e,dataTestId:r}),defaultLocation:d,...y})};return d})());
2
152
  //# sourceMappingURL=main.bundle.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */