@freightos/fusion-location-input 1.0.1-fusion-mvp → 1.0.1-test10

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.
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # Fusion Location Input #
2
- It is a React front-end shared component library.
3
- contains Fusion Location Input component that allows to enter Location(full address), City, Port.
4
-
5
- ### Owners ###
6
-
7
- * nowwar@freightos.com
8
-
9
- ### Technology Stack ###
10
-
11
- * ReactJS ( FrontEnd Library )
12
-
13
- ----
14
-
15
- ### Consume from your app/micro-front
16
-
17
- - Using npm or yarn to install the package `npm install --save @freightos/fusion-location-input`
18
- - Consume in your application by importing components from commodity ui library:
19
-
20
- ```
21
- import React from 'react';
22
- import ReactDOM from 'react-dom';
23
- import { LocationInput } from '@freightos/fusion-location-input';
24
-
25
- ReactDOM.render(<LocationInput />, document.getElementById('root'));
26
- ```
1
+ # Fusion Location Input #
2
+ It is a React front-end shared component library.
3
+ contains Fusion Location Input component that allows to enter Location(full address), City, Port.
4
+
5
+ ### Owners ###
6
+
7
+ * nowwar@freightos.com
8
+
9
+ ### Technology Stack ###
10
+
11
+ * ReactJS ( FrontEnd Library )
12
+
13
+ ----
14
+
15
+ ### Consume from your app/micro-front
16
+
17
+ - Using npm or yarn to install the package `npm install --save @freightos/fusion-location-input`
18
+ - Consume in your application by importing components from commodity ui library:
19
+
20
+ ```
21
+ import React from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import { LocationInput } from '@freightos/fusion-location-input';
24
+
25
+ ReactDOM.render(<LocationInput />, document.getElementById('root'));
26
+ ```
@@ -3,7 +3,7 @@
3
3
  "main.js": "/main.bundle.js",
4
4
  "main.js.map": "/main.bundle.js.map",
5
5
  "index.html": "/index.html",
6
- "precache-manifest.f04418ec3d26cecf5c0309534f8cadbb.js": "/precache-manifest.f04418ec3d26cecf5c0309534f8cadbb.js",
6
+ "precache-manifest.8bbf26d59b3fefd26080638a0319306c.js": "/precache-manifest.8bbf26d59b3fefd26080638a0319306c.js",
7
7
  "service-worker.js": "/service-worker.js"
8
8
  },
