{ "version": 3, "sources": ["src/app/location/location-api.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport * as Rx from 'rxjs';\r\nimport { AppSettingService } from '../app.service';\r\nimport { CacheService } from '../utility/cache.service';\r\n\r\nexport interface IZipCodeLocation {\r\n\tCity: string,\r\n\tCountryCode: string,\r\n\tLatitude: number,\r\n\tLongitude: number,\r\n\tStateCode: string,\r\n\tStateName: string,\r\n\tStreet: string,\r\n\tZipCode: string\r\n};\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root'\r\n})\r\nexport class ZipCodeAPIService {\r\n\tconstructor(\r\n\t\tprivate http: HttpClient\r\n\t) { }\r\n\tprivate url = AppSettingService.appConfig.JourneyAPIUrl + \"ZipCode\";\r\n\r\n\tgetLocation(zipCode: string): Rx.Observable {\r\n\t\treturn this.http.get(\r\n\t\t\tthis.url + \"/\" + encodeURIComponent(zipCode) \r\n\t\t);\r\n\t}\r\n\r\n\tgetLocationByIP(ip: string = \"\"): Rx.Observable {\r\n\t\treturn this.http.get(\r\n\t\t\tthis.url + \"/IP?ip=\" + encodeURIComponent(ip)\r\n\t\t);\r\n\t}\r\n}\r\n\r\n\r\nexport interface ICityState {\r\n\tCity: string;\r\n\tState: string;\r\n}\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root'\r\n})\r\nexport class StateAPIService {\r\n\tconstructor(\r\n\t\tprivate cacheSrv: CacheService,\r\n\t\tprivate http: HttpClient\r\n\t) { }\r\n\r\n\tprivate url = AppSettingService.appConfig.JourneyAPIUrl + \"State\";\r\n\r\n\tgetAllStates(): Rx.Observable {\r\n\t\tlet l: string = this.url + \"/All\";\r\n\t\treturn this.cacheSrv.get(true, l);\r\n\t}\r\n\r\n\tlookupCityState(keyword: string, limit: number): Rx.Observable {\r\n\t\treturn this.http.get(\r\n\t\t\tthis.url + \"/City/Lookup?keyowrd=\" + encodeURIComponent(keyword) + \"&limit=\" + limit.toString()\r\n\t\t);\r\n\t}\r\n}\r\n\r\n"], "mappings": "0GAoBA,IAAaA,GAAiB,IAAA,CAAxB,MAAOA,CAAiB,CAC7BC,YACSC,EAAgB,CAAhB,KAAAA,KAAAA,EAED,KAAAC,IAAMC,EAAkBC,UAAUC,cAAgB,SADtD,CAGJC,YAAYC,EAAe,CAC1B,OAAO,KAAKN,KAAKO,IAChB,KAAKN,IAAM,IAAMO,mBAAmBF,CAAO,CAAC,CAE9C,CAEAG,gBAAgBC,EAAa,GAAE,CAC9B,OAAO,KAAKV,KAAKO,IAChB,KAAKN,IAAM,UAAYO,mBAAmBE,CAAE,CAAC,CAE/C,iDAhBYZ,GAAiBa,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAAjBd,EAAiBe,QAAjBf,EAAiBgB,UAAAC,WAFjB,MAAM,CAAA,CAAA,SAENjB,CAAiB,GAAA,EA4BjBkB,GAAe,IAAA,CAAtB,MAAOA,CAAe,CAC3BjB,YACSkB,EACAjB,EAAgB,CADhB,KAAAiB,SAAAA,EACA,KAAAjB,KAAAA,EAGD,KAAAC,IAAMC,EAAkBC,UAAUC,cAAgB,OAFtD,CAIJc,cAAY,CACX,IAAIC,EAAY,KAAKlB,IAAM,OAC3B,OAAO,KAAKgB,SAASV,IAAI,GAAMY,CAAC,CACjC,CAEAC,gBAAgBC,EAAiBC,EAAa,CAC7C,OAAO,KAAKtB,KAAKO,IAChB,KAAKN,IAAM,wBAA0BO,mBAAmBa,CAAO,EAAI,UAAYC,EAAMC,SAAQ,CAAE,CAEjG,iDAjBYP,GAAeL,EAAAa,CAAA,EAAAb,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAAfI,EAAeH,QAAfG,EAAeF,UAAAC,WAFf,MAAM,CAAA,CAAA,SAENC,CAAe,GAAA", "names": ["ZipCodeAPIService", "constructor", "http", "url", "AppSettingService", "appConfig", "JourneyAPIUrl", "getLocation", "zipCode", "get", "encodeURIComponent", "getLocationByIP", "ip", "\u0275\u0275inject", "HttpClient", "factory", "\u0275fac", "providedIn", "StateAPIService", "cacheSrv", "getAllStates", "l", "lookupCityState", "keyword", "limit", "toString", "CacheService"] }