PageSourceSearch

https://www.swireshipping.com/chunk-JS7PJXRN.js

js swireshipping.com collected 2026-09-24 18:31:18 UTC 16,020 bytes, 1 lines download raw bytes

1import{b as N,d as $,f as B}from"./chunk-PUEGCG5U.js";import{$ as E,A as T,Nc as b,Oc as U,S as _,X as u,_ as o,a as R,gd as w,i as y,l as x,m as l,nd as C,sd as d,td as z,ua as h,uc as P,v as F,wa as f}from"./chunk-B55Z224L.js";var S=class s{constructor(i){this._storageService=i}_storageService;currentAppLang="en";appLang=new l("");appLangCast=this.appLang.asObservable();setAppLanguage(i){this._storageService.putDataInStorage("defaultLang",i),this.currentAppLang=i,this.appLang.next(i)}getAppLanguage(){let i=this._storageService.getDataFromStorage("defaultLang");return i||this.setAppLanguage("en"),i}currentAppLocation="India";appLocation=new l("");appLocationCast=this.appLocation.asObservable();setAppLocation(i){this._storageService.putDataInStorage("defaultLocation",i),this.currentAppLocation=i,this.appLocation.next(i)}getAppLocation(){let i=this._storageService.getDataFromStorage("defaultLocation");return i||(i="india",this.setAppLocation(i)),i}getAllCountryList(){let i=this._storageService.getDataFromStorage("formFieldsOptions");if(i){let e=JSON.parse(i);if(e.Country)return e.Country}return[]}static \u0275fac=function(e){return new(e||s)(o(d))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};var D=class s{constructor(i,e,t,r){this._httpService=i;this._platformService=e;this._langService=t;this._storageService=r}_httpService;_platformService;_langService;_storageService;formFieldsSubject=new l(null);formFields$=this.formFieldsSubject.asObservable();
1homePageDataSubject=new l(null);homePageData$=this.homePageDataSubject.asObservable();tradeSearchSubject=new l(null);tradeSearch$=this.tradeSearchSubject.asObservable();newsSubject=new l(null);news$=this.newsSubject.asObservable();allCountryList=h(null);get getMasterData(){return{formFields$:this.formFields$,homePageData$:this.homePageData$,tradeSearch$:this.tradeSearch$,news$:this.news$}}callMasterApi(){return y(this,null,function*(){yield this.getCmsDetails(),yield this.getAllCargoCommodity(),yield this.getTradeSearchData()})}getCmsDetails(){return y(this,arguments,function*(i=0){this._httpService.sendGetRequestWithCache($.getHomePageData,i).subscribe({next:e=>{e?.data&&this.homePageDataSubject.next(e.data)},error:e=>{this.homePageDataSubject.next({getHomePageData:null,isError:!0,error:e})}})})}getAllCargoCommodity(){return y(this,arguments,function*(i=0){this._httpService.sendGetRequestWithCache(B.getAllCargoCommodity,i,"formFieldsOptions").subscribe({next:e=>{e?.data&&this.formFieldsSubject.next(e.data)},error:e=>{this.formFieldsSubject.next({getAllCargoCommodity:null,isError:!0,error:e})}})})}getTradeSearchData(){return y(this,arguments,function*(i=0){this._httpService.sendGetRequestWithCache("tradeSearch",i).subscribe({next:e=>{if(e?.data){this.tradeSearchSubject.next(e.data.arFormattedData),this.allCountryList.set(e.data.arFormattedData);let t=JSON.stringify(e);this._storageService.putDataInStorage("serveLocationResults",t)}},error:e=>{this.tradeSearchSubject.next({tradeSearch:e,isError:!0,error:e})}})})}static \u0275fac=function(e){return new(e||s)(o(z),o(C),o(S),o(d))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};var V=(()=>{class s{constructor(e,t){this.document=e,this.platformId=t,this.documentIsAccessible=b(this.platformId)}static getCookieRegExp(e){let t=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),s.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let r=s.getCookieRegExp(e).exec(this.document.cookie);return r&&r[1]?s.safeDecodeURIComponent(r[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},t=this.document;return t.cookie&&t.cookie!==""&&t.cookie.split(";").forEach(r=>{let[a,n]=r.split("=");e[s.safeDecodeURIComponent(a.replace(/^ /,""))]=s.safeDecodeURIComponent(n)}),e}set(e,t,r,a,n,p,g,M){if(!this.documentIsAccessible)return;if(typeof r=="number"||r instanceof Date||a||n||p||g){let k={expires:r,path:a,domain:n,secure:p,sameSite:g||"Lax",partitioned:M};this.set(e,t,k);return}let m=encodeURIComponent(e)+"="+encodeURIComponent(t)+";",c=r||{};if(c.expires)if(typeof c.expires=="number"){let k=new Date(new Date().getTime()+c.expires*1e3*60*60*24);m+="expires="+k.toUTCString()+";"}else m+="expires="+c.expires.toUTCString()+";";c.path&&(m+="path="+c.path+";"),c.domain&&(m+="domain="+c.domain+";"),c.secure===!1&&c.sameSite==="None"&&(c.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),c.secure&&(m+="secure;"),c.sameSite||(c.sameSite="Lax"),m+="sameSite="+c.sameSite+";",c.partitioned&&(m+="Partitioned;"),this.document.cookie=m}delete(e,t,r,a,n="Lax"){if(!this.documentIsAccessible)return;let p=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:p,path:t,domain:r,secure:a,sameSite:n})}deleteAll(e,t,r,a="Lax"){if(!this.documentIsAccessible)return;let n=this.getAll();for(let p in n)n.hasOwnProperty(p)&&this.delete(p,e,t,r,a)}static{this.\u0275fac=function(t){return new(t||s)(o(P),o(f))}}static{this.\u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var I=class s{constructor(i,e){this._cookieService=i;this.platformId=e}_cookieService;platformId;cookies={};getCookie(i){if(typeof document<"u"){let e=document?.cookie?.split(";");for(let t of e){let[r,a]=t?.trim()?.split("=");if(r===i)return decodeURIComponent(a)}}return""}deleteCookie(i){U(this.platformId)?this._cookieService.delete(i):this._cookieService.delete(i)}checkUserNameInCookie(i){}static \u0275fac=function(e){return new(e||s)(o(V),o(f))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};var j=(t=>(t.chineseUrl="zh-hans",t.english="en",t.chinese="ch",t))(j||{});var L=class s{constructor(i,e){this._router=i;this._storageService=e;let t=this._router.url?.split("/")[1];this.currentLang=t===this.langSwitchName.chineseUrl?this.langSwitchName.chineseUrl:""}_router;_storageService;currentLang="";langSwitchName=j;navigateToPage(i){return this.currentLang===this.langSwitchName.chineseUrl?`/${this.langSwitchName.chineseUrl}/${i}`:`/${i}`}navigateWithLang(i,e,t={},r=null){let a=this._storageService.getCurrentLang(),n="";(this._router.url?.split("/")[1]===this.langSwitchName.chineseUrl||a==this.langSwitchName.chinese)&&(n=this.langSwitchName.chineseUrl);let g=n===this.langSwitchName.chineseUrl?`/${this.langSwitchName.chineseUrl}/${e}`:`/${e}`;g=g?.replace("//","/"),this._router.navigate([g],{queryParams:t,state:r})}static \u0275fac=function(e){return new(e||s)(o(w),o(d))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};var A=class s{destroy$=new x;get onDestroy$(){return this.destroy$.asObservable()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=u({token:s,factory:s.\u0275fac})};var q=class s extends A{constructor(e,t,r,a,n,p,g,M,m){super();this._router=e;this._storageService=t;this._environmentService=r;this._lang=a;this._httpService=n;this._masterService=p;this._cookiesService=g;this._navigatService=M;this.platformId=m}_router;_storageService;_environmentService;_lang;_httpService;_masterService;_cookiesService;_navigatService;platformId;isConfirm=h(!1);_platformService=E(C);AttachmentSizeData=new l({});AttachmentSizeDataCaste=this.AttachmentSizeData.asObservable();requestSearch=new l({});requestSearchCaste=this.requestSearch.asObservable();isHideMuleBanner=new l(!0);isHideMaintenanceBanner=new l(!0);isSideMenu=new l(!1);isSideMenuOpen=this.isSideMenu.asObservable();announcementBarHeight;tosterObj={};isCallFirstTime=!0;breadCumsCallBacks={event:"continue",progess:1};isApiCalled=!1;isBtnDisabledSearch=!1;showPageLoader=h(!0);pannelType=1;redirectUrl=h("");afterLoginEvent=h({});datepicker={swPlaceholder:"Select Date",swClassName:"myClass",swMinDate:{},swMaxDate:{},swType:"input",swSelectedData:{},swDisplayMonths:1,swfirstDayOfWeek:7,swIconClass:"swi-icon icon-calendar-1 Grey-80 heading-regular-20",swIsShowHideCal:!1,swIsDisable:!1,swReadOnlyProperties:!0,swModel:"",swDateRangeFormat:"dd MMM yyyy",locator:"",swDateRangeLabel:"to"};longRangeDatePicker={swPlaceholder:"Validity start - Validity end",swClassName:"myClass",swMinDate:{},swMaxDate:{},swSelectedData:{},swDisplayMonths:1,swfirstDayOfWeek:7,swIconClass:"swi-icon icon-calendar-1 Grey-80 heading-regular-20",swIsShowHideCal:!1,swIsDisable:!1,swReadOnlyProperties:!0,swModel:"",swDateRangeFormat:"YYYY-MM-dd",locator:"",fromDate:"",toDate:"",swShowMonths:2,swDateDisabled:{},swDateRangeLabel:"to",swAutocomplete:"off",swCancelBtnClass:"swi-button-greyblue-small-default-regular",swSubmitBtnClass:"swi-button-blue-small-default-regular"};swDateConfiguration={swIsMobileView:!1,swInputLabelFirst:"Departs from",swInputLabelSecond:"Arrives before",swInputLabelFirstMandatory:!1,swInputLabelSecondMandatory:!1,swPlaceholder:"Select date",firstSelectedValue:"",secondSelectedValue:"",bindKeyForSelectedData:"text",swClass:"swClass",swIconClass:"swi-icon icon-calendar-1 Grey-80 heading-regular-20",swMinDateFirst:null,swMaxDateFirst:null,swMinDateSecond:null,swMaxDateSecond:null,firstDayOfWeek:7,showHideCal1:!1,showHideCal2:!1,swReadOnlyProperties:!0,swCentreIcon:"icon-ship-1",swErrorFirst:"",swErrorSecond:"",swFromErrorMsg:"",swToErrorMsg:"",swFromErrorMsgClass:"text-error paragraph-regular-14 Error-Main",swToErrorMsgClass:"text-error paragraph-regular-14 Error-Main",swDisabled:!1,swSelectedValueFirst:null,swSelectedValueSecond:null,locatorDeparts:"From",locatorArrives:"TO",swAutocomplete:"",swDateRangeFormat:"dd MMM yyyy"};userAccessLocation="";isRestrictInputHeader=!1;currentForm="";arForm=["Support Request","Quote Request","Booking Request","User Registration"];lastSizeAvailableBk=null;updateLastSizeAvailableBk(e){this.lastSizeAvailableBk=e,this.AttachmentSizeData.next(e),this._storageService.putDataInStorage("lastSizeAvailableBk",e)}updateRestrictInputHeader(e){this._storageService.getDataFromStorage("isRestrictInputHeaderShow")||(this.isRestrictInputHeader=e),e||this._storageService.putDataInStorage("isRestrictInputHeaderShow",!0)}updateCurrentForm(e){this.currentForm=e}goToNewTab(e){localStorage.getItem("defaultLang")=="ch"&&(e="zh-hans"+e);let r=this._router.createUrlTree([e]).toString();window.open(r,"_blank")}goToCmsLink(e){this._platformService.runIfBrowser(()=>{window.open(e,"_blank")})}
1goToCmsLinkOnSameTab(e){this._platformService.runIfBrowser(()=>{window.location.href=e})}goToExtranalLink(e){window.open(e,"_blank")}getCustomerKey(){let e="",t;return this._platformService.runIfBrowser(()=>{t=this._storageService.authDetails()}),t?(e=t?.szCustomerKey,e):this._storageService.getDataFromStorage("customerKey")}openUrlBasedOnLanguage(e){this._navigatService.navigateWithLang(this,e)}getAuthEmail(){let e=null,t=this._storageService?.authDetails();return t&&(e=t?t?.szEmail:null),e}logActivity(e){let t="";if(e.szCategory=="live_schedule"||e.szCategory=="booking_request"||e.szCategory=="quote_request"||e.szCategory=="schedule_builder"){let n=e?.szOriginName||e?.szOrigin||"",p=e?.szDestinationName||e?.szDestination||"";n!=""&&p!=""&&(t=n+" | "+p)}this.userAccessLocation=this._cookiesService.getCookie("user_country")?this._cookiesService.getCookie("user_country"):"China";let r=this.getCurrentUrl(),a={szCategory:e.szCategory||"",szLabel:e.szLabel||"",szAction:e.szAction||"",szOrigin:e.szOriginName||e.szOrigin||"",szDestination:e.szDestinationName||e.szDestination||"",szCargo:e.szCargo||"",szSubCategory:e.szSubCategory||"",szReference:e.szReference||"",iResposeTime:e.iResposeTime||e.iResponseTime||0,szResultCount:e.szResultCount||0,szLiveScheduleDepartureTime:e.dtStartDate||e.szLiveScheduleDepartureTime||"",szLiveScheduleArrivalTime:e.dtEndDate||e.szLiveScheduleArrivalTime||"",szLiveScheduleLength:e.szLiveScheduleLength||0,szCargoWeight:e.szCargoWeight||"",szCargoType:e.szCargoType||"",szCargoContainer:e.szCargoContainer||"",szUserType:e.szUserType||"",szOriginDestinationPair:t,szQuoteReference:e.szQuoteReference||"",szBookingReference:e.szBookingReference||"",szEvent:e.szCategory||"",szPage:r||"",idUser:this.getCustomerKey()||"",szCustomerType:this.getAdminType()||"Guest User",szOption:e.szOption||"",szType:e.szType||"",szLogin:this.getAuthEmail()||"",szLanguage:this._storageService.getDataFromStorage("defaultLang")||"",szCountry:this.userAccessLocation,szCustomerKey:this.getCustomerKey(),szSearchToken:this._storageService.getDataFromStorage("szSearchToken"),szEnvironment:e.szEnvironment||"",szInstance:e.szInstance||""};return this._httpService.sendPostRequest("logActivity",a)}getServeLocationFromStorage(){return this._masterService.getMasterData.tradeSearch$.pipe(F(r=>(r||[]).map(a=>{let n={};return a?.szType=="Country"?(n.szDisplayName=`${a?.szDisplayName}`,n.subText="Location"):n.subText=`${a?.szType}, ${a?.szCountryName}`,R(R({},a),n)})))}getAdminType(){let e="",t="",r;return this._platformService.runIfBrowser(()=>{r=this._storageService.authDetails()}),r&&(e=r.iRole),e&&(e==this._environmentService.env.swireRoleSsAdmin?t="Swire Shipping Admin":e==this._environmentService.env.swireRoleUser?t="User":e==this._environmentService.env.swireRoleClaimAdmin?t="Claim Admin":e==this._environmentService.env.swireRoleSanctionAdmin&&(t="Compliance Admin")),t}printConsole(e,t){this._environmentService.env.appEnv=="dev"||this._environmentService.env.appEnv=="local"}updateSearchJourney(e){this.requestSearch.next(e)}OpenToster(e){this.tosterObj={},this._platformService.runIfBrowser(()=>{T(100).pipe(_(this.onDestroy$)).subscribe(()=>{this.tosterObj=e})})}updatebreadCumsCall(e,t){this.breadCumsCallBacks={event:e,progess:t}}clearAllConditionalValidation(e,t,r=!0){t.forEach(a=>{e.controls[a]?.clearValidators(),r&&e.controls[a]?.markAsUntouched(),e.controls[a]?.updateValueAndValidity()})}updateAllConditionalValidation(e,t){t.forEach(r=>{e.controls[r]?.updateValueAndValidity()})}createUploadFormat(e,t){return delete e?.data?.msg,e.data.name=e?.data?.szFileOriginalName,e.data.szFileName=e?.data?.szFileName,e.data.size=e?.data?.szFileSize,e.data.szFormType=t,e}checkErrorStatus(e,t,r,a){if(e||r){if(t&&t.hasOwnProperty("required"))return"Field is required";if(t&&t.hasOwnProperty("mustNotMatch")&&a==="searchDate")return"Departure Date and Arrival Date cannot be the same.";if(t&&t.hasOwnProperty("mustNotMatch")&&a==="searchLocation")return"Origin and Destination cannot be the same";if(t&&t.hasOwnProperty("mustNotMatch"))return"Departure Date and Arrival Date cannot be the same.";if(t&&t.hasOwnProperty("maxlength"))return"Please enter a valid value.";if(t&&t.hasOwnProperty("restrictInput"))return"Enter field in English only.";if(t&&t.hasOwnProperty("UrlBlockerDirective"))return"Please enter a valid value.";if(t&&t.hasOwnProperty("customError"))return"Please enter a valid value"}else return""}onGlobleLanguageSwitch(e){return h(`${e}`)}trimInputValue(e){return e?.trim()}getCurrentUrl(){return this._environmentService.env.frontendBaseUrl+this._router.url}
1headerType=2;setHeaderType(e=2){this.headerType=e}setPannelType(e){this.pannelType=e,this._platformService.runIfBrowser(()=>{localStorage.setItem("pannelType",JSON.stringify(e))})}getRandomString(e=20,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"){for(var r=new Date().getTime(),a="SC"+r,n=e;n>0;--n)a+=t[Math.floor(Math.random()*t.length)];return a.toLocaleUpperCase()}openSideMenuUpdate(e=!1){this.isSideMenu.next(e)}scrollToTop(){b(this.platformId)&&T(500).subscribe(()=>{window.scrollTo({top:0,behavior:"smooth"})})}static \u0275fac=function(t){return new(t||s)(o(w),o(d),o(N),o(S),o(z),o(D),o(I),o(L),o(f))};static \u0275prov=u({token:s,factory:s.\u0275fac,providedIn:"root"})};export{A as a,S as b,D as c,I as d,j as e,L as f,q as g};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.