9
9
  "entrypoints": [
@@ -1,151 +1,2 @@
1
- !function(e,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")):e.FusionLocationInput=t(e.React,e["@freightos/design-system"],e["styled-components"],e["@freightos/freightos-i18n"],e["@freightos/http-client"],e.lodash)}(this,(function(e,t,n,o,a,r){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="http://ship.freightos.local:8800/FusionLocationInput/",n(n.s=6)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t){e.exports=r},function(e,t,n){e.exports=n(7)},function(e,t,n){"use strict";n.r(t);var o=n(0),a=n.n(o),r=n(1),i=n(3),l=n(5);const s="airport",c="seaport",d="fulfillment_center",u="address_book",m="last_mile_address",p="address",h={[s]:{label:"Airports",key:s,icon:"mode-air"},[c]:{label:"Ports",key:c,icon:"mode-ship"},[d]:{label:"Fulfillment centers",key:d,icon:"fulfillment-center"},[u]:{key:u,groupedBy:"address"},[m]:{key:m,groupedBy:"address"},[p]:{label:"Address",key:p,icon:"location"}},C="single",g="multiple",f="origin",v="destination";var L={"aog-cargo":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.0934 13.8699L10.5914 13.8753L5.09226 13.8684L3.43549 13.8671L2.09739 8.87329L3.59892 8.87471L5.0977 10.875L10.2426 10.8733L8.09955 2.87544L10.0932 2.85889L15.0963 10.8669L20.5929 10.8641C21.4226 10.8696 22.0914 11.5497 22.093 12.3671C22.0875 13.1968 21.4171 13.863 20.59 13.8672L15.0934 13.8699ZM15 16.9999C15.5523 16.9999 16 16.5522 16 15.9999C16 15.4476 15.5523 14.9999 15 14.9999C14.4477 14.9999 14 15.4476 14 15.9999C14 16.5522 14.4477 16.9999 15 16.9999ZM12 15.9999C12 16.5522 11.5523 16.9999 11 16.9999C10.4477 16.9999 10 16.5522 10 15.9999C10 15.4476 10.4477 14.9999 11 14.9999C11.5523 14.9999 12 15.4476 12 15.9999ZM1 17.9999V19.9999H23V17.9999H1Z",fill:"currentColor"})),chemical:()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M13.1112 11.2462L18.6673 18.75H5.33274L10.8888 11.2462V5.25H13.1112M16.4004 3H7.59961C7.1329 3 6.87732 3.54 7.16624 3.91125L8.66637 5.8125V10.5038L2.22135 19.2C1.67686 19.9425 2.19913 21 3.11032 21H20.8897C21.8009 21 22.3231 19.9425 21.7786 19.2L15.3336 10.5038V5.8125L16.8338 3.91125C17.1227 3.54 16.8671 3 16.4004 3Z",fill:"currentColor"})),"consolidation-loose":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M5 10H3V4H11V6H5V10ZM19 18H13V20H21V14H19V18ZM5 18V14H3V20H11V18H5ZM21 4H13V6H19V10H21V4ZM8 13V15L11 12L8 9V11H3V13H8ZM16 11V9L13 12L16 15V13H21V11H16Z",fill:"currentColor"})),courier:()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M10.78 12.05L13.81 11.79L15 9L16.19 11.79L19.22 12.05L16.92 14.04L17.61 17L15 15.47L12.39 17L13.08 14.04L10.78 12.05ZM22 8V18C22 19.11 21.11 20 20 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.9 4 4 4H10L12 6H20C21.11 6 22 6.9 22 8ZM20 8H4V18H20V8Z",fill:"currentColor"})),"dangerous-goods":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M12.0001 22.0251C11.7334 22.0251 11.4793 21.9751 11.2376 21.8751C10.9959 21.7751 10.7751 21.6334 10.5751 21.4501L2.5501 13.4251C2.36676 13.2251 2.2251 13.0043 2.1251 12.7626C2.0251 12.5209 1.9751 12.2668 1.9751 12.0001C1.9751 11.7334 2.0251 11.4751 2.1251 11.2251C2.2251 10.9751 2.36676 10.7584 2.5501 10.5751L10.5751 2.5501C10.7751 2.3501 10.9959 2.20426 11.2376 2.1126C11.4793 2.02093 11.7334 1.9751 12.0001 1.9751C12.2668 1.9751 12.5251 2.02093 12.7751 2.1126C13.0251 2.20426 13.2418 2.3501 13.4251 2.5501L21.4501 10.5751C21.6501 10.7584 21.7959 10.9751 21.8876 11.2251C21.9793 11.4751 22.0251 11.7334 22.0251 12.0001C22.0251 12.2668 21.9793 12.5209 21.8876 12.7626C21.7959 13.0043 21.6501 13.2251 21.4501 13.4251L13.4251 21.4501C13.2418 21.6334 13.0251 21.7751 12.7751 21.8751C12.5251 21.9751 12.2668 22.0251 12.0001 22.0251ZM12.0001 20.0251L20.0251 12.0001L12.0001 3.9751L3.9751 12.0001L12.0001 20.0251ZM11.0001 13.0001H13.0001V7.0001H11.0001V13.0001ZM12.0001 16.0001C12.2834 16.0001 12.5209 15.9043 12.7126 15.7126C12.9043 15.5209 13.0001 15.2834 13.0001 15.0001C13.0001 14.7168 12.9043 14.4793 12.7126 14.2876C12.5209 14.0959 12.2834 14.0001 12.0001 14.0001C11.7168 14.0001 11.4793 14.0959 11.2876 14.2876C11.0959 14.4793 11.0001 14.7168 11.0001 15.0001C11.0001 15.2834 11.0959 15.5209 11.2876 15.7126C11.4793 15.9043 11.7168 16.0001 12.0001 16.0001Z",fill:"currentColor"})),"diplomatic-cargo":()=>a.a.createElement("svg",{width:"1em",height:"1em",fill:"none"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17 2H11V5V8.00167L3 8.01377V10H21V8.01377L13 8.00139V5H17V2ZM4.46212 19.0138V11.343H6.40657V19.0138H8.90657V11.343H10.851V19.0138H13.351V11.343H15.2955V19.0138H17.7955V11.343H19.7399V19.0138H22V21H2V19.0138H4.46212Z",fill:"currentColor"})),"electric-equipment":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M16.6667 6.44444V2H14.3333V6.44444H9.66667V2H7.33333V6.44444C6.16667 6.44444 5 7.55556 5 8.66667V14.7778L9.08333 18.6667V22H14.9167V18.6667L19 14.7778V8.66667C19 7.55556 17.8333 6.44444 16.6667 6.44444ZM16.6667 13.8556L13.2717 17.1L12.7817 17.5556H11.2183L10.74 17.1L7.33333 13.8556V8.76667C7.33333 8.73333 7.40333 8.66667 7.43833 8.66667H16.5733C16.6083 8.66667 16.6667 8.73333 16.6667 8.76667V13.8556Z",fill:"currentColor"})),"food-perishables":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M20 10.0001C18.58 7.57005 15.5 6.69005 13 8.00005V3.00005H11V8.00005C8.50002 6.69005 5.42002 7.57005 4.00002 10.0001C2.00002 13.0001 7.00002 22 9.00002 22C11 22 11 21 12 21C13 21 13 22 15 22C17 22 22 13.0001 20 10.0001ZM18.25 13.3801C17.63 15.8501 16.41 18.12 14.7 20C14.5 20 14.27 19.9 14.1 19.75C12.87 18.76 11.13 18.76 9.90002 19.75C9.73002 19.9 9.50002 20 9.30002 20C7.59002 18.13 6.36002 15.8501 5.75002 13.3901C5.50002 12.6601 5.45002 11.8701 5.66002 11.1201C6.24002 10.0901 7.32002 9.43005 8.50002 9.40005C9.06002 9.41005 9.61002 9.54005 10.11 9.79005L11 10.2401H13L13.89 9.79005C14.39 9.54005 14.94 9.41005 15.5 9.40005C16.68 9.43005 17.76 10.0801 18.34 11.1101C18.55 11.8601 18.5 12.6501 18.25 13.3801ZM11 5.00005C5.38002 8.07005 4.11002 3.78005 4.11002 3.78005C4.11002 3.78005 6.77002 0.190051 11 5.00005Z",fill:"currentColor"})),"general-cargo":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M12 2L6.5 11H17.5L12 2ZM12 5.84L13.93 9H10.06L12 5.84ZM17.5 13C15.01 13 13 15.01 13 17.5C13 19.99 15.01 22 17.5 22C19.99 22 22 19.99 22 17.5C22 15.01 19.99 13 17.5 13ZM17.5 20C16.12 20 15 18.88 15 17.5C15 16.12 16.12 15 17.5 15C18.88 15 20 16.12 20 17.5C20 18.88 18.88 20 17.5 20ZM3 21.5H11V13.5H3V21.5ZM5 15.5H9V19.5H5V15.5Z",fill:"currentColor"})),"lithium-batteries":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M4.72727 4V6.64706H2V19H22V6.64706H19.2727V4H13.8182V6.64706H10.1818V4H4.72727ZM3.81818 8.41176H20.1818V17.2353H3.81818V8.41176ZM14.7273 10.1765V11.9412H12.9091V13.7059H14.7273V15.4706H16.5455V13.7059H18.3636V11.9412H16.5455V10.1765H14.7273ZM5.63636 11.9412V13.7059H11.0909V11.9412H5.63636Z",fill:"currentColor"})),"live-animals":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M16 11C16.2833 11 16.5208 10.9042 16.7125 10.7125C16.9042 10.5208 17 10.2833 17 10C17 9.71667 16.9042 9.47917 16.7125 9.2875C16.5208 9.09583 16.2833 9 16 9C15.7167 9 15.4792 9.09583 15.2875 9.2875C15.0958 9.47917 15 9.71667 15 10C15 10.2833 15.0958 10.5208 15.2875 10.7125C15.4792 10.9042 15.7167 11 16 11ZM4.5 21C3.93333 19.1 3.375 17.2042 2.825 15.3125C2.275 13.4208 2 11.4833 2 9.5C2 7.96667 2.53333 6.66667 3.6 5.6C4.66667 4.53333 5.96667 4 7.5 4H12.5C12.9833 3.36667 13.5708 2.875 14.2625 2.525C14.9542 2.175 15.7 2 16.5 2C16.9167 2 17.2708 2.14583 17.5625 2.4375C17.8542 2.72917 18 3.08333 18 3.5C18 3.6 17.9875 3.7 17.9625 3.8C17.9375 3.9 17.9083 3.99167 17.875 4.075C17.8083 4.25833 17.7458 4.44583 17.6875 4.6375C17.6292 4.82917 17.5833 5.025 17.55 5.225L19.825 7.5H22V14.475L19.175 15.4L17.5 21H12V19H10V21H4.5ZM6 19H8V17H14V19H16L17.55 13.85L20 13.025V9.5H19L15.5 6C15.5 5.66667 15.5208 5.34583 15.5625 5.0375C15.6042 4.72917 15.6667 4.41667 15.75 4.1C15.2667 4.23333 14.8417 4.4625 14.475 4.7875C14.1083 5.1125 13.8417 5.51667 13.675 6H7.5C6.53333 6 5.70833 6.34167 5.025 7.025C4.34167 7.70833 4 8.53333 4 9.5C4 11.1333 4.225 12.7292 4.675 14.2875C5.125 15.8458 5.56667 17.4167 6 19Z",fill:"currentColor"})),"perishables-notemp":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M3 13C3 15.3869 3.94821 17.6761 5.63604 19.364C7.32387 21.0518 9.61305 22 12 22C12 19.6131 11.0518 17.3239 9.36396 15.636C7.67613 13.9482 5.38695 13 3 13ZM5.44 15.44C7.35 16.15 8.85 17.65 9.56 19.56C7.65 18.85 6.15 17.35 5.44 15.44ZM12 22C14.3869 22 16.6761 21.0518 18.364 19.364C20.0518 17.6761 21 15.3869 21 13C18.6131 13 16.3239 13.9482 14.636 15.636C12.9482 17.3239 12 19.6131 12 22ZM14.42 19.57C15.11 17.64 16.64 16.11 18.57 15.42C17.86 17.34 16.34 18.86 14.42 19.57ZM12 14C13.5913 14 15.1174 13.3679 16.2426 12.2426C17.3679 11.1174 18 9.5913 18 8V3C17.26 3 16.53 3.12 15.84 3.39C15.29 3.62 14.8 3.96 14.39 4.39L12 2L9.61 4.39C9.2 3.96 8.71 3.62 8.16 3.39C7.47 3.12 6.74 3 6 3V8C6 9.5913 6.63214 11.1174 7.75736 12.2426C8.88258 13.3679 10.4087 14 12 14ZM8 5.61L9.57 7.26L12 4.83L14.43 7.26L16 5.61V8C16 9.06087 15.5786 10.0783 14.8284 10.8284C14.0783 11.5786 13.0609 12 12 12C10.9391 12 9.92172 11.5786 9.17157 10.8284C8.42143 10.0783 8 9.06087 8 8V5.61Z",fill:"currentColor"})),pharmaceuticals:()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M11.1501 15.18L9.73008 13.77L11.1501 12.35L12.5601 13.77L13.9701 12.35L12.5601 10.94L13.9701 9.53L15.3901 10.94L16.8001 9.53L13.9701 6.7L6.90008 13.77L9.73008 16.6L11.1501 15.18ZM3.08008 19L6.20008 15.89L4.08008 13.77L13.9701 3.87L16.1001 6L17.5001 4.58L16.1001 3.16L17.5001 1.75L21.7501 6L20.3401 7.4L18.9201 6L17.5001 7.4L19.6301 9.53L9.73008 19.42L7.61008 17.3L3.08008 21.84V19Z",fill:"currentColor"})),retail:()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("g",{clipPath:"url(#clip0_1354_47817)"},a.a.createElement("path",{d:"M21.6 18.2002L13 11.7502V10.8402C14.65 10.3502 15.8 8.67016 15.43 6.79016C15.17 5.48016 14.13 4.39016 12.82 4.09016C10.54 3.57016 8.50002 5.30016 8.50002 7.50016H10.5C10.5 6.67016 11.17 6.00016 12 6.00016C12.83 6.00016 13.5 6.67016 13.5 7.50016C13.5 8.34016 12.81 9.02016 11.97 9.00016C11.43 8.99016 11 9.45016 11 9.99016V11.7502L2.40002 18.2002C1.63002 18.7802 2.04002 20.0002 3.00002 20.0002H12H21C21.96 20.0002 22.37 18.7802 21.6 18.2002ZM6.00002 18.0002L12 13.5002L18 18.0002H6.00002Z",fill:"currentColor"})),a.a.createElement("defs",null,a.a.createElement("clipPath",{id:"clip0_1354_47817"},a.a.createElement("rect",{fill:"transparent"})))),"shiny-stars":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M18.364 2l-1.146 2.5-2.49 1.136 2.49 1.146 1.146 2.49 1.136-2.49L22 5.636 19.5 4.5m-10.227.227L7 9.727 2 12l5 2.273 2.273 5 2.273-5 5-2.273-5-2.273m6.818 5l-1.146 2.491-2.49 1.146 2.49 1.136 1.146 2.5 1.136-2.5 2.5-1.136-2.5-1.146",fill:"currentColor"})),"spare-parts":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M9 1.08984V5.99984H7V1.08984C4.16 1.56984 2 4.02984 2 6.99984C2 9.21984 3.21 11.1498 5 12.1898V20.9998C5 21.5498 5.45 21.9998 6 21.9998H10C10.55 21.9998 11 21.5498 11 20.9998V12.1898C12.79 11.1498 14 9.21984 14 6.99984C14 4.02984 11.84 1.56984 9 1.08984ZM10 10.4598L9 11.0398V19.9998H7V11.0398L6 10.4598C4.77 9.73984 4 8.41984 4 6.99984C4 5.99984 4.37 5.05984 5 4.34984V7.99984H11V4.34984C11.63 5.05984 12 5.99984 12 6.99984C12 8.41984 11.23 9.73984 10 10.4598ZM20.94 17.9398C20.96 17.7898 20.97 17.6498 20.97 17.4998C20.97 17.3498 20.96 17.1998 20.94 17.0498L21.91 16.3198C22 16.2498 22.03 16.1298 21.97 16.0298L21.05 14.4698C21 14.3698 20.87 14.3298 20.76 14.3698L19.61 14.8198C19.37 14.6498 19.12 14.4998 18.83 14.3798L18.66 13.1898C18.64 13.0798 18.54 12.9998 18.43 12.9998H16.58C16.46 12.9998 16.36 13.0798 16.34 13.1898L16.17 14.3798C15.88 14.4998 15.63 14.6498 15.39 14.8198L14.24 14.3698C14.14 14.3298 14 14.3698 13.96 14.4698L13.03 16.0298C12.97 16.1298 13 16.2498 13.09 16.3198L14.06 17.0498C14.05 17.1998 14.03 17.3498 14.03 17.4998C14.03 17.6498 14.05 17.7898 14.06 17.9398L13.09 18.6798C13 18.7498 12.97 18.8698 13.03 18.9698L13.96 20.5298C14 20.6298 14.14 20.6598 14.24 20.6298L15.39 20.1698C15.63 20.3498 15.88 20.4998 16.17 20.6198L16.34 21.8098C16.36 21.9198 16.46 21.9998 16.58 21.9998H18.43C18.54 21.9998 18.64 21.9198 18.66 21.8098L18.83 20.6198C19.12 20.4998 19.37 20.3498 19.61 20.1698L20.76 20.6298C20.87 20.6598 21 20.6298 21.05 20.5298L21.97 18.9698C22.03 18.8698 22 18.7498 21.91 18.6798L20.94 17.9398ZM17.5 18.9998C16.67 18.9998 16 18.3298 16 17.4998C16 16.6698 16.67 15.9998 17.5 15.9998C18.33 15.9998 19 16.6698 19 17.4998C19 18.3298 18.33 18.9998 17.5 18.9998Z",fill:"currentColor"})),"temperature-control":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83 1C10.7318 1 12.28 2.4929 12.28 4.32678V14.3862C13.1554 15.2469 13.66 16.4196 13.66 17.6339C13.66 20.2038 11.4952 22.2914 8.83 22.2914C6.16488 22.2914 4 20.2038 4 17.6339C4 16.4196 4.50456 15.2469 5.38 14.3862V4.32678C5.38 2.4929 6.92819 1 8.83 1ZM17.8 1C16.2777 1 15.04 2.19348 15.04 3.66143C15.04 5.12937 16.2777 6.32285 17.8 6.32285C19.3223 6.32285 20.56 5.12937 20.56 3.66143C20.56 2.19348 19.3223 1 17.8 1ZM17.8 4.99214C17.0367 4.99214 16.42 4.39748 16.42 3.66143C16.42 2.92538 17.0367 2.33071 17.8 2.33071C18.5633 2.33071 19.18 2.92538 19.18 3.66143C19.18 4.39748 18.5633 4.99214 17.8 4.99214ZM8.83001 20.9607C6.92819 20.9607 5.38 19.4678 5.38 17.6339C5.38 16.5735 5.90613 15.6005 6.76001 14.9808V4.32678C6.76001 3.22478 7.68719 2.33071 8.83001 2.33071C9.97281 2.33071 10.9 3.22478 10.9 4.32678V14.9808C11.7539 15.5962 12.28 16.5735 12.28 17.6339C12.28 19.4678 10.7318 20.9607 8.83001 20.9607ZM6.76001 17.6782C6.76001 18.7807 7.68676 19.6743 8.83001 19.6743C9.97325 19.6743 10.9 18.7807 10.9 17.6782C10.9 16.8093 10.3239 16.0703 9.52 15.7962V10.3594C9.52 9.99191 9.2111 9.69402 8.83001 9.69402C8.4489 9.69402 8.14 9.99191 8.14 10.3594V15.7962C7.33611 16.0703 6.76001 16.8093 6.76001 17.6782Z",fill:"currentColor"})),"valuable-cargo":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{d:"M16 9H19L14 16M10 9H14L12 17M5 9H8L10 16M15 4H17L19 7H16M11 4H13L14 7H10M7 4H9L8 7H5M6 2L2 8L12 22L22 8L18 2H6Z",fill:"currentColor"})),"vulnerable-cargo":()=>a.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 2H18.2273V8.36364C18.2273 11.5695 15.8566 14.2217 12.7727 14.6628V16.6197C13.9184 16.8079 14.9246 17.3364 15.6888 18.0035C16.6227 18.8188 17.3182 19.9571 17.3182 21.0909V22H6.40909V21.0909C6.40909 19.9571 7.10455 18.8188 8.03849 18.0035C8.80262 17.3364 9.80885 16.8079 10.9545 16.6197V14.6628C7.87064 14.2217 5.5 11.5695 5.5 8.36364V2ZM7.31818 3.81818V8.36364C7.31818 10.874 9.35325 12.9091 11.8636 12.9091C14.374 12.9091 16.4091 10.874 16.4091 8.36364V3.81818H14.1216L12.295 6.12546L15.0194 7.84612L11.6692 12.1073L10.2399 10.9836L12.3442 8.30699L9.61407 6.58268L11.8026 3.81818H7.31818ZM8.53757 20.1818H15.1897C15.0271 19.9172 14.7975 19.6389 14.493 19.3731C13.8172 18.7831 12.8874 18.3636 11.8636 18.3636C10.8399 18.3636 9.91011 18.7831 9.23423 19.3731C8.92981 19.6389 8.70012 19.9172 8.53757 20.1818Z",fill:"currentColor"}))};var y=e=>{let{type:t,component:n,...o}=e;if(!t)return null;const i=L[t]||n;return a.a.createElement(r.Icon,Object.assign({type:t,component:i},o))},E=n(2),b=n.n(E);const S=E.createGlobalStyle`
2
- .ant-select-dropdown {
3
- .ant-select-dropdown-menu {
4
- max-height: 400px;
5
- padding: 0 !important;
6
- margin-top: 0 !important;
7
- }
8
- }
9
- `,V=b()(r.Select)`
10
- .ant-select-selection__rendered {
11
- min-width: 100% !important;
12
- }
13
-
14
- li.ant-select-selection__choice {
15
- border-radius: ${r.tokens.fdsBorderRadiusXl};
16
- border: none;
17
- border-color: ${r.tokens.fdsColorPrimaryBlue};
18
- color: ${r.tokens.fdsColorPrimaryBlue};
19
- background-color: ${r.tokens.fdsColorPrimaryBlue10};
20
- line-height: 10px !important;
21
- margin-right: ${r.tokens.fdsComponentSpacingXxs};
22
- width: fit-content;
23
- max-width: 90px;
24
- height: ${r.tokens.fdsSizeMd} !important;
25
- ${e=>{let{size:t}=e;return"large"===t?`\n\t\t\tmargin-top: ${r.tokens.fdsComponentSpacingSm} !important;\n\t\t`:"\n\t\t\tmargin-top: 5px !important;\n\t\t"}}
26
-
27
- .ant-select-selection__choice__remove {
28
- color: ${r.tokens.fdsColorPrimaryBlue};
29
- margin-top: ${r.tokens.fdsComponentSpacingXs} !important;
30
- }
31
-
32
- .ant-select-selection__choice__content {
33
- line-height: ${r.tokens.fdsSizeMd} !important;
34
- height: ${r.tokens.fdsSizeMd} !important;
35
- }
36
- }
37
-
38
- li.ant-select-selection__choice__disabled {
39
- border: none;
40
- background-color: transparent;
41
- padding: 0;
42
- padding-left: 0;
43
- width: fit-content;
44
- }
45
-
46
- .ant-select-dropdown .ant-select-not-found {
47
- cursor: pointer !important;
48
- }
49
-
50
- .ant-select-selection-selected-value {
51
- max-width: 280px !important;
52
- }
53
-
54
- li.ant-select-search.ant-select-search--inline {
55
- margin-left: -1px !important;
56
- }
57
- .ant-select-search__field {
58
- color: ${r.tokens.fdsColorPrimaryGray80} !important;
59
- }
60
- ${e=>{let{$hasError:t}=e;return t&&`\n\t\t.ant-select-selection {\n\t\t\tcolor: ${r.tokens.fdsColorSemanticRed};\n \t\tborder: 1px solid ${r.tokens.fdsColorSemanticRed};\n \t\tbackground-color: ${r.tokens.fdsColorSemanticRed10};\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ${r.tokens.fdsColorSemanticRed};\n\t\t}\n\t`}}
61
- `,w=b.a.span`
62
- font-size: ${r.tokens.fdsFontSizeSm} !important;
63
- `,H=b.a.div`
64
- font-size: ${r.tokens.fdsFontSizeSm} !important;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- display: -webkit-box;
68
- -webkit-line-clamp: 2;
69
- -webkit-box-orient: vertical;
70
- `,$=b()(r.Menu)`
71
- cursor: pointer !important;
72
-
73
- .ant-menu-item-group-title {
74
- padding: 0;
75
- color: ${r.tokens.fdsBodyTextColorDisabled};
76
- }
77
-
78
- .ant-menu-item {
79
- padding: 0;
80
- white-space: normal;
81
- line-height: normal;
82
-
83
- &:hover {
84
- background-color: #f5f5f5;
85
- }
86
- }
87
- `,O=b.a.div`
88
- font-size: ${r.tokens.fdsFontSizeSm};
89
- line-height: ${r.tokens.fdsSizeSm};
90
- font-family: ${r.tokens.fdsHeadingsFontFamily};
91
- `,M=(b()(y)`
92
- margin-right: 0 !important;
93
- vertical-align: bottom;
94
- `,{XXLARGE:r.tokens.fdsComponentSpacingXxl,XLARGE:r.tokens.fdsComponentSpacingXl,LARGE:r.tokens.fdsComponentSpacingLg,MEDIUM:r.tokens.fdsComponentSpacingMd,SMALL:r.tokens.fdsComponentSpacingSm,XSMALL:r.tokens.fdsComponentSpacingXs,XXSMALL:r.tokens.fdsComponentSpacingXxs,NONE:0}),T={VERTICAL:"vertical",HORIZONTAL:"horizontal"},x="totalShipment",k="unitsShipment",_="containerPackages",Z="celsius",I="fahrenheit",P={["FRO"]:{[Z]:"-10\xbaC or below",[I]:"14\xbaF or below"},["COL"]:{[Z]:"From +2\xbaC To +8\xbaC",[I]:"From 35.6\xbaF To 46.4\xbaF"},["ERT"]:{[Z]:"From +2\xbaC To +25\xbaC",[I]:"From 35.6\xbaF To 77\xbaF"},["CRT"]:{[Z]:"From +15\xbaC To +25\xbaC",[I]:"From 59\xbaF To 77\xbaF"}},j="quotation",R="units",A="totals",F="container",U="CBM",z="CFT",B="kg",N="box",D="uld",W=b.a.div`
95
- display: flex;
96
- flex-direction: ${e=>{let{$direction:t}=e;return t===T.VERTICAL?"column":"row"}};
97
- flex-wrap: ${e=>{let{$wrap:t}=e;return t?"wrap":"nowrap"}};
98
- align-items: ${e=>{let{$alignItems:t}=e;return t}};
99
- justify-content: ${e=>{let{$justifyContent:t}=e;return t}};
100
- box-sizing: border-box;
101
-
102
- ${e=>{let{$fullWidth:t}=e;return t&&E.css`
103
- width: 100%;
104
- `}}
105
- ${e=>{let{$direction:t,$spacing:n}=e;return t===T.VERTICAL?E.css`
106
- > *:not(:first-child) {
107
- margin-top: ${n};
108
- }
109
- `:E.css`
110
- > *:not(:first-child) {
111
- margin-left: ${n};
112
- }
113
- `}};
114
- `;var X=e=>{let{direction:t=T.HORIZONTAL,alignItems:n="start",spacing:o=M.NONE,wrap:r,justifyContent:i,fullWidth:l,...s}=e;return a.a.createElement(W,Object.assign({},s,{$direction:t,$alignItems:n,$spacing:o,$wrap:r,$justifyContent:i,$fullWidth:l}),s.children)},q=n(4),G=n.n(q);class K{static isProduction(){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}static isTest(){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}static isLocal(){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}}const J=e=>{const t=[];JSON.stringify(e,(e,n)=>(t.push(e),n));const n=Array.from(new Set(t)).sort();return JSON.stringify(e,n)},Y=e=>{const{displayLabel:t,selectedValue:n,formattedNameOrAddress:o,code:a,countryCode:r,stateOrProvince:i,city:l,latitude:s,longitude:c,postalOrZipCode:d,sourceType:u,locationType:m,type:p,countryName:h}=e||{};return{displayLabel:t,selectedValue:n||a,formattedNameOrAddress:o,code:a||n,country:r,countryName:h,stateOrProvince:null!==i&&void 0!==i?i:null,city:null!==l&&void 0!==l?l:null,latitude:null!==s&&void 0!==s?s:null,longitude:null!==c&&void 0!==c?c:null,postalOrZipCode:null!==d&&void 0!==d?d:null,sourceType:null!==u&&void 0!==u?u:null,locationType:null!==m&&void 0!==m?m:null,type:null!==p&&void 0!==p?p:u}},Q=e=>{try{const t="string"===typeof(null===e||void 0===e?void 0:e.key)?JSON.parse(ae(e.key)):e;return J(Y(t))}catch{return J(Y(e))}},ee=e=>{const t=e=>(e=>{if(e){var t;const n=e.label||e.selectedValue;return{key:Q(e),label:n?a.a.createElement(a.a.Fragment,null,a.a.createElement(y,{type:e.sourceType?null===(t=h[e.sourceType])||void 0===t?void 0:t.icon:"location",size:"tiny"}),"\xa0",a.a.createElement(w,null,n)):void 0}}})(e);return Array.isArray(e)?e.map(t):t(e)},te=(e,t,n)=>async o=>{if(!o)return[];const a=""!==e?[e]:t;let r=(await(async(e,t,n)=>{try{const o=e.reduce((e,t)=>({...e,[h[t].key]:{type:t.toUpperCase(),...(null===n||void 0===n?void 0:n.code)?{searchTerm:n.name}:{},...h[t].groupedBy?{groupedBy:h[t].groupedBy}:{}}}),{});return(await G.a.post("/geocoder/api/v3/geocoder/locations",{query:t,limit:5,sources:o})).data}catch(o){return console.error("Error fetching locations:",o),{results:{}}}})(a,o,n)).results;return r[p]&&(r=(e=>{let t={...e};const n=e[p].filter(e=>e.sourceType===d);if(n.length>0){const{address:e,...o}=t;t={...o,[d]:n,address:e.filter(e=>e.type!==d)}}return t})(r)),Object.keys(r).map(e=>{var t;return{label:(null===(t=h[e])||void 0===t?void 0:t.label)||e,options:r[e].map(e=>({...e,type:e.sourceType}))}})},ne=async(e,t)=>{const n=Array.isArray(e)?e:[e];t((await Promise.all(n.map(async e=>{try{const t=null===e||void 0===e?void 0:e.key,n=ae(t);return{key:n,...JSON.parse(n)}}catch(t){return}}))).filter(Boolean))},oe=e=>e&&(e===p||e===m||e===u||e===d),ae=e=>"string"===typeof e?e.replace(/&quot;/g,'"').replace(/&#34;/g,'"').replace(/&amp;/g,"&"):e,re=async e=>{var t;await(async e=>{let{method:t,url:n="",data:o={},options:a={}}=e;const r=(()=>{if("get"===t){return[Object.keys(o).length?`${n}?${new URLSearchParams(o).toString()}`:n,a]}if("post"===t){const e={...null===a||void 0===a?void 0:a.headers,accept:"application/json","content-type":"multipart/form-data"};return[n,o,{...a,headers:e}]}return[n,o,a]})();return await G.a[t](...r)})({method:"put",url:(t=!1,`https://platform.${K.isProduction()?"freightos.com":"test-freightos.com"}/gateway/${t?"webcargo-talaia":"webcargo-alpha"}`)+"/backend/api.php",options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:e}})},ie=b.a.div`
115
- color: ${r.tokens.fdsColorPrimaryGray60};
116
- font-size: ${r.tokens.fdsSizeXs};
117
- font-weight: ${r.tokens.fdsFontWeightRegular};
118
- margin-bottom: ${r.tokens.fdsComponentSpacingSm};
119
- i {
120
- margin-right: ${r.tokens.fdsComponentSpacingSm};
121
- }
122
-
123
- `,le=b()(X)`
124
- padding-left: 0 !important;
125
- `,se=b()(y)`
126
- margin-right: 0 !important;
127
- vertical-align: bottom;
128
- `,ce=b.a.span`
129
- white-space: nowrap;
130
- min-width: 0;
131
- color: ${r.tokens.fdsColorPrimaryGray80};
132
- overflow: hidden;
133
- text-overflow: ellipsis;
134
- ${e=>{let{$isLocationLabel:t}=e;return!t&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}}
135
- ${e=>{let{$isPort:t}=e;if(void 0!==t)return`min-width: ${t?"65px":"55px"};`}};
136
- `,de=b()(r.Avatar)`
137
- border: 1px solid ${r.tokens.fdsColorPrimaryGray20};
138
- width: ${r.tokens.fdsSizeSm};
139
- height: ${r.tokens.fdsSizeSm};
140
- `,ue=b()(X)`
141
- overflow: hidden !important;
142
- font-size: 10px; //TODO: FSN-145
143
- line-height: 15px;
144
- flex: 1;
145
- min-width: 0;
146
- `,me=b()(X)`
147
- :last-child {
148
- padding-bottom: 0 !important;
149
- }
150
- `,pe=e=>e?e.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0",he=e=>{const t=e.reduce((e,t)=>{const n=t.country;return e[n]||(e[n]=[]),e[n].push(t),e},{});return Object.keys(t).forEach(e=>{t[e].sort((e,t)=>e.value.localeCompare(t.value))}),t};var Ce=e=>{let{text:t="",testId:n,isPort:i,isLocationLabel:l=!1,children:s=null}=e;const c=Object(o.useRef)(null),[d,u]=Object(o.useState)(!1);Object(o.useEffect)(()=>{(()=>{if(c.current){const e=c.current,t=e.scrollWidth>e.clientWidth;u(t)}})()},[t]);const m=a.a.createElement(ce,{ref:c,"data-test-id":n,$isLocationLabel:l,$isPort:i},s||t);return d?a.a.createElement(r.Tooltip,{title:t,"data-test-id":n+"-tooltip"},a.a.createElement(ce,{ref:c,"data-test-id":n,$isLocationLabel:l,$isPort:i},s||t)):m};var ge=e=>{let{search:t,index:n,dataTestId:o}=e;const i=t.origin.length>1,l=t.destination.length>1,s=i?he(t.origin):{[t.origin[0].country]:t.origin},d=l?he(t.destination):{[t.destination[0].country]:t.destination};return a.a.createElement(X,{alignItems:"center",spacing:M.XSMALL,fullWidth:!0},Object.keys(s).map(e=>{const t=s[e].map(e=>e.selectedValue).join(", ");return a.a.createElement(Ce,{key:e,text:t,isLocationLabel:!0,testId:`${o}-origin-${n}`,isPort:s[e][0].type===c},a.a.createElement(de,{type:"flag",country:e,size:"small","data-test-id":`${o}-origin-flag-${n}`,style:{marginRight:"4px"}}),t)}),a.a.createElement(y,{type:"arrow-forward",style:{marginRight:0,color:r.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(d).map(e=>{const t=d[e].map(e=>e.selectedValue).join(", ");return a.a.createElement(Ce,{key:e,text:t,isLocationLabel:!0,testId:`${o}-destination-${n}`,isPort:d[e][0].type===c},a.a.createElement(de,{type:"flag",country:e,size:"small","data-test-id":`${o}-destination-flag-${n}`,style:{marginRight:"4px"}}),t)}))};var fe=e=>{var t,n,r;let{search:i,index:l,dataTestId:s}=e;const c=i.platform_type,d=(e=>{const t=e.shipment_details.type;if(t===A)return["box-total"];if(t===R){const t=e.shipment_details[k];if((null===t||void 0===t?void 0:t.packageType)===N){return t.boxPackages.reduce((e,t)=>{var n,o;const a=null===(n=t.type)||void 0===n||null===(o=n.value)||void 0===o?void 0:o.icon;return e.includes(a)||e.push(a),e},[])}return(null===t||void 0===t?void 0:t.packageType)===D?["uld"]:["box"]}return t===F?["container"]:["box"]})(i),{units:u,volume:m,weight:p,weightUnit:h,volumeUnit:C}=Object(o.useMemo)(()=>(e=>{const t=e.shipment_details.type;if(e.platform_type===j)return{units:0,volume:0,weight:0,weightUnit:B,volumeUnit:U};switch(t){case F:{var n;let t=0,o=0;return null===(n=e.shipment_details[_])||void 0===n||n.forEach(e=>{const n=Number(e.units)||0;if(n>0){t+=n;const a=parseInt(e.dimensions.value,10);o+=n*(a/20)}}),{units:t,volume:o,weight:null,weightUnit:null,volumeUnit:"TEU"}}case R:{const t=e.shipment_details[k],n=(null===t||void 0===t?void 0:t.volumeUnit)===z?1728:1e6;if((null===t||void 0===t?void 0:t.packageType)===N){const e=pe(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")/n,0)),o=pe(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:o,weightUnit:t.weightUnit,volumeUnit:t.volumeUnit}}if((null===t||void 0===t?void 0:t.packageType)===D){const e=pe(t.uldPackages.reduce((e,t)=>e+parseFloat(t.volume||"0"),0)),n=pe(t.uldPackages.reduce((e,t)=>e+parseFloat(t.weight||"0"),0));return{units:t.uldPackages.length,volume:e,weight:n,weightUnit:t.weightUnit,volumeUnit:t.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:B,volumeUnit:U}}case A:{var o,a,r,i,l;const t=pe(parseFloat((null===(o=e.shipment_details[x])||void 0===o?void 0:o.volume)||"0")),n=pe(parseFloat((null===(a=e.shipment_details[x])||void 0===a?void 0:a.weight)||"0"));return{units:(null===(r=e.shipment_details[x])||void 0===r?void 0:r.units)||0,volume:t,weight:n,weightUnit:(null===(i=e.shipment_details[x])||void 0===i?void 0:i.weightUnit)||B,volumeUnit:(null===(l=e.shipment_details[x])||void 0===l?void 0:l.volumeUnit)||U}}default:return{units:0,volume:0,weight:0,weightUnit:B,volumeUnit:U}}})(i),[i]),g=1===i.commodity.length&&i.commodity[0].is_temperature,f=(null===(t=i.commodity_temperature)||void 0===t?void 0:t.tempRange)&&g?P[null===(n=i.commodity_temperature)||void 0===n?void 0:n.tempRange][null===(r=i.commodity_temperature)||void 0===r?void 0:r.temperatureSystem]:"";return a.a.createElement(X,{spacing:M.XSMALL,alignItems:"center",fullWidth:!0,key:l},c===j?a.a.createElement(ue,{alignItems:"center",spacing:M.SMALL,style:{flex:1}},d.map((e,t)=>a.a.createElement(se,{type:e,key:`${l}-${t}`,size:"tiny","data-test-id":`${s}rs-package-icon-${l}-${t}`})),a.a.createElement(Ce,{text:i.commodity.map(e=>e.label).join(", "),testId:`${s}rs-commodity-${l}`})):a.a.createElement(ue,{alignItems:"center",spacing:M.SMALL},a.a.createElement(X,{alignItems:"center",spacing:M.XSMALL,"data-test-id":`rs-${l}-units`},u,"\xa0",d.map((e,t)=>a.a.createElement(se,{type:e,key:`${l}-${t}`,size:"tiny","data-test-id":`${s}rs-package-icon-${l}-${t}`}))),a.a.createElement("span",{"data-test-id":`${s}rs-volume-${l}`},m,"\xa0",C),p&&a.a.createElement("span",{"data-test-id":`${s}rs-weight-${l}`},p,"\xa0",h),a.a.createElement(Ce,{text:i.commodity.map(e=>e.label).join(", "),testId:`${s}rs-commodity-${l}`}),g&&a.a.createElement(X,{alignItems:"center",spacing:M.XSMALL,"data-test-id":`${s}rs-temperature-${l}`},a.a.createElement(y,{type:"temperature-low",size:"tiny","data-test-id":`${s}rs-temperature-icon-${l}`}),a.a.createElement("span",{style:{whiteSpace:"nowrap"}},f))))};const ve=e=>{let{search:t,index:n,setIsOpen:o,dataTestId:i,onRecentSearchSelect:l}=e;return a.a.createElement(le,{direction:T.VERTICAL,fullWidth:!0,spacing:M.XSMALL,key:t.id,style:{padding:r.tokens.fdsComponentSpacingSm},"data-test-id":`${i}rs-card-${n}`,onClick:()=>{(async()=>{l(t);try{await re(t.id)}catch(e){console.error(e)}o(!1)})()}},a.a.createElement(ge,{search:t,index:n,dataTestId:i}),a.a.createElement(fe,{search:t,index:n,dataTestId:i}))};var Le=e=>{let{recentSearches:t,setIsOpen:n,dataTestId:o,onRecentSearchSelect:l,initialValues:s}=e;const c=t?(e=>[...e].sort((e,t)=>{const n=new Date(Math.max(new Date(e.last_time_used_date).getTime(),new Date(e.saved_update_date).getTime()));return new Date(Math.max(new Date(t.last_time_used_date).getTime(),new Date(t.saved_update_date).getTime())).getTime()-n.getTime()}).slice(0,6))(t):[];return a.a.createElement($,null,a.a.createElement(ie,null,a.a.createElement(y,{"data-test-id":o+"rs-icon",color:r.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),a.a.createElement(i.TranslatableText,{stringId:"Recent searches"})),a.a.createElement(me,{direction:T.VERTICAL,fullWidth:!0},c.map((e,t)=>a.a.createElement(ve,{onRecentSearchSelect:l,initialValues:s,search:e,index:t,key:e.id,setIsOpen:n,dataTestId:o}))))};var ye=e=>{let{isLoading:t,recentSearches:n,searchKey:o,dataTestId:l,setIsOpen:s,onRecentSearchSelect:c,initialValues:d}=e;return o||n&&0!==n.length?t?a.a.createElement(r.Spin,{size:"small"}):(null===n||void 0===n?void 0:n.length)>0&&!o.trim()?a.a.createElement(Le,{recentSearches:n,dataTestId:l,setIsOpen:s,onRecentSearchSelect:c,initialValues:d}):o.trim()?a.a.createElement(O,null,a.a.createElement(i.TranslatableText,{stringId:"No matching results",module:i.TRANSLATION_MODULES.SearchAndBook})):null:null};var Ee=e=>{let{fetchOptions:t,renderedOptions:n,recentSearches:i=[],hasError:s,mode:c,dataTestId:d,value:u,debounceTimeout:m=800,activeLocationMode:p,defaultLocation:g,onChange:f,...v}=e;const[L,y]=Object(o.useState)([]),[E,b]=Object(o.useState)(!1),[w,H]=Object(o.useState)(""),$=Object(o.useRef)(0),[O,M]=Object(o.useState)(!1),[T,x]=Object(o.useState)(3),k=Object(o.useRef)();Object(o.useEffect)(()=>{u&&0!==u.length||O||(y([]),H(""))},[u,O]),Object(o.useEffect)(()=>(""!==p&&y(e=>e.filter(e=>e.label===h[p].label)),M(!1),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{document.activeElement.blur(),document.body.click();const e=document.querySelector(".ant-select-focused");e&&e.classList.remove("ant-select-focused"),x(3)},100),()=>{k.current&&clearTimeout(k.current)}),[p]);const _=Object(o.useMemo)(()=>Object(l.debounce)(async e=>{H(e),$.current+=1;const n=$.current;y([]),b(!0);let o=null;try{const a=await t(e);n===$.current&&(y(a),o=a)}catch(a){console.error("Error fetching options:",a),n===$.current&&r.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."})}finally{if(n===$.current)return b(!1),o}},m),[t,m]);Object(o.useEffect)(()=>{if(!(null===g||void 0===g?void 0:g.code))return;(async()=>{try{y([]),b(!0);const e=await t(g.code);if(y(e),!e||0===e.length)return;let n=null;if(g.type){const t=e.find(e=>{var t;return e.label.toLowerCase()===(null===(t=h[g.type])||void 0===t?void 0:t.label.toLowerCase())});(null===t||void 0===t?void 0:t.options)&&(n=t.options.find(e=>e.code.toLowerCase()===g.code.toLowerCase()||e.selectedValue.toLowerCase()===g.code.toLowerCase()))}if(n||(n=e.map(e=>e.options).flat().find(e=>e.code.toLowerCase()===g.code.toLowerCase()||e.selectedValue.toLowerCase()===g.code.toLowerCase())),n&&f){const e={key:JSON.stringify(n),label:n.selectedValue||n.displayLabel||n.code};f([e])}}catch(e){K.isLocal()&&console.error("Error loading default location:",e)}finally{b(!1)}})()},[null===g||void 0===g?void 0:g.code,null===g||void 0===g?void 0:g.type]);return a.a.createElement(a.a.Fragment,null,a.a.createElement(S,null),a.a.createElement(V,Object.assign({maxTagCount:T,onSearch:_,$hasError:s,loading:E,options:L,filterOption:!1,notFoundContent:a.a.createElement(ye,{isLoading:E,recentSearches:i,searchKey:w,dataTestId:d,setIsOpen:M,onRecentSearchSelect:v.onRecentSearchSelect,initialValues:v.initialValues}),mode:c,"data-test-id":d+"-selector",allowClear:c===C,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:e=>{x(e?2:3),y([]),H(""),M(e)},open:O&&(E||w.trim()||(null===i||void 0===i?void 0:i.length)>0),value:u,onChange:f},v),n(L)))};var be=e=>{let{omittedPorts:t,dataTestId:n}=e;const o=t.map(e=>{var t;return null===(t=JSON.parse(e.key))||void 0===t?void 0:t.selectedValue});return a.a.createElement(r.Tooltip,{title:o.join(",")},a.a.createElement(w,{"data-test-id":n+"-extra-ports"},"+"+t.length))};t.default=e=>{let{value:t,onChange:n,hasError:l,dataTestId:c="location-input",isOriginLocation:m=!0,maxPorts:p=1,supportedLocationModes:L,customer:E,defaultLocation:b,...S}=e;const[V,$]=Object(o.useState)(t),[O,T]=Object(o.useState)(1===L.length?L[0]:""),[x,k]=Object(o.useState)(oe(O)||""===O?C:g);return Object(o.useEffect)(()=>{oe(O)?k(C):k(g)},[O]),Object(o.useEffect)(()=>{$(t),Array.isArray(t)&&t.length>0?T(t[0].type):(null===b||void 0===b?void 0:b.type)?T(b.type):T("")},[t,null===b||void 0===b?void 0:b.type]),a.a.createElement(Ee,Object.assign({mode:x,dataTestId:c,hasError:l,placeholder:a.a.createElement(i.TranslatableText,{style:{fontSize:r.tokens.fdsFontSizeBase},stringId:"Select "+(m?f:v)}),value:ee(V),fetchOptions:te(O,L,E),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 n;const o=Object.values(h).find(t=>t.label===e.label),i=null===o||void 0===o?void 0:o.icon;return a.a.createElement(r.Select.OptGroup,{label:a.a.createElement("span",{style:{fontFamily:"Open Sans"}},a.a.createElement(y,{size:"tiny",type:i}),"\xa0 \xa0",e.label),key:e.label,"data-test-id":`${t}-group-${e.label}`},null===(n=e.options)||void 0===n?void 0:n.map(n=>{const{countryCode:o,selectedValue:l,displayLabel:s,type:c}=n;return a.a.createElement(r.Option,{value:Q(n),title:l,"data-test-id":`${t}-${e.label}-${l}`,style:{paddingLeft:"8px"},label:a.a.createElement(a.a.Fragment,null,a.a.createElement(y,{type:i,size:"tiny"}),"\xa0",a.a.createElement(w,null,l)),key:n.code},a.a.createElement(X,{fullWidth:!0,justifyContent:"space-between"},a.a.createElement(X,{spacing:M.XSMALL},a.a.createElement("span",{style:{display:"inline-flex"}},a.a.createElement(r.Avatar,{type:"flag",country:o,size:"small",style:{width:r.tokens.fdsSizeSm,height:r.tokens.fdsSizeSm}})),a.a.createElement(H,null,s)),c===d&&a.a.createElement(y,{type:"amazon",size:"small"}),c===u&&a.a.createElement(r.Chip,{type:"neutral",iconType:"address-book"})))}))})})(e,c),onChange:e=>{((e,t,n,o,l)=>{if(t===g){const t=Array.isArray(e)?e:[];if(t.length<=n)o(t),ne(t,l);else{var c,d;const e=(null===(c=JSON.parse(null===(d=t[0])||void 0===d?void 0:d.key))||void 0===c?void 0:c.sourceType)===s?n>1?"airports":"airport":n>1?"ports":"port";r.Message.danger(a.a.createElement(a.a.Fragment,null,a.a.createElement(i.TranslatableText,{stringId:"You cannot enter more than"})," "," ",n," "," ",a.a.createElement(i.TranslatableText,{stringId:e})))}}else o(e),ne(e,l)})(null!==e&&void 0!==e?e:[],x,p,$,n),T("")},activeLocationMode:O,maxTagPlaceholder:e=>a.a.createElement(be,{omittedPorts:e,dataTestId:c}),defaultLocation:b,isOriginLocation:m},S))}}])}));
1
+ !function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("lodash"),require("@freightos/http-client")):"function"===typeof define&&define.amd?define("FusionLocationInput",["react","@freightos/design-system","styled-components","@freightos/freightos-i18n","lodash","@freightos/http-client"],e):"object"===typeof exports?exports.FusionLocationInput=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("lodash"),require("@freightos/http-client")):t.FusionLocationInput=e(t.React,t["@freightos/design-system"],t["styled-components"],t["@freightos/freightos-i18n"],t.lodash,t["@freightos/http-client"])}(this,(function(t,e,n,r,o,a){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="http://ship.freightos.local:8800/FusionLocationInput/",n(n.s=7)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(8)},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=a},function(t,e,n){t.exports=n(9)},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(B){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),i=new w(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=S(i,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,i),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(B){return{type:"throw",arg:B}}}t.wrap=l;var u={};function d(){}function p(){}function f(){}var h={};c(h,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(x([])));y&&y!==e&&n.call(y,o)&&(h=y);var g=f.prototype=d.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"===typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(d).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(o,a,r,i)}))}return r=r?r.then(i,i):i()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=f,c(g,"constructor",f),c(f,"constructor",p),p.displayName=c(f,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,c(t,i,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},v(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(l(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},v(g),c(g,i,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=r}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(l){o=!0,a=l}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}n.r(e);var i=n(0),c=n.n(i),l=n(1),s=n(4),u=n(2),d=n.n(u);function p(t,e,n,r,o,a,i){try{var c=t[a](i),l=c.value}catch(s){return void n(s)}c.done?e(l):Promise.resolve(l).then(r,o)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){p(a,r,o,i,c,"next",t)}function c(t){p(a,r,o,i,c,"throw",t)}i(void 0)}))}}var h,m=n(5);function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g="airport",v="seaport",b="fulfillment_center",S="address_book",E="last_mile_address",O="address",w=(y(h={},g,{label:"Airports",key:g,icon:"mode-air"}),y(h,v,{label:"Seaports",key:v,icon:"mode-ship"}),y(h,b,{label:"Fulfillment centers",key:b,icon:"fulfillment-center"}),y(h,S,{key:S,groupBy:"address"}),y(h,E,{key:E,groupBy:"address"}),y(h,O,{label:"Address",key:O,icon:"location"}),h),x="single",k="multiple",B="origin",L="destination";function j(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var C,A,I,N,T,P,_,z,M,R,F,Z=n(3),V=n.n(Z),X=Object(Z.createGlobalStyle)(C||(C=j(["\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"]))),D=V()(l.Select)(A||(A=j(["\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: 90px;\n\t\theight: "," !important;\n\t\tmargin-top: "," !important;\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"])),l.tokens.fdsBorderRadiusXl,l.tokens.fdsColorPrimaryBlue,l.tokens.fdsColorPrimaryBlue,l.tokens.fdsColorPrimaryBlue10,l.tokens.fdsComponentSpacingXxs,l.tokens.fdsSizeMd,l.tokens.fdsComponentSpacingSm,l.tokens.fdsColorPrimaryBlue,l.tokens.fdsComponentSpacingXs,l.tokens.fdsSizeMd,l.tokens.fdsSizeMd),G=V.a.span(I||(I=j(["\n\tfont-size: "," !important;\n"])),l.tokens.fdsFontSizeSm),J=V.a.div(N||(N=j(["\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"])),l.tokens.fdsFontSizeSm),U=V()(l.Menu)(T||(T=j(["\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"])),l.tokens.fdsBodyTextColorDisabled),q=V.a.div(P||(P=j(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),l.tokens.fdsFontSizeSm,l.tokens.fdsSizeSm,l.tokens.fdsHeadingsFontFamily),W=V()(l.Icon)(_||(_=j(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),H={XXLARGE:l.tokens.fdsComponentSpacingXxl,XLARGE:l.tokens.fdsComponentSpacingXl,LARGE:l.tokens.fdsComponentSpacingLg,MEDIUM:l.tokens.fdsComponentSpacingMd,SMALL:l.tokens.fdsComponentSpacingSm,XSMALL:l.tokens.fdsComponentSpacingXs,XXSMALL:l.tokens.fdsComponentSpacingXxs,NONE:0},K="vertical",Y="horizontal",$=V.a.div(z||(z=j(["\n\tdisplay: flex;\n\tflex-direction: ",";\n\tflex-wrap: ",";\n\talign-items: ",";\n\tjustify-content: ",";\n\tbox-sizing: border-box;\n\n\t","\n\t",";\n"])),(function(t){return t.direction===K?"column":"row"}),(function(t){return t.wrap?"wrap":"nowrap"}),(function(t){return t.alignItems}),(function(t){return t.justifyContent}),(function(t){return t.fullWidth&&Object(Z.css)(M||(M=j(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(t){var e=t.direction,n=t.spacing;return e===K?Object(Z.css)(R||(R=j(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ",";\n\t\t\t\t\t}\n\t\t\t "])),n):Object(Z.css)(F||(F=j(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ",";\n\t\t\t\t\t}\n\t\t\t "])),n)})),Q=["direction","alignItems","spacing"],tt=function(t){var e=t.direction,n=void 0===e?Y:e,r=t.alignItems,o=void 0===r?"start":r,i=t.spacing,l=void 0===i?H.NONE:i,s=a(t,Q);return c.a.createElement($,Object.assign({},s,{direction:n,alignItems:o,spacing:l}),s.children)},et=function(t){var e=t.recentSearches,n=t.onSelect,r=t.dataTestId,o=t.setIsOpen;return c.a.createElement(U,null,c.a.createElement(l.Menu.ItemGroup,{title:c.a.createElement("span",null,c.a.createElement(l.Icon,{color:l.tokens.fdsColorPrimaryGray60,type:"history"})," ",c.a.createElement(s.TranslatableText,{stringId:"Recent searches"}))},e.map((function(t,e){return c.a.createElement(l.Menu.Item,{key:e,onClick:function(){n(t),o(!1)}},c.a.createElement(tt,{direction:K},c.a.createElement(tt,{alignItems:"center"},c.a.createElement(l.Avatar,{type:"flag",country:t.origin[0].code,size:"small",style:{width:l.tokens.fdsSizeSm,height:l.tokens.fdsSizeSm},"data-test-id":"".concat(r,"-recent-search-").concat(e,"-origin-flag")}),"\xa0",c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-origin-value")},t.origin.map((function(t){return t.value})).join(", ")),"\xa0",c.a.createElement(l.Icon,{type:"arrow-forward",style:{marginRight:0}}),"\xa0",c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-destination-value")},t.destination.map((function(t){return t.value})).join(", ")),"\xa0",c.a.createElement(l.Avatar,{type:"flag",country:t.destination[0].code,size:"small",style:{width:l.tokens.fdsSizeSm,height:l.tokens.fdsSizeSm},"data-test-id":"".concat(r,"-recent-search-").concat(e,"-destination-flag")})),c.a.createElement(tt,{spacing:H.SMALL,alignItems:"center",style:{fontSize:"10px"}},c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-units")},t.shipmentDetails.units.value,c.a.createElement(W,{type:t.shipmentDetails.units.type})),c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-volume")},t.shipmentDetails.volume.value," ",t.shipmentDetails.volume.unit),c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-weight")},t.shipmentDetails.weight.value," ",t.shipmentDetails.weight.unit),c.a.createElement("span",{"data-test-id":"".concat(r,"-recent-search-").concat(e,"-commodity")},t.commodity))))}))))},nt=function(t){var e=t.isLoading,n=t.recentSearches,r=t.searchKey,o=t.onSelect,a=t.dataTestId,i=t.setIsOpen;return r||n&&0!==n.length?e?c.a.createElement(l.Spin,{size:"small"}):(null===n||void 0===n?void 0:n.length)>0&&!r.trim()?c.a.createElement(et,{recentSearches:n,onSelect:o,dataTestId:a,setIsOpen:i}):r.trim()?c.a.createElement(q,null,c.a.createElement(s.TranslatableText,{stringId:"No matching results",module:s.TRANSLATION_MODULES.SearchAndBook})):null:null},rt=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode"],ot=function(t){var e=t.fetchOptions,n=t.renderedOptions,r=t.recentSearches,l=void 0===r?[]:r,s=t.hasError,u=t.mode,p=t.dataTestId,h=t.value,y=t.debounceTimeout,g=void 0===y?800:y,v=t.activeLocationMode,b=a(t,rt),S=o(Object(i.useState)([]),2),E=S[0],O=S[1],k=o(Object(i.useState)(!1),2),B=k[0],L=k[1],j=o(Object(i.useState)(""),2),C=j[0],A=j[1],I=Object(i.useRef)(0),N=o(Object(i.useState)(!1),2),T=N[0],P=N[1],_=o(Object(i.useState)(3),2),z=_[0],M=_[1];Object(i.useEffect)((function(){h&&0!==h.length||(O([]),A(""))}),[h]),Object(i.useEffect)((function(){""!==v&&O((function(t){return t.filter((function(t){return t.label===w[v].label}))})),P(!1),setTimeout((function(){document.activeElement.blur(),document.body.click();var t=document.querySelector(".ant-select-focused");t&&t.classList.remove("ant-select-focused"),M(3)}),100)}),[v]);var R=Object(i.useMemo)((function(){var t=function(){var t=f(d.a.mark((function t(n){var r,o;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return A(n),I.current+=1,r=I.current,O([]),L(!0),t.prev=5,t.next=8,e(n);case 8:o=t.sent,r===I.current&&O(o),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),console.error("Error fetching options:",t.t0);case 15:return t.prev=15,r===I.current&&L(!1),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[5,12,15,18]])})));return function(e){return t.apply(this,arguments)}}();return Object(m.debounce)(t,g)}),[e,g]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(X,null),c.a.createElement(D,Object.assign({maxTagCount:z,onSearch:R,$hasError:s,loading:B,options:E,notFoundContent:c.a.createElement(nt,{isLoading:B,recentSearches:l,searchKey:C,onSelect:b.onSelect,dataTestId:p,setIsOpen:P}),mode:u,"data-test-id":"".concat(p,"-selector"),allowClear:u===x,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(t){M(t?2:3),P(t)},open:T&&(B||C.trim()||(null===l||void 0===l?void 0:l.length)>0),value:h},b),n(E)))},at=function(t){var e=t.omittedPorts,n=t.dataTestId,r=e.map((function(t){var e;return null===(e=JSON.parse(t.key))||void 0===e?void 0:e.selectedValue}));return c.a.createElement(l.Tooltip,{title:r.join(",")},c.a.createElement(G,{"data-test-id":"".concat(n,"-extra-ports")},"+".concat(e.length)))};function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var lt=n(6),st=n.n(lt),ut=function(){var t=f(d.a.mark((function t(e,n,r){var o,a;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=e.reduce((function(t,e){return ct(ct({},t),{},y({},w[e].key,ct(ct({type:e.toUpperCase()},(null===r||void 0===r?void 0:r.code)?{id:r.code}:{}),w[e].groupBy?{groupBy:w[e].groupBy}:{})))}),{}),t.next=4,st.a.get("/geocoder/api/v1/fusion/search-locations",{params:{query:n,limit:5,sources:o}});case 4:return a=t.sent,t.abrupt("return",a.data);case 8:return t.prev=8,t.t0=t.catch(0),console.error("Error fetching locations:",t.t0),t.abrupt("return",{results:{airport:[{displayLabel:"08820 - Barcelona, Spain",selectedValue:"BCN",formattedNameOrAddress:"Barcelona Airport, ES",code:"BCN",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"airport"}],seaport:[{displayLabel:"08820 - ESBCN, Spain",selectedValue:"ESBCN",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"33 - ESBCN, Spain",selectedValue:"ESBCN2",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN2",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"44 - ESBCN, Spain",selectedValue:"ESBCN3",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN3",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"55 - ESBCN, Spain",selectedValue:"ESBCN4",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN4",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"66 - ESBCN, Spain",selectedValue:"ESBCN5",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN5",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"77 - ESBCN, Spain",selectedValue:"ESBCN6",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN6",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"},{displayLabel:"88 - ESBCN, Spain",selectedValue:"ESBCN7",formattedNameOrAddress:"Barcelona Airport, ES",code:"ESBCN7",country:"ES",city:"Barcelona",state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"seaport"}],address:[{displayLabel:"#PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA, #PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA",selectedValue:"#PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA",formattedNameOrAddress:"6835 W Buckeye Rd",code:"ChIJrSI6B8UVK4cRvKlMRiIR1zI",country:"US",city:null,state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"fulfillment_center"},{displayLabel:"#PP - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA, #PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA",selectedValue:"#PP - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA",formattedNameOrAddress:"6835 W Buckeye Rd",code:"ChIJrSI6B8UVK4cRvKlMRiIR1zI",country:"US",city:null,state:null,latitude:null,longitude:null,postalOrZipCode:null,sourceType:"fulfillment_center"},{displayLabel:"08820 - Barcelona, Spain",selectedValue:"08820 - Barcelona, Spain",formattedNameOrAddress:"Josep Tarradellas Barcelona-El Prat Airport (BCN), 08820 El Prat de Llobregat, Barcelona, Spain",code:"ChIJpY58hGSepBIR15tv-0LpK_M",country:"ES",city:"Barcelona",state:null,latitude:"41.29834049999999",longitude:"2.0800095",postalOrZipCode:"08820",locationType:null,sourceType:"address"},{displayLabel:"08001 - Barcelona, Spain",selectedValue:"08001 - Barcelona, Spain",formattedNameOrAddress:"Barcelona, Spain",code:"ChIJ5TCOcRaYpBIRCmZHTz37sEQ",country:"ES",city:"Barcelona",state:null,latitude:"41.3873974",longitude:"2.168568",postalOrZipCode:"08001",sourceType:"last_mile_address"},{displayLabel:"3584 BJ - Barcelona, Spain",selectedValue:"3584 BJ - Barcelona, Spain",label:"Daltonlaan 100, 3584 BJ Utrecht, Netherlands",formattedNameOrAddress:"Daltonlaan 100, 3584 BJ Utrecht, Netherlands",code:"ChIJO-Sv5aJoxkcRFS4H-mRHXM0",city:"Barcelona",state:null,country:"NL",latitude:"52.0874336",longitude:"5.159197",postalOrZipCode:"3584 BJ",locationType:"warehouse",sourceType:"address_book"}]}});case 13:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e,n,r){return t.apply(this,arguments)}}(),dt=["address"],pt=function(t){var e=function(t){return{key:(e=t).key||JSON.stringify(e),label:e.label};var e};return Array.isArray(t)?t.map(e):e(t)},ft=function(t){var e=ct({},t),n=t[O].filter((function(t){return t.sourceType===b}));if(n.length>0){var r,o=e,i=o.address;e=ct(ct({},a(o,dt)),{},(y(r={},b,n),y(r,"address",i.filter((function(t){return t.type!==b}))),r))}return e},ht=function(t,e,n){return function(){var r=f(d.a.mark((function r(o){var a,i,c;return d.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o){r.next=2;break}return r.abrupt("return",[]);case 2:return a=""!==t?[t]:e,r.next=5,ut(a,o,n);case 5:return i=r.sent,(c=i.results)[O]&&(c=ft(c)),r.abrupt("return",Object.keys(c).map((function(t){var e;return{label:(null===(e=w[t])||void 0===e?void 0:e.label)||t,options:c[t].map((function(t){return ct(ct({},t),{},{type:t.sourceType})}))}})));case 9:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()},mt=function(){var t=f(d.a.mark((function t(e,n){var r,o;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Array.isArray(e)?e:[e],t.next=3,Promise.all(r.map(function(){var t=f(d.a.mark((function t(e){var n;return d.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=JSON.parse(e.key),t.abrupt("return",ct({key:e.key},n));case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return",void 0);case 8:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()));case 3:o=t.sent,n(o.filter(Boolean));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),yt=function(t){return t&&(t===O||t===E||t===S||t===b)},gt=["value","onChange","hasError","dataTestId","isOriginLocation","maxPorts","supportedLocationModes","customer"];e.default=function(t){var e=t.value,n=t.onChange,r=t.hasError,u=t.dataTestId,d=void 0===u?"location-input":u,p=t.isOriginLocation,f=void 0===p||p,h=t.maxPorts,m=void 0===h?1:h,y=t.supportedLocationModes,g=t.customer,v=a(t,gt),E=o(Object(i.useState)(e),2),O=E[0],j=E[1],C=o(Object(i.useState)(1===y.length?y[0]:""),2),A=C[0],I=C[1],N=o(Object(i.useState)(yt(A)||""===A?x:k),2),T=N[0],P=N[1];return Object(i.useEffect)((function(){yt(A)?P(x):P(k)}),[A]),Object(i.useEffect)((function(){j(e),Array.isArray(e)&&e.length>0?I(e[0].type):I("")}),[e]),c.a.createElement(ot,Object.assign({mode:T,dataTestId:d,hasError:r,placeholder:c.a.createElement(s.TranslatableText,{style:{fontSize:l.tokens.fdsFontSizeBase},stringId:"Select ".concat(f?B:L)}),value:O&&pt(O),fetchOptions:ht(A,y,g),renderedOptions:function(t){return function(t,e){return null===t||void 0===t?void 0:t.map((function(t){var n,r=Object.values(w).find((function(e){return e.label===t.label})),o=null===r||void 0===r?void 0:r.icon;return c.a.createElement(l.Select.OptGroup,{label:c.a.createElement("span",{style:{fontFamily:"Open Sans"}},c.a.createElement(l.Icon,{size:"tiny",type:o}),"\xa0 \xa0",t.label),key:t.label,"data-test-id":"".concat(e,"-group-").concat(t.label)},null===(n=t.options)||void 0===n?void 0:n.map((function(n){var r=n.country,a=n.selectedValue,i=n.displayLabel,s=n.type;return c.a.createElement(l.Option,{key:a,value:JSON.stringify(n),title:a,label:c.a.createElement(c.a.Fragment,null,c.a.createElement(l.Icon,{type:o,size:"tiny"}),"\xa0",c.a.createElement(G,null,a)),"data-test-id":"".concat(e,"-").concat(t.label,"-").concat(a),style:{paddingLeft:"8px"}},c.a.createElement(tt,{fullWidth:!0,justifyContent:"space-between"},c.a.createElement(tt,{spacing:H.XSMALL},c.a.createElement("span",null,c.a.createElement(l.Avatar,{type:"flag",country:r,size:"small",style:{width:l.tokens.fdsSizeSm,height:l.tokens.fdsSizeSm}})),c.a.createElement(J,null,i)),s===b&&c.a.createElement(l.Icon,{type:"amazon",size:"small"}),s===S&&c.a.createElement(l.Chip,{type:"neutral",iconType:"address-book"})))})))}))}(t,d)},onChange:function(t){!function(t,e,n,r,o){if(e===k){var a=Array.isArray(t)?t:[];a.length<=n?(r(a),mt(a,o)):l.Message.danger(c.a.createElement(s.TranslatableText,{stringId:"You cannot enter more than ".concat(n," ports")}))}else r(t),mt(t,o)}(t,T,m,j,n),I("")},activeLocationMode:A,maxTagPlaceholder:function(t){return c.a.createElement(at,{omittedPorts:t,dataTestId:d})}},v))}}])}));
151
2
  //# sourceMappingURL=main.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../webpack/universalModuleDefinition","../webpack/bootstrap","../external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","../external \"@freightos/design-system\"","../external \"styled-components\"","../external \"@freightos/freightos-i18n\"","../external \"@freightos/http-client\"","../external \"lodash\"","helpers/constant.js","common/components/FusionIcon/svgs.jsx","common/components/FusionIcon/index.jsx","helpers/styled.js","common/helpers/constants.js","components/RecentSearches/constants.js","common/helpers/styled.js","common/components/Flex.js","common/helpers/Environment.js","helpers/utils.js","helpers/apis.js","components/RecentSearches/apis.js","common/httpClient/doRequest/index.js","components/RecentSearches/styled.js","components/RecentSearches/utils.js","components/RecentSearches/components/TruncatedLabel.jsx","components/RecentSearches/components/ItineraryDisplay.jsx","components/RecentSearches/components/ShipmentAndCommodityDisplay.jsx","components/RecentSearches/components/SearchCard.jsx","components/RecentSearches/index.jsx","components/RecentSearches/adapters.js","components/SelectorContent.js","components/DebounceSelect.js","components/MaxPortsPlaceholder.js","index.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__4__","__WEBPACK_EXTERNAL_MODULE__5__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","LOCATION_MODES","LOCATION_MODES_MAP","label","icon","groupedBy","SelectModes","LocationTypes","aog-cargo","React","createElement","width","height","viewBox","fill","fillRule","clipRule","chemical","consolidation-loose","courier","dangerous-goods","diplomatic-cargo","electric-equipment","food-perishables","general-cargo","lithium-batteries","live-animals","perishables-notemp","pharmaceuticals","retail","clipPath","id","shiny-stars","spare-parts","temperature-control","valuable-cargo","vulnerable-cargo","FusionIcon","_ref","type","component","rest","newComponent","svgs","Icon","assign","DropdownGlobalStyle","createGlobalStyle","DebounceSelector","styled","Select","tokens","fdsBorderRadiusXl","fdsColorPrimaryBlue","fdsColorPrimaryBlue10","fdsComponentSpacingXxs","fdsSizeMd","size","fdsComponentSpacingSm","fdsComponentSpacingXs","fdsColorPrimaryGray80","_ref2","$hasError","fdsColorSemanticRed","fdsColorSemanticRed10","SelectedOptionLabel","span","fdsFontSizeSm","SelectOptionLabel","div","StyledMenu","Menu","fdsBodyTextColorDisabled","NoMatchingResults","fdsSizeSm","fdsHeadingsFontFamily","FlexSpacings","XXLARGE","fdsComponentSpacingXxl","XLARGE","fdsComponentSpacingXl","LARGE","fdsComponentSpacingLg","MEDIUM","fdsComponentSpacingMd","SMALL","XSMALL","XXSMALL","NONE","FlexDirections","VERTICAL","HORIZONTAL","SEARCH_FIELDS","TEMPERATURE_SYSTEM","TEMPERATURE_RANGES_DATA","SEARCH_PLATFORMS","SHIPMENT_OPTIONS","VOLUME_OPTIONS","WEIGHT_OPTIONS","PACKAGE_TYPE","StyledFlex","$direction","$wrap","_ref3","$alignItems","_ref4","$justifyContent","_ref5","$fullWidth","css","_ref6","$spacing","Flex","direction","alignItems","spacing","wrap","justifyContent","fullWidth","children","Environment","process","REACT_APP_CUSTOM_ENV","stableStringify","obj","allKeys","JSON","stringify","k","v","push","uniqSortedKeys","Array","from","Set","sort","normalizeLocationForKey","loc","displayLabel","selectedValue","formattedNameOrAddress","code","countryCode","stateOrProvince","city","latitude","longitude","postalOrZipCode","sourceType","locationType","countryName","country","stableKeyFromLocation","parsed","parse","decodeHtmlEntities","getLocationInputValue","locations","formatLocation","location","_LOCATION_MODES_MAP$l","Fragment","undefined","getLocationInputOption","isArray","map","fetchLocations","activeLocationMode","supportedLocationModes","customer","async","query","modes","locationsResults","locationModes","sources","reduce","acc","toUpperCase","searchTerm","httpClient","post","limit","data","error","console","results","getLocations","updatedLocationsResults","fulfillmentCenters","filter","option","length","address","otherTypes","extractFulfillmentCenters","keys","_LOCATION_MODES_MAP$k","options","onChangeLocation","changedLocations","onChange","Promise","all","raw","json","err","Boolean","isLocationAddress","replace","saveLastUsedSearch","isTalaia","method","url","params","URLSearchParams","toString","headers","doRequest","isProduction","searchId","STitle","fdsColorPrimaryGray60","fdsSizeXs","fdsFontWeightRegular","SCard","UnitIcon","STruncatedLabel","$isLocationLabel","$isPort","SLocationFlag","Avatar","fdsColorPrimaryGray20","STinyWrapper","SListWrapper","formatNumber","toLocaleString","maximumFractionDigits","useGrouping","groupAndOrderLocationsByCountries","groupedByCountry","forEach","a","b","localeCompare","TruncatedLabel","text","testId","isPort","isLocationLabel","labelRef","useRef","isTruncated","setIsTruncated","useState","useEffect","checkTruncation","current","element","truncated","scrollWidth","clientWidth","labelElement","ref","data-test-id","Tooltip","title","ItineraryDisplay","search","index","dataTestId","isMultiOrigin","origin","isMultiDestination","destination","groupedOrigin","groupedDestination","labelOrigin","join","style","marginRight","color","fdsColorPrimaryGray90","flex","labelDestination","ShipmentAndCommodityDisplay","_search$commodity_tem","_search$commodity_tem2","_search$commodity_tem3","platformType","platform_type","icons","shipmentType","shipment_details","unitsPackages","packageType","boxPackages","uniqueIcons","packageItem","_packageItem$type","_packageItem$type$val","includes","chooseIconsType","units","volume","weight","weightUnit","volumeUnit","useMemo","_search$shipment_deta","calculatedUnits","calculatedTEU","pkg","Number","dimensionSelected","parseInt","dimensions","volumeCalculationFactor","formattedVolume","curr","parseFloat","formattedWeight","uldPackages","_search$shipment_deta2","_search$shipment_deta3","_search$shipment_deta4","_search$shipment_deta5","_search$shipment_deta6","shipmentTotalsBasedOnPackages","isTemperature","commodity","is_temperature","temperatureRange","commodity_temperature","tempRange","temperatureSystem","iconIndex","whiteSpace","SearchCard","setIsOpen","onRecentSearchSelect","padding","onClick","handleClick","RecentSearches","recentSearches","initialValues","firstSixSearches","aMaxDate","Date","Math","max","last_time_used_date","getTime","saved_update_date","slice","orderRecentSearches","TranslatableText","stringId","SelectorContent","isLoading","searchKey","Spin","trim","TRANSLATION_MODULES","SearchAndBook","DebounceSelect","fetchOptions","renderedOptions","hasError","debounceTimeout","defaultLocation","props","setOptions","setIsLoading","setSearchKey","fetchRef","isOpen","maxTagCount","setMaxTagCount","timeoutRef","prevOptions","clearTimeout","setTimeout","document","activeElement","blur","body","click","active","querySelector","classList","remove","debounceFetcher","debounce","optionValue","fetchId","returnOptions","newOptions","Notification","danger","message","description","match","targetGroup","find","group","_LOCATION_MODES_MAP$d","toLowerCase","flat","formattedMatch","isLocal","loadDefaultLocation","onSearch","loading","filterOption","notFoundContent","allowClear","labelInValue","optionLabelProp","showSearch","onDropdownVisibleChange","open","MaxPortsPlaceholder","omittedPorts","selectedItems","omittedPort","_JSON$parse","LocationInput","isOriginLocation","maxPorts","selectedLocation","setSelectedLocation","setActiveLocationMode","selectionMode","setSelectionMode","placeholder","fontSize","fdsFontSizeBase","optionGroups","renderLocationOptions","some","_group$options","_group$options2","values","locationOptionIcon","OptGroup","fontFamily","Option","paddingLeft","display","Chip","iconType","handleLocationChange","selectedPorts","_selectedPorts$","typePort","Message","maxTagPlaceholder"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,4BAA6BA,QAAQ,qBAAsBA,QAAQ,6BAA8BA,QAAQ,0BAA2BA,QAAQ,WACtK,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,sBAAuB,CAAC,QAAS,2BAA4B,oBAAqB,4BAA6B,yBAA0B,UAAWJ,GACjI,kBAAZC,QACdA,QAA6B,oBAAID,EAAQG,QAAQ,SAAUA,QAAQ,4BAA6BA,QAAQ,qBAAsBA,QAAQ,6BAA8BA,QAAQ,0BAA2BA,QAAQ,WAE/MJ,EAA0B,oBAAIC,EAAQD,EAAY,MAAGA,EAAK,4BAA6BA,EAAK,qBAAsBA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Z,CAAsBD,EAAczK,GACrErE,SAAU1C,If4MuBsS,EAACtS,EAAUmR,EAAeJ,EAAUE,EAAqBvO,KAC5F,GAAIyO,IAAkB5a,EAAsB,CAC3C,MAAMgc,EAAgBlU,MAAMgC,QAAQL,GAAYA,EAAW,GAC3D,GAAIuS,EAActQ,QAAU8O,EAC3BE,EAAoBsB,GACpB/P,GAAiB+P,EAAe7P,OAC1B,CAAC,IAADkO,EAAA4B,EACN,MAAMC,GAA4C,QAAjC7B,EAAA7S,KAAK4B,MAAsB,QAAjB6S,EAACD,EAAc,UAAE,IAAAC,OAAA,EAAhBA,EAAkB/c,YAAI,IAAAmb,OAAA,EAAjCA,EAAmCvR,cAAenJ,EAA0B6a,EAAW,EAAI,WAAa,UAAcA,EAAW,EAAI,QAAU,OAChK2B,UAAQzD,OACPvY,IAAAC,cAAAD,IAAAwJ,SAAA,KACCxJ,IAAAC,cAAC2V,mBAAgB,CAACC,SAAU,+BAC3B,IAAI,IAAEwE,EAAS,IAAE,IAClBra,IAAAC,cAAC2V,mBAAgB,CAACC,SAAUkG,YAK/BxB,EAAoBjR,GACpBwC,GAAiBxC,EAAU0C,Ie7NzB4P,CAA6B,OAARtS,QAAQ,IAARA,IAAY,GAAImR,EAAeJ,EAAUE,EAAqBvO,GACnFwO,ExB1GiC,KwB4GlC1Q,mBAAoBA,EACpBmS,kBAAmBlC,GAAgB/Z,IAAAC,cAAC6Z,GAAmB,CAACC,aAAcA,EAAc1J,WAAYA,IAChGqG,gBAAiBA,EACjB0D,iBAAkBA,GACdpY","file":"main.bundle.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"@freightos/design-system\"), require(\"styled-components\"), require(\"@freightos/freightos-i18n\"), require(\"@freightos/http-client\"), require(\"lodash\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"FusionLocationInput\", [\"react\", \"@freightos/design-system\", \"styled-components\", \"@freightos/freightos-i18n\", \"@freightos/http-client\", \"lodash\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FusionLocationInput\"] = factory(require(\"react\"), require(\"@freightos/design-system\"), require(\"styled-components\"), require(\"@freightos/freightos-i18n\"), require(\"@freightos/http-client\"), require(\"lodash\"));\n\telse\n\t\troot[\"FusionLocationInput\"] = factory(root[\"React\"], root[\"@freightos/design-system\"], root[\"styled-components\"], root[\"@freightos/freightos-i18n\"], root[\"@freightos/http-client\"], root[\"lodash\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__5__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"http://ship.freightos.local:8800/FusionLocationInput/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","/**\r\n * Default location mode used when no specific mode is selected.\r\n * @type {string}\r\n */\r\nexport const DEFAULT_LOCATION_MODE = '';\r\n\r\nexport const LOCATION_MODES = {\r\n\tAIRPORT: 'airport',\r\n\tSEAPORT: 'seaport',\r\n\tFULFILLMENT_CENTER: 'fulfillment_center',\r\n\tADDRESS_BOOK: 'address_book',\r\n\tLAST_MILE_ADDRESS: 'last_mile_address',\r\n\tADDRESS: 'address',\r\n};\r\n\r\nexport const LOCATION_MODES_MAP = {\r\n\t[LOCATION_MODES.AIRPORT]: { label: 'Airports', key: LOCATION_MODES.AIRPORT, icon: 'mode-air' },\r\n\t[LOCATION_MODES.SEAPORT]: { label: 'Ports', key: LOCATION_MODES.SEAPORT, icon: 'mode-ship' },\r\n\t[LOCATION_MODES.FULFILLMENT_CENTER]: {\r\n\t\tlabel: 'Fulfillment centers',\r\n\t\tkey: LOCATION_MODES.FULFILLMENT_CENTER,\r\n\t\ticon: 'fulfillment-center',\r\n\t},\r\n\t[LOCATION_MODES.ADDRESS_BOOK]: { key: LOCATION_MODES.ADDRESS_BOOK, groupedBy: 'address' },\r\n\t[LOCATION_MODES.LAST_MILE_ADDRESS]: { key: LOCATION_MODES.LAST_MILE_ADDRESS, groupedBy: 'address' },\r\n\t[LOCATION_MODES.ADDRESS]: { label: 'Address', key: LOCATION_MODES.ADDRESS, icon: 'location' },\r\n};\r\n\r\n/**\r\n * Enumeration of selection modes for location input.\r\n * @enum {string}\r\n */\r\nexport const SelectModes = {\r\n\tSINGLE: 'single',\r\n\tMULTIPLE: 'multiple',\r\n};\r\n\r\n/**\r\n * Enumeration of location types for origin and destination.\r\n * @enum {string}\r\n */\r\nexport const LocationTypes = {\r\n\tORIGIN: 'origin',\r\n\tDESTINATION: 'destination',\r\n};\r\n\r\nexport const MAX_TAG_COUNT = 3;\r\nexport const MAX_TAG_COUNT_MULTIPLE = 2;\r\n","import React from 'react';\r\n\r\nexport default {\r\n\t'aog-cargo': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\tfillRule=\"evenodd\"\r\n\t\t\t\tclipRule=\"evenodd\"\r\n\t\t\t\td=\"M15.0934 13.8699L10.5914 13.8753L5.09226 13.8684L3.43549 13.8671L2.09739 8.87329L3.59892 8.87471L5.0977 10.875L10.2426 10.8733L8.09955 2.87544L10.0932 2.85889L15.0963 10.8669L20.5929 10.8641C21.4226 10.8696 22.0914 11.5497 22.093 12.3671C22.0875 13.1968 21.4171 13.863 20.59 13.8672L15.0934 13.8699ZM15 16.9999C15.5523 16.9999 16 16.5522 16 15.9999C16 15.4476 15.5523 14.9999 15 14.9999C14.4477 14.9999 14 15.4476 14 15.9999C14 16.5522 14.4477 16.9999 15 16.9999ZM12 15.9999C12 16.5522 11.5523 16.9999 11 16.9999C10.4477 16.9999 10 16.5522 10 15.9999C10 15.4476 10.4477 14.9999 11 14.9999C11.5523 14.9999 12 15.4476 12 15.9999ZM1 17.9999V19.9999H23V17.9999H1Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'chemical': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M13.1112 11.2462L18.6673 18.75H5.33274L10.8888 11.2462V5.25H13.1112M16.4004 3H7.59961C7.1329 3 6.87732 3.54 7.16624 3.91125L8.66637 5.8125V10.5038L2.22135 19.2C1.67686 19.9425 2.19913 21 3.11032 21H20.8897C21.8009 21 22.3231 19.9425 21.7786 19.2L15.3336 10.5038V5.8125L16.8338 3.91125C17.1227 3.54 16.8671 3 16.4004 3Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'consolidation-loose': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M5 10H3V4H11V6H5V10ZM19 18H13V20H21V14H19V18ZM5 18V14H3V20H11V18H5ZM21 4H13V6H19V10H21V4ZM8 13V15L11 12L8 9V11H3V13H8ZM16 11V9L13 12L16 15V13H21V11H16Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'courier': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M10.78 12.05L13.81 11.79L15 9L16.19 11.79L19.22 12.05L16.92 14.04L17.61 17L15 15.47L12.39 17L13.08 14.04L10.78 12.05ZM22 8V18C22 19.11 21.11 20 20 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.9 4 4 4H10L12 6H20C21.11 6 22 6.9 22 8ZM20 8H4V18H20V8Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'dangerous-goods': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M12.0001 22.0251C11.7334 22.0251 11.4793 21.9751 11.2376 21.8751C10.9959 21.7751 10.7751 21.6334 10.5751 21.4501L2.5501 13.4251C2.36676 13.2251 2.2251 13.0043 2.1251 12.7626C2.0251 12.5209 1.9751 12.2668 1.9751 12.0001C1.9751 11.7334 2.0251 11.4751 2.1251 11.2251C2.2251 10.9751 2.36676 10.7584 2.5501 10.5751L10.5751 2.5501C10.7751 2.3501 10.9959 2.20426 11.2376 2.1126C11.4793 2.02093 11.7334 1.9751 12.0001 1.9751C12.2668 1.9751 12.5251 2.02093 12.7751 2.1126C13.0251 2.20426 13.2418 2.3501 13.4251 2.5501L21.4501 10.5751C21.6501 10.7584 21.7959 10.9751 21.8876 11.2251C21.9793 11.4751 22.0251 11.7334 22.0251 12.0001C22.0251 12.2668 21.9793 12.5209 21.8876 12.7626C21.7959 13.0043 21.6501 13.2251 21.4501 13.4251L13.4251 21.4501C13.2418 21.6334 13.0251 21.7751 12.7751 21.8751C12.5251 21.9751 12.2668 22.0251 12.0001 22.0251ZM12.0001 20.0251L20.0251 12.0001L12.0001 3.9751L3.9751 12.0001L12.0001 20.0251ZM11.0001 13.0001H13.0001V7.0001H11.0001V13.0001ZM12.0001 16.0001C12.2834 16.0001 12.5209 15.9043 12.7126 15.7126C12.9043 15.5209 13.0001 15.2834 13.0001 15.0001C13.0001 14.7168 12.9043 14.4793 12.7126 14.2876C12.5209 14.0959 12.2834 14.0001 12.0001 14.0001C11.7168 14.0001 11.4793 14.0959 11.2876 14.2876C11.0959 14.4793 11.0001 14.7168 11.0001 15.0001C11.0001 15.2834 11.0959 15.5209 11.2876 15.7126C11.4793 15.9043 11.7168 16.0001 12.0001 16.0001Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'diplomatic-cargo': () => (\r\n\t\t<svg width='1em' height='1em' fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\tfillRule=\"evenodd\"\r\n\t\t\t\tclipRule=\"evenodd\"\r\n\t\t\t\td=\"M17 2H11V5V8.00167L3 8.01377V10H21V8.01377L13 8.00139V5H17V2ZM4.46212 19.0138V11.343H6.40657V19.0138H8.90657V11.343H10.851V19.0138H13.351V11.343H15.2955V19.0138H17.7955V11.343H19.7399V19.0138H22V21H2V19.0138H4.46212Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'electric-equipment': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M16.6667 6.44444V2H14.3333V6.44444H9.66667V2H7.33333V6.44444C6.16667 6.44444 5 7.55556 5 8.66667V14.7778L9.08333 18.6667V22H14.9167V18.6667L19 14.7778V8.66667C19 7.55556 17.8333 6.44444 16.6667 6.44444ZM16.6667 13.8556L13.2717 17.1L12.7817 17.5556H11.2183L10.74 17.1L7.33333 13.8556V8.76667C7.33333 8.73333 7.40333 8.66667 7.43833 8.66667H16.5733C16.6083 8.66667 16.6667 8.73333 16.6667 8.76667V13.8556Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'food-perishables': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M20 10.0001C18.58 7.57005 15.5 6.69005 13 8.00005V3.00005H11V8.00005C8.50002 6.69005 5.42002 7.57005 4.00002 10.0001C2.00002 13.0001 7.00002 22 9.00002 22C11 22 11 21 12 21C13 21 13 22 15 22C17 22 22 13.0001 20 10.0001ZM18.25 13.3801C17.63 15.8501 16.41 18.12 14.7 20C14.5 20 14.27 19.9 14.1 19.75C12.87 18.76 11.13 18.76 9.90002 19.75C9.73002 19.9 9.50002 20 9.30002 20C7.59002 18.13 6.36002 15.8501 5.75002 13.3901C5.50002 12.6601 5.45002 11.8701 5.66002 11.1201C6.24002 10.0901 7.32002 9.43005 8.50002 9.40005C9.06002 9.41005 9.61002 9.54005 10.11 9.79005L11 10.2401H13L13.89 9.79005C14.39 9.54005 14.94 9.41005 15.5 9.40005C16.68 9.43005 17.76 10.0801 18.34 11.1101C18.55 11.8601 18.5 12.6501 18.25 13.3801ZM11 5.00005C5.38002 8.07005 4.11002 3.78005 4.11002 3.78005C4.11002 3.78005 6.77002 0.190051 11 5.00005Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'general-cargo': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path d=\"M12 2L6.5 11H17.5L12 2ZM12 5.84L13.93 9H10.06L12 5.84ZM17.5 13C15.01 13 13 15.01 13 17.5C13 19.99 15.01 22 17.5 22C19.99 22 22 19.99 22 17.5C22 15.01 19.99 13 17.5 13ZM17.5 20C16.12 20 15 18.88 15 17.5C15 16.12 16.12 15 17.5 15C18.88 15 20 16.12 20 17.5C20 18.88 18.88 20 17.5 20ZM3 21.5H11V13.5H3V21.5ZM5 15.5H9V19.5H5V15.5Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'lithium-batteries': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M4.72727 4V6.64706H2V19H22V6.64706H19.2727V4H13.8182V6.64706H10.1818V4H4.72727ZM3.81818 8.41176H20.1818V17.2353H3.81818V8.41176ZM14.7273 10.1765V11.9412H12.9091V13.7059H14.7273V15.4706H16.5455V13.7059H18.3636V11.9412H16.5455V10.1765H14.7273ZM5.63636 11.9412V13.7059H11.0909V11.9412H5.63636Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'live-animals': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M16 11C16.2833 11 16.5208 10.9042 16.7125 10.7125C16.9042 10.5208 17 10.2833 17 10C17 9.71667 16.9042 9.47917 16.7125 9.2875C16.5208 9.09583 16.2833 9 16 9C15.7167 9 15.4792 9.09583 15.2875 9.2875C15.0958 9.47917 15 9.71667 15 10C15 10.2833 15.0958 10.5208 15.2875 10.7125C15.4792 10.9042 15.7167 11 16 11ZM4.5 21C3.93333 19.1 3.375 17.2042 2.825 15.3125C2.275 13.4208 2 11.4833 2 9.5C2 7.96667 2.53333 6.66667 3.6 5.6C4.66667 4.53333 5.96667 4 7.5 4H12.5C12.9833 3.36667 13.5708 2.875 14.2625 2.525C14.9542 2.175 15.7 2 16.5 2C16.9167 2 17.2708 2.14583 17.5625 2.4375C17.8542 2.72917 18 3.08333 18 3.5C18 3.6 17.9875 3.7 17.9625 3.8C17.9375 3.9 17.9083 3.99167 17.875 4.075C17.8083 4.25833 17.7458 4.44583 17.6875 4.6375C17.6292 4.82917 17.5833 5.025 17.55 5.225L19.825 7.5H22V14.475L19.175 15.4L17.5 21H12V19H10V21H4.5ZM6 19H8V17H14V19H16L17.55 13.85L20 13.025V9.5H19L15.5 6C15.5 5.66667 15.5208 5.34583 15.5625 5.0375C15.6042 4.72917 15.6667 4.41667 15.75 4.1C15.2667 4.23333 14.8417 4.4625 14.475 4.7875C14.1083 5.1125 13.8417 5.51667 13.675 6H7.5C6.53333 6 5.70833 6.34167 5.025 7.025C4.34167 7.70833 4 8.53333 4 9.5C4 11.1333 4.225 12.7292 4.675 14.2875C5.125 15.8458 5.56667 17.4167 6 19Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'perishables-notemp': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M3 13C3 15.3869 3.94821 17.6761 5.63604 19.364C7.32387 21.0518 9.61305 22 12 22C12 19.6131 11.0518 17.3239 9.36396 15.636C7.67613 13.9482 5.38695 13 3 13ZM5.44 15.44C7.35 16.15 8.85 17.65 9.56 19.56C7.65 18.85 6.15 17.35 5.44 15.44ZM12 22C14.3869 22 16.6761 21.0518 18.364 19.364C20.0518 17.6761 21 15.3869 21 13C18.6131 13 16.3239 13.9482 14.636 15.636C12.9482 17.3239 12 19.6131 12 22ZM14.42 19.57C15.11 17.64 16.64 16.11 18.57 15.42C17.86 17.34 16.34 18.86 14.42 19.57ZM12 14C13.5913 14 15.1174 13.3679 16.2426 12.2426C17.3679 11.1174 18 9.5913 18 8V3C17.26 3 16.53 3.12 15.84 3.39C15.29 3.62 14.8 3.96 14.39 4.39L12 2L9.61 4.39C9.2 3.96 8.71 3.62 8.16 3.39C7.47 3.12 6.74 3 6 3V8C6 9.5913 6.63214 11.1174 7.75736 12.2426C8.88258 13.3679 10.4087 14 12 14ZM8 5.61L9.57 7.26L12 4.83L14.43 7.26L16 5.61V8C16 9.06087 15.5786 10.0783 14.8284 10.8284C14.0783 11.5786 13.0609 12 12 12C10.9391 12 9.92172 11.5786 9.17157 10.8284C8.42143 10.0783 8 9.06087 8 8V5.61Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'pharmaceuticals': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M11.1501 15.18L9.73008 13.77L11.1501 12.35L12.5601 13.77L13.9701 12.35L12.5601 10.94L13.9701 9.53L15.3901 10.94L16.8001 9.53L13.9701 6.7L6.90008 13.77L9.73008 16.6L11.1501 15.18ZM3.08008 19L6.20008 15.89L4.08008 13.77L13.9701 3.87L16.1001 6L17.5001 4.58L16.1001 3.16L17.5001 1.75L21.7501 6L20.3401 7.4L18.9201 6L17.5001 7.4L19.6301 9.53L9.73008 19.42L7.61008 17.3L3.08008 21.84V19Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'retail': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<g clipPath=\"url(#clip0_1354_47817)\">\r\n\t\t\t\t<path\r\n\t\t\t\t\td=\"M21.6 18.2002L13 11.7502V10.8402C14.65 10.3502 15.8 8.67016 15.43 6.79016C15.17 5.48016 14.13 4.39016 12.82 4.09016C10.54 3.57016 8.50002 5.30016 8.50002 7.50016H10.5C10.5 6.67016 11.17 6.00016 12 6.00016C12.83 6.00016 13.5 6.67016 13.5 7.50016C13.5 8.34016 12.81 9.02016 11.97 9.00016C11.43 8.99016 11 9.45016 11 9.99016V11.7502L2.40002 18.2002C1.63002 18.7802 2.04002 20.0002 3.00002 20.0002H12H21C21.96 20.0002 22.37 18.7802 21.6 18.2002ZM6.00002 18.0002L12 13.5002L18 18.0002H6.00002Z\"\r\n\t\t\t\t\tfill=\"currentColor\"\r\n\t\t\t\t/>\r\n\t\t\t</g>\r\n\t\t\t<defs>\r\n\t\t\t\t<clipPath id=\"clip0_1354_47817\">\r\n\t\t\t\t\t<rect fill=\"transparent\"/>\r\n\t\t\t\t</clipPath>\r\n\t\t\t</defs>\r\n\t\t</svg>\r\n\t),\r\n\t'shiny-stars': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M18.364 2l-1.146 2.5-2.49 1.136 2.49 1.146 1.146 2.49 1.136-2.49L22 5.636 19.5 4.5m-10.227.227L7 9.727 2 12l5 2.273 2.273 5 2.273-5 5-2.273-5-2.273m6.818 5l-1.146 2.491-2.49 1.146 2.49 1.136 1.146 2.5 1.136-2.5 2.5-1.136-2.5-1.146\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'spare-parts': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M9 1.08984V5.99984H7V1.08984C4.16 1.56984 2 4.02984 2 6.99984C2 9.21984 3.21 11.1498 5 12.1898V20.9998C5 21.5498 5.45 21.9998 6 21.9998H10C10.55 21.9998 11 21.5498 11 20.9998V12.1898C12.79 11.1498 14 9.21984 14 6.99984C14 4.02984 11.84 1.56984 9 1.08984ZM10 10.4598L9 11.0398V19.9998H7V11.0398L6 10.4598C4.77 9.73984 4 8.41984 4 6.99984C4 5.99984 4.37 5.05984 5 4.34984V7.99984H11V4.34984C11.63 5.05984 12 5.99984 12 6.99984C12 8.41984 11.23 9.73984 10 10.4598ZM20.94 17.9398C20.96 17.7898 20.97 17.6498 20.97 17.4998C20.97 17.3498 20.96 17.1998 20.94 17.0498L21.91 16.3198C22 16.2498 22.03 16.1298 21.97 16.0298L21.05 14.4698C21 14.3698 20.87 14.3298 20.76 14.3698L19.61 14.8198C19.37 14.6498 19.12 14.4998 18.83 14.3798L18.66 13.1898C18.64 13.0798 18.54 12.9998 18.43 12.9998H16.58C16.46 12.9998 16.36 13.0798 16.34 13.1898L16.17 14.3798C15.88 14.4998 15.63 14.6498 15.39 14.8198L14.24 14.3698C14.14 14.3298 14 14.3698 13.96 14.4698L13.03 16.0298C12.97 16.1298 13 16.2498 13.09 16.3198L14.06 17.0498C14.05 17.1998 14.03 17.3498 14.03 17.4998C14.03 17.6498 14.05 17.7898 14.06 17.9398L13.09 18.6798C13 18.7498 12.97 18.8698 13.03 18.9698L13.96 20.5298C14 20.6298 14.14 20.6598 14.24 20.6298L15.39 20.1698C15.63 20.3498 15.88 20.4998 16.17 20.6198L16.34 21.8098C16.36 21.9198 16.46 21.9998 16.58 21.9998H18.43C18.54 21.9998 18.64 21.9198 18.66 21.8098L18.83 20.6198C19.12 20.4998 19.37 20.3498 19.61 20.1698L20.76 20.6298C20.87 20.6598 21 20.6298 21.05 20.5298L21.97 18.9698C22.03 18.8698 22 18.7498 21.91 18.6798L20.94 17.9398ZM17.5 18.9998C16.67 18.9998 16 18.3298 16 17.4998C16 16.6698 16.67 15.9998 17.5 15.9998C18.33 15.9998 19 16.6698 19 17.4998C19 18.3298 18.33 18.9998 17.5 18.9998Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'temperature-control': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\tfillRule=\"evenodd\"\r\n\t\t\t\tclipRule=\"evenodd\"\r\n\t\t\t\td=\"M8.83 1C10.7318 1 12.28 2.4929 12.28 4.32678V14.3862C13.1554 15.2469 13.66 16.4196 13.66 17.6339C13.66 20.2038 11.4952 22.2914 8.83 22.2914C6.16488 22.2914 4 20.2038 4 17.6339C4 16.4196 4.50456 15.2469 5.38 14.3862V4.32678C5.38 2.4929 6.92819 1 8.83 1ZM17.8 1C16.2777 1 15.04 2.19348 15.04 3.66143C15.04 5.12937 16.2777 6.32285 17.8 6.32285C19.3223 6.32285 20.56 5.12937 20.56 3.66143C20.56 2.19348 19.3223 1 17.8 1ZM17.8 4.99214C17.0367 4.99214 16.42 4.39748 16.42 3.66143C16.42 2.92538 17.0367 2.33071 17.8 2.33071C18.5633 2.33071 19.18 2.92538 19.18 3.66143C19.18 4.39748 18.5633 4.99214 17.8 4.99214ZM8.83001 20.9607C6.92819 20.9607 5.38 19.4678 5.38 17.6339C5.38 16.5735 5.90613 15.6005 6.76001 14.9808V4.32678C6.76001 3.22478 7.68719 2.33071 8.83001 2.33071C9.97281 2.33071 10.9 3.22478 10.9 4.32678V14.9808C11.7539 15.5962 12.28 16.5735 12.28 17.6339C12.28 19.4678 10.7318 20.9607 8.83001 20.9607ZM6.76001 17.6782C6.76001 18.7807 7.68676 19.6743 8.83001 19.6743C9.97325 19.6743 10.9 18.7807 10.9 17.6782C10.9 16.8093 10.3239 16.0703 9.52 15.7962V10.3594C9.52 9.99191 9.2111 9.69402 8.83001 9.69402C8.4489 9.69402 8.14 9.99191 8.14 10.3594V15.7962C7.33611 16.0703 6.76001 16.8093 6.76001 17.6782Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'valuable-cargo': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\td=\"M16 9H19L14 16M10 9H14L12 17M5 9H8L10 16M15 4H17L19 7H16M11 4H13L14 7H10M7 4H9L8 7H5M6 2L2 8L12 22L22 8L18 2H6Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t),\r\n\t'vulnerable-cargo': () => (\r\n\t\t<svg width='1em' height='1em' viewBox=\"0 0 24 24\" fill=\"none\">\r\n\t\t\t<path\r\n\t\t\t\tfillRule=\"evenodd\"\r\n\t\t\t\tclipRule=\"evenodd\"\r\n\t\t\t\td=\"M5.5 2H18.2273V8.36364C18.2273 11.5695 15.8566 14.2217 12.7727 14.6628V16.6197C13.9184 16.8079 14.9246 17.3364 15.6888 18.0035C16.6227 18.8188 17.3182 19.9571 17.3182 21.0909V22H6.40909V21.0909C6.40909 19.9571 7.10455 18.8188 8.03849 18.0035C8.80262 17.3364 9.80885 16.8079 10.9545 16.6197V14.6628C7.87064 14.2217 5.5 11.5695 5.5 8.36364V2ZM7.31818 3.81818V8.36364C7.31818 10.874 9.35325 12.9091 11.8636 12.9091C14.374 12.9091 16.4091 10.874 16.4091 8.36364V3.81818H14.1216L12.295 6.12546L15.0194 7.84612L11.6692 12.1073L10.2399 10.9836L12.3442 8.30699L9.61407 6.58268L11.8026 3.81818H7.31818ZM8.53757 20.1818H15.1897C15.0271 19.9172 14.7975 19.6389 14.493 19.3731C13.8172 18.7831 12.8874 18.3636 11.8636 18.3636C10.8399 18.3636 9.91011 18.7831 9.23423 19.3731C8.92981 19.6389 8.70012 19.9172 8.53757 20.1818Z\"\r\n\t\t\t\tfill=\"currentColor\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t)\r\n}","import React from 'react';\r\n\r\nimport { Icon } from '@freightos/design-system'\r\n\r\nimport svgs from 'common/components/FusionIcon/svgs';\r\n\r\nconst FusionIcon = ({ type, component, ...rest }) => {\r\n\r\n\tif (!type)\r\n\t\treturn null;\r\n\r\n\tconst newComponent = svgs[type] || component;\r\n\r\n\treturn (\r\n\t\t<Icon\r\n\t\t\ttype={type}\r\n\t\t\tcomponent={newComponent}\r\n\t\t\t{...rest}\r\n\t\t/>\r\n\t)\r\n};\r\n\r\nexport default FusionIcon","import { Menu, Select, tokens } from '@freightos/design-system';\r\nimport FusionIcon from 'common/components/FusionIcon';\r\nimport styled, { createGlobalStyle } from 'styled-components';\r\n\r\nexport const DropdownGlobalStyle = createGlobalStyle`\r\n .ant-select-dropdown {\r\n .ant-select-dropdown-menu {\r\n max-height: 400px;\r\n padding: 0 !important;\r\n margin-top: 0 !important;\r\n }\r\n }\r\n`;\r\n\r\nexport const DebounceSelector = styled(Select)`\r\n\t.ant-select-selection__rendered {\r\n\t\tmin-width: 100% !important;\r\n\t}\r\n\r\n\tli.ant-select-selection__choice {\r\n\t\tborder-radius: ${tokens.fdsBorderRadiusXl};\r\n\t\tborder: none;\r\n\t\tborder-color: ${tokens.fdsColorPrimaryBlue};\r\n\t\tcolor: ${tokens.fdsColorPrimaryBlue};\r\n\t\tbackground-color: ${tokens.fdsColorPrimaryBlue10};\r\n\t\tline-height: 10px !important;\r\n\t\tmargin-right: ${tokens.fdsComponentSpacingXxs};\r\n\t\twidth: fit-content;\r\n\t\tmax-width: 90px;\r\n\t\theight: ${tokens.fdsSizeMd} !important;\r\n\t\t${({size}) => size === 'large' ? `\r\n\t\t\tmargin-top: ${tokens.fdsComponentSpacingSm} !important;\r\n\t\t` : `\r\n\t\t\tmargin-top: 5px !important;\r\n\t\t`}\r\n\r\n\t\t.ant-select-selection__choice__remove {\r\n\t\t\tcolor: ${tokens.fdsColorPrimaryBlue};\r\n\t\t\tmargin-top: ${tokens.fdsComponentSpacingXs} !important;\r\n\t\t}\r\n\r\n\t\t.ant-select-selection__choice__content {\r\n\t\t\tline-height: ${tokens.fdsSizeMd} !important;\r\n\t\t\theight: ${tokens.fdsSizeMd} !important;\r\n\t\t}\r\n\t}\r\n\r\n\tli.ant-select-selection__choice__disabled {\r\n\t\tborder: none;\r\n\t\tbackground-color: transparent;\r\n\t\tpadding: 0;\r\n\t\tpadding-left: 0;\r\n\t\twidth: fit-content;\r\n\t}\r\n\r\n\t.ant-select-dropdown .ant-select-not-found {\r\n\t\tcursor: pointer !important;\r\n\t}\r\n\r\n\t.ant-select-selection-selected-value {\r\n\t\tmax-width: 280px !important;\r\n\t}\r\n\r\n\tli.ant-select-search.ant-select-search--inline {\r\n\t\tmargin-left: -1px !important;\r\n\t}\r\n\t.ant-select-search__field {\r\n\t\tcolor: ${tokens.fdsColorPrimaryGray80} !important;\r\n\t}\r\n\t${({ $hasError }) => $hasError && `\r\n\t\t.ant-select-selection {\r\n\t\t\tcolor: ${tokens.fdsColorSemanticRed};\r\n \t\tborder: 1px solid ${tokens.fdsColorSemanticRed};\r\n \t\tbackground-color: ${tokens.fdsColorSemanticRed10};\r\n\t\t}\r\n\r\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\r\n\t\t\tcolor: ${tokens.fdsColorSemanticRed};\r\n\t\t}\r\n\t`}\r\n`;\r\n\r\nexport const SelectedOptionLabel = styled.span`\r\n\tfont-size: ${tokens.fdsFontSizeSm} !important;\r\n`;\r\n\r\nexport const SelectOptionLabel = styled.div`\r\n\tfont-size: ${tokens.fdsFontSizeSm} !important;\r\n\toverflow: hidden;\r\n\ttext-overflow: ellipsis;\r\n\tdisplay: -webkit-box;\r\n\t-webkit-line-clamp: 2;\r\n\t-webkit-box-orient: vertical;\r\n`;\r\n\r\nexport const StyledMenu = styled(Menu)`\r\n\tcursor: pointer !important;\r\n\r\n\t.ant-menu-item-group-title {\r\n\t\tpadding: 0;\r\n\t\tcolor: ${tokens.fdsBodyTextColorDisabled};\r\n\t}\r\n\r\n\t.ant-menu-item {\r\n\t\tpadding: 0;\r\n\t\twhite-space: normal;\r\n\t\tline-height: normal;\r\n\r\n\t\t&:hover {\r\n\t\t\tbackground-color: #f5f5f5;\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const NoMatchingResults = styled.div`\r\n\tfont-size: ${tokens.fdsFontSizeSm};\r\n\tline-height: ${tokens.fdsSizeSm};\r\n\tfont-family: ${tokens.fdsHeadingsFontFamily};\r\n`;\r\n\r\nexport const UnitIcon = styled(FusionIcon)`\r\n\tmargin-right: 0 !important;\r\n\tvertical-align: bottom;\r\n`;\r\n","import { tokens } from '@freightos/design-system';\r\n\r\nexport const FlexSpacings = {\r\n\tXXLARGE: tokens.fdsComponentSpacingXxl,\r\n\tXLARGE: tokens.fdsComponentSpacingXl,\r\n\tLARGE: tokens.fdsComponentSpacingLg,\r\n\tMEDIUM: tokens.fdsComponentSpacingMd,\r\n\tSMALL: tokens.fdsComponentSpacingSm,\r\n\tXSMALL: tokens.fdsComponentSpacingXs,\r\n\tXXSMALL: tokens.fdsComponentSpacingXxs,\r\n\tNONE: 0,\r\n};\r\n\r\nexport const FlexDirections = {\r\n\tVERTICAL: 'vertical',\r\n\tHORIZONTAL: 'horizontal',\r\n};\r\n","export const SEARCH_FIELDS = {\r\n\tORIGIN: 'origin',\r\n\tDESTINATION: 'destination',\r\n\tTOTALS_SHIPMENT: 'totalShipment',\r\n\tUNITS_SHIPMENT: 'unitsShipment',\r\n\tCONTAINER_SHIPMENT: 'containerShipment',\r\n\tCOMMODITY: 'commodity',\r\n\tSHIPMENT_TYPE: 'shipmentType',\r\n\tUNITS: 'units',\r\n\tVOLUME: 'volume',\r\n\tVOLUME_UNIT: 'volumeUnit',\r\n\tWEIGHT: 'weight',\r\n\tWEIGHT_UNIT: 'weightUnit',\r\n\tTURNABLE: 'turnable',\r\n\tSTACKABLE: 'stackable',\r\n\tDEFINE_EACH_UNIT_DIMENSIONS: 'defineEachUnitDimensions',\r\n\tDEFINE_EACH_UNIT_WEIGHT: 'defineEachUnitWeight',\r\n\tUNIT_DIMENSIONS: 'unitDimensions',\r\n\tUNIT_WEIGHTS: 'unitWeights',\r\n\tLENGTH: 'length',\r\n\tHEIGHT: 'height',\r\n\tWIDTH: 'width',\r\n\tTYPE: 'type',\r\n\tDIMENSION_UNIT: 'dimensionUnit',\r\n\tBOX_PACKAGES: 'boxPackages',\r\n\tULD_PACKAGES: 'uldPackages',\r\n\tPACKAGE_TYPE: 'packageType',\r\n\tTOTAL_WEIGHT: 'totalWeight',\r\n\tCONTAINER_PACKAGES: 'containerPackages',\r\n\tDIMENSIONS: 'dimensions',\r\n\tFULLFILLMENT_DETAILS: 'fullfillmentDetails',\r\n\tIS_FULLFILLMENT: 'isFullfillment',\r\n\tCOMMODITY_TEMPERATURE: 'commodityTemperature',\r\n\tBATTERY_HS_CODE: 'batteryHsCode',\r\n\tSUPPORTED_FREIGHT_TYPES: 'supportedFreightTypes',\r\n}\r\n\r\nexport const TEMPERATURE_SYSTEM = {\r\n\tCELSIUS: 'celsius',\r\n\tFAHRENHEIT: 'fahrenheit',\r\n}\r\n\r\nexport const TEMPERATURE_RANGE = {\r\n\tFRO: 'FRO',\r\n\tCOL: 'COL',\r\n\tERT: 'ERT',\r\n\tCRT: 'CRT',\r\n}\r\n\r\nexport const TEMPERATURE_RANGES_DATA = {\r\n\t[TEMPERATURE_RANGE.FRO]: {\r\n\t\t[TEMPERATURE_SYSTEM.CELSIUS]: '-10ºC or below',\r\n\t\t[TEMPERATURE_SYSTEM.FAHRENHEIT]: '14ºF or below',\r\n\t},\r\n\t[TEMPERATURE_RANGE.COL]: {\r\n\t\t[TEMPERATURE_SYSTEM.CELSIUS]: 'From +2ºC To +8ºC',\r\n\t\t[TEMPERATURE_SYSTEM.FAHRENHEIT]: 'From 35.6ºF To 46.4ºF',\r\n\t},\r\n\t[TEMPERATURE_RANGE.ERT]: {\r\n\t\t[TEMPERATURE_SYSTEM.CELSIUS]: 'From +2ºC To +25ºC',\r\n\t\t[TEMPERATURE_SYSTEM.FAHRENHEIT]: 'From 35.6ºF To 77ºF',\r\n\t},\r\n\t[TEMPERATURE_RANGE.CRT]: {\r\n\t\t[TEMPERATURE_SYSTEM.CELSIUS]: 'From +15ºC To +25ºC',\r\n\t\t[TEMPERATURE_SYSTEM.FAHRENHEIT]: 'From 59ºF To 77ºF',\r\n\t},\r\n\r\n};\r\n\r\nexport const SEARCH_PLATFORMS = {\r\n\tBOOKING: 'booking',\r\n\tQUOTATION: 'quotation',\r\n\tBI: 'bi',\r\n}\r\n\r\nexport const RS_PLATFORM_TYPES = {\t\r\n\tBOOK: 'BOOK',\r\n\tQUOTE: 'QUOTE',\r\n\tBI: 'BI',\r\n}\r\n\r\nexport const CONTAINER_TYPE_20_FOOT_FACTOR = 20;\r\n\r\nexport const SHIPMENT_OPTIONS = {\r\n\tUNITS: 'units',\r\n\tTOTALS: 'totals',\r\n\tCONTAINER: 'container'\r\n}\r\n\r\nexport const CUBIC_FOOT_TO_CUBIC_INCH_CONVERSION_FACTOR = 1728;\r\n\r\nexport const CUBIC_METER_TO_CUBIC_CM_CONVERSION_FACTOR = 1000000;\r\n\r\nexport const VOLUME_OPTIONS = {\r\n\tCBM: 'CBM',\r\n\tCFT: 'CFT',\t\r\n}\r\n\r\nexport const WEIGHT_OPTIONS = {\r\n\tKG: 'kg',\r\n\tLB: 'lb',\r\n}\r\n\r\nexport const DIMENSION_OPTIONS = {\r\n\tCM: 'cm',\r\n\tIN: 'in',\r\n}\r\n\r\nexport const PACKAGE_TYPE = {\r\n\tBOX: 'box',\r\n\tULD: 'uld',\r\n}\r\n\r\nexport const RECENT_SEARCHES_LIMIT = 6;\r\n","import styled, { css } from 'styled-components';\r\n\r\nimport { FlexDirections } from './constants';\r\n\r\nexport const StyledFlex = styled.div`\r\n\tdisplay: flex;\r\n\tflex-direction: ${({ $direction }) => ($direction === FlexDirections.VERTICAL ? 'column' : 'row')};\r\n\tflex-wrap: ${({ $wrap }) => ($wrap ? 'wrap' : 'nowrap')};\r\n\talign-items: ${({ $alignItems }) => $alignItems};\r\n\tjustify-content: ${({ $justifyContent }) => $justifyContent};\r\n\tbox-sizing: border-box;\r\n\r\n\t${({ $fullWidth }) =>\r\n\t\t$fullWidth &&\r\n\t\tcss`\r\n\t\t\twidth: 100%;\r\n\t\t`}\r\n\t${({ $direction, $spacing }) =>\r\n\t\t$direction === FlexDirections.VERTICAL\r\n\t\t\t? css`\r\n\t\t\t\t\t> *:not(:first-child) {\r\n\t\t\t\t\t\tmargin-top: ${$spacing};\r\n\t\t\t\t\t}\r\n\t\t\t `\r\n\t\t\t: css`\r\n\t\t\t\t\t> *:not(:first-child) {\r\n\t\t\t\t\t\tmargin-left: ${$spacing};\r\n\t\t\t\t\t}\r\n\t\t\t `};\r\n`;","import React from 'react';\r\n\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { FlexDirections, FlexSpacings } from '../helpers/constants';\r\nimport { StyledFlex } from '../helpers/styled';\r\n\r\nconst Flex = ({\r\n\tdirection = FlexDirections.HORIZONTAL,\r\n\talignItems = 'start',\r\n\tspacing = FlexSpacings.NONE,\r\n\twrap,\r\n\tjustifyContent,\r\n\tfullWidth,\r\n\t...rest\r\n}) => (\r\n\t<StyledFlex\r\n\t\t{...rest}\r\n\t\t$direction={direction}\r\n\t\t$alignItems={alignItems}\r\n\t\t$spacing={spacing}\r\n\t\t$wrap={wrap}\r\n\t\t$justifyContent={justifyContent}\r\n\t\t$fullWidth={fullWidth}\r\n\t>\r\n\t\t{rest.children}\r\n\t</StyledFlex>\r\n);\r\n\r\nFlex.propTypes = {\r\n\tdirection: PropTypes.oneOf([FlexDirections.HORIZONTAL, FlexDirections.VERTICAL]),\r\n\tspacing: PropTypes.oneOf(Object.keys(FlexSpacings)),\r\n\tchildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\r\n\talignItems: PropTypes.string,\r\n\tjustifyContent: PropTypes.string,\r\n\tfullWidth: PropTypes.bool,\r\n\twrap: PropTypes.bool,\r\n};\r\n\r\nexport default Flex;\r\n","export default class Environment {\r\n\tstatic isProduction() {\r\n\t\treturn process.env.REACT_APP_CUSTOM_ENV === 'prod';\r\n\t}\r\n\r\n\tstatic isTest() {\r\n\t\treturn process.env.REACT_APP_CUSTOM_ENV === 'test';\r\n\t}\r\n\r\n\tstatic isLocal() {\r\n\t\treturn process.env.REACT_APP_CUSTOM_ENV === 'dev';\r\n\t}\r\n}\r\n","import React from 'react';\r\n\r\nimport { Avatar, Chip, Message, Option, Select, tokens } from '@freightos/design-system';\r\nimport { TranslatableText } from '@freightos/freightos-i18n';\r\n\r\nimport Flex from 'common/components/Flex';\r\nimport FusionIcon from 'common/components/FusionIcon';\r\nimport { FlexSpacings } from '../common/helpers/constants';\r\nimport { getLocations } from './apis';\r\nimport { DEFAULT_LOCATION_MODE, LOCATION_MODES, LOCATION_MODES_MAP, SelectModes } from './constant';\r\nimport { SelectOptionLabel, SelectedOptionLabel } from './styled';\r\n\r\nimport Environment from '../common/helpers/Environment';\r\n\r\n/**\r\n * Get the gateway API prefix based on the environment.\r\n *\r\n * @returns {string} The gateway API prefix.\r\n */\r\nexport const getGatewayApiPrefix = (isTalaia) => {\r\n\tconst domain = Environment.isProduction()\r\n\t\t? 'freightos.com'\r\n\t\t: 'test-freightos.com';\r\n\treturn `https://platform.${domain}/gateway/${isTalaia ? 'webcargo-talaia' : 'webcargo-alpha'}`;\r\n};\r\n\r\n// Deterministic JSON stringify\r\nconst stableStringify = (obj) => {\r\n const allKeys = [];\r\n JSON.stringify(obj, (k, v) => (allKeys.push(k), v));\r\n const uniqSortedKeys = Array.from(new Set(allKeys)).sort();\r\n return JSON.stringify(obj, uniqSortedKeys);\r\n};\r\n\r\nconst normalizeLocationForKey = (loc) => {\r\n const {\r\n displayLabel,\r\n selectedValue,\r\n formattedNameOrAddress,\r\n code,\r\n countryCode,\r\n stateOrProvince,\r\n city,\r\n latitude,\r\n longitude,\r\n postalOrZipCode,\r\n sourceType,\r\n locationType,\r\n type,\r\n\tcountryName,\r\n } = loc || {};\r\n\r\n return {\r\n displayLabel,\r\n selectedValue: selectedValue || code,\r\n formattedNameOrAddress,\r\n code: code || selectedValue,\r\n country: countryCode,\r\n\tcountryName,\r\n stateOrProvince: stateOrProvince ?? null,\r\n city: city ?? null,\r\n latitude: latitude ?? null,\r\n longitude: longitude ?? null,\r\n postalOrZipCode: postalOrZipCode ?? null,\r\n sourceType: sourceType ?? null,\r\n locationType: locationType ?? null,\r\n type: type ?? sourceType,\r\n };\r\n};\r\n\r\nconst stableKeyFromLocation = (loc) => {\r\n try {\r\n const parsed = typeof loc?.key === 'string'\r\n ? JSON.parse(decodeHtmlEntities(loc.key))\r\n : loc;\r\n return stableStringify(normalizeLocationForKey(parsed));\r\n } catch {\r\n return stableStringify(normalizeLocationForKey(loc));\r\n }\r\n};\r\n\r\n/**\r\n * Get location input option.\r\n *\r\n * @param {Object} location - The location object to get the option for.\r\n * @returns {Object} The location input option.\r\n */\r\nexport const getLocationInputOption = (location) => {\r\n\tif(location) {\r\n \t\tconst displayLabel = location.label || location.selectedValue;\r\n \t\tconst key = stableKeyFromLocation(location);\r\n\r\n \t\tconst label = displayLabel\r\n \t\t ? (\r\n \t\t <>\r\n \t\t <FusionIcon type={location.sourceType ? LOCATION_MODES_MAP[location.sourceType]?.icon : 'location'} size='tiny' />\r\n \t\t &nbsp;\r\n \t\t <SelectedOptionLabel>{displayLabel}</SelectedOptionLabel>\r\n \t\t </>\r\n \t\t )\r\n \t\t : undefined;\r\n\r\n \t\treturn { key, label };\r\n\t} \r\n\treturn undefined;\r\n};\r\n\r\n/**\r\n * Formats location(s) into option(s) with key and label for the location input.\r\n *\r\n * @param {Object|Array} locations - Single location object or array of location objects.\r\n * @returns {Object|Array} Formatted option(s) with key and label.\r\n * - For single location: Returns {key: string, label: ReactElement}.\r\n * - For multiple locations: Returns array of {key: string, label: ReactElement}.\r\n */\r\nexport const getLocationInputValue = locations => {\r\n\tconst formatLocation = loc => getLocationInputOption(loc);\r\n\treturn Array.isArray(locations) ? locations.map(formatLocation) : formatLocation(locations);\r\n};\r\n\r\n/**\r\n * Renders location options (ports and addresses) in a select dropdown with icons and grouping.\r\n *\r\n * @param {Array} locationOptions - Array of location option groups to render.\r\n * @param {string} dataTestId - Test ID prefix for components.\r\n * @returns {Array<ReactElement>} Array of Select.OptGroup components containing the location options.\r\n *\r\n * @example\r\n * Location options format:\r\n * [\r\n * {\r\n * label: \"seaport\",\r\n * options: [{\r\n * label: \"Port Name\",\r\n * key: \"{...port data...}\"\r\n * }]\r\n * }\r\n * ]\r\n */\r\nexport const renderLocationOptions = (optionGroups, dataTestId) => {\r\n\r\n\tif (!(optionGroups || []).some(group => group?.options?.length > 0) )\r\n\t\treturn;\r\n\r\n\treturn optionGroups.map(group => {\r\n\t\tconst location = Object.values(LOCATION_MODES_MAP).find(mode => mode.label === group.label);\r\n\t\tconst locationOptionIcon = location?.icon;\r\n\r\n\t\treturn (\r\n\t\t\t<Select.OptGroup\r\n\t\t\t\tlabel={\r\n\t\t\t\t\t<span style={{fontFamily: 'Open Sans'}}>\r\n\t\t\t\t\t\t<FusionIcon size='tiny' type={locationOptionIcon} />\r\n\t\t\t\t\t\t&nbsp;\r\n\t\t\t\t\t\t&nbsp;\r\n\t\t\t\t\t\t{group.label}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t}\r\n\t\t\t\tkey={group.label}\r\n\t\t\t\tdata-test-id={`${dataTestId}-group-${group.label}`}\r\n\t\t\t>\r\n\t\t\t\t{group.options?.map(option => {\r\n\t\t\t\t\tconst { countryCode, selectedValue, displayLabel, type } = option;\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<Option\r\n\t\t\t\t\t\t\tvalue={stableKeyFromLocation(option)}\r\n\t\t\t\t\t\t\ttitle={selectedValue}\r\n\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-${group.label}-${selectedValue}`}\r\n\t\t\t\t\t\t\tstyle={{ paddingLeft: '8px' }}\r\n\t\t\t\t\t\t\tlabel={<>\r\n\t\t\t\t\t\t\t\t\t<FusionIcon type={locationOptionIcon} size='tiny' />\r\n\t\t\t\t\t\t\t\t\t&nbsp;\r\n\t\t\t\t\t\t\t\t\t<SelectedOptionLabel>{selectedValue}</SelectedOptionLabel>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tkey={option.code}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Flex fullWidth justifyContent='space-between'>\r\n\t\t\t\t\t\t\t\t<Flex spacing={FlexSpacings.XSMALL}>\r\n\t\t\t\t\t\t\t\t\t<span style={{ display: 'inline-flex' }}>\r\n\t\t\t\t\t\t\t\t\t\t<Avatar\r\n\t\t\t\t\t\t\t\t\t\t\ttype='flag'\r\n\t\t\t\t\t\t\t\t\t\t\tcountry={countryCode}\r\n\t\t\t\t\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\t\t\t\t\twidth: tokens.fdsSizeSm,\r\n\t\t\t\t\t\t\t\t\t\t\t\theight: tokens.fdsSizeSm,\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t<SelectOptionLabel>{displayLabel}</SelectOptionLabel>\r\n\t\t\t\t\t\t\t\t</Flex>\r\n\t\t\t\t\t\t\t\t{type === LOCATION_MODES.FULFILLMENT_CENTER && <FusionIcon type='amazon' size='small' />}\r\n\t\t\t\t\t\t\t\t{type === LOCATION_MODES.ADDRESS_BOOK && <Chip type='neutral' iconType='address-book' />}\r\n\t\t\t\t\t\t\t</Flex>\r\n\t\t\t\t\t\t</Option>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t</Select.OptGroup>\r\n\t\t);\r\n\t});\r\n};\r\n\r\n/**\r\n * Extracts fulfillment centers from addresses and adds them as a separate key in results\r\n * @param {Object} locationsResults - The locations results object\r\n * @param {string} addressKey - The key for addresses (default: 'address')\r\n * @returns {Object} Updated locations results with fulfillment centers separated\r\n */\r\nconst extractFulfillmentCenters = locationsResults => {\r\n\tlet updatedLocationsResults = { ...locationsResults };\r\n\t// Extract fulfillment centers from addresses\r\n\tconst fulfillmentCenters = locationsResults[LOCATION_MODES.ADDRESS].filter(\r\n\t\toption => option.sourceType === LOCATION_MODES.FULFILLMENT_CENTER\r\n\t);\r\n\t// Add fulfillment centers as a separate key in results\r\n\tif (fulfillmentCenters.length > 0) {\r\n\t\t// Create new object with specific order\r\n\t\tconst { address, ...otherTypes } = updatedLocationsResults;\r\n\t\tupdatedLocationsResults = {\r\n\t\t\t...otherTypes,\r\n\t\t\t[LOCATION_MODES.FULFILLMENT_CENTER]: fulfillmentCenters,\r\n\t\t\taddress: address.filter(option => option.type !== LOCATION_MODES.FULFILLMENT_CENTER),\r\n\t\t};\r\n\t}\r\n\r\n\treturn updatedLocationsResults;\r\n};\r\n\r\n/**\r\n * Fetches location data for the active location mode or supported modes.\r\n *\r\n * @param {string} activeLocationMode - The active location mode.\r\n * @param {Array} supportedLocationModes - Array of supported location modes.\r\n * @returns {Function} A function that takes a query string and returns a promise resolving to an array of formatted location objects.\r\n */\r\nexport const fetchLocations = (activeLocationMode, supportedLocationModes, customer) => async query => {\r\n\tif (!query) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tconst modes = activeLocationMode !== DEFAULT_LOCATION_MODE ? [activeLocationMode] : supportedLocationModes;\r\n\tconst locations = await getLocations(modes, query, customer);\r\n\r\n\tlet locationsResults = locations.results;\r\n\r\n\tif (locationsResults[LOCATION_MODES.ADDRESS]) {\r\n\t\tlocationsResults = extractFulfillmentCenters(locationsResults);\r\n\t}\t\r\n\r\n\treturn Object.keys(locationsResults).map(key => {\r\n\t\treturn {\r\n\t\t\tlabel: LOCATION_MODES_MAP[key]?.label || key,\r\n\t\t\toptions: locationsResults[key].map(option => ({\r\n\t\t\t\t...option,\r\n\t\t\t\ttype: option.sourceType,\r\n\t\t\t})),\r\n\t\t};\r\n\t});\r\n};\r\n\r\n/**\r\n * Processes location input changes by retrieving geocoder details for addresses\r\n * or transforming port locations into a standardized format.\r\n *\r\n * For addresses (with placeId), fetches full geocoder details.\r\n * For ports, transforms them into geocoder address schema.\r\n * Filters out any failed location processing.\r\n *\r\n * @param {Object|Array} changedLocations - The new location value(s) to process.\r\n * @param {Function} onChange - Callback to handle the processed location(s).\r\n */\r\nexport const onChangeLocation = async (changedLocations, onChange) => {\r\n\tconst locations = Array.isArray(changedLocations) ? changedLocations : [changedLocations];\r\n\r\n\tconst locationsDetails = await Promise.all(\r\n\t\tlocations.map(async location => {\r\n\t\t\ttry {\r\n\t\t\t\tconst raw = location?.key;\r\n\t\t\t\tconst json = decodeHtmlEntities(raw);\r\n\t\t\t\tconst parsed = JSON.parse(json);\r\n\t\t\t\treturn { key: json, ...parsed };\r\n\t\t\t} catch (err) {\r\n\t\t\t\t// Useful in case one of the addresses has encountered a failure while retrieving its details\r\n\t\t\t\t// It won't cause all the addresses to stop working properly\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\t\t})\r\n\t);\r\n\r\n\tonChange(locationsDetails.filter(Boolean));\r\n};\r\n\r\n/**\r\n * Handles changes to the location input value.\r\n *\r\n * @param {Object|Array} location - The new location value(s) selected.\r\n * @param {string} selectionMode - The current selection mode ('single' or 'multiple').\r\n * @param {number} maxPorts - Maximum number of ports that can be selected in multiple mode.\r\n * @param {Function} setSelectedLocation - State setter for the selected location.\r\n * @param {Function} onChange - Callback to handle processed location changes.\r\n *\r\n * For multiple selection mode:\r\n * - Validates that selected ports don't exceed maxPorts limit.\r\n * - Shows error message if limit is exceeded.\r\n * - Updates state and triggers onChange with valid selections.\r\n *\r\n * For single selection mode:\r\n * - Updates selected location state directly.\r\n * - Triggers onChange with the new location if one is selected.\r\n */\r\nexport const handleLocationChange = (location, selectionMode, maxPorts, setSelectedLocation, onChange) => {\r\n\tif (selectionMode === SelectModes.MULTIPLE) {\r\n\t\tconst selectedPorts = Array.isArray(location) ? location : [];\r\n\t\tif (selectedPorts.length <= maxPorts) {\r\n\t\t\tsetSelectedLocation(selectedPorts);\r\n\t\t\tonChangeLocation(selectedPorts, onChange);\r\n\t\t} else {\r\n\t\t\tconst typePort = JSON.parse(selectedPorts[0]?.key)?.sourceType === LOCATION_MODES.AIRPORT ? (maxPorts > 1 ? 'airports' : 'airport') : (maxPorts > 1 ? 'ports' : 'port');\r\n\t\t\tMessage.danger(\r\n\t\t\t\t<>\r\n\t\t\t\t\t<TranslatableText stringId={'You cannot enter more than'}/>\r\n\t\t\t\t\t{' '} {maxPorts} {' '}\r\n\t\t\t\t\t<TranslatableText stringId={typePort} />\r\n\t\t\t\t</>\r\n\t\t\t);\r\n\t\t}\r\n\t} else {\r\n\t\tsetSelectedLocation(location);\r\n\t\tonChangeLocation(location, onChange);\r\n\t}\r\n};\r\n\r\n/**\r\n * Check if the location is an address\r\n * @param location - The location to check\r\n * @returns Whether the location is an address\r\n */\r\nexport const isLocationAddress = locationType =>\r\n\tlocationType &&\r\n\t(locationType === LOCATION_MODES.ADDRESS ||\r\n\t\tlocationType === LOCATION_MODES.LAST_MILE_ADDRESS ||\r\n\t\tlocationType === LOCATION_MODES.ADDRESS_BOOK ||\r\n\t\tlocationType === LOCATION_MODES.FULFILLMENT_CENTER);\r\n\r\nconst decodeHtmlEntities = (s) =>\r\n typeof s === 'string'\r\n ? s.replace(/&quot;/g, '\"').replace(/&#34;/g, '\"').replace(/&amp;/g, '&')\r\n : s;\r\n","import httpClient from '@freightos/http-client';\r\n\r\nimport { LOCATION_MODES_MAP } from './constant';\r\n\r\n/**\r\n * Fetches locations based on the provided location modes and query.\r\n *\r\n * @param {Array<string>} locationModes - Array of location modes to search for.\r\n * @param {string} query - The search query.\r\n * @returns {Promise<Object>} A promise resolving to an object containing location results.\r\n */\r\nexport const getLocations = async (locationModes, query, customer) => {\r\n\ttry {\r\n\t\tconst sources = locationModes.reduce(\r\n\t\t\t(acc, mode) => ({\r\n\t\t\t\t...acc,\r\n\t\t\t\t[LOCATION_MODES_MAP[mode].key]: {\r\n\t\t\t\t\ttype: mode.toUpperCase(),\r\n\t\t\t\t\t...(customer?.code ? { searchTerm: customer.name } : {}),\r\n\t\t\t\t\t...(LOCATION_MODES_MAP[mode].groupedBy ? { groupedBy: LOCATION_MODES_MAP[mode].groupedBy } : {}),\r\n\t\t\t\t},\r\n\t\t\t}),\r\n\t\t\t{}\r\n\t\t);\r\n\t\tconst response = await httpClient.post('/geocoder/api/v3/geocoder/locations', {\r\n\t\t\tquery,\r\n\t\t\tlimit: 5,\r\n\t\t\tsources,\r\n\t\t});\r\n\t\treturn response.data;\r\n\t} catch (error) {\r\n\t\tconsole.error('Error fetching locations:', error);\r\n\t\treturn { results: {} };\r\n\t}\r\n};\r\n","import { getGatewayApiPrefix } from \"../../helpers/utils\";\r\nimport { doRequest } from \"../../common/httpClient/doRequest/index\";\r\n\r\nexport const saveLastUsedSearch = async ( searchId ) => {\r\n\tawait doRequest({\r\n\t\tmethod: 'put',\r\n\t\turl: `${getGatewayApiPrefix(false)}/backend/api.php`,\r\n\t\toptions: {\r\n\t\t\theaders: {\r\n\t\t\t\t'namespace': 'airops/user_searches',\r\n\t\t\t\t'route': ' user_search_used',\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata: {\r\n\t\t\tid: searchId,\r\n\t\t},\r\n\t});\r\n};\r\n","import httpClient from '@freightos/http-client'\r\n\r\nexport const doRequest = async ({\r\n\tmethod,\r\n\turl = '',\r\n\tdata = {},\r\n\toptions = {},\r\n}) => {\r\n\r\n\tconst params = (() => {\r\n\t\tif (method === 'get') {\r\n\r\n\t\t\tconst newUrl = (() => {\r\n\t\t\t\tif (!Object.keys(data).length) {\r\n\t\t\t\t\treturn url\r\n\t\t\t\t}\r\n\t\t\t\treturn `${url}?${new URLSearchParams(data).toString()}`\r\n\t\t\t})();\r\n\r\n\t\t\treturn [newUrl, options]\r\n\t\t}\r\n\t\tif (method === 'post') {\r\n\t\t\tconst headers = {\r\n\t\t\t\t...options?.headers,\r\n\t\t\t\t'accept': 'application/json',\r\n\t\t\t\t'content-type': `multipart/form-data`\r\n\t\t\t}\r\n\t\t\treturn [url, data, { ...options, headers }]\r\n\t\t}\r\n\r\n\t\treturn [url, data, options]\r\n\t})()\r\n\r\n\treturn await httpClient[method](...params)\r\n}","import { Avatar, tokens } from '@freightos/design-system';\r\n\r\nimport styled from 'styled-components';\r\n\r\nimport Flex from '../../common/components/Flex';\r\nimport FusionIcon from 'common/components/FusionIcon';\r\n\r\nexport const STitle = styled.div`\r\n\tcolor: ${tokens.fdsColorPrimaryGray60};\r\n\tfont-size: ${tokens.fdsSizeXs};\r\n\tfont-weight: ${tokens.fdsFontWeightRegular};\r\n\tmargin-bottom: ${tokens.fdsComponentSpacingSm};\r\n\ti {\r\n\t\tmargin-right: ${tokens.fdsComponentSpacingSm};\r\n\t}\r\n\r\n`;\r\n\r\nexport const SCard = styled(Flex)`\r\n\tpadding-left: 0 !important;\r\n`;\r\n\r\nexport const UnitIcon = styled(FusionIcon)`\r\n\tmargin-right: 0 !important;\r\n\tvertical-align: bottom;\r\n`;\r\n\r\nexport const STruncatedLabel = styled.span`\r\n\twhite-space: nowrap;\r\n\tmin-width: 0;\r\n\tcolor: ${tokens.fdsColorPrimaryGray80};\r\n\toverflow: hidden;\r\n\ttext-overflow: ellipsis;\r\n\t${({$isLocationLabel}) => !$isLocationLabel && `\r\n\t\tfont-size: 10px; //TODO: FSN-145\r\n\t\tline-height: 15px;\r\n\t`}\r\n\t${({$isPort}) => {\r\n\t\tif ($isPort === undefined)\r\n\t\t\treturn;\r\n\r\n\t\treturn `min-width: ${$isPort ? '65px' : '55px'};`\r\n\t}};\r\n`;\r\n\r\nexport const SLocationFlag = styled(Avatar)`\r\n\tborder: 1px solid ${tokens.fdsColorPrimaryGray20};\r\n\twidth: ${tokens.fdsSizeSm};\r\n\theight: ${tokens.fdsSizeSm};\r\n`;\r\n\r\nexport const STinyWrapper = styled(Flex)`\r\n\toverflow: hidden !important;\r\n\tfont-size: 10px; //TODO: FSN-145\r\n\tline-height: 15px;\r\n\tflex: 1;\r\n\tmin-width: 0;\r\n`;\r\n\r\nexport const SListWrapper = styled(Flex)`\r\n\t:last-child {\r\n\t\tpadding-bottom: 0 !important;\r\n\t}\r\n`;\r\n\r\n","import { \r\n\tCONTAINER_TYPE_20_FOOT_FACTOR, \r\n\tCUBIC_FOOT_TO_CUBIC_INCH_CONVERSION_FACTOR, \r\n\tCUBIC_METER_TO_CUBIC_CM_CONVERSION_FACTOR, \r\n\tPACKAGE_TYPE, \r\n\tSEARCH_FIELDS,\r\n\tSEARCH_PLATFORMS,\r\n\tSHIPMENT_OPTIONS,\r\n\tVOLUME_OPTIONS, \r\n\tWEIGHT_OPTIONS\r\n} from \"./constants\";\r\n\r\n/**\r\n * Formats a number using thousand separators (e.g., 1000 becomes \"1,000\").\r\n * Limits fraction digits to 3.\r\n */\r\nexport const formatNumber = (value) => {\r\n\tif(!value) return '0';\r\n\r\n\treturn value.toLocaleString(\"en-US\", {\r\n\t\tmaximumFractionDigits: 3,\r\n\t\tuseGrouping: true\r\n\t});\r\n};\r\n\r\n/**\r\n * Orders locations by countries and also groups them by country\r\n * @param locations - Array of location objects\r\n * @param countryOrder - Array of country codes in desired order\r\n * @returns Object with countries as keys and their locations as values, ordered by countryOrder\r\n */\r\nexport const groupAndOrderLocationsByCountries = (\r\n\tlocations\r\n) => {\r\n\t// Group locations by country\r\n\tconst groupedByCountry = locations.reduce((acc, location) => {\r\n\t\tconst countryCode = location.country;\r\n\t\tif (!acc[countryCode]) {\r\n\t\t\tacc[countryCode] = [];\r\n\t\t}\r\n\t\tacc[countryCode].push(location);\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\t// Sort locations within each country group\r\n\tObject.keys(groupedByCountry).forEach(countryCode => {\r\n\t\tgroupedByCountry[countryCode].sort((a, b) => a.value.localeCompare(b.value));\r\n\t});\r\n\treturn groupedByCountry;\r\n};\r\n\r\n/**\r\n * Extracts unique icons from box packages array\r\n * @param boxPackages - Array of box package objects\r\n * @returns Array of unique icon names\r\n */\r\nexport const getUniqueBoxPackageIcons = (boxPackages) =>\r\n\tboxPackages.reduce((uniqueIcons, packageItem) => {\r\n\t\tconst icon = packageItem.type?.value?.icon;\r\n\t\t\r\n\t\t// Add icon to array only if it's not already present\r\n\t\tif (!uniqueIcons.includes(icon)) {\r\n\t\t\tuniqueIcons.push(icon);\r\n\t\t}\r\n\t\t\r\n\t\treturn uniqueIcons;\r\n\t}, []);\r\n\r\nexport const chooseIconsType = (search) => {\r\n\tconst shipmentType = search.shipment_details.type;\r\n\tif(shipmentType === SHIPMENT_OPTIONS.TOTALS) {\r\n\t\treturn ['box-total'];\r\n\t}\r\n\r\n\tif(shipmentType === SHIPMENT_OPTIONS.UNITS) {\r\n\t\tconst unitsPackages = search.shipment_details[SEARCH_FIELDS.UNITS_SHIPMENT];\r\n\t\tif(unitsPackages?.packageType === PACKAGE_TYPE.BOX) {\r\n\t\t\tconst uniqueIcons = getUniqueBoxPackageIcons(unitsPackages.boxPackages);\r\n\t\t\treturn uniqueIcons;\r\n\t\t}\r\n\t\tif(unitsPackages?.packageType === PACKAGE_TYPE.ULD) {\r\n\t\t\treturn ['uld'];\r\n\t\t}\r\n\t\treturn ['box'];\r\n\t}\r\n\r\n\tif(shipmentType === SHIPMENT_OPTIONS.CONTAINER) {\r\n\t\treturn ['container'];\r\n\t}\r\n\r\n\treturn ['box'];\r\n}\r\n\r\n/**\r\n * Calculates total units, volume and weight based on package type in IRecentSearch\r\n * @param search - Recent search object containing shipment details\r\n * @returns Object with calculated totals for units, volume, and weight\r\n */\r\nexport const shipmentTotalsBasedOnPackages = (search) => {\r\n\tconst shipmentType = search.shipment_details.type;\r\n\tconst platformType = search.platform_type;\r\n\r\n\tif(platformType === SEARCH_PLATFORMS.QUOTATION) {\r\n\t\treturn { units: 0, volume: 0, weight: 0, weightUnit: WEIGHT_OPTIONS.KG, volumeUnit: VOLUME_OPTIONS.CBM };\r\n\t}\r\n\tswitch (shipmentType) {\r\n\t\tcase SHIPMENT_OPTIONS.CONTAINER: {\r\n\t\t\tlet calculatedUnits = 0;\r\n\t\t\tlet calculatedTEU = 0;\r\n\t\t\t// eslint-disable-next-line no-unused-expressions\r\n\t\t\tsearch.shipment_details[SEARCH_FIELDS.CONTAINER_PACKAGES]?.forEach((pkg) => {\r\n\t\t\t\tconst units = Number(pkg.units) || 0;\r\n\t\t\t\tif (units > 0) {\r\n\t\t\t\t\tcalculatedUnits += units;\r\n\t\t\t\t\tconst dimensionSelected = parseInt(pkg.dimensions.value, 10);\r\n\t\t\t\t\tcalculatedTEU += units * (dimensionSelected / CONTAINER_TYPE_20_FOOT_FACTOR);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn {\r\n\t\t\t\tunits: calculatedUnits, \r\n\t\t\t\tvolume: calculatedTEU, \r\n\t\t\t\tweight: null,\r\n\t\t\t\tweightUnit: null,\r\n\t\t\t\tvolumeUnit: 'TEU',\r\n\t\t\t};\r\n\t\t}\r\n\t\tcase SHIPMENT_OPTIONS.UNITS: {\r\n\t\t\tconst unitsPackages = search.shipment_details[SEARCH_FIELDS.UNITS_SHIPMENT];\r\n\t\t\tconst volumeCalculationFactor = unitsPackages?.volumeUnit === VOLUME_OPTIONS.CFT \r\n\t\t\t\t? CUBIC_FOOT_TO_CUBIC_INCH_CONVERSION_FACTOR : CUBIC_METER_TO_CUBIC_CM_CONVERSION_FACTOR;\r\n\t\t\tif (unitsPackages?.packageType === PACKAGE_TYPE.BOX) {\r\n\t\t\t\tconst formattedVolume = formatNumber(unitsPackages?.boxPackages.reduce((acc, curr) => {\r\n\t\t\t\t\tconst volume = parseFloat(curr.width || '0') * parseFloat(curr.height || '0') * parseFloat(curr.length || '0') * parseFloat(curr.units || '0') / volumeCalculationFactor;\r\n\t\t\t\t\treturn acc + volume;\r\n\t\t\t\t}, 0));\r\n\t\t\t\tconst formattedWeight = formatNumber(unitsPackages.boxPackages.reduce((acc, curr) => acc + parseFloat(curr.weight || '0'), 0));\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tunits: unitsPackages.boxPackages.reduce((acc, curr) => acc + parseFloat(curr.units || '0'), 0),\r\n\t\t\t\t\tvolume: formattedVolume, \r\n\t\t\t\t\tweight: formattedWeight,\r\n\t\t\t\t\tweightUnit: unitsPackages.weightUnit,\r\n\t\t\t\t\tvolumeUnit: unitsPackages.volumeUnit,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tif (unitsPackages?.packageType === PACKAGE_TYPE.ULD) {\r\n\t\t\t\tconst formattedVolume = formatNumber(unitsPackages.uldPackages.reduce((acc, curr) => acc + parseFloat(curr.volume || '0'), 0));\r\n\t\t\t\tconst formattedWeight = formatNumber(unitsPackages.uldPackages.reduce((acc, curr) => acc + parseFloat(curr.weight || '0'), 0));\r\n\t\t\t\treturn {\r\n\t\t\t\t\tunits: unitsPackages.uldPackages.length, \r\n\t\t\t\t\tvolume: formattedVolume, \r\n\t\t\t\t\tweight: formattedWeight,\r\n\t\t\t\t\tweightUnit: unitsPackages.weightUnit,\r\n\t\t\t\t\tvolumeUnit: unitsPackages.volumeUnit,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn { units: 0, volume: 0, weight: 0, weightUnit: WEIGHT_OPTIONS.KG, volumeUnit: VOLUME_OPTIONS.CBM };\r\n\t\t}\r\n\r\n\t\tcase SHIPMENT_OPTIONS.TOTALS: {\r\n\t\t\tconst formattedVolume = formatNumber(parseFloat(search.shipment_details[SEARCH_FIELDS.TOTALS_SHIPMENT]?.volume || '0'));\r\n\t\t\tconst formattedWeight = formatNumber(parseFloat(search.shipment_details[SEARCH_FIELDS.TOTALS_SHIPMENT]?.weight || '0'));\r\n\t\t\treturn {\r\n\t\t\t\tunits: search.shipment_details[SEARCH_FIELDS.TOTALS_SHIPMENT]?.units || 0, \r\n\t\t\t\tvolume: formattedVolume, \r\n\t\t\t\tweight: formattedWeight,\r\n\t\t\t\tweightUnit: search.shipment_details[SEARCH_FIELDS.TOTALS_SHIPMENT]?.weightUnit || WEIGHT_OPTIONS.KG,\r\n\t\t\t\tvolumeUnit: search.shipment_details[SEARCH_FIELDS.TOTALS_SHIPMENT]?.volumeUnit || VOLUME_OPTIONS.CBM,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tdefault:\r\n\t\t\treturn { units: 0, volume: 0, weight: 0, weightUnit: WEIGHT_OPTIONS.KG, volumeUnit: VOLUME_OPTIONS.CBM };\r\n\t}\r\n};\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\n\r\nimport { Tooltip } from \"@freightos/design-system\";\r\n\r\nimport { STruncatedLabel } from \"../styled\";\r\n\r\n/**\r\n * TruncatedLabel component that automatically detects text truncation\r\n * and shows a tooltip with full text when content is truncated with ellipsis\r\n */\r\nconst TruncatedLabel = ({ \r\n\ttext = '', \r\n\ttestId, \r\n\tisPort = undefined,\r\n\tisLocationLabel = false,\r\n\tchildren = null\r\n}) => {\r\n\tconst labelRef = useRef(null);\r\n\tconst [isTruncated, setIsTruncated] = useState(false);\r\n\r\n\t/**\r\n\t * Check if the label text is truncated by comparing scroll width vs client width\r\n\t */\r\n\tconst checkTruncation = () => {\r\n\t\tif (labelRef.current) {\r\n\t\t\tconst element = labelRef.current;\r\n\t\t\tconst truncated = element.scrollWidth > element.clientWidth;\r\n\t\t\tsetIsTruncated(truncated);\r\n\t\t}\r\n\t};\r\n\r\n\t// Check truncation on mount and when text changes\r\n\tuseEffect(() => {\r\n\t\tcheckTruncation();\r\n\t}, [text]);\r\n\r\n\tconst labelElement = (\r\n\t\t<STruncatedLabel \r\n\t\t\tref={labelRef}\r\n\t\t\tdata-test-id={testId}\r\n\t\t\t$isLocationLabel={isLocationLabel}\r\n\t\t\t$isPort={isPort}\r\n\t\t>\r\n\t\t\t{children || text}\r\n\t\t</STruncatedLabel>\r\n\t);\r\n\r\n\t// Only show tooltip if text is actually truncated\r\n\tif (isTruncated) {\r\n\t\treturn (\r\n\t\t\t<Tooltip title={text} data-test-id={`${testId}-tooltip`}>\r\n\t\t\t\t<STruncatedLabel \r\n\t\t\t\t\tref={labelRef}\r\n\t\t\t\t\tdata-test-id={testId}\r\n\t\t\t\t\t$isLocationLabel={isLocationLabel}\r\n\t\t\t\t\t$isPort={isPort}\r\n\t\t\t\t>\r\n\t\t\t\t\t{children || text}\r\n\t\t\t\t</STruncatedLabel>\r\n\t\t\t</Tooltip>\r\n\t\t);\r\n\t}\r\n\r\n\treturn labelElement;\r\n};\r\n\r\nexport default TruncatedLabel; ","import React from \"react\";\r\n\r\nimport { tokens } from \"@freightos/design-system\";\r\nimport FusionIcon from 'common/components/FusionIcon';\r\n\r\nimport Flex from \"../../../common/components/Flex\";\r\nimport { FlexSpacings } from \"../../../common/helpers/constants\";\r\nimport { SLocationFlag } from \"../styled\";\r\nimport { groupAndOrderLocationsByCountries } from \"../utils\";\r\n\r\nimport TruncatedLabel from \"./TruncatedLabel.jsx\";\r\nimport { LOCATION_MODES } from \"../../../helpers/constant\";\r\n\r\nconst ItineraryDisplay = ({search, index, dataTestId}) => {\r\n\tconst isMultiOrigin = search.origin.length > 1;\t\r\n\tconst isMultiDestination = search.destination.length > 1;\r\n\tconst groupedOrigin = isMultiOrigin \r\n\t\t? groupAndOrderLocationsByCountries(search.origin) \r\n\t\t: { [search.origin[0].country]: search.origin };\r\n\tconst groupedDestination = isMultiDestination \r\n\t\t? groupAndOrderLocationsByCountries(search.destination) \r\n\t\t: { [search.destination[0].country]: search.destination };\r\n\treturn (\r\n\t\t<Flex alignItems='center' spacing={FlexSpacings.XSMALL} fullWidth>\r\n\t\t\t{Object.keys(groupedOrigin).map(countryCode =>{ \r\n\t\t\t\tconst labelOrigin = groupedOrigin[countryCode].map(origin => origin.selectedValue).join(', ');\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<TruncatedLabel\r\n\t\t\t\t\t\tkey={countryCode}\r\n\t\t\t\t\t\ttext={labelOrigin}\r\n\t\t\t\t\t\tisLocationLabel\r\n\t\t\t\t\t\ttestId={`${dataTestId}-origin-${index}`}\r\n\t\t\t\t\t\tisPort={groupedOrigin[countryCode][0].type === LOCATION_MODES.SEAPORT}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<SLocationFlag\r\n\t\t\t\t\t\t\ttype='flag'\r\n\t\t\t\t\t\t\tcountry={countryCode}\r\n\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-origin-flag-${index}`}\r\n\t\t\t\t\t\t\tstyle={{ marginRight: '4px' }}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t{labelOrigin}\r\n\t\t\t\t\t</TruncatedLabel>\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\t<FusionIcon type='arrow-forward' style={{ marginRight: 0, color: tokens.fdsColorPrimaryGray90, flex: 'none' }} />\r\n\t\t\t{Object.keys(groupedDestination).map(countryCode => {\r\n\t\t\t\tconst labelDestination = groupedDestination[countryCode].map(destination => destination.selectedValue).join(', ');\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<TruncatedLabel \r\n\t\t\t\t\t\tkey={countryCode} \r\n\t\t\t\t\t\ttext={labelDestination} \r\n\t\t\t\t\t\tisLocationLabel \r\n\t\t\t\t\t\ttestId={`${dataTestId}-destination-${index}`}\r\n\t\t\t\t\t\tisPort={groupedDestination[countryCode][0].type === LOCATION_MODES.SEAPORT}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<SLocationFlag\r\n\t\t\t\t\t\t\ttype='flag'\r\n\t\t\t\t\t\t\tcountry={countryCode}\r\n\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-destination-flag-${index}`}\r\n\t\t\t\t\t\t\tstyle={{ marginRight: '4px' }}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t{labelDestination}\r\n\t\t\t\t\t</TruncatedLabel>\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t</Flex>\r\n\t);\r\n};\r\n\r\nexport default ItineraryDisplay;","import React, { useMemo } from \"react\";\r\n\r\nimport FusionIcon from 'common/components/FusionIcon';\r\n\r\nimport Flex from \"../../../common/components/Flex\";\r\nimport { FlexSpacings } from \"../../../common/helpers/constants\";\r\nimport { SEARCH_PLATFORMS, TEMPERATURE_RANGES_DATA } from \"../constants\";\r\nimport { STinyWrapper, UnitIcon } from \"../styled\";\r\nimport { chooseIconsType, shipmentTotalsBasedOnPackages } from \"../utils\";\r\n\r\nimport TruncatedLabel from \"./TruncatedLabel.jsx\";\r\n\r\nconst ShipmentAndCommodityDisplay = ({search, index, dataTestId}) => {\r\n\tconst platformType = search.platform_type;\r\n\tconst icons = chooseIconsType(search);\r\n\tconst {units, volume, weight, weightUnit, volumeUnit} = useMemo(() => shipmentTotalsBasedOnPackages(search), [search]);\r\n\tconst isTemperature = search.commodity.length === 1 && search.commodity[0].is_temperature;\r\n\tconst temperatureRange = search.commodity_temperature?.tempRange && isTemperature \r\n\t\t? TEMPERATURE_RANGES_DATA[search.commodity_temperature?.tempRange][search.commodity_temperature?.temperatureSystem] \r\n\t\t: '';\r\n\r\n\treturn <Flex spacing={FlexSpacings.XSMALL} alignItems='center' fullWidth key={index}>\r\n\t\t{platformType === SEARCH_PLATFORMS.QUOTATION ? (\r\n\t\t\t<STinyWrapper alignItems='center' spacing={FlexSpacings.SMALL} style={{flex: 1}}>\r\n\t\t\t\t{icons.map((icon, iconIndex) => <UnitIcon type={icon} key={`${index}-${iconIndex}`} size='tiny' data-test-id={`${dataTestId}rs-package-icon-${index}-${iconIndex}`} />)}\r\n\t\t\t\t<TruncatedLabel\r\n\t\t\t\t\ttext={search.commodity.map(commodity => commodity.label).join(', ')}\r\n\t\t\t\t\ttestId={`${dataTestId}rs-commodity-${index}`}\r\n\t\t\t\t/>\r\n\t\t\t</STinyWrapper>\r\n\t\t) : (\r\n\t\t\t<STinyWrapper alignItems='center' spacing={FlexSpacings.SMALL}>\r\n\t\t\t\t<Flex\r\n\t\t\t\t\talignItems='center'\r\n\t\t\t\t\tspacing={FlexSpacings.XSMALL}\r\n\t\t\t\t\tdata-test-id={`rs-${index}-units`}\r\n\t\t\t\t\t\r\n\t\t\t\t>\r\n\t\t\t\t\t{units}&nbsp;{icons.map((icon, iconIndex) => <UnitIcon type={icon} key={`${index}-${iconIndex}`} size='tiny' data-test-id={`${dataTestId}rs-package-icon-${index}-${iconIndex}`}/>)}\r\n\t\t\t\t</Flex>\r\n\t\t\t\t<span data-test-id={`${dataTestId}rs-volume-${index}`}>\r\n\t\t\t\t\t{volume}&nbsp;{volumeUnit}\r\n\t\t\t\t</span>\r\n\t\t\t\t{weight && (\r\n\t\t\t\t\t<span data-test-id={`${dataTestId}rs-weight-${index}`}>\r\n\t\t\t\t\t\t{weight}&nbsp;{weightUnit}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t)}\r\n\t\t\t\t<TruncatedLabel\r\n\t\t\t\t\ttext={search.commodity.map(commodity => commodity.label).join(', ')}\r\n\t\t\t\t\ttestId={`${dataTestId}rs-commodity-${index}`}\r\n\t\t\t\t/>\r\n\t\t\t\t{isTemperature && (\r\n\t\t\t\t\t<Flex\r\n\t\t\t\t\t\talignItems='center'\r\n\t\t\t\t\t\tspacing={FlexSpacings.XSMALL}\r\n\t\t\t\t\t\tdata-test-id={`${dataTestId}rs-temperature-${index}`}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<FusionIcon type='temperature-low' size=\"tiny\" data-test-id={`${dataTestId}rs-temperature-icon-${index}`} />\r\n\t\t\t\t\t\t<span style={{whiteSpace: 'nowrap'}}>\r\n\t\t\t\t\t\t\t{temperatureRange}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</Flex>\r\n\t\t\t\t)}\r\n\t\t\t</STinyWrapper>\r\n\t\t)}\r\n\t</Flex>;\r\n};\r\n\r\nexport default ShipmentAndCommodityDisplay;","import React from \"react\";\r\n\r\nimport { tokens } from \"@freightos/design-system\";\r\n\r\nimport { useFormikContext } from \"formik\";\r\n\r\nimport { FlexDirections, FlexSpacings } from \"../../../common/helpers/constants\";\r\nimport { saveLastUsedSearch } from \"../apis\";\r\nimport { SCard } from \"../styled\";\r\n\r\nimport ItineraryDisplay from \"./ItineraryDisplay.jsx\";\r\nimport ShipmentAndCommodityDisplay from \"./ShipmentAndCommodityDisplay.jsx\";\r\n\r\nexport const SearchCard = (\r\n\t{ search, index, setIsOpen, dataTestId, onRecentSearchSelect }) => {\r\n\r\n\tconst handleClick = async () => {\r\n\t\tonRecentSearchSelect(search);\r\n\t\ttry {\r\n\t\t\tawait saveLastUsedSearch(search.id);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\t\r\n\t\tsetIsOpen(false);\r\n\t};\r\n\r\n\treturn <SCard \r\n\t\tdirection={FlexDirections.VERTICAL} \r\n\t\tfullWidth \r\n\t\tspacing={FlexSpacings.XSMALL}\r\n\t\tkey={search.id}\r\n\t\tstyle={{\r\n\t\t\tpadding: tokens.fdsComponentSpacingSm,\r\n\t\t}}\r\n\t\tdata-test-id={`${dataTestId}rs-card-${index}`}\r\n\t\tonClick={() => {\r\n\t\t\thandleClick();\r\n\t\t}}>\r\n\t\t<ItineraryDisplay search={search} index={index} dataTestId={dataTestId} />\r\n\t\t<ShipmentAndCommodityDisplay search={search} index={index} dataTestId={dataTestId} />\r\n\t</SCard>;\t\r\n};","import React from 'react';\r\n\r\nimport { tokens } from '@freightos/design-system';\r\nimport FusionIcon from 'common/components/FusionIcon';\r\nimport { TranslatableText } from '@freightos/freightos-i18n';\r\n\r\nimport { FlexDirections } from '../../common/helpers/constants';\r\nimport { StyledMenu } from '../../helpers/styled';\r\n\r\nimport { orderRecentSearches } from './adapters';\r\nimport { SearchCard } from './components/SearchCard.jsx';\r\nimport { SListWrapper, STitle } from './styled';\r\n\r\nconst RecentSearches = ({ recentSearches, setIsOpen, dataTestId, onRecentSearchSelect, initialValues }) => {\r\n\tconst firstSixSearches = recentSearches ? orderRecentSearches(recentSearches) : [];\r\n\treturn (\r\n\t\t<StyledMenu>\r\n\t\t\t<STitle>\r\n\t\t\t\t<FusionIcon data-test-id={`${dataTestId}rs-icon`} color={tokens.fdsColorPrimaryGray60} type='history' size='tiny' /><TranslatableText stringId='Recent searches' />\r\n\t\t\t</STitle>\r\n\t\t\t<SListWrapper direction={FlexDirections.VERTICAL} fullWidth>\r\n\t\t\t\t{firstSixSearches.map((search, index) => (\r\n\t\t\t\t\t<SearchCard \r\n\t\t\t\t\t\tonRecentSearchSelect={onRecentSearchSelect} \r\n\t\t\t\t\t\tinitialValues={initialValues} \r\n\t\t\t\t\t\tsearch={search} \r\n\t\t\t\t\t\tindex={index} \r\n\t\t\t\t\t\tkey={search.id}\r\n\t\t\t\t\t\tsetIsOpen={setIsOpen} dataTestId={dataTestId} />\r\n\t\t\t\t))}\r\n\t\t\t</SListWrapper>\r\n\t\t</StyledMenu>\r\n\t);\r\n};\r\n\r\nexport default RecentSearches;\r\n","import { RS_PLATFORM_TYPES, SEARCH_FIELDS, SEARCH_PLATFORMS, RECENT_SEARCHES_LIMIT } from \"./constants\";\r\n\r\nexport const formatPlatformType = (platformType) => {\r\n\tswitch (platformType) {\r\n\t\tcase SEARCH_PLATFORMS.BOOKING:\r\n\t\t\treturn RS_PLATFORM_TYPES.BOOK;\r\n\t\tcase SEARCH_PLATFORMS.QUOTATION:\r\n\t\t\treturn RS_PLATFORM_TYPES.QUOTE;\r\n\t\tcase SEARCH_PLATFORMS.BI:\r\n\t\t\treturn RS_PLATFORM_TYPES.BI;\r\n\t\tdefault:\r\n\t\t\treturn platformType;\r\n\t}\r\n};\r\n\r\nexport const formatPlatformTypeFromRecentSearch = (platformType) => {\r\n\tswitch (platformType) {\r\n\t\tcase RS_PLATFORM_TYPES.BOOK:\r\n\t\t\treturn SEARCH_PLATFORMS.BOOKING;\r\n\t\tcase RS_PLATFORM_TYPES.QUOTE:\r\n\t\t\treturn SEARCH_PLATFORMS.QUOTATION;\r\n\t\tcase RS_PLATFORM_TYPES.BI:\r\n\t\t\treturn SEARCH_PLATFORMS.BI;\r\n\t\tdefault:\r\n\t\t\treturn SEARCH_PLATFORMS.BOOKING;\r\n\t}\r\n};\r\n\r\nconst formatContainerShipment = (search) => ({\t\r\n\t[SEARCH_FIELDS.CONTAINER_PACKAGES]: search.shipment_details[SEARCH_FIELDS.CONTAINER_PACKAGES],\r\n});\r\n\r\nexport const orderRecentSearches = (recentSearches) => [...recentSearches].sort((a, b) => {\r\n\t// Sort by most recent date (comparing last_time_used_date vs saved_update_date) and return last 6 \r\n\tconst aMaxDate = new Date(Math.max(\r\n\t\tnew Date(a.last_time_used_date).getTime(),\r\n\t\tnew Date(a.saved_update_date).getTime()\r\n\t));\r\n\tconst bMaxDate = new Date(Math.max(\r\n\t\tnew Date(b.last_time_used_date).getTime(),\r\n\t\tnew Date(b.saved_update_date).getTime()\r\n\t));\r\n\t\r\n\treturn bMaxDate.getTime() - aMaxDate.getTime();\r\n}).slice(0, RECENT_SEARCHES_LIMIT);\r\n\r\n","import React from 'react';\r\n\r\nimport { Spin } from '@freightos/design-system';\r\nimport { TRANSLATION_MODULES, TranslatableText } from '@freightos/freightos-i18n';\r\n\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { NoMatchingResults } from '../helpers/styled';\r\n\r\nimport RecentSearches from './RecentSearches/index.jsx';\r\n\r\nconst SelectorContent = ({ \r\n\tisLoading, \r\n\trecentSearches, \r\n\tsearchKey, \r\n\tdataTestId, \r\n\tsetIsOpen, \r\n\tonRecentSearchSelect, \r\n\tinitialValues }) => {\r\n\t// Return null for initial state (no search, no recent searches)\r\n\tif (!searchKey && (!recentSearches || recentSearches.length === 0)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (isLoading) {\r\n\t\treturn <Spin size='small' />;\r\n\t}\r\n\r\n\tif (recentSearches?.length > 0 && !searchKey.trim()) {\r\n\t\treturn (\r\n\t\t\t<RecentSearches\r\n\t\t\t\trecentSearches={recentSearches}\r\n\t\t\t\tdataTestId={dataTestId}\r\n\t\t\t\tsetIsOpen={setIsOpen}\r\n\t\t\t\tonRecentSearchSelect={onRecentSearchSelect}\r\n\t\t\t\tinitialValues={initialValues}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n\r\n\tif (searchKey.trim()) {\r\n\t\treturn (\r\n\t\t\t<NoMatchingResults>\r\n\t\t\t\t<TranslatableText stringId='No matching results' module={TRANSLATION_MODULES.SearchAndBook} />\r\n\t\t\t</NoMatchingResults>\r\n\t\t);\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nSelectorContent.propTypes = {\r\n\tisLoading: PropTypes.bool,\r\n\trecentSearches: PropTypes.array,\r\n\tsearchKey: PropTypes.string,\r\n\tonSelect: PropTypes.func,\r\n\tdataTestId: PropTypes.string,\r\n\tsetIsOpen: PropTypes.func,\r\n};\r\n\r\nexport default SelectorContent;\r\n","import React, { useEffect, useMemo, useRef, useState } from 'react';\r\n\r\nimport { Notification } from '@freightos/design-system';\r\nimport { debounce } from 'lodash';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { DEFAULT_LOCATION_MODE, LOCATION_MODES_MAP, MAX_TAG_COUNT, MAX_TAG_COUNT_MULTIPLE, SelectModes } from '../helpers/constant';\r\nimport { DebounceSelector, DropdownGlobalStyle } from '../helpers/styled';\r\n\r\nimport SelectorContent from './SelectorContent';\r\nimport Environment from 'common/helpers/Environment';\r\n\r\nconst DebounceSelect = ({\r\n\tfetchOptions,\r\n\trenderedOptions,\r\n\trecentSearches = [],\r\n\thasError,\r\n\tmode,\r\n\tdataTestId,\r\n\tvalue,\r\n\tdebounceTimeout = 800,\r\n\tactiveLocationMode,\r\n\tdefaultLocation,\r\n\tonChange,\r\n\t...props\r\n}) => {\r\n\tconst [options, setOptions] = useState([]);\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\tconst [searchKey, setSearchKey] = useState('');\r\n\tconst fetchRef = useRef(0);\r\n\tconst [isOpen, setIsOpen] = useState(false);\r\n\tconst [maxTagCount, setMaxTagCount] = useState(MAX_TAG_COUNT);\r\n\tconst timeoutRef = useRef();\r\n\r\n\tuseEffect(() => {\r\n\t\tif ((!value || value.length === 0) && !isOpen) {\r\n\t\t\tsetOptions([]);\r\n\t\t\tsetSearchKey('');\r\n\t\t}\r\n\t}, [value, isOpen]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (activeLocationMode !== DEFAULT_LOCATION_MODE) {\r\n\t\t\tsetOptions(prevOptions =>\r\n\t\t\t\tprevOptions.filter(option => option.label === LOCATION_MODES_MAP[activeLocationMode].label)\r\n\t\t\t);\r\n\t\t}\r\n\t\tsetIsOpen(false);\r\n\r\n\t\t// Clear any existing timeout\r\n\t\tif (timeoutRef.current) {\r\n\t\t\tclearTimeout(timeoutRef.current);\r\n\t\t}\r\n\r\n\t\ttimeoutRef.current = setTimeout(() => {\r\n\t\t\tdocument.activeElement.blur(); // remove focus from input\r\n\t\t\tdocument.body.click(); // simulate outside click\r\n\t\t\tconst active = document.querySelector('.ant-select-focused');\r\n\t\t\tif (active) {\r\n\t\t\t\tactive.classList.remove('ant-select-focused');\r\n\t\t\t}\r\n\t\t\tsetMaxTagCount(MAX_TAG_COUNT);\r\n\t\t}, 100);\r\n\r\n\t\t// Cleanup function\r\n\t\treturn () => {\r\n\t\t\tif (timeoutRef.current) {\r\n\t\t\t\tclearTimeout(timeoutRef.current);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [activeLocationMode]);\r\n\r\n\tconst debounceFetcher = useMemo(() => {\r\n\t\tconst loadOptions = async optionValue => {\r\n\t\t\tsetSearchKey(optionValue);\r\n\t\t\tfetchRef.current += 1;\r\n\t\t\tconst fetchId = fetchRef.current;\r\n\r\n\t\t\tsetOptions([]);\r\n\t\t\tsetIsLoading(true);\r\n\r\n\t\t\tlet returnOptions = null;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst newOptions = await fetchOptions(optionValue);\r\n\t\t\t\tif (fetchId === fetchRef.current) {\r\n\t\t\t\t\tsetOptions(newOptions);\r\n\t\t\t\t\treturnOptions = newOptions;\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Error fetching options:', error);\r\n\t\t\t\tif (fetchId === fetchRef.current) {\r\n\t\t\t\t\tNotification.danger({\r\n\t\t\t\t\t\tmessage: 'Search failed',\r\n\t\t\t\t\t\tdescription: 'Unable to fetch location results. Please try again later.',\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tif (fetchId === fetchRef.current) {\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t\treturn returnOptions;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn debounce(loadOptions, debounceTimeout);\r\n\t}, [fetchOptions, debounceTimeout]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!defaultLocation?.code) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst loadDefaultLocation = async () => {\r\n\t\t\ttry {\r\n\t\t\t\tsetOptions([]);\r\n\t\t\t\tsetIsLoading(true);\r\n\t\t\t\t\r\n\t\t\t\tconst options = await fetchOptions(defaultLocation.code);\r\n\t\t\t\tsetOptions(options);\r\n\t\t\t\t\r\n\t\t\t\tif (!options || options.length === 0) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlet match = null;\r\n\t\t\t\t\r\n\t\t\t\tif (defaultLocation.type) {\r\n\t\t\t\t\tconst targetGroup = options.find(group => \r\n\t\t\t\t\t\tgroup.label.toLowerCase() === LOCATION_MODES_MAP[defaultLocation.type]?.label.toLowerCase()\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (targetGroup?.options) {\r\n\t\t\t\t\t\tmatch = targetGroup.options.find(option => \r\n\t\t\t\t\t\t\toption.code.toLowerCase() === defaultLocation.code.toLowerCase() || \r\n\t\t\t\t\t\t\toption.selectedValue.toLowerCase() === defaultLocation.code.toLowerCase()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!match) {\r\n\t\t\t\t\tmatch = options\r\n\t\t\t\t\t\t.map(group => group.options)\r\n\t\t\t\t\t\t.flat()\r\n\t\t\t\t\t\t.find(option => \r\n\t\t\t\t\t\t\toption.code.toLowerCase() === defaultLocation.code.toLowerCase() || \r\n\t\t\t\t\t\t\toption.selectedValue.toLowerCase() === defaultLocation.code.toLowerCase()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (match && onChange) {\r\n\t\t\t\t\tconst formattedMatch = {\r\n\t\t\t\t\t\tkey: JSON.stringify(match),\r\n\t\t\t\t\t\tlabel: match.selectedValue || match.displayLabel || match.code\r\n\t\t\t\t\t};\r\n\t\t\t\t\tonChange([formattedMatch]);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Environment.isLocal()) {\r\n\t\t\t\t\tconsole.error('Error loading default location:', error);\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tsetIsLoading(false);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tloadDefaultLocation();\r\n\t}, [defaultLocation?.code, defaultLocation?.type]);\r\n\r\n\tconst shouldShowDropdown = () => isLoading || searchKey.trim() || recentSearches?.length > 0;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<DropdownGlobalStyle />\r\n\t\t\t<DebounceSelector\r\n\t\t\t\tmaxTagCount={maxTagCount}\r\n\t\t\t\tonSearch={debounceFetcher}\r\n\t\t\t\t$hasError={hasError}\r\n\t\t\t\tloading={isLoading}\r\n\t\t\t\toptions={options}\r\n\t\t\t\tfilterOption={false}\r\n\t\t\t\tnotFoundContent={\r\n\t\t\t\t\t<SelectorContent\r\n\t\t\t\t\t\tisLoading={isLoading}\r\n\t\t\t\t\t\trecentSearches={recentSearches}\r\n\t\t\t\t\t\tsearchKey={searchKey}\r\n\t\t\t\t\t\tdataTestId={dataTestId}\r\n\t\t\t\t\t\tsetIsOpen={setIsOpen}\r\n\t\t\t\t\t\tonRecentSearchSelect={props.onRecentSearchSelect}\r\n\t\t\t\t\t\tinitialValues={props.initialValues}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tmode={mode}\r\n\t\t\t\tdata-test-id={`${dataTestId}-selector`}\r\n\t\t\t\tallowClear={mode === SelectModes.SINGLE}\r\n\t\t\t\tlabelInValue\r\n\t\t\t\toptionLabelProp='label'\r\n\t\t\t\tshowSearch\r\n\t\t\t\tonDropdownVisibleChange={open => {\r\n\t\t\t\t\tif (open) {\r\n\t\t\t\t\t\tsetMaxTagCount(MAX_TAG_COUNT_MULTIPLE);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsetMaxTagCount(MAX_TAG_COUNT);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsetOptions([]);\r\n\t\t\t\t\tsetSearchKey('');\r\n\t\t\t\t\tsetIsOpen(open);\r\n\t\t\t\t}}\r\n\t\t\t\topen={isOpen && shouldShowDropdown()}\r\n\t\t\t\tvalue={value}\r\n\t\t\t\tonChange={onChange}\r\n\t\t\t\t{...props}\r\n\t\t\t>\r\n\t\t\t\t{renderedOptions(options)}\r\n\t\t\t</DebounceSelector>\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nDebounceSelect.propTypes = {\r\n\tfetchOptions: PropTypes.func.isRequired,\r\n\trenderedOptions: PropTypes.func.isRequired,\r\n\thasError: PropTypes.bool,\r\n\tmode: PropTypes.string.isRequired,\r\n\tdataTestId: PropTypes.string,\r\n\tdebounceTimeout: PropTypes.number,\r\n\tvalue: PropTypes.array,\r\n\tactiveLocationMode: PropTypes.string,\r\n\trecentSearches: PropTypes.array,\r\n\tmaxTagCount: PropTypes.number,\r\n\tdefaultLocation: PropTypes.shape({\r\n\t\tcode: PropTypes.string.isRequired,\r\n\t\ttype: PropTypes.string.isRequired,\r\n\t}),\r\n\tonChange: PropTypes.func,\r\n};\r\n\r\nexport default DebounceSelect;\r\n","import React from 'react';\r\n\r\nimport { Tooltip } from '@freightos/design-system';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport { SelectedOptionLabel } from '../helpers/styled';\r\n\r\nconst MaxPortsPlaceholder = ({ omittedPorts, dataTestId }) => {\r\n\tconst selectedItems = omittedPorts.map(omittedPort => JSON.parse(omittedPort.key)?.selectedValue);\r\n\r\n\treturn (\r\n\t\t<Tooltip title={selectedItems.join(',')}>\r\n\t\t\t<SelectedOptionLabel data-test-id={`${dataTestId}-extra-ports`}>{`+${omittedPorts.length}`}</SelectedOptionLabel>\r\n\t\t</Tooltip>\r\n\t);\r\n};\r\n\r\nMaxPortsPlaceholder.propTypes = {\r\n\tomittedPorts: PropTypes.array,\r\n\tdataTestId: PropTypes.string,\r\n};\r\n\r\nexport default MaxPortsPlaceholder;\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nimport { tokens } from '@freightos/design-system';\r\nimport { TranslatableText } from '@freightos/freightos-i18n';\r\n\r\nimport PropTypes from 'prop-types';\r\n\r\nimport DebounceSelect from './components/DebounceSelect';\r\nimport MaxPortsPlaceholder from './components/MaxPortsPlaceholder';\r\nimport {\r\n\tDEFAULT_LOCATION_MODE,\r\n\tLocationTypes,\r\n\tSelectModes,\r\n} from './helpers/constant';\r\nimport {\r\n\tfetchLocations,\r\n\tgetLocationInputValue,\r\n\thandleLocationChange,\r\n\tisLocationAddress,\r\n\trenderLocationOptions,\r\n} from './helpers/utils';\r\n\r\n/**\r\n * LocationInput component for selecting locations (ports, airports, addresses, etc.)\r\n * \r\n * @param {Object|Array} value - Current selected location(s)\r\n * @param {Function} onChange - Callback fired when location changes\r\n * @param {boolean} hasError - Whether the input has validation errors\r\n * @param {string} dataTestId - Test ID for the component\r\n * @param {boolean} isOriginLocation - Whether this is an origin location input\r\n * @param {number} maxPorts - Maximum number of ports that can be selected\r\n * @param {Array<string>} supportedLocationModes - Array of supported location modes\r\n * @param {Object} customer - Customer object for API requests\r\n * @param {Object} defaultLocation - Default location to load\r\n * @param {string} defaultLocation.code - Location code (e.g., 'BCN')\r\n * @param {string} defaultLocation.type - Location type ('airport', 'seaport', 'address', etc.)\r\n * \r\n * @example\r\n * // Basic usage\r\n * <LocationInput \r\n * onChange={handleLocationChange}\r\n * supportedLocationModes={['airport', 'seaport']}\r\n * />\r\n * \r\n * @example\r\n * // With default value - will automatically load and select Barcelona airport\r\n * <LocationInput \r\n * onChange={handleLocationChange}\r\n * supportedLocationModes={['airport', 'seaport']}\r\n * defaultLocation={{ code: 'BCN', type: 'airport' }}\r\n * />\r\n */\r\nconst LocationInput = ({\r\n\tvalue,\r\n\tonChange,\r\n\thasError,\r\n\tdataTestId = 'location-input',\r\n\tisOriginLocation = true,\r\n\tmaxPorts = 1,\r\n\tsupportedLocationModes,\r\n\tcustomer,\r\n\tdefaultLocation,\r\n\t...rest\r\n}) => {\r\n\tconst [selectedLocation, setSelectedLocation] = useState(value);\r\n\tconst [activeLocationMode, setActiveLocationMode] = useState(\r\n\t\tsupportedLocationModes.length === 1 ? supportedLocationModes[0] : DEFAULT_LOCATION_MODE\r\n\t);\r\n\r\n\tconst [selectionMode, setSelectionMode] = useState(\r\n\t\tisLocationAddress(activeLocationMode) || activeLocationMode === DEFAULT_LOCATION_MODE\r\n\t\t\t? SelectModes.SINGLE\r\n\t\t\t: SelectModes.MULTIPLE\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isLocationAddress(activeLocationMode)) {\r\n\t\t\tsetSelectionMode(SelectModes.SINGLE);\r\n\t\t} else {\r\n\t\t\tsetSelectionMode(SelectModes.MULTIPLE);\r\n\t\t}\r\n\t}, [activeLocationMode]);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetSelectedLocation(value);\r\n\t\tif (Array.isArray(value) && value.length > 0) {\r\n\t\t\tsetActiveLocationMode(value[0].type);\r\n\t\t} else if (defaultLocation?.type) {\r\n\t\t\tsetActiveLocationMode(defaultLocation.type);\r\n\t\t} else {\r\n\t\t\tsetActiveLocationMode(DEFAULT_LOCATION_MODE);\r\n\t\t}\r\n\t}, [value, defaultLocation?.type]);\r\n\r\n\treturn (\r\n\t\t<DebounceSelect\r\n\t\t\tmode={selectionMode}\r\n\t\t\tdataTestId={dataTestId}\r\n\t\t\thasError={hasError}\r\n\t\t\tplaceholder={\r\n\t\t\t\t<TranslatableText\r\n\t\t\t\t\tstyle={{ fontSize: tokens.fdsFontSizeBase }}\r\n\t\t\t\t\tstringId={`Select ${isOriginLocation ? LocationTypes.ORIGIN : LocationTypes.DESTINATION}`}\r\n\t\t\t\t/>\r\n\t\t\t}\r\n\t\t\tvalue={getLocationInputValue(selectedLocation)}\r\n\t\t\tfetchOptions={fetchLocations(activeLocationMode, supportedLocationModes, customer)}\r\n\t\t\trenderedOptions={optionGroups => renderLocationOptions(optionGroups, dataTestId)}\r\n\t\t\tonChange={location => {\r\n\t\t\t\thandleLocationChange(location ?? [], selectionMode, maxPorts, setSelectedLocation, onChange);\r\n\t\t\t\tsetActiveLocationMode(DEFAULT_LOCATION_MODE);\r\n\t\t\t}}\r\n\t\t\tactiveLocationMode={activeLocationMode}\r\n\t\t\tmaxTagPlaceholder={omittedPorts => <MaxPortsPlaceholder omittedPorts={omittedPorts} dataTestId={dataTestId} />}\r\n\t\t\tdefaultLocation={defaultLocation}\r\n\t\t\tisOriginLocation={isOriginLocation}\r\n\t\t\t{...rest}\r\n\t\t/>\r\n\t);\r\n};\r\n\r\nLocationInput.propTypes = {\r\n\tvalue: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\r\n\tonChange: PropTypes.func.isRequired,\r\n\thasError: PropTypes.bool,\r\n\tdataTestId: PropTypes.string,\r\n\tisOriginLocation: PropTypes.bool,\r\n\tmaxPorts: PropTypes.number,\r\n\tsupportedLocationModes: PropTypes.arrayOf(PropTypes.string).isRequired,\r\n\tcustomer: PropTypes.object,\r\n\trecentSearches: PropTypes.array,\r\n\tonRecentSearchSelect: PropTypes.func,\r\n\tinitialValues: PropTypes.object,\r\n\tdefaultLocation: PropTypes.shape({\r\n\t\tcode: PropTypes.string.isRequired,\r\n\t\ttype: PropTypes.string.isRequired,\r\n\t}),\r\n};\r\n\r\nexport default LocationInput;\r\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["../webpack/universalModuleDefinition","../webpack/bootstrap","../external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","../external \"@freightos/design-system\"","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator/index.js","../external \"styled-components\"","../external \"@freightos/freightos-i18n\"","../external \"lodash\"","../external \"@freightos/http-client\"","../../../node_modules/regenerator-runtime/runtime.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/defineProperty.js","helpers/constant.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","helpers/styled.js","common/helpers/constants.js","common/helpers/styled.js","common/components/Flex.js","components/RecentSearches.js","components/SelectorContent.js","components/DebounceSelect.js","components/MaxPortsPlaceholder.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","helpers/apis.js","helpers/utils.js","index.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__3__","__WEBPACK_EXTERNAL_MODULE__4__","__WEBPACK_EXTERNAL_MODULE__5__","__WEBPACK_EXTERNAL_MODULE__6__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","runtime","Op","hasOwn","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","obj","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","method","arg","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","makeInvokeMethod","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","displayName","isGeneratorFunction","genFun","ctor","constructor","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","_arrayLikeToArray","arr","len","arr2","Array","_slicedToArray","isArray","_arr","_n","_d","_e","_s","_i","minLen","toString","from","test","_objectWithoutProperties","source","excluded","target","sourceKeys","indexOf","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","_defineProperty","LOCATION_MODES","LOCATION_MODES_MAP","label","icon","groupBy","SelectModes","LocationTypes","_taggedTemplateLiteral","strings","raw","freeze","defineProperties","DropdownGlobalStyle","createGlobalStyle","DebounceSelector","styled","Select","tokens","fdsBorderRadiusXl","fdsColorPrimaryBlue","fdsColorPrimaryBlue10","fdsComponentSpacingXxs","fdsSizeMd","fdsComponentSpacingSm","fdsComponentSpacingXs","SelectedOptionLabel","span","fdsFontSizeSm","SelectOptionLabel","div","StyledMenu","Menu","fdsBodyTextColorDisabled","NoMatchingResults","fdsSizeSm","fdsHeadingsFontFamily","UnitIcon","Icon","FlexSpacings","XXLARGE","fdsComponentSpacingXxl","XLARGE","fdsComponentSpacingXl","LARGE","fdsComponentSpacingLg","MEDIUM","fdsComponentSpacingMd","SMALL","XSMALL","XXSMALL","NONE","FlexDirections","StyledFlex","direction","alignItems","justifyContent","fullWidth","css","spacing","Flex","rest","children","RecentSearches","recentSearches","onSelect","dataTestId","setIsOpen","ItemGroup","title","color","fdsColorPrimaryGray60","stringId","map","recentSearch","index","Item","onClick","country","origin","code","size","style","width","height","data-test-id","join","marginRight","destination","fontSize","shipmentDetails","units","volume","unit","weight","commodity","SelectorContent","isLoading","searchKey","trim","TRANSLATION_MODULES","SearchAndBook","DebounceSelect","fetchOptions","renderedOptions","hasError","debounceTimeout","activeLocationMode","props","useState","options","setOptions","setIsLoading","setSearchKey","fetchRef","useRef","isOpen","maxTagCount","setMaxTagCount","useEffect","prevOptions","filter","option","setTimeout","document","activeElement","blur","body","click","active","querySelector","classList","remove","debounceFetcher","useMemo","loadOptions","optionValue","a","current","fetchId","newOptions","console","debounce","onSearch","$hasError","loading","notFoundContent","allowClear","labelInValue","optionLabelProp","showSearch","onDropdownVisibleChange","open","MaxPortsPlaceholder","omittedPorts","selectedItems","omittedPort","JSON","parse","selectedValue","ownKeys","enumerableOnly","symbols","sym","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getLocations","locationModes","query","customer","sources","reduce","acc","toUpperCase","id","httpClient","params","limit","response","data","results","airport","displayLabel","formattedNameOrAddress","city","latitude","longitude","postalOrZipCode","sourceType","seaport","address","locationType","getLocationInputValue","locations","formatLocation","location","stringify","extractFulfillmentCenters","locationsResults","updatedLocationsResults","fulfillmentCenters","fetchLocations","supportedLocationModes","modes","onChangeLocation","changedLocations","onChange","all","parsedKey","locationsDetails","Boolean","isLocationAddress","LocationInput","isOriginLocation","maxPorts","selectedLocation","setSelectedLocation","setActiveLocationMode","selectionMode","setSelectionMode","placeholder","fdsFontSizeBase","locationOptions","locationOption","find","locationOptionIcon","OptGroup","fontFamily","paddingLeft","iconType","renderLocationOptions","selectedPorts","Message","danger","handleLocationChange","maxTagPlaceholder"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,4BAA6BA,QAAQ,qBAAsBA,QAAQ,6BAA8BA,QAAQ,UAAWA,QAAQ,2BACtJ,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,sBAAuB,CAAC,QAAS,2BAA4B,oBAAqB,4BAA6B,SAAU,0BAA2BJ,GACjI,kBAAZC,QACdA,QAA6B,oBAAID,EAAQG,QAAQ,SAAUA,QAAQ,4BAA6BA,QAAQ,qBAAsBA,QAAQ,6BAA8BA,QAAQ,UAAWA,QAAQ,2BAE/LJ,EAA0B,oBAAIC,EAAQD,EAAY,MAAGA,EAAK,4BAA6BA,EAAK,qBAAsBA,EAAK,6BAA8BA,EAAa,OAAGA,EAAK,2BAR5K,CASGO,MAAM,SAASC,EAAgCC,EAAgCC,EAAgCC,EAAgCC,EAAgCC,GAClL,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUd,QAGnC,IAAIC,EAASW,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHhB,QAAS,IAUV,OANAiB,EAAQH,GAAUI,KAAKjB,EAAOD,QAASC,EAAQA,EAAOD,QAASa,GAG/DZ,EAAOe,GAAI,EAGJf,EAAOD,QA0Df,OArDAa,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASrB,EAASsB,EAAMC,GAC3CV,EAAoBW,EAAExB,EAASsB,IAClCG,OAAOC,eAAe1B,EAASsB,EAAM,CAAEK,YAAY,EAAM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,IAGxB1E,eAAA,UAAiBnB,EAAjB,YAA+B6J,EAAe5N,MAA9C,YAAuD4J,GACvD7E,MAAO,CAAEkJ,YAAa,QAEtB,kBAAC,GAAD,CAAM3K,WAAS,EAACD,eAAe,iBAC9B,kBAAC,GAAD,CAAMG,QAASpB,EAAaU,QAC3B,8BACC,kBAAC,SAAD,CACCxK,KAAK,OACLqM,QAASA,EACTG,KAAK,QACLC,MAAO,CACNC,MAAOjE,SAAOiB,UACdiD,OAAQlE,SAAOiB,cAIlB,kBAACN,EAAD,KAAoByJ,IAEpB7S,IAASwH,GAAqC,kBAAC,OAAD,CAAMxH,KAAK,SAASwM,KAAK,UACvExM,IAASwH,GAA+B,kBAAC,OAAD,CAAMxH,KAAK,UAAU4V,SAAS,0BCjChDC,CAAsBxH,EAAS5C,IAC3D4I,SAAU,SAAAX,IDsJuB,SAACA,EAAUuB,EAAeJ,EAAUE,EAAqBV,GAC5F,GAAIY,IAAkBpN,EAAsB,CAC3C,IAAMiO,EAAgBrQ,MAAME,QAAQ+N,GAAYA,EAAW,GACvDoC,EAAc/S,QAAU8R,GAC3BE,EAAoBe,GACpB3B,GAAiB2B,EAAezB,IAEhC0B,UAAQC,OAAO,kBAAC,mBAAD,CAAkBjK,SAAQ,qCAAgC8I,EAAhC,kBAG1CE,EAAoBrB,GACpBS,GAAiBT,EAAUW,GChKzB4B,CAAqBvC,EAAUuB,EAAeJ,EAAUE,EAAqBV,GAC7EW,EbxEiC,Ka0ElC9G,mBAAoBA,EACpBgI,kBAAmB,SAAAjF,GAAY,OAAI,kBAAC,GAAD,CAAqBA,aAAcA,EAAcxF,WAAYA,MAC5FL","file":"main.bundle.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"@freightos/design-system\"), require(\"styled-components\"), require(\"@freightos/freightos-i18n\"), require(\"lodash\"), require(\"@freightos/http-client\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"FusionLocationInput\", [\"react\", \"@freightos/design-system\", \"styled-components\", \"@freightos/freightos-i18n\", \"lodash\", \"@freightos/http-client\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FusionLocationInput\"] = factory(require(\"react\"), require(\"@freightos/design-system\"), require(\"styled-components\"), require(\"@freightos/freightos-i18n\"), require(\"lodash\"), require(\"@freightos/http-client\"));\n\telse\n\t\troot[\"FusionLocationInput\"] = factory(root[\"React\"], root[\"@freightos/design-system\"], root[\"styled-components\"], root[\"@freightos/freightos-i18n\"], root[\"lodash\"], root[\"@freightos/http-client\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__6__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"http://ship.freightos.local:8800/FusionLocationInput/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = require(\"regenerator-runtime\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","module.exports = __WEBPACK_EXTERNAL_MODULE__6__;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayWithHoles from \"./arrayWithHoles\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray\";\nimport nonIterableRest from \"./nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","import arrayLikeToArray from \"./arrayLikeToArray\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","/**\n * Default location mode used when no specific mode is selected.\n * @type {string}\n */\nexport const DEFAULT_LOCATION_MODE = '';\n\nexport const LOCATION_MODES = {\n\tAIRPORT: 'airport',\n\tSEAPORT: 'seaport',\n\tFULFILLMENT_CENTER: 'fulfillment_center',\n\tADDRESS_BOOK: 'address_book',\n\tLAST_MILE_ADDRESS: 'last_mile_address',\n\tADDRESS: 'address',\n};\n\nexport const LOCATION_MODES_MAP = {\n\t[LOCATION_MODES.AIRPORT]: { label: 'Airports', key: LOCATION_MODES.AIRPORT, icon: 'mode-air' },\n\t[LOCATION_MODES.SEAPORT]: { label: 'Seaports', key: LOCATION_MODES.SEAPORT, icon: 'mode-ship' },\n\t[LOCATION_MODES.FULFILLMENT_CENTER]: {\n\t\tlabel: 'Fulfillment centers',\n\t\tkey: LOCATION_MODES.FULFILLMENT_CENTER,\n\t\ticon: 'fulfillment-center',\n\t},\n\t[LOCATION_MODES.ADDRESS_BOOK]: { key: LOCATION_MODES.ADDRESS_BOOK, groupBy: 'address' },\n\t[LOCATION_MODES.LAST_MILE_ADDRESS]: { key: LOCATION_MODES.LAST_MILE_ADDRESS, groupBy: 'address' },\n\t[LOCATION_MODES.ADDRESS]: { label: 'Address', key: LOCATION_MODES.ADDRESS, icon: 'location' },\n};\n\n/**\n * Enumeration of selection modes for location input.\n * @enum {string}\n */\nexport const SelectModes = {\n\tSINGLE: 'single',\n\tMULTIPLE: 'multiple',\n};\n\n/**\n * Enumeration of location types for origin and destination.\n * @enum {string}\n */\nexport const LocationTypes = {\n\tORIGIN: 'origin',\n\tDESTINATION: 'destination',\n};\n","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","import { Icon, Menu, Select, tokens } from '@freightos/design-system';\nimport styled, { createGlobalStyle } from 'styled-components';\n\nexport const DropdownGlobalStyle = createGlobalStyle`\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`;\n\nexport const DebounceSelector = styled(Select)`\n\tli.ant-select-selection__choice {\n\t\tborder-radius: ${tokens.fdsBorderRadiusXl};\n\t\tborder: none;\n\t\tborder-color: ${tokens.fdsColorPrimaryBlue};\n\t\tcolor: ${tokens.fdsColorPrimaryBlue};\n\t\tbackground-color: ${tokens.fdsColorPrimaryBlue10};\n\t\tline-height: 10px !important;\n\t\tmargin-right: ${tokens.fdsComponentSpacingXxs};\n\t\twidth: 90px;\n\t\theight: ${tokens.fdsSizeMd} !important;\n\t\tmargin-top: ${tokens.fdsComponentSpacingSm} !important;\n\n\t\t.ant-select-selection__choice__remove {\n\t\t\tcolor: ${tokens.fdsColorPrimaryBlue};\n\t\t\tmargin-top: ${tokens.fdsComponentSpacingXs} !important;\n\t\t}\n\n\t\t.ant-select-selection__choice__content {\n\t\t\tline-height: ${tokens.fdsSizeMd} !important;\n\t\t\theight: ${tokens.fdsSizeMd} !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`;\n\nexport const SelectedOptionLabel = styled.span`\n\tfont-size: ${tokens.fdsFontSizeSm} !important;\n`;\n\nexport const SelectOptionLabel = styled.div`\n\tfont-size: ${tokens.fdsFontSizeSm} !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`;\n\nexport const StyledMenu = styled(Menu)`\n\tcursor: pointer !important;\n\n\t.ant-menu-item-group-title {\n\t\tpadding: 0;\n\t\tcolor: ${tokens.fdsBodyTextColorDisabled};\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`;\n\nexport const NoMatchingResults = styled.div`\n\tfont-size: ${tokens.fdsFontSizeSm};\n\tline-height: ${tokens.fdsSizeSm};\n\tfont-family: ${tokens.fdsHeadingsFontFamily};\n`;\n\nexport const UnitIcon = styled(Icon)`\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n`;\n","import { tokens } from '@freightos/design-system';\n\nexport const FlexSpacings = {\n\tXXLARGE: tokens.fdsComponentSpacingXxl,\n\tXLARGE: tokens.fdsComponentSpacingXl,\n\tLARGE: tokens.fdsComponentSpacingLg,\n\tMEDIUM: tokens.fdsComponentSpacingMd,\n\tSMALL: tokens.fdsComponentSpacingSm,\n\tXSMALL: tokens.fdsComponentSpacingXs,\n\tXXSMALL: tokens.fdsComponentSpacingXxs,\n\tNONE: 0,\n};\n\nexport const FlexDirections = {\n\tVERTICAL: 'vertical',\n\tHORIZONTAL: 'horizontal',\n};\n","import styled, { css } from 'styled-components';\n\nimport { FlexDirections } from './constants';\n\nexport const StyledFlex = styled.div`\n\tdisplay: flex;\n\tflex-direction: ${({ direction }) => (direction === FlexDirections.VERTICAL ? 'column' : 'row')};\n\tflex-wrap: ${({ wrap }) => (wrap ? 'wrap' : 'nowrap')};\n\talign-items: ${({ alignItems }) => alignItems};\n\tjustify-content: ${({ justifyContent }) => justifyContent};\n\tbox-sizing: border-box;\n\n\t${({ fullWidth }) =>\n\t\tfullWidth &&\n\t\tcss`\n\t\t\twidth: 100%;\n\t\t`}\n\t${({ direction, spacing }) =>\n\t\tdirection === FlexDirections.VERTICAL\n\t\t\t? css`\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ${spacing};\n\t\t\t\t\t}\n\t\t\t `\n\t\t\t: css`\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ${spacing};\n\t\t\t\t\t}\n\t\t\t `};\n`;\n","import React from 'react';\n\nimport PropTypes from 'prop-types';\n\nimport { FlexDirections, FlexSpacings } from '../helpers/constants';\nimport { StyledFlex } from '../helpers/styled';\n\nconst Flex = ({\n\tdirection = FlexDirections.HORIZONTAL,\n\talignItems = 'start',\n\tspacing = FlexSpacings.NONE,\n\t...rest\n}) => (\n\t<StyledFlex {...rest} direction={direction} alignItems={alignItems} spacing={spacing}>\n\t\t{rest.children}\n\t</StyledFlex>\n);\n\nFlex.propTypes = {\n\tdirection: PropTypes.oneOf([FlexDirections.HORIZONTAL, FlexDirections.VERTICAL]),\n\tspacing: PropTypes.oneOf(Object.keys(FlexSpacings)),\n\tchildren: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n\talignItems: PropTypes.string,\n\tjustifyContent: PropTypes.string,\n\tfullWidth: PropTypes.bool,\n\twrap: PropTypes.bool,\n};\n\nexport default Flex;\n","import React from 'react';\n\nimport { Avatar, Icon, Menu, tokens } from '@freightos/design-system';\nimport { TranslatableText } from '@freightos/freightos-i18n';\nimport PropTypes from 'prop-types';\n\nimport Flex from '../common/components/Flex';\nimport { FlexDirections, FlexSpacings } from '../common/helpers/constants';\nimport { StyledMenu, UnitIcon } from '../helpers/styled';\n\nconst RecentSearches = ({ recentSearches, onSelect, dataTestId, setIsOpen }) => (\n\t<StyledMenu>\n\t\t<Menu.ItemGroup\n\t\t\ttitle={\n\t\t\t\t<span>\n\t\t\t\t\t<Icon color={tokens.fdsColorPrimaryGray60} type='history' /> <TranslatableText stringId='Recent searches' />\n\t\t\t\t</span>\n\t\t\t}\n\t\t>\n\t\t\t{recentSearches.map((recentSearch, index) => (\n\t\t\t\t<Menu.Item\n\t\t\t\t\tkey={index}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tonSelect(recentSearch);\n\t\t\t\t\t\tsetIsOpen(false);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Flex direction={FlexDirections.VERTICAL}>\n\t\t\t\t\t\t<Flex alignItems='center'>\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\ttype='flag'\n\t\t\t\t\t\t\t\tcountry={recentSearch.origin[0].code}\n\t\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\t\tstyle={{ width: tokens.fdsSizeSm, height: tokens.fdsSizeSm }}\n\t\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-recent-search-${index}-origin-flag`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-origin-value`}>\n\t\t\t\t\t\t\t\t{recentSearch.origin.map(origin => origin.value).join(', ')}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t<Icon type='arrow-forward' style={{ marginRight: 0 }} />\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-destination-value`}>\n\t\t\t\t\t\t\t\t{recentSearch.destination.map(destination => destination.value).join(', ')}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\ttype='flag'\n\t\t\t\t\t\t\t\tcountry={recentSearch.destination[0].code}\n\t\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\t\tstyle={{ width: tokens.fdsSizeSm, height: tokens.fdsSizeSm }}\n\t\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-recent-search-${index}-destination-flag`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t<Flex spacing={FlexSpacings.SMALL} alignItems='center' style={{ fontSize: '10px' }}>\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-units`}>\n\t\t\t\t\t\t\t\t{recentSearch.shipmentDetails.units.value}\n\t\t\t\t\t\t\t\t<UnitIcon type={recentSearch.shipmentDetails.units.type} />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-volume`}>\n\t\t\t\t\t\t\t\t{recentSearch.shipmentDetails.volume.value} {recentSearch.shipmentDetails.volume.unit}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-weight`}>\n\t\t\t\t\t\t\t\t{recentSearch.shipmentDetails.weight.value} {recentSearch.shipmentDetails.weight.unit}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span data-test-id={`${dataTestId}-recent-search-${index}-commodity`}>{recentSearch.commodity}</span>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</Flex>\n\t\t\t\t</Menu.Item>\n\t\t\t))}\n\t\t</Menu.ItemGroup>\n\t</StyledMenu>\n);\n\nRecentSearches.propTypes = {\n\trecentSearches: PropTypes.arrayOf(\n\t\tPropTypes.shape({\n\t\t\torigin: PropTypes.arrayOf(\n\t\t\t\tPropTypes.shape({\n\t\t\t\t\tcode: PropTypes.string,\n\t\t\t\t\tvalue: PropTypes.string,\n\t\t\t\t})\n\t\t\t),\n\t\t\tdestination: PropTypes.arrayOf(\n\t\t\t\tPropTypes.shape({\n\t\t\t\t\tcode: PropTypes.string,\n\t\t\t\t\tvalue: PropTypes.string,\n\t\t\t\t})\n\t\t\t),\n\t\t\tshipmentDetails: PropTypes.object,\n\t\t\tcommodity: PropTypes.string,\n\t\t})\n\t),\n\tonSelect: PropTypes.func,\n\tdataTestId: PropTypes.string,\n\tsetIsOpen: PropTypes.func,\n};\n\nexport default RecentSearches;\n","import React from 'react';\n\nimport { Spin } from '@freightos/design-system';\nimport { TRANSLATION_MODULES, TranslatableText } from '@freightos/freightos-i18n';\nimport PropTypes from 'prop-types';\n\nimport { NoMatchingResults } from '../helpers/styled';\n\nimport RecentSearches from './RecentSearches';\n\nconst SelectorContent = ({ isLoading, recentSearches, searchKey, onSelect, dataTestId, setIsOpen }) => {\n\t// Return null for initial state (no search, no recent searches)\n\tif (!searchKey && (!recentSearches || recentSearches.length === 0)) {\n\t\treturn null;\n\t}\n\n\tif (isLoading) {\n\t\treturn <Spin size='small' />;\n\t}\n\n\tif (recentSearches?.length > 0 && !searchKey.trim()) {\n\t\treturn (\n\t\t\t<RecentSearches\n\t\t\t\trecentSearches={recentSearches}\n\t\t\t\tonSelect={onSelect}\n\t\t\t\tdataTestId={dataTestId}\n\t\t\t\tsetIsOpen={setIsOpen}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (searchKey.trim()) {\n\t\treturn (\n\t\t\t<NoMatchingResults>\n\t\t\t\t<TranslatableText stringId='No matching results' module={TRANSLATION_MODULES.SearchAndBook} />\n\t\t\t</NoMatchingResults>\n\t\t);\n\t}\n\n\treturn null;\n};\n\nSelectorContent.propTypes = {\n\tisLoading: PropTypes.bool,\n\trecentSearches: PropTypes.array,\n\tsearchKey: PropTypes.string,\n\tonSelect: PropTypes.func,\n\tdataTestId: PropTypes.string,\n\tsetIsOpen: PropTypes.func,\n};\n\nexport default SelectorContent;\n","import React, { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\n\nimport { DEFAULT_LOCATION_MODE, LOCATION_MODES_MAP, SelectModes } from '../helpers/constant';\nimport { DebounceSelector, DropdownGlobalStyle } from '../helpers/styled';\n\nimport SelectorContent from './SelectorContent';\n\nconst DebounceSelect = ({\n\tfetchOptions,\n\trenderedOptions,\n\trecentSearches = [],\n\thasError,\n\tmode,\n\tdataTestId,\n\tvalue,\n\tdebounceTimeout = 800,\n\tactiveLocationMode,\n\t...props\n}) => {\n\tconst [options, setOptions] = useState([]);\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [searchKey, setSearchKey] = useState('');\n\tconst fetchRef = useRef(0);\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst [maxTagCount, setMaxTagCount] = useState(3);\n\n\tuseEffect(() => {\n\t\tif (!value || value.length === 0) {\n\t\t\tsetOptions([]);\n\t\t\tsetSearchKey('');\n\t\t}\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tif (activeLocationMode !== DEFAULT_LOCATION_MODE) {\n\t\t\tsetOptions(prevOptions =>\n\t\t\t\tprevOptions.filter(option => option.label === LOCATION_MODES_MAP[activeLocationMode].label)\n\t\t\t);\n\t\t}\n\t\tsetIsOpen(false);\n\t\tsetTimeout(() => {\n\t\t\tdocument.activeElement.blur(); // remove focus from input\n\t\t\tdocument.body.click(); // simulate outside click\n\t\t\tconst active = document.querySelector('.ant-select-focused');\n\t\t\tif (active) {\n\t\t\t\tactive.classList.remove('ant-select-focused');\n\t\t\t}\n\t\t\tsetMaxTagCount(3);\n\t\t}, 100);\n\t}, [activeLocationMode]);\n\n\tconst debounceFetcher = useMemo(() => {\n\t\tconst loadOptions = async optionValue => {\n\t\t\tsetSearchKey(optionValue);\n\t\t\tfetchRef.current += 1;\n\t\t\tconst fetchId = fetchRef.current;\n\n\t\t\tsetOptions([]);\n\t\t\tsetIsLoading(true);\n\n\t\t\ttry {\n\t\t\t\tconst newOptions = await fetchOptions(optionValue);\n\t\t\t\tif (fetchId === fetchRef.current) {\n\t\t\t\t\tsetOptions(newOptions);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error fetching options:', error);\n\t\t\t} finally {\n\t\t\t\tif (fetchId === fetchRef.current) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn debounce(loadOptions, debounceTimeout);\n\t}, [fetchOptions, debounceTimeout]);\n\n\tconst shouldShowDropdown = () => isLoading || searchKey.trim() || recentSearches?.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownGlobalStyle />\n\t\t\t<DebounceSelector\n\t\t\t\tmaxTagCount={maxTagCount}\n\t\t\t\tonSearch={debounceFetcher}\n\t\t\t\t$hasError={hasError}\n\t\t\t\tloading={isLoading}\n\t\t\t\toptions={options}\n\t\t\t\tnotFoundContent={\n\t\t\t\t\t<SelectorContent\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\trecentSearches={recentSearches}\n\t\t\t\t\t\tsearchKey={searchKey}\n\t\t\t\t\t\tonSelect={props.onSelect}\n\t\t\t\t\t\tdataTestId={dataTestId}\n\t\t\t\t\t\tsetIsOpen={setIsOpen}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tmode={mode}\n\t\t\t\tdata-test-id={`${dataTestId}-selector`}\n\t\t\t\tallowClear={mode === SelectModes.SINGLE}\n\t\t\t\tlabelInValue\n\t\t\t\toptionLabelProp='label'\n\t\t\t\tshowSearch\n\t\t\t\tonDropdownVisibleChange={open => {\n\t\t\t\t\tif (open) {\n\t\t\t\t\t\tsetMaxTagCount(2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetMaxTagCount(3);\n\t\t\t\t\t}\n\t\t\t\t\tsetIsOpen(open);\n\t\t\t\t}}\n\t\t\t\topen={isOpen && shouldShowDropdown()}\n\t\t\t\tvalue={value}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{renderedOptions(options)}\n\t\t\t</DebounceSelector>\n\t\t</>\n\t);\n};\n\nDebounceSelect.propTypes = {\n\tfetchOptions: PropTypes.func.isRequired,\n\trenderedOptions: PropTypes.func.isRequired,\n\thasError: PropTypes.bool,\n\tmode: PropTypes.string.isRequired,\n\tdataTestId: PropTypes.string,\n\tdebounceTimeout: PropTypes.number,\n\tvalue: PropTypes.array,\n\tactiveLocationMode: PropTypes.string,\n\trecentSearches: PropTypes.array,\n\tmaxTagCount: PropTypes.number,\n};\n\nexport default DebounceSelect;\n","import React from 'react';\n\nimport { Tooltip } from '@freightos/design-system';\nimport PropTypes from 'prop-types';\n\nimport { SelectedOptionLabel } from '../helpers/styled';\n\nconst MaxPortsPlaceholder = ({ omittedPorts, dataTestId }) => {\n\tconst selectedItems = omittedPorts.map(omittedPort => JSON.parse(omittedPort.key)?.selectedValue);\n\n\treturn (\n\t\t<Tooltip title={selectedItems.join(',')}>\n\t\t\t<SelectedOptionLabel data-test-id={`${dataTestId}-extra-ports`}>{`+${omittedPorts.length}`}</SelectedOptionLabel>\n\t\t</Tooltip>\n\t);\n};\n\nMaxPortsPlaceholder.propTypes = {\n\tomittedPorts: PropTypes.array,\n\tdataTestId: PropTypes.string,\n};\n\nexport default MaxPortsPlaceholder;\n","import defineProperty from \"./defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}","import httpClient from '@freightos/http-client';\nimport { LOCATION_MODES_MAP } from './constant';\n\n/**\n * Fetches locations based on the provided location modes and query.\n *\n * @param {Array<string>} locationModes - Array of location modes to search for.\n * @param {string} query - The search query.\n * @returns {Promise<Object>} A promise resolving to an object containing location results.\n * @throws Will throw an error if the request fails.\n */\nexport const getLocations = async (locationModes, query, customer) => {\n\ttry {\n\t\tconst sources = locationModes.reduce(\n\t\t\t(acc, mode) => ({\n\t\t\t\t...acc,\n\t\t\t\t[LOCATION_MODES_MAP[mode].key]: {\n\t\t\t\t\ttype: mode.toUpperCase(),\n\t\t\t\t\t...(customer?.code ? { id: customer.code } : {}),\n\t\t\t\t\t...(LOCATION_MODES_MAP[mode].groupBy ? { groupBy: LOCATION_MODES_MAP[mode].groupBy } : {}),\n\t\t\t\t},\n\t\t\t}),\n\t\t\t{}\n\t\t);\n\t\tconst response = await httpClient.get('/geocoder/api/v1/fusion/search-locations', {\n\t\t\tparams: { query, limit: 5, sources },\n\t\t});\n\t\treturn response.data;\n\t} catch (error) {\n\t\tconsole.error('Error fetching locations:', error);\n\t\treturn {\n\t\t\tresults: {\n\t\t\t\tairport: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '08820 - Barcelona, Spain',\n\t\t\t\t\t\tselectedValue: 'BCN',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'BCN',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'airport',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tseaport: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '08820 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '33 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN2',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN2',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '44 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN3',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN3',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '55 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN4',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN4',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '66 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN5',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN5',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '77 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN6',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN6',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '88 - ESBCN, Spain',\n\t\t\t\t\t\tselectedValue: 'ESBCN7',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona Airport, ES',\n\t\t\t\t\t\tcode: 'ESBCN7',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'seaport',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\taddress: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel:\n\t\t\t\t\t\t\t'#PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA, #PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA',\n\t\t\t\t\t\tselectedValue: '#PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA',\n\t\t\t\t\t\tformattedNameOrAddress: '6835 W Buckeye Rd',\n\t\t\t\t\t\tcode: 'ChIJrSI6B8UVK4cRvKlMRiIR1zI',\n\t\t\t\t\t\tcountry: 'US',\n\t\t\t\t\t\tcity: null,\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'fulfillment_center',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel:\n\t\t\t\t\t\t\t'#PP - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA, #PHX3 - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA',\n\t\t\t\t\t\tselectedValue: '#PP - 6835 W Buckeye Rd, Phoenix, AZ 85043, USA',\n\t\t\t\t\t\tformattedNameOrAddress: '6835 W Buckeye Rd',\n\t\t\t\t\t\tcode: 'ChIJrSI6B8UVK4cRvKlMRiIR1zI',\n\t\t\t\t\t\tcountry: 'US',\n\t\t\t\t\t\tcity: null,\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: null,\n\t\t\t\t\t\tlongitude: null,\n\t\t\t\t\t\tpostalOrZipCode: null,\n\t\t\t\t\t\tsourceType: 'fulfillment_center',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '08820 - Barcelona, Spain',\n\t\t\t\t\t\tselectedValue: '08820 - Barcelona, Spain',\n\t\t\t\t\t\tformattedNameOrAddress:\n\t\t\t\t\t\t\t'Josep Tarradellas Barcelona-El Prat Airport (BCN), 08820 El Prat de Llobregat, Barcelona, Spain',\n\t\t\t\t\t\tcode: 'ChIJpY58hGSepBIR15tv-0LpK_M',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: '41.29834049999999',\n\t\t\t\t\t\tlongitude: '2.0800095',\n\t\t\t\t\t\tpostalOrZipCode: '08820',\n\t\t\t\t\t\tlocationType: null,\n\t\t\t\t\t\tsourceType: 'address',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '08001 - Barcelona, Spain',\n\t\t\t\t\t\tselectedValue: '08001 - Barcelona, Spain',\n\t\t\t\t\t\tformattedNameOrAddress: 'Barcelona, Spain',\n\t\t\t\t\t\tcode: 'ChIJ5TCOcRaYpBIRCmZHTz37sEQ',\n\t\t\t\t\t\tcountry: 'ES',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tlatitude: '41.3873974',\n\t\t\t\t\t\tlongitude: '2.168568',\n\t\t\t\t\t\tpostalOrZipCode: '08001',\n\t\t\t\t\t\tsourceType: 'last_mile_address',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayLabel: '3584 BJ - Barcelona, Spain',\n\t\t\t\t\t\tselectedValue: '3584 BJ - Barcelona, Spain',\n\t\t\t\t\t\tlabel: 'Daltonlaan 100, 3584 BJ Utrecht, Netherlands',\n\t\t\t\t\t\tformattedNameOrAddress: 'Daltonlaan 100, 3584 BJ Utrecht, Netherlands',\n\t\t\t\t\t\tcode: 'ChIJO-Sv5aJoxkcRFS4H-mRHXM0',\n\t\t\t\t\t\tcity: 'Barcelona',\n\t\t\t\t\t\tstate: null,\n\t\t\t\t\t\tcountry: 'NL',\n\t\t\t\t\t\tlatitude: '52.0874336',\n\t\t\t\t\t\tlongitude: '5.159197',\n\t\t\t\t\t\tpostalOrZipCode: '3584 BJ',\n\t\t\t\t\t\tlocationType: 'warehouse',\n\t\t\t\t\t\tsourceType: 'address_book',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t};\n\t\tthrow new Error('Failed to fetch locations. Please try again later.');\n\t}\n};\n","import React from 'react';\n\nimport { Avatar, Chip, Icon, Message, Option, Select, tokens } from '@freightos/design-system';\nimport { TranslatableText } from '@freightos/freightos-i18n';\n\nimport Flex from 'common/components/Flex';\nimport { FlexSpacings } from '../common/helpers/constants';\nimport { getLocations } from './apis';\nimport { DEFAULT_LOCATION_MODE, LOCATION_MODES, LOCATION_MODES_MAP, SelectModes } from './constant';\nimport { SelectOptionLabel, SelectedOptionLabel } from './styled';\n\n/**\n * Get location input option.\n *\n * @param {Object} location - The location object to get the option for.\n * @returns {Object} The location input option.\n */\nexport const getLocationInputOption = location => ({\n\tkey: location.key || JSON.stringify(location),\n\tlabel: location.label,\n});\n\n/**\n * Formats location(s) into option(s) with key and label for the location input.\n *\n * @param {Object|Array} locations - Single location object or array of location objects.\n * @returns {Object|Array} Formatted option(s) with key and label.\n * - For single location: Returns {key: string, label: ReactElement}.\n * - For multiple locations: Returns array of {key: string, label: ReactElement}.\n */\nexport const getLocationInputValue = locations => {\n\tconst formatLocation = loc => getLocationInputOption(loc);\n\treturn Array.isArray(locations) ? locations.map(formatLocation) : formatLocation(locations);\n};\n\n/**\n * Renders location options (ports and addresses) in a select dropdown with icons and grouping.\n *\n * @param {Array} locationOptions - Array of location option groups to render.\n * @param {string} dataTestId - Test ID prefix for components.\n * @returns {Array<ReactElement>} Array of Select.OptGroup components containing the location options.\n *\n * @example\n * Location options format:\n * [\n * {\n * label: \"seaport\",\n * options: [{\n * label: \"Port Name\",\n * key: \"{...port data...}\"\n * }]\n * }\n * ]\n */\nexport const renderLocationOptions = (locationOptions, dataTestId) =>\n\tlocationOptions?.map(locationOption => {\n\t\tconst location = Object.values(LOCATION_MODES_MAP).find(mode => mode.label === locationOption.label);\n\t\tconst locationOptionIcon = location?.icon;\n\n\t\treturn (\n\t\t\t<Select.OptGroup\n\t\t\t\tlabel={\n\t\t\t\t\t<span style={{fontFamily: 'Open Sans'}}>\n\t\t\t\t\t\t<Icon size='tiny' type={locationOptionIcon} />\n\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t{locationOption.label}\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t\tkey={locationOption.label}\n\t\t\t\tdata-test-id={`${dataTestId}-group-${locationOption.label}`}\n\t\t\t>\n\t\t\t\t{locationOption.options?.map(option => {\n\t\t\t\t\tconst { country, selectedValue, displayLabel, type } = option;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Option\n\t\t\t\t\t\t\tkey={selectedValue}\n\t\t\t\t\t\t\tvalue={JSON.stringify(option)}\n\t\t\t\t\t\t\ttitle={selectedValue}\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<Icon type={locationOptionIcon} size='tiny' />\n\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t<SelectedOptionLabel>{selectedValue}</SelectedOptionLabel>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata-test-id={`${dataTestId}-${locationOption.label}-${selectedValue}`}\n\t\t\t\t\t\t\tstyle={{ paddingLeft: '8px' }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Flex fullWidth justifyContent='space-between'>\n\t\t\t\t\t\t\t\t<Flex spacing={FlexSpacings.XSMALL}>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\t\t\ttype='flag'\n\t\t\t\t\t\t\t\t\t\t\tcountry={country}\n\t\t\t\t\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\twidth: tokens.fdsSizeSm,\n\t\t\t\t\t\t\t\t\t\t\t\theight: tokens.fdsSizeSm,\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<SelectOptionLabel>{displayLabel}</SelectOptionLabel>\n\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t{type === LOCATION_MODES.FULFILLMENT_CENTER && <Icon type='amazon' size='small' />}\n\t\t\t\t\t\t\t\t{type === LOCATION_MODES.ADDRESS_BOOK && <Chip type='neutral' iconType='address-book' />}\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Option>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Select.OptGroup>\n\t\t);\n\t});\n\n/**\n * Extracts fulfillment centers from addresses and adds them as a separate key in results\n * @param {Object} locationsResults - The locations results object\n * @param {string} addressKey - The key for addresses (default: 'address')\n * @returns {Object} Updated locations results with fulfillment centers separated\n */\nconst extractFulfillmentCenters = locationsResults => {\n\tlet updatedLocationsResults = { ...locationsResults };\n\t// Extract fulfillment centers from addresses\n\tconst fulfillmentCenters = locationsResults[LOCATION_MODES.ADDRESS].filter(\n\t\toption => option.sourceType === LOCATION_MODES.FULFILLMENT_CENTER\n\t);\n\t// Add fulfillment centers as a separate key in results\n\tif (fulfillmentCenters.length > 0) {\n\t\t// Create new object with specific order\n\t\tconst { address, ...otherTypes } = updatedLocationsResults;\n\t\tupdatedLocationsResults = {\n\t\t\t...otherTypes,\n\t\t\t[LOCATION_MODES.FULFILLMENT_CENTER]: fulfillmentCenters,\n\t\t\taddress: address.filter(option => option.type !== LOCATION_MODES.FULFILLMENT_CENTER),\n\t\t};\n\t}\n\n\treturn updatedLocationsResults;\n};\n\n/**\n * Fetches location data for the active location mode or supported modes.\n *\n * @param {string} activeLocationMode - The active location mode.\n * @param {Array} supportedLocationModes - Array of supported location modes.\n * @returns {Function} A function that takes a query string and returns a promise resolving to an array of formatted location objects.\n */\nexport const fetchLocations = (activeLocationMode, supportedLocationModes, customer) => async query => {\n\tif (!query) {\n\t\treturn [];\n\t}\n\n\tconst modes = activeLocationMode !== DEFAULT_LOCATION_MODE ? [activeLocationMode] : supportedLocationModes;\n\tconst locations = await getLocations(modes, query, customer);\n\n\tlet locationsResults = locations.results;\n\n\tif (locationsResults[LOCATION_MODES.ADDRESS]) {\n\t\tlocationsResults = extractFulfillmentCenters(locationsResults);\n\t}\n\n\treturn Object.keys(locationsResults).map(key => {\n\t\treturn {\n\t\t\tlabel: LOCATION_MODES_MAP[key]?.label || key,\n\t\t\toptions: locationsResults[key].map(option => ({\n\t\t\t\t...option,\n\t\t\t\ttype: option.sourceType,\n\t\t\t})),\n\t\t};\n\t});\n};\n\n/**\n * Processes location input changes by retrieving geocoder details for addresses\n * or transforming port locations into a standardized format.\n *\n * For addresses (with placeId), fetches full geocoder details.\n * For ports, transforms them into geocoder address schema.\n * Filters out any failed location processing.\n *\n * @param {Object|Array} changedLocations - The new location value(s) to process.\n * @param {Function} onChange - Callback to handle the processed location(s).\n */\nexport const onChangeLocation = async (changedLocations, onChange) => {\n\tconst locations = Array.isArray(changedLocations) ? changedLocations : [changedLocations];\n\n\tconst locationsDetails = await Promise.all(\n\t\tlocations.map(async location => {\n\t\t\ttry {\n\t\t\t\tconst parsedKey = JSON.parse(location.key);\n\t\t\t\treturn {\n\t\t\t\t\tkey: location.key,\n\t\t\t\t\t...parsedKey,\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\t// Useful in case one of the addresses has encountered a failure while retrieving its details\n\t\t\t\t// It won't cause all the addresses to stop working properly\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})\n\t);\n\n\tonChange(locationsDetails.filter(Boolean));\n};\n\n/**\n * Handles changes to the location input value.\n *\n * @param {Object|Array} location - The new location value(s) selected.\n * @param {string} selectionMode - The current selection mode ('single' or 'multiple').\n * @param {number} maxPorts - Maximum number of ports that can be selected in multiple mode.\n * @param {Function} setSelectedLocation - State setter for the selected location.\n * @param {Function} onChange - Callback to handle processed location changes.\n *\n * For multiple selection mode:\n * - Validates that selected ports don't exceed maxPorts limit.\n * - Shows error message if limit is exceeded.\n * - Updates state and triggers onChange with valid selections.\n *\n * For single selection mode:\n * - Updates selected location state directly.\n * - Triggers onChange with the new location if one is selected.\n */\nexport const handleLocationChange = (location, selectionMode, maxPorts, setSelectedLocation, onChange) => {\n\tif (selectionMode === SelectModes.MULTIPLE) {\n\t\tconst selectedPorts = Array.isArray(location) ? location : [];\n\t\tif (selectedPorts.length <= maxPorts) {\n\t\t\tsetSelectedLocation(selectedPorts);\n\t\t\tonChangeLocation(selectedPorts, onChange);\n\t\t} else {\n\t\t\tMessage.danger(<TranslatableText stringId={`You cannot enter more than ${maxPorts} ports`} />);\n\t\t}\n\t} else {\n\t\tsetSelectedLocation(location);\n\t\tonChangeLocation(location, onChange);\n\t}\n};\n\n/**\n * Check if the location is an address\n * @param location - The location to check\n * @returns Whether the location is an address\n */\nexport const isLocationAddress = locationType =>\n\tlocationType &&\n\t(locationType === LOCATION_MODES.ADDRESS ||\n\t\tlocationType === LOCATION_MODES.LAST_MILE_ADDRESS ||\n\t\tlocationType === LOCATION_MODES.ADDRESS_BOOK ||\n\t\tlocationType === LOCATION_MODES.FULFILLMENT_CENTER);\n","import React, { useEffect, useState } from 'react';\n\nimport { tokens } from '@freightos/design-system';\nimport { TranslatableText } from '@freightos/freightos-i18n';\nimport PropTypes from 'prop-types';\n\nimport DebounceSelect from './components/DebounceSelect';\nimport MaxPortsPlaceholder from './components/MaxPortsPlaceholder';\nimport {\n\tDEFAULT_LOCATION_MODE,\n\tLocationTypes,\n\tSelectModes,\n} from './helpers/constant';\nimport {\n\tfetchLocations,\n\tgetLocationInputValue,\n\thandleLocationChange,\n\tisLocationAddress,\n\trenderLocationOptions,\n} from './helpers/utils';\n\nconst LocationInput = ({\n\tvalue,\n\tonChange,\n\thasError,\n\tdataTestId = 'location-input',\n\tisOriginLocation = true,\n\tmaxPorts = 1,\n\tsupportedLocationModes,\n\tcustomer,\n\t...rest\n}) => {\n\tconst [selectedLocation, setSelectedLocation] = useState(value);\n\tconst [activeLocationMode, setActiveLocationMode] = useState(\n\t\tsupportedLocationModes.length === 1 ? supportedLocationModes[0] : DEFAULT_LOCATION_MODE\n\t);\n\n\tconst [selectionMode, setSelectionMode] = useState(\n\t\tisLocationAddress(activeLocationMode) || activeLocationMode === DEFAULT_LOCATION_MODE\n\t\t\t? SelectModes.SINGLE\n\t\t\t: SelectModes.MULTIPLE\n\t);\n\n\tuseEffect(() => {\n\t\tif (isLocationAddress(activeLocationMode)) {\n\t\t\tsetSelectionMode(SelectModes.SINGLE);\n\t\t} else {\n\t\t\tsetSelectionMode(SelectModes.MULTIPLE);\n\t\t}\n\t}, [activeLocationMode]);\n\n\tuseEffect(() => {\n\t\tsetSelectedLocation(value);\n\t\tif (Array.isArray(value) && value.length > 0) {\n\t\t\tsetActiveLocationMode(value[0].type);\n\t\t} else {\n\t\t\tsetActiveLocationMode(DEFAULT_LOCATION_MODE);\n\t\t}\n\t}, [value]);\n\n\treturn (\n\t\t<DebounceSelect\n\t\t\tmode={selectionMode}\n\t\t\tdataTestId={dataTestId}\n\t\t\thasError={hasError}\n\t\t\tplaceholder={\n\t\t\t\t<TranslatableText\n\t\t\t\t\tstyle={{ fontSize: tokens.fdsFontSizeBase }}\n\t\t\t\t\tstringId={`Select ${isOriginLocation ? LocationTypes.ORIGIN : LocationTypes.DESTINATION}`}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tvalue={selectedLocation && getLocationInputValue(selectedLocation)}\n\t\t\tfetchOptions={fetchLocations(activeLocationMode, supportedLocationModes, customer)}\n\t\t\trenderedOptions={options => renderLocationOptions(options, dataTestId)}\n\t\t\tonChange={location => {\n\t\t\t\thandleLocationChange(location, selectionMode, maxPorts, setSelectedLocation, onChange);\n\t\t\t\tsetActiveLocationMode(DEFAULT_LOCATION_MODE);\n\t\t\t}}\n\t\t\tactiveLocationMode={activeLocationMode}\n\t\t\tmaxTagPlaceholder={omittedPorts => <MaxPortsPlaceholder omittedPorts={omittedPorts} dataTestId={dataTestId} />}\n\t\t\t{...rest}\n\t\t/>\n\t);\n};\n\nLocationInput.propTypes = {\n\tvalue: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n\tonChange: PropTypes.func.isRequired,\n\thasError: PropTypes.bool,\n\tdataTestId: PropTypes.string,\n\tisOriginLocation: PropTypes.bool,\n\tmaxPorts: PropTypes.number,\n\tsupportedLocationModes: PropTypes.arrayOf(PropTypes.string).isRequired,\n\tcustomer: PropTypes.object,\n};\n\nexport default LocationInput;\n"],"sourceRoot":""}
@@ -4,7 +4,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
4
4
  "url": "http://ship.freightos.local:8800/FusionLocationInput/index.html"
5
5
  },
6
6
  {
7
- "revision": "63d172e4e260b55e6dcc",
7
+ "revision": "c147ddf3500b4bd89756",
8
8
  "url": "http://ship.freightos.local:8800/FusionLocationInput/main.bundle.js"
9
9
  }
10
10
  ]);
@@ -14,7 +14,7 @@
14
14
  importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
15
15
 
16
16
  importScripts(
17
- "http://ship.freightos.local:8800/FusionLocationInput/precache-manifest.f04418ec3d26cecf5c0309534f8cadbb.js"
17
+ "http://ship.freightos.local:8800/FusionLocationInput/precache-manifest.8bbf26d59b3fefd26080638a0319306c.js"
18
18
  );
19
19
 
20
20
  self.addEventListener('message', (event) => {
package/package.json CHANGED
@@ -1,66 +1,65 @@
1
- {
2
- "name": "@freightos/fusion-location-input",
3
- "version": "1.0.1-fusion-mvp",
4
- "description": "Fusion Location Input",
5
- "author": "Nowwar Kusa",
6
- "main": "build/main.bundle.js",
7
- "files": [
8
- "build",
9
- "public"
10
- ],
11
- "scripts": {
12
- "start": "npx craco start",
13
- "build": "npx craco build",
14
- "test": "react-scripts test",
15
- "yalcPublish": "npx yalc publish",
16
- "yalcBuild": "npx yarn build && npx yalc push"
17
- },
18
- "jest": {
19
- "transform": {
20
- "^.+\\.[t|j]sx?$": "babel-jest"
21
- },
22
- "transformIgnorePatterns": [
23
- "node_modules/(?!@shotgunjed)/",
24
- "node_modules/(?!(axios)/)"
25
- ]
26
- },
27
- "dependencies": {
28
- "axios-mock-adapter": "^1.20.0",
29
- "formik": "^2.2.6",
30
- "peer-deps-externals-webpack-plugin": "^1.0.4",
31
- "yalc": "^1.0.0-pre.53",
32
- "yup": "^0.32.9"
33
- },
34
- "devDependencies": {
35
- "@craco/craco": "5.8.0",
36
- "@freightos/design-system": "^6.0.23",
37
- "@freightos/freightos-i18n": "^4.0.2-test-fusion1",
38
- "@freightos/http-client": "^5.0.1"
39
- },
40
- "peerDependencies": {
41
- "@freightos/design-system": "^6.0.23",
42
- "@freightos/freightos-i18n": "^4.0.2-test-fusion1",
43
- "@freightos/http-client": "^5.0.1",
44
- "lodash": "^4.17.21",
45
- "moment": ">=2.26.0",
46
- "react": "16.x || 17.x || 18.x",
47
- "react-dom": "16.x || 17.x || 18.x",
48
- "styled-components": "^6.1.14"
49
- },
50
- "engines": {
51
- "node": "16.14",
52
- "npm": "8.x"
53
- },
54
- "browserslist": {
55
- "production": [
56
- ">0.2%",
57
- "not dead",
58
- "not op_mini all"
59
- ],
60
- "development": [
61
- "last 1 chrome version",
62
- "last 1 firefox version",
63
- "last 1 safari version"
64
- ]
65
- }
66
- }
1
+ {
2
+ "name": "@freightos/fusion-location-input",
3
+ "version": "1.0.1-test10",
4
+ "description": "Fusion Location Input",
5
+ "author": "Nowwar Kusa",
6
+ "main": "build/main.bundle.js",
7
+ "files": [
8
+ "build",
9
+ "public"
10
+ ],
11
+ "scripts": {
12
+ "start": "npx craco start",
13
+ "build": "npx craco build",
14
+ "test": "react-scripts test",
15
+ "yalcPublish": "npx yalc publish",
16
+ "yalcBuild": "npx yarn build && npx yalc push"
17
+ },
18
+ "jest": {
19
+ "transform": {
20
+ "^.+\\.[t|j]sx?$": "babel-jest"
21
+ },
22
+ "transformIgnorePatterns": [
23
+ "node_modules/(?!@shotgunjed)/",
24
+ "node_modules/(?!(axios)/)"
25
+ ]
26
+ },
27
+ "dependencies": {
28
+ "axios-mock-adapter": "^1.20.0",
29
+ "formik": "^2.2.6",
30
+ "peer-deps-externals-webpack-plugin": "^1.0.4",
31
+ "yup": "^0.32.9"
32
+ },
33
+ "devDependencies": {
34
+ "@craco/craco": "5.8.0",
35
+ "@freightos/design-system": "^7.0.1-rc-a2b7a15.0",
36
+ "@freightos/freightos-i18n": "^4.0.2-test-fusion1",
37
+ "@freightos/http-client": "^4.0.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@freightos/design-system": "^7.0.1-rc-a2b7a15.0",
41
+ "@freightos/freightos-i18n": "^4.0.2-test-fusion1",
42
+ "@freightos/http-client": "^4.0.0",
43
+ "lodash": "^4.17.21",
44
+ "moment": ">=2.26.0",
45
+ "react": "16.x || 17.x || 18.x",
46
+ "react-dom": "16.x || 17.x || 18.x",
47
+ "styled-components": "^6.1.14"
48
+ },
49
+ "engines": {
50
+ "node": "16.14",
51
+ "npm": "8.x"
52
+ },
53
+ "browserslist": {
54
+ "production": [
55
+ ">0.2%",
56
+ "not dead",
57
+ "not op_mini all"
58
+ ],
59
+ "development": [
60
+ "last 1 chrome version",
61
+ "last 1 firefox version",
62
+ "last 1 safari version"
63
+ ]
64
+ }
65
+ }
package/public/index.html CHANGED
@@ -1,9 +1,9 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <meta name="theme-color" content="#000000" />
7
- <title>Fusion location input</title>
8
- </head>
9
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="theme-color" content="#000000" />
7
+ <title>Fusion location input</title>
8
+ </head>
9
+ </html>