(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{ckqB:function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n=r("XlPw"),i=r("F/XL"),a=r("VNr4"),s=r("t/Na"),o=(r("Klzi"),r("AytR")),u=r("67Y/"),p=r("vubp"),l=r("E7z5"),c=(r("yTtk"),r("AcpL"),r("Ip0R")),h=r("wd/R"),S=function(){function e(e,t,r,n,i,a){this.http=e,this.generalService=t,this.flightState=r,this.generalState=n,this.platform=i,this.router=a,this.flightServiceHelper=new l.a(this.flightState,this.generalState)}return e.prototype.getCommonSettings=function(e){return this.executeGetCommonSettings(e)},e.prototype.executeGetCommonSettings=function(e){var t=this;if(Object(c.F)(this.platform)){var r=new s.h({"Content-Type":"application/json"});return this.http.post(o.a.api.url.wc.util+"/Utils/WebSettings",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("getCommonSettings-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return i.Settings;if(null!=i.Msg)throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}else 401===r.status?t.executeGetCommonSettings(e):Object(n.a)(new Error("getCommonSettings-Unknown Error"))})))}return Object(i.a)({})},e.prototype.getAirports=function(e){if(Object(c.F)(this.platform))return this.executeGetAirports(e)},e.prototype.executeGetAirports=function(e){var t,r=this,a=!1,l=(new Date).getTime();if("undefined"!=typeof localStorage&&localStorage.getItem("storeversion")&&(t=localStorage.getItem("storeversion")),(!t||(l-+t)/1e3/60/60>7)&&(a=!0,localStorage.removeItem("popularairports"),localStorage.removeItem("allairports"),localStorage.removeItem("storeversion")),e.SearchText.length)a=!0;else{var c=this.flightServiceHelper.getAirportsFromLocalStorage(e);if(null!=c&&null!=c&&c.length>0)return a=!1,Object(i.a)(c);a=!0}if(a){e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI);var S=new s.h({"Content-Type":"application/json"});return this.http.post(o.a.apiURL+"/Utils/Airports",e,{headers:S,observe:"response"}).pipe(Object(p.a)("A"==e.Type?500:0),Object(u.a)((function(t){var i=t.body;if(!i)throw new Error("getAirports-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(r.generalState.TUI=i.TUI),200===t.status){if("200"===i.Code){localStorage.getItem("storeversion")||(h().format("MM DD YYYY, h:mm:ss a"),localStorage.setItem("storeversion",(new Date).getTime().toString()));var a=i.Airports;if(null!=a&&null!=a&&(a=r.flightServiceHelper.processAirports(a)),!e.SearchText.length)if("P"===e.Type)"undefined"!=typeof localStorage&&localStorage.setItem("popularairports",JSON.stringify(a));else if("A"===e.Type)return r.flightServiceHelper.setAirportsToLocalStorage(a,e);return a}throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===t.status?r.executeGetAirports(e):Object(n.a)(new Error("getAirports-Unknown Error"))})))}},e.prototype.getGeoLocationWiseAirport=function(e){return this.executeGetGeoLocationWiseAirport(e)},e.prototype.executeGetGeoLocationWiseAirport=function(e){var t=this,r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.api.url.wc.util+"/Utils/AirportNavigator",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("getGeoLocationWiseAirport-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if(i){if("200"===i.Code)return i;if(null!=i.Msg)throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}}else 401===r.status?t.executeGetGeoLocationWiseAirport(e):Object(n.a)(new Error("getGeoLocationWiseAirport-Unknown Error"))})))},e.prototype.getFareCalendar=function(e){return this.executeGetFareCalendar(e)},e.prototype.executeGetFareCalendar=function(e){var t=this;if(Object(c.F)(this.platform)){var r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.apiURL+"/Flights/FareCalendar",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("getFareCalendar-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return i;if("1601"===i.Code)return i;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeGetFareCalendar(e):Object(n.a)(new Error("getFareCalendar-Unknown Error"))})))}return Object(i.a)({FareCalendar:[]})},e.prototype.getImpulsiveFares=function(e){return this.executeGetImpulsiveFares(e)},e.prototype.executeGetImpulsiveFares=function(e){var t=this;if(Object(c.F)(this.platform)){var r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.apiURL+"/Flights/ImpulsiveFares",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){if(200==r.status){var i=r.body;if(!i)throw new Error("getImpulsiveFares-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),"200"===i.Code)return i.Fares;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeGetImpulsiveFares(e):Object(n.a)(new Error("getImpulsiveFares-Unknown Error"))})))}return Object(i.a)([])},e.prototype.getRecentSearch=function(e){return this.executeGetRecentSearch(e)},e.prototype.executeGetRecentSearch=function(e){var t=this,r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.apiURL+"/Flights/RecentSearch",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("getRecentSearch-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return i.SearchList;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeGetRecentSearch(e):Object(n.a)(new Error("getRecentSearch-Unknown Error"))})))},e.prototype.startRSFThirdParty=function(e,t){if("I"!=this.flightState.SectorType||!sessionStorage.getItem("reissue")){var r=this.executeExSearch(e);return n=this.executeExSearchRSF(t),Object(a.a)(r,n)}var n,i=JSON.parse(sessionStorage.getItem("reissue"));if(i.paxname&&i.pnr&&i.airline)return this.executeExSearchRSF(t)},e.prototype.startInRsf=function(e,t){if("I"!=t.SecType||!sessionStorage.getItem("reissue")){var r=this.executeExSearch(e);return n=this.executeExSearchRSF(t),Object(a.a)(r,n)}var n,i=JSON.parse(sessionStorage.getItem("reissue"));if(i.paxname&&i.pnr&&i.airline)return this.executeExSearchRSF(t)},e.prototype.startExpressSearch=function(e,t){return this.executeExSearch(e,t)},e.prototype.executeExSearch=function(e,t){var r=this,i=new s.h({"Content-Type":"application/json"});e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI);var a=o.a.apiURL+"/flights/ExpressSearch",p=!(!this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0]||!this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0].Value||"true"!=this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0].Value),l=!(!this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))||!this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))[0]||"true"!=this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))[0].Value);return(p||l)&&(a=o.a.expressSearchAPIUrl+"/flights/ExpressSearch"),this.http.post(a,e,{headers:i,observe:"response"}).pipe(Object(u.a)((function(i){var a=i.body;if(!a)throw new Error("startExpressSearch-Response is null/undefined");if(a&&a.TUI&&""!=a.TUI&&(r.generalState.TUI=a.TUI),200===i.status){if("200"===a.Code)return r.flightState.TUI=a.TUI,a.CeilingInfo&&(r.flightState.SearchResult.CeilingInfo=a.CeilingInfo),localStorage.setItem("currentTui",a.TUI),r.flightState.SearchResult.Completed="D"==r.flightState.SectorType&&"RT"==e.FareType?"":"True",null!=a.Notices&&(r.flightState.SearchResult.Notices=a.Notices),"DM"===e.FareType&&(r.flightState.SearchResTUI[t]=a.TUI),a.Trips&&(0==a.Trips.length?r.router.navigate(["/flight"]):"DM"===e.FareType?(r.flightState.SearchResult.Trips[t]=a.Trips[0],a.Trips[0]&&a.Trips[0].Journey.map((function(e){e.couponFareJourneyVisible=!0,e.DisplayFare=e.GFL?e.GrossFare:e.NetFare}))):"I"==r.flightState.SectorType&&"RT"==e.FareType?r.CombineNFandRSFinState(a,!1):"D"==r.flightState.SectorType&&"RT"==e.FareType?(a.Trips.map((function(e,t){e.Journey.map((function(e){e.visible=!0,e.couponFareJourneyVisible=!0,"I"==r.flightState.SectorType&&(e.GFL=!1),e.DisplayFare=e.GFL?e.GrossFare:e.NetFare,e.IndexPrifix=e.Index.indexOf("-")>-1?e.Index.split("-")[0]:"",o.a.GJSSpecialFareSettings.EnableGJSSpecialFare&&o.a.MerchantSettings.Clevertap.AUI.indexOf(o.a.MerchantSettings.Desktop.AUI)>-1&&(e.GJStag=o.a.GJSSpecialFareSettings.GJSSpecialFareAirlines.includes(e.Provider)?0:1)}))})),r.flightState.SearchResult.Trips=a.Trips):(a.Trips[0].Journey.map((function(e){e.couponFareJourneyVisible=!0,e.DisplayFare=e.GFL?e.GrossFare:e.NetFare,e.IndexPrifix=e.Index.indexOf("-")>-1?e.Index.split("-")[0]:"","D"==r.flightState.SectorType&&o.a.GJSSpecialFareSettings.EnableGJSSpecialFare&&o.a.MerchantSettings.Clevertap.AUI.indexOf(o.a.MerchantSettings.Desktop.AUI)>-1&&(e.GJStag=o.a.GJSSpecialFareSettings.GJSSpecialFareAirlines.includes(e.Provider)?0:1)})),r.flightState.SearchResult.Trips=a.Trips)),a.TUI;if("1100"!==a.Code)throw a&&a.Msg?new Error(a.Msg.reduce((function(e,t){return e+","+t}))):new Error("some issue occured in expresssearch data.msg is null/undefined");r.router.navigate(["/flight"])}else 401===i.status?r.executeExSearch(e,t):Object(n.a)(new Error("startExpressSearch-Unknown Error"))})))},e.prototype.startExpressSearchRSF=function(e){return this.executeExSearchRSF(e)},e.prototype.executeExSearchRSF=function(e){var t=this,r=new s.h({"Content-Type":"application/json"});e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI);var i=o.a.apiURL+"/flights/ExpressSearch",a=!(!this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0]||!this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0].Value||"true"!=this.generalState.WebSettings[0].filter((function(e){return"EnableAWSWAF"==e.Key}))[0].Value),p=!(!this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))||!this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))[0]||"true"!=this.generalState.WebSettings[0].filter((function(e){return"FingerPrintCookieEnabled"==e.Key}))[0].Value);return(a||p)&&(i=o.a.expressSearchAPIUrl+"/flights/ExpressSearch"),this.http.post(i,e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("startExpressSearchRSF-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return t.flightState.TUIRSF=i.TUI,i.CeilingInfo&&(t.flightState.SearchResultRSF.CeilingInfo=i.CeilingInfo),localStorage.setItem("currentTui",i.TUI),t.flightState.SearchResultRSF.Completed="True",i.Trips&&("D"==t.flightState.SectorType?(i.Trips.map((function(e,t){e.Journey.map((function(e){e.IndexPrifix=e.Index.indexOf("-")>-1?e.Index.split("-")[0]:""}))})),t.flightState.SearchResultRSF.Trips=i.Trips):"I"==t.flightState.SectorType&&t.CombineNFandRSFinState(i,!0)),i.TUI;throw i&&i.Msg?new Error(i.Msg.reduce((function(e,t){return e+","+t}))):new Error("some issue occured in expresssearchrsf data.msg is null or undefined")}401===r.status?t.executeExSearchRSF(e):Object(n.a)(new Error("startExpressSearchRSF-Unknown Error"))})))},e.prototype.getImpulsiveCity=function(e){return this.executeGetImpulsiveCity(e)},e.prototype.executeGetImpulsiveCity=function(e){var t=this;if(Object(c.F)(this.platform)){var r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.api.url.wc.util+"/Utils/GetCities",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){if(200==r.status){var i=r.body;if(!i)throw new Error("getImpulsiveCity-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),"200"===i.Code)return i.GetCities;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeGetImpulsiveCity(e):Object(n.a)(new Error("getImpulsiveCity-Unknown Error"))})))}return Object(i.a)({})},e.prototype.CombineNFandRSFinState=function(e,t){var r=this;this.flightState.SearchResult.Trips||(this.flightState.SearchResult.Trips={}),this.flightState.SearchResult.Trips[0]?null==this.flightState.SearchResult.Trips[0].Journey&&(this.flightState.SearchResult.Trips[0].Journey=[]):this.flightState.SearchResult.Trips.push({Journey:[]}),this.flightState.SearchResult.Trips[1]?null==this.flightState.SearchResult.Trips[1].Journey&&(this.flightState.SearchResult.Trips[1].Journey=[]):this.flightState.SearchResult.Trips.push({Journey:[]}),e&&e.Trips&&e.Trips.map((function(e,n){e.Journey.forEach((function(e){e.isRSF=t,e.visible=!0,e.couponFareJourneyVisible=!0,e.GFL=!1,e.DisplayFare=e.GFL?e.GrossFare:e.NetFare,e.IndexPrifix=e.Index.indexOf("-")>-1?e.Index.split("-")[0]:""})),r.flightState.SearchResult.Trips[n].Journey&&(r.flightState.SearchResult.Trips[n].Journey=r.flightState.SearchResult.Trips[n].Journey.concat(e.Journey))}))},e.prototype.createGroupFareEnquiry=function(e){return this.executeGroupFareEnquiry(e)},e.prototype.executeGroupFareEnquiry=function(e){var t=this,r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.api.url.wc.util+"/Utils/GroupFareEnquiry",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("createGroupFareEnquiry-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return i;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeGroupFareEnquiry(e):Object(n.a)(new Error("createGroupFareEnquiry-Unknown Error"))})))},e.prototype.deleteRecentSearch=function(e){return this.executeDeleteRecentSearch(e)},e.prototype.executeDeleteRecentSearch=function(e){var t=this,r=new s.h({"Content-Type":"application/json"});return e&&e.TUI&&""!=e.TUI&&(this.generalState.TUI=e.TUI),this.http.post(o.a.apiURL+"/Flights/DeleteRecentSearch",e,{headers:r,observe:"response"}).pipe(Object(u.a)((function(r){var i=r.body;if(!i)throw new Error("deleteRecentSearch-Response is null/undefined");if(i&&i.TUI&&""!=i.TUI&&(t.generalState.TUI=i.TUI),200===r.status){if("200"===i.Code)return i;throw new Error(i.Msg.reduce((function(e,t){return e+","+t})))}401===r.status?t.executeDeleteRecentSearch(e):Object(n.a)(new Error("deleteRecentSearch-Unknown Error"))})))},e}()}}]);