{"version":3,"sources":["webpack:///webpack/bootstrap 3bc3ab773a4e7028f1ee","webpack:///./webpack.propsearchhomev5.ts","webpack:///./App/PropertySearchHomeV5.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","PropertySearchV4","[object Object]","this","defaultLatitude","defaultLongitude","defaultZoom","defaultRadius","defaultSearchRadius","defaultSearchRadiusHome","propertySearchModel","pageNo","pageSize","searchField","searchTerm","orderID","departmentID","departmentName","categoryName","priceFrequencyId","priceMin","priceMax","bedroomsMin","location","searchRadius","mapLongitude","mapLatitude","mapZoom","mapRadius","noMap","includeLetOrSold","searchScopes","propertyTypes","searchGeos","coordinates","gridViewMode","runHomePropertySearch","$","val","undefined","toString","localStorage","setItem","JSON","stringify","buildUrl","length","replace","window","href","setUiThread","getIsHomePage","isHomePage","getSearchCategory","setSearchCategory","category","console","log","getItem","isHomePageInitialisation","document","ready","propertySearch","run","on","e","preventDefault","click"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAhB,GACA,IAAAS,EAAAT,KAAAiB,WACA,WAA2B,OAAAjB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACA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a,UAAoBpB,KAAKO,oBAAoBa,SAASuB,OAAS,IACxFD,GAAY1C,KAAKO,oBAAoBa,SAASwB,QAAQ,IAAK,MAI/DC,OAAOzB,SAAS0B,KAAOJ,IAG3B1C,KAAA+C,YAAc,SAId/C,KAAAgD,cAAgB,KACLhD,KAAKiD,YAGhBjD,KAAAkD,kBAAoB,KACThB,EAAE,wCAAwCC,MAAME,YAG3DrC,KAAAmD,kBAAoB,CAACC,IACjBpD,KAAKO,oBAAoBQ,aAAeqC,EACxClB,EAAE,0BAA0BC,IAAIiB,GAI5BpD,KAAKO,oBAAoBoB,iBADZ,UAAbyB,IAhFDrD,MACHsD,QAAQC,mCAAkF,MAA/ChB,aAAaiB,QAAQ,yBAGhEvD,KAAKiD,YAAa,EAClBjD,KAAKwD,0BAA2B,EAGhCxD,KAAKO,oBAAoBmB,OAAQ,EAGjCY,aAAaC,QAAQ,gBAAiBC,KAAKC,UAAUzC,KAAKO,sBAG1DP,KAAKwD,0BAA2B,GA3FxCnF,EAAAyB,mBAqKAoC,EAAEuB,UAAUC,MAAM,WAEd,IAAIC,EAAiB,IAAI7D,EACzB6D,EAAeC,MAGf1B,EAAE,kBAAkB2B,GAAG,QAAS,SAAUC,GACtCA,EAAEC,iBACFJ,EAAe1B,0BAInBC,EAAE,sBAAsB8B,MAAM,SAAUF,GACpC5B,EAAE,0BAA0BC,IAAID,EAAElC,MAAMmC,OACxCwB,EAAeR,kBAAkBQ,EAAeT,uBAEpDhB,EAAE,yBAAyB8B,MAAM,SAAUF,GACvC5B,EAAE,0BAA0BC,IAAID,EAAElC,MAAMmC,OACxCwB,EAAeR,kBAAkBQ,EAAeT,uBAEpDhB,EAAE,yBAAyB8B,MAAM,SAAUF,GACvC5B,EAAE,0BAA0BC,IAAID,EAAElC,MAAMmC,OACxCwB,EAAeR,kBAAkBQ,EAAeT","file":"propsearchhomev5.js","sourcesContent":[" \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, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\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 = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3bc3ab773a4e7028f1ee","\"use strict\";\r\n\r\n// Application Scripts\r\nimport './App/PropertySearchHomeV5.ts';\n\n\n// WEBPACK FOOTER //\n// ./webpack.propsearchhomev5.ts","import { PropertySearchModel } from './PropertySearchModel';\r\nimport * as _ from 'lodash';\r\n\r\nexport class PropertySearchV4 {\r\n\r\n /*pageNo: number;\r\n pageSize: number;\r\n searchField: string;\r\n searchTerm: string;\r\n orderID: number;\r\n departmentName: string;\r\n departmentID: number;\r\n categoryName: string;\r\n isResidential: boolean;\r\n isResidentialSale: boolean;\r\n isResidentialLetting: boolean;\r\n isCommercial: boolean;\r\n isAgricultural: boolean;\r\n studentProperties: boolean;\r\n auctionProperties: boolean;\r\n priceTypeId: number;\r\n priceMin: number;\r\n priceMax: number;\r\n bedroomsMin: number;\r\n location: string;\r\n searchRadius: number;\r\n mapLongitude: number;\r\n mapLatitude: number;\r\n mapZoom: number;\r\n mapRadius: number;\r\n noMap: boolean;\r\n includeLetOrSold: boolean;\r\n propertyTypes: number[];\r\n searchScopes: SearchScopeModel[];\r\n searchGeos: SearchGeoModel[];\r\n coordinates: CoordinateModel[]\r\n */\r\n\r\n public isHomePage: boolean;\r\n public isHomePageInitialisation: boolean;\r\n\r\n public defaultLatitude = 54.974248;\r\n public defaultLongitude = -1.603980;\r\n\r\n public defaultZoom = 15;\r\n public defaultRadius = 500;\r\n public defaultSearchRadius = 0;\r\n public defaultSearchRadiusHome = 0;\r\n\r\n public propertySearchModel = {\r\n pageNo: 1,\r\n pageSize: 12,\r\n searchField: '',\r\n searchTerm: '',\r\n orderID: 1,\r\n departmentID: 0,\r\n departmentName: 'residential',\r\n categoryName: 'lettings',\r\n priceFrequencyId: 0,\r\n priceMin: 0,\r\n priceMax: 0,\r\n bedroomsMin: 0,\r\n location: '',\r\n searchRadius: 0,\r\n mapLongitude: this.defaultLongitude,\r\n mapLatitude: this.defaultLatitude,\r\n mapZoom: this.defaultZoom,\r\n mapRadius: this.defaultRadius,\r\n noMap: true,\r\n includeLetOrSold: false,\r\n searchScopes: [],\r\n propertyTypes: [],\r\n searchGeos: [],\r\n coordinates: [],\r\n gridViewMode: '3x' // 1x, 2x, 3x, mapx\r\n } as PropertySearchModel;\r\n\r\n constructor() {\r\n }\r\n\r\n public run(): void {\r\n console.log(`PropertySearchComponent run ${localStorage.getItem(\"bm-pty-search-init\") === \"1\"}`);\r\n\r\n // Is this the home page or the search listing\r\n this.isHomePage = true;\r\n this.isHomePageInitialisation = true;\r\n\r\n // Update hasMap based upon screen size\r\n this.propertySearchModel.noMap = true;\r\n\r\n // Save fresh search model to localStorage\r\n localStorage.setItem(\"bm-pty-search\", JSON.stringify(this.propertySearchModel));\r\n\r\n // Reset isHomePageInitialisation after initialisation complete\r\n this.isHomePageInitialisation = false;\r\n }\r\n\r\n runHomePropertySearch = () => {\r\n // Set model basic fields\r\n this.propertySearchModel.departmentName = $('#hdnSearchDepartmentName').val() != null \r\n && $('#hdnSearchDepartmentName').val() != undefined\r\n && $('#hdnSearchDepartmentName').val() != ''\r\n ? $('#hdnSearchDepartmentName').val().toString()\r\n : 'residential';\r\n this.propertySearchModel.categoryName = $('input[name=searchCategories]:checked').val().toString();\r\n this.propertySearchModel.location = $('#psearch-locality').val().toString();\r\n\r\n // Save search model to localStorage\r\n localStorage.setItem(\"bm-pty-search\", JSON.stringify(this.propertySearchModel));\r\n localStorage.setItem(\"bm-pty-search-init\", \"1\");\r\n\r\n // Redirect to search page\r\n /**\r\n sdept=auction&slocation={R:1}\r\n sdept={R:1}&scat={R:2}&slocation={R:3}\r\n sdept [auction, residential, commercial, agricultural]\r\n scat [sales, lettings, students]\r\n slocation [name, postcode]\r\n\r\n /residential/sales/location/\r\n /residential/lettings/location/\r\n /residential/students/location/\r\n /saleby/auction/location/\r\n /commercial/sales/location/\r\n /commercial/lettings/location/\r\n */\r\n let buildUrl = '/';\r\n if (this.propertySearchModel.categoryName === 'sales') {\r\n buildUrl += 'sales/find-a-property/';\r\n } else if (this.propertySearchModel.categoryName === 'lettings') {\r\n buildUrl += 'lettings/find-a-property/';\r\n } else if (this.propertySearchModel.categoryName === 'students') {\r\n buildUrl += 'students/find-a-property/';\r\n }\r\n\r\n if (this.propertySearchModel.location != null && this.propertySearchModel.location.length > 0) {\r\n buildUrl += this.propertySearchModel.location.replace(' ', '-');\r\n }\r\n\r\n // Perform redirect\r\n window.location.href = buildUrl;\r\n } \r\n\r\n setUiThread = () => {\r\n // TODO: MG\r\n }\r\n\r\n getIsHomePage = () => {\r\n return this.isHomePage;\r\n }\r\n\r\n getSearchCategory = () => {\r\n return $('input[name=searchCategories]:checked').val().toString();\r\n }\r\n\r\n setSearchCategory = (category: string) => {\r\n this.propertySearchModel.categoryName = category;\r\n $('#hdnSearchCategoryName').val(category);\r\n\r\n // Set include sold items when sales\r\n if (category === 'sales') {\r\n this.propertySearchModel.includeLetOrSold = true;\r\n } else {\r\n this.propertySearchModel.includeLetOrSold = false;\r\n }\r\n }\r\n}\r\n\r\n$(document).ready(function () {\r\n\r\n var propertySearch = new PropertySearchV4();\r\n propertySearch.run();\r\n\r\n // Run search\r\n $('.search-button').on('click', function (e) {\r\n e.preventDefault();\r\n propertySearch.runHomePropertySearch();\r\n });\r\n\r\n // Radio buttons\r\n $('#search-scat-sales').click(function (e) {\r\n $('#hdnSearchCategoryName').val($(this).val());\r\n propertySearch.setSearchCategory(propertySearch.getSearchCategory());\r\n });\r\n $('#search-scat-lettings').click(function (e) {\r\n $('#hdnSearchCategoryName').val($(this).val());\r\n propertySearch.setSearchCategory(propertySearch.getSearchCategory());\r\n });\r\n $('#search-scat-students').click(function (e) {\r\n $('#hdnSearchCategoryName').val($(this).val());\r\n propertySearch.setSearchCategory(propertySearch.getSearchCategory());\r\n });\r\n\r\n});\n\n\n// WEBPACK FOOTER //\n// ./App/PropertySearchHomeV5.ts"],"sourceRoot":""}