define('app',['exports', 'aurelia-http-client', 'aurelia-framework', './translations-manager', 'src/services/search-service.js'], function (exports, _aureliaHttpClient, _aureliaFramework, _translationsManager, _searchService) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.App = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _dec, _class; var App = exports.App = (_dec = (0, _aureliaFramework.inject)(_aureliaHttpClient.HttpClient, _translationsManager.TranslationsManager, _searchService.SearchService), _dec(_class = function () { function App(httpClient, translationsManager, searchService) { _classCallCheck(this, App); this.httpClient = httpClient; this.translationsManager = translationsManager; this.searchService = searchService; } App.prototype.configureRouter = function configureRouter(config, router) { config.options.pushState = true; config.options.hashChange = false; this.router = router; config.map(window.routes); this.translationsManager.setTranslations('propertylist', window.propertyListTranslations); }; return App; }()) || _class); }); define('environment',["exports"], function (exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { debug: false, testing: false }; }); define('feriehus-link-handler',['exports', 'aurelia-history-browser'], function (exports, _aureliaHistoryBrowser) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.FeriehusLinkHandler = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var FeriehusLinkHandler = exports.FeriehusLinkHandler = function (_DefaultLinkHandler) { _inherits(FeriehusLinkHandler, _DefaultLinkHandler); function FeriehusLinkHandler() { _classCallCheck(this, FeriehusLinkHandler); var _this = _possibleConstructorReturn(this, _DefaultLinkHandler.call(this)); _this.handler = function (e) { var _DefaultLinkHandler$g = _aureliaHistoryBrowser.DefaultLinkHandler.getEventInfo(e), shouldHandleEvent = _DefaultLinkHandler$g.shouldHandleEvent, href = _DefaultLinkHandler$g.href; if (shouldHandleEvent && _this.hasClass(e.target, 'client-link')) { e.preventDefault(); _this.history.navigate(href); window.scrollTo(0, 0); } }; return _this; } FeriehusLinkHandler.prototype.activate = function activate(history) { this.history = history; _DefaultLinkHandler.prototype.activate.call(this, history); }; FeriehusLinkHandler.prototype.deactivate = function deactivate() { _DefaultLinkHandler.prototype.deactivate.call(this); }; FeriehusLinkHandler.prototype.hasClass = function hasClass(target, cls) { if (!target) { return false; } if (target.classList.contains(cls)) { return true; } return this.hasClass(target.offsetParent, cls); }; return FeriehusLinkHandler; }(_aureliaHistoryBrowser.DefaultLinkHandler); }); define('main',['exports', './environment', './feriehus-link-handler', 'aurelia-history-browser', 'aurelia-event-aggregator'], function (exports, _environment, _feriehusLinkHandler, _aureliaHistoryBrowser, _aureliaEventAggregator) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.configure = configure; var _environment2 = _interopRequireDefault(_environment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Promise.config({ warnings: { wForgottenReturn: false } }); function configure(aurelia) { aurelia.use.standardConfiguration().plugin('aurelia-cookie').feature('resources'); if (_environment2.default.debug) { aurelia.use.developmentLogging(); } aurelia.container.registerSingleton(_aureliaHistoryBrowser.LinkHandler, _feriehusLinkHandler.FeriehusLinkHandler); var eventAggregator = aurelia.container.get(_aureliaEventAggregator.EventAggregator); eventAggregator.subscribe('router:navigation:success', function (x) { if (!x.instruction) { return; } if (window.ga) { var url = x.instruction.fragment; if (x.instruction.queryString && x.instruction.queryString.length > 0) { url = url + '?' + x.instruction.queryString; } window.ga('set', 'page', url); window.ga('send', 'pageview'); } if (window.fbq) { window.fbq('track', "PageView"); } if (window.google_trackConversion && window.googleConversionId) { window.google_trackConversion({ google_conversion_id: window.googleConversionId, google_remarketing_only: true, google_conversion_format: 3, google_custom_params: window.google_tag_params }); } }); aurelia.start().then(function () { return aurelia.setRoot(); }); } }); define('translations-manager',['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var TranslationsManager = exports.TranslationsManager = function () { function TranslationsManager() { _classCallCheck(this, TranslationsManager); this._state = {}; } TranslationsManager.prototype.setTranslations = function setTranslations(key, translations) { this._state[key] = translations; }; TranslationsManager.prototype.getPropertyListTranslations = function getPropertyListTranslations() { return this._state['propertylist'] || {}; }; return TranslationsManager; }(); }); define('booking/details',['exports', 'aurelia-framework', 'src/services/booking-service.js', 'linqjs'], function (exports, _aureliaFramework, _bookingService) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Details = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _desc, _value, _class2, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _desc2, _value2, _class4; var Details = exports.Details = (_dec = (0, _aureliaFramework.inject)(_bookingService.BookingService, _aureliaFramework.BindingEngine), _dec2 = (0, _aureliaFramework.computedFrom)('booking.propertyPrice', 'booking.discount'), _dec3 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec4 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec5 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec6 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec7 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec8 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec9 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec10 = (0, _aureliaFramework.computedFrom)('valueUpdated'), _dec(_class = (_class2 = function () { function Details(bookingService, bindingEngine) { _classCallCheck(this, Details); this.bookingForm = { 'title': '', 'firstName': '', 'lastName': '', 'address': '', 'postalCode': '', 'city': '', 'country': '', 'email': '', 'mobileNumber': '', 'phoneNumber': '', 'newsletter': '' }; this.valid = true; this.errors = []; this.visitorCategoryInputs = {}; this.valueUpdated = false; this.bookingIsProgess = false; this.isLoading = true; this.translations = {}; this.waitingMessage = window.waitingMessage; this.newsletter = false; this.visitorError = false; this.isMobile = window.innerWidth < 768; this.currentBookingStep = 2; this.bookingStepTotal = this.hasAddons ? 3 : 2; this.showAddons = false; this.mobileTermsAndConditionsAccepted = false; this.showMobileTermsAndConditionsError = false; this.bookingService = bookingService; this.bindingEngine = bindingEngine; } Details.prototype.activate = function activate(params) { var _this = this; this.length = params.length; this.arrival = params.arrival; this.id = params.Id || params.id; this.bookingService.getBooking(this.id, params.numberOfPersons, params.length, params.arrival).then(function (x) { _this.translations = x.translations; _this.bookingDescription = x.bookingDescription; _this.bookingProperty = x.bookingProperty; _this.booking = x.booking; _this.maximumOccupancy = x.maximumOccupancy; _this.visitorCategories = x.visitorCategories; _this.includedItems = x.includedItems; _this.availableCountries = x.availableCountries; _this.availableAddons = []; _this.availableTitles = x.availableTitles; _this.available = x.available; _this.noAvailableLink = x.noAvailableLink; _this.arrival = x.arrival; _this.departure = x.departure; _this.termsAndConditions = x.termsAndConditions; for (var _iterator = x.addons, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var addon = _ref; var thisAddon = new Addon(addon, _this.translations, function (parent) { if (_this.availableAddons) { for (var _iterator3 = _this.availableAddons, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var parentAddon = _ref3; if (parentAddon.data.code === parent && parentAddon.selectedValue <= 0) { return false; } } } return true; }, _this); _this.availableAddons.push(thisAddon); _this.bindingEngine.propertyObserver(thisAddon, 'selectedValue').subscribe(function (x) { _this.valueUpdated = !_this.valueUpdated; }); } for (var _iterator2 = x.visitorCategories, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var visitorCategory = _ref2; _this.visitorCategoryInputs[visitorCategory.visitorType] = visitorCategory.amount; _this.bindingEngine.propertyObserver(_this.visitorCategoryInputs, visitorCategory.visitorType).subscribe(function (x) { _this.valueUpdated = !_this.valueUpdated; }); } return x; }).then(function (x) { _this.isLoading = false; }); }; Details.prototype.attached = function attached() { $("a#termsAndConditionsLink").fancybox({ 'hideOnContentClick': true }); var requiredMessage = this.translations.validationMessageRequired; var confirmMessage = this.translations.validationMessageConfirm; var emailMessage = this.translations.validationMessageEmail; var equalMessage = this.translations.validationMessageEqual; var digitsMessage = this.translations.validationMessageDigits; var phoneNumberLengthMessage = this.translations.validationMessagePhoneNumberMaxLength; $('#personal-data-box').find("input[parsley-required-message]").each(function () { var $this = $(this); if ($this.attr("id") === 'conditions') { $this.attr("parsley-required-message", confirmMessage); } else { $this.attr("parsley-required-message", requiredMessage); } }); $(this.personalData).find("input[parsley-type-email-message]").each(function () { $(this).attr("parsley-type-email-message", emailMessage); }); $(this.personalData).find("input[parsley-equalto-message]").each(function () { $(this).attr("parsley-equalto-message", equalMessage); }); $(this.personalData).find("input[parsley-type-digits-message]").each(function () { $(this).attr("parsley-type-digits-message", digitsMessage); }); $(this.personalData).find("input[parsley-maxlength-message]").each(function () { $(this).attr("parsley-maxlength-message", phoneNumberLengthMessage); }); }; Details.prototype.gotoNextStep = function gotoNextStep() { if (this.currentBookingStep === 2 || this.currentBookingStep === 2 && !this.showAddons) { if (!$(this.validatedBookingForm).parsley('validate')) { this.valid = false; return; } } this.currentBookingStep++; document.body.scrollTop = 0; document.documentElement.scrollTop = 0; }; Details.prototype.gotoPreviousStep = function gotoPreviousStep() { this.currentBookingStep--; document.body.scrollTop = 0; document.documentElement.scrollTop = 0; }; Details.prototype.validateMobileTermsCheck = function validateMobileTermsCheck() { if (this.isMobile && !this.mobileTermsAndConditionsAccepted) { this.valid = false; this.showMobileTermsAndConditionsError = true; return false; } this.showMobileTermsAndConditionsError = false; return true; }; Details.prototype.book = function book() { var _this2 = this; this.attached(); this.errors.splice(0, this.errors.length); if (!$(this.validatedBookingForm).parsley('validate') || !this.validateMobileTermsCheck()) { this.valid = false; if (this.isMobile) { window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }); } return; } if (this.newsletter) { this.bookingService.newsletterSubscribe(this.bookingForm.email, this.bookingForm.firstName, this.bookingForm.lastName); } this.bookingIsProgess = true; this.valid = true; var addons = {}; for (var _iterator4 = this.availableAddons, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var addon = _ref4; if (addon.selectedValue > 0) { addons[addon.data.code] = addon.selectedValue; } } this.bookingService.book(this.id, this.bookingForm, this.visitorCategoryInputs, addons, this.length, this.arrival).then(function (x) { if (x.success) { var receiptUrl = x.recieptUrl + "/?Id=" + x.bookingId + "&hash=" + x.hash; window.location.href = x.receiptUrl; } else { _this2.errors.push(x.message); _this2.bookingIsProgess = false; } }); }; Details.prototype.reloadPropertyData = function reloadPropertyData() { if (this.validateVisitors()) { this.updateAddons(); this.updatePropertyPrice(); } }; Details.prototype.updateAddons = function updateAddons() { var _this3 = this; var addons = {}; for (var _iterator5 = this.availableAddons, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var addon = _ref5; if (addon.selectedValue > 0) { addons[addon.data.code] = addon.selectedValue; } } this.bookingService.updateAddons(this.id, this.visitorCategoryInputs[0] || 0, this.visitorCategoryInputs[2] || 0, this.visitorCategoryInputs[1] || 0, this.visitorCategoryInputs[3] || 0, this.length, this.arrival).then(function (x) { _this3.availableAddons.removeAll(); for (var _iterator6 = x.addons, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { var _ref6; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref6 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref6 = _i6.value; } var addon = _ref6; var thisAddon = new Addon(addon, _this3.translations, function (parent) { if (_this3.availableAddons) { for (var _iterator7 = _this3.availableAddons, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref7 = _i7.value; } var parentAddon = _ref7; if (parentAddon.data.code === parent && parentAddon.selectedValue <= 0) { return false; } } } return true; }, _this3); if (addons[thisAddon.data.code] !== null) { thisAddon.selectedValue = addons[thisAddon.data.code]; } _this3.availableAddons.push(thisAddon); _this3.valueUpdated = !_this3.valueUpdated; _this3.bindingEngine.propertyObserver(thisAddon, 'selectedValue').subscribe(function (x) { _this3.valueUpdated = !_this3.valueUpdated; }); } }); }; Details.prototype.updatePropertyPrice = function updatePropertyPrice() { var _this4 = this; this.bookingService.getBookingProperty(this.id, this.visitorCategoryInputs[0] + this.visitorCategoryInputs[2], this.length, this.arrival).then(function (x) { _this4.booking.propertyPrice = x.property.Price; _this4.booking.discount = x.property.Discount; }); }; Details.prototype.getAddonDescription = function getAddonDescription(addon) { var providerId = this.bookingProperty.provider; if (providerId != 2 && providerId != 12) { return addon.data.description; } switch (addon.data.name) { case 'Trygghetsforsikring fra': return 'Les mer under "Betingelser og vilkar"'; break; case 'Trygghetsgaranti': return 'Les mer under "Betingelser og vilkar"'; break; } }; Details.prototype.validateVisitors = function validateVisitors() { var providerId = this.bookingProperty.provider; var adults = parseInt(this.visitorCategoryInputs[0]); var children1 = parseInt(this.visitorCategoryInputs[1]); var children2 = parseInt(this.visitorCategoryInputs[2]); var maxOccupancy = parseInt(this.maximumOccupancy); var totalOccupancy; switch (providerId) { case 2: var totalOccupancy = adults + children2; break; case 3: var totalOccupancy = adults + children1 + children2; break; case 4: var totalOccupancy = adults + children2; break; case 5: var totalOccupancy = adults + children2; break; case 7: var totalOccupancy = adults + children1 + children2; break; case 9: var totalOccupancy = adults + children2; break; case 12: var totalOccupancy = adults; break; } if (totalOccupancy > maxOccupancy) { this.visitorError = true; return false; } this.visitorError = false; return true; }; _createClass(Details, [{ key: 'calculatedPropertyExchangedPrice', get: function get() { var price = this.booking.propertyPrice; if (this.bookingProperty.exchangeRate > 0 && this.bookingProperty.exchangeRate !== 1) { price = price * this.bookingProperty.exchangeRate; } return Math.round(price * 100) / 100; } }, { key: 'addonsConsumption', get: function get() { var result = []; for (var _iterator8 = this.availableAddons, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { var _ref8; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref8 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref8 = _i8.value; } var addon = _ref8; if (addon.data.tags.indexOf('consumption') > -1 && addon.data.tags.indexOf('included') === -1) { result.push(addon); } } return result; } }, { key: 'addonsPayedOnline', get: function get() { var result = []; for (var _iterator9 = this.availableAddons, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { var _ref9; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref9 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref9 = _i9.value; } var addon = _ref9; if (addon.data.tags.indexOf('pay-online') > -1 && addon.selectedValue > 0 && addon.data.tags.indexOf('included') === -1 && addon.data.tags.indexOf('consumption') === -1) { addon.data.description = this.getAddonDescription(addon); result.push(addon); } } return result; } }, { key: 'addonsPayedOnSite', get: function get() { var result = []; for (var _iterator10 = this.availableAddons, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { var _ref10; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref10 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref10 = _i10.value; } var addon = _ref10; if (addon.data.tags.indexOf('pay-on-site') > -1 && addon.selectedValue > 0 && (addon.data.tags.indexOf('selectable') > -1 || addon.data.tags.indexOf('mandatory') > -1) && addon.data.tags.indexOf('pay-online') === -1 && addon.data.tags.indexOf('included') === -1 && addon.data.tags.indexOf('consumption') === -1) { addon.data.description = this.getAddonDescription(addon); result.push(addon); } } return result; } }, { key: 'ownerAddonsPayedOnSite', get: function get() { var result = []; for (var _iterator11 = this.availableAddons, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { var _ref11; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref11 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref11 = _i11.value; } var addon = _ref11; if (addon.data.tags.indexOf('mandatory') === -1 && addon.data.tags.indexOf('pay-on-site') > -1 && addon.data.tags.indexOf('selectable') === -1 && addon.data.tags.indexOf('included') === -1) { result.push(addon); } } return result; } }, { key: 'mandatoryAddons', get: function get() { var result = []; for (var _iterator12 = this.availableAddons, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { var _ref12; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref12 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref12 = _i12.value; } var addon = _ref12; if (addon.data.tags.indexOf('mandatory') > -1 && addon.data.tags.indexOf('included') === -1 && addon.data.tags.indexOf('consumption') === -1) { addon.data.description = this.getAddonDescription(addon); result.push(addon); this.bookingStepTotal = 3; this.currentBookingStep = 1; this.showAddons = true; } } return result; } }, { key: 'optionalAddons', get: function get() { var result = []; for (var _iterator13 = this.availableAddons, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { var _ref13; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref13 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref13 = _i13.value; } var addon = _ref13; if (addon.data.tags.indexOf('mandatory') === -1 && addon.data.tags.indexOf('included') === -1 && addon.data.tags.indexOf('selectable') > -1 && addon.data.tags.indexOf('consumption') === -1) { addon.data.description = this.getAddonDescription(addon); result.push(addon); this.bookingStepTotal = 3; this.currentBookingStep = 1; this.showAddons = true; } } return result; } }, { key: 'includedAddons', get: function get() { var result = []; for (var _iterator14 = this.includedItems, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { var _ref14; if (_isArray14) { if (_i14 >= _iterator14.length) break; _ref14 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; _ref14 = _i14.value; } var item = _ref14; result.push(item); } for (var _iterator15 = this.availableAddons, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { var _ref15; if (_isArray15) { if (_i15 >= _iterator15.length) break; _ref15 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; _ref15 = _i15.value; } var addon = _ref15; if (addon.data.tags.indexOf('included') > -1) { addon.data.description = this.getAddonDescription(addon); result.push({ 'title': addon.data.name, 'description': addon.data.description }); } } return result; } }, { key: 'payedOnlinePrice', get: function get() { var price = this.calculatedPropertyExchangedPrice; for (var _iterator16 = this.addonsPayedOnline, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { var _ref16; if (_isArray16) { if (_i16 >= _iterator16.length) break; _ref16 = _iterator16[_i16++]; } else { _i16 = _iterator16.next(); if (_i16.done) break; _ref16 = _i16.value; } var addon = _ref16; price += addon.calculatedExchangedPrice; } return Math.round(price * 100) / 100; } }]); return Details; }(), (_applyDecoratedDescriptor(_class2.prototype, 'calculatedPropertyExchangedPrice', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'calculatedPropertyExchangedPrice'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'addonsConsumption', [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, 'addonsConsumption'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'addonsPayedOnline', [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, 'addonsPayedOnline'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'addonsPayedOnSite', [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, 'addonsPayedOnSite'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'ownerAddonsPayedOnSite', [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, 'ownerAddonsPayedOnSite'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'mandatoryAddons', [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, 'mandatoryAddons'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'optionalAddons', [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, 'optionalAddons'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'includedAddons', [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, 'includedAddons'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'payedOnlinePrice', [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, 'payedOnlinePrice'), _class2.prototype)), _class2)) || _class); var Addon = (_dec11 = (0, _aureliaFramework.computedFrom)('selectedQuantity'), _dec12 = (0, _aureliaFramework.computedFrom)('data.tags'), _dec13 = (0, _aureliaFramework.computedFrom)('data.calculationType'), _dec14 = (0, _aureliaFramework.computedFrom)('data.unitPrice', 'selectedValue'), _dec15 = (0, _aureliaFramework.computedFrom)('data.dependsOn', 'parent.valueUpdated'), _dec16 = (0, _aureliaFramework.computedFrom)('data.tags', 'parent.valueUpdated'), _dec17 = (0, _aureliaFramework.computedFrom)('selectedValue', 'parent.valueUpdated'), _dec18 = (0, _aureliaFramework.computedFrom)('selectedValue', 'parent.valueUpdated'), (_class4 = function () { function Addon(data, translations, isOrdered, parent) { _classCallCheck(this, Addon); this.data = {}; this.selectedValue = 0; this.data = data; this.translations = translations; this.isOrdered = isOrdered; this.parent = parent; this.calculationTypeUnits = { '5': translations.perUnit, '7': translations.perPersonPerWeek, '6': translations.perPersonPerDay, '3': translations.perStay, '4': translations.perPerson, '2': translations.perWeek, '1': translations.perDay, '8': translations.perKilowattHour, '9': translations.perM3, '10': translations.perUnitPerDay, '11': translations.perUnitPerWeek, '12': translations.perHour, '13': translations.accordingToUse, '14': translations.noCalculationRelevance, '15': translations.perLitre }; } Addon.prototype.getMinQuantity = function getMinQuantity() { if (this.data.calculationType === 4) { var quantity = 0; for (var k in this.parent.visitorCategoryInputs) { if (this.parent.visitorCategoryInputs.hasOwnProperty(k)) { if (k === '0' || k === '2') { quantity += this.parent.visitorCategoryInputs[k]; } } } return quantity; } return 0; }; _createClass(Addon, [{ key: 'showValue', get: function get() { return this.selectedQuantity > 1; } }, { key: 'payOnline', get: function get() { return this.data.tags.indexOf('pay-online') > -1; } }, { key: 'unit', get: function get() { return this.calculationTypeUnits[this.data.calculationType.toString()] || ''; } }, { key: 'totalPrice', get: function get() { var price = this.data.unitPrice * this.selectedValue; if (this.data.minTotalPrice > price) { price = this.data.minTotalPrice; } return price; } }, { key: 'canOrder', get: function get() { if (this.options && this.options.length === 1) { return false; } if (this.data.dependsOn.length <= 0) { return true; } for (var _iterator17 = this.data.dependsOn, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) { var _ref17; if (_isArray17) { if (_i17 >= _iterator17.length) break; _ref17 = _iterator17[_i17++]; } else { _i17 = _iterator17.next(); if (_i17.done) break; _ref17 = _i17.value; } var parent = _ref17; if (!this.isOrdered(parent)) { this.selectedValue = 0; return false; } } return true; } }, { key: 'options', get: function get() { var minQuantity = this.getMinQuantity(); if (this.data.tags.indexOf('mandatory') > -1) { if (this.data.specialArrengement) { this.selectedValue = minQuantity > 0 ? minQuantity : 1; return [{ value: minQuantity > 0 ? minQuantity : 1, title: this.translations.formSpecialArrangement }]; } else if (this.data.tags.indexOf('pay-online') > -1 && this.data.tags.indexOf('pay-on-site') > -1) { if (this.selectedValue !== 0) { this.selectedValue = minQuantity > 0 ? minQuantity : 1; } return [{ value: 0, title: this.translations.formPayOnArrival }, { value: minQuantity > 0 ? minQuantity : 1, title: this.translations.formPayOnline }]; } else if (this.data.tags.indexOf('pay-online') > -1) { this.selectedValue = minQuantity > 0 ? minQuantity : 1; return [{ value: minQuantity > 0 ? minQuantity : 1, title: this.translations.formPayOnline }]; } else if (this.data.tags.indexOf('pay-on-site') > -1) { this.selectedValue = minQuantity > 0 ? minQuantity : 1; return [{ value: minQuantity > 0 ? minQuantity : 1, title: this.translations.formPayOnArrival }]; } else { return [{ value: 0, title: this.translations.formIncluded }]; } } if (this.data.maxUnits === 1) { return [{ value: 0, title: this.translations.formNo }, { value: 1, title: this.translations.formYes }]; } if (this.data.calculationType === 4) { return [{ value: 0, title: this.translations.formNo }, { value: 1, title: this.translations.formYes }]; } if (this.data.maxUnits > 0) { var result = []; for (var i = 0; i <= this.data.maxUnits; i++) { result[i] = { value: i, title: i }; } return result; } var defaultResult = []; for (var _i18 = 0; _i18 <= 15; _i18++) { defaultResult[_i18] = { value: _i18, title: _i18 }; } return defaultResult; } }, { key: 'calculatedExchangedPrice', get: function get() { var price = this.data.unitPrice; var selectedValue = this.selectedValue; var minQuantity = this.getMinQuantity(); if (minQuantity > selectedValue) { selectedValue = minQuantity; } if (this.data.exchangeRate <= 0 || this.data.exchangeRate === 1) { if (selectedValue > 0) { price = this.data.unitPrice * selectedValue; if (this.data.minTotalPrice > price) { price = this.data.minTotalPrice; } } } else if (selectedValue > 0) { price = this.data.unitPrice * selectedValue; if (this.data.minTotalPrice > price) { price = this.data.minTotalPrice; } price = price * this.data.exchangeRate; } else { price = this.data.unitPrice; if (this.data.minTotalPrice > price) { price = this.data.minTotalPrice; } price = price * this.data.exchangeRate; } if (price > 100) { return Math.round(price); } return Math.round(price * 100) / 100; } }, { key: 'selectedQuantity', get: function get() { var selectedValue = this.selectedValue; var minQuantity = this.getMinQuantity(); if (minQuantity > selectedValue) { selectedValue = minQuantity; } return selectedValue; } }]); return Addon; }(), (_applyDecoratedDescriptor(_class4.prototype, 'showValue', [_dec11], Object.getOwnPropertyDescriptor(_class4.prototype, 'showValue'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'payOnline', [_dec12], Object.getOwnPropertyDescriptor(_class4.prototype, 'payOnline'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'unit', [_dec13], Object.getOwnPropertyDescriptor(_class4.prototype, 'unit'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'totalPrice', [_dec14], Object.getOwnPropertyDescriptor(_class4.prototype, 'totalPrice'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'canOrder', [_dec15], Object.getOwnPropertyDescriptor(_class4.prototype, 'canOrder'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'options', [_dec16], Object.getOwnPropertyDescriptor(_class4.prototype, 'options'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'calculatedExchangedPrice', [_dec17], Object.getOwnPropertyDescriptor(_class4.prototype, 'calculatedExchangedPrice'), _class4.prototype), _applyDecoratedDescriptor(_class4.prototype, 'selectedQuantity', [_dec18], Object.getOwnPropertyDescriptor(_class4.prototype, 'selectedQuantity'), _class4.prototype)), _class4)); }); define('resources/google-maps-controller',['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var GoogleMapsController = exports.GoogleMapsController = function () { function GoogleMapsController() { _classCallCheck(this, GoogleMapsController); this.map = null; this.mapLocation = null; this.mapsEventHandlers = []; this.mapPosition = null; } GoogleMapsController.prototype.init = function init(mapContainer, mapOptions, mapPosition, setMapPos) { var _this = this; this.setMapPos = setMapPos; if (this.map) { return this.map; } this.map = new google.maps.Map(mapContainer, mapOptions); this.mapsEventHandlers.push(google.maps.event.addListener(this.map, 'zoom_changed', function () { if (!_this.setMapPos) { return; } var center = _this.map.getCenter(); var zoom = _this.map.getZoom(); var styles = [{ featureType: 'poi.business', elementType: 'labels', stylers: [{ visibility: 'off' }] }]; _this.map.setOptions({ styles: styles }); if (!center || !zoom) { return; } _this.setMapPos(center.lat().toFixed(4) + '_' + center.lng().toFixed(4) + '_' + zoom); })); this.mapsEventHandlers.push(google.maps.event.addListener(this.map, 'dragend', function () { if (!_this.setMapPos) { return; } var center = _this.map.getCenter(); var zoom = _this.map.getZoom(); if (!center || !zoom) { return; } _this.setMapPos(center.lat().toFixed(4) + '_' + center.lng().toFixed(4) + '_' + zoom); })); this.updatePosition(mapPosition); return this.map; }; GoogleMapsController.prototype.updatePosition = function updatePosition(mapPosition) { if (!mapPosition) { return; } this.map.setZoom(mapPosition.zoom); this.map.setCenter(new google.maps.LatLng(mapPosition.lat, mapPosition.lng)); this.mapPosition = mapPosition; }; GoogleMapsController.prototype.dispose = function dispose() { this.setMapPos = null; this.map = null; for (var _iterator = this.mapsEventHandlers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var eventHandler = _ref; eventHandler.remove(); } this.mapsEventHandlers = []; }; GoogleMapsController.prototype.setMapLocation = function setMapLocation(location) { if (this.mapLocation && location && this.mapLocation.slug === location.slug) { return; } var currentLocation = this.mapLocation; this.mapLocation = location; if (this.mapPosition && !currentLocation) { return; } if (this.mapLocation) { this.map.fitBounds(this.getMapBoundaries(this.mapLocation)); } }; GoogleMapsController.prototype.getMapBoundaries = function getMapBoundaries(location) { if (!location) { return null; } var boundaries = location.boundaries; if (boundaries == null || boundaries.southWest == null || boundaries.northEast == null) { if (location.parentLocation) { return this.getMapBoundaries(location.parentLocation); } return null; } var sw = new google.maps.LatLng(boundaries.southWest.latitude, boundaries.southWest.longitude); var ne = new google.maps.LatLng(boundaries.northEast.latitude, boundaries.northEast.longitude); return new google.maps.LatLngBounds(sw, ne); }; return GoogleMapsController; }(); }); define('resources/index',['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.configure = configure; function configure(config) { config.globalResources(['./elements/bootstrap-select', './elements/slider', './elements/range-slider', './elements/google-map']); } }); define('searchresult/criteria',['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Criteria = exports.Criteria = function () { function Criteria() { _classCallCheck(this, Criteria); this.location = ''; this.query = ''; this.sort = ''; this.mapPosition = ''; this.itemsPerPage = 15; this.showingProperties = 15; this.defaultSort = '4'; } Criteria.prototype.getSearchFor = function getSearchFor(searchName) { return (this.query || '').split(' ').select(function (x) { return x.split(':'); }).where(function (x) { return x[0] === searchName; }).select(function (x) { return x[1]; }).first() || ''; }; Criteria.prototype.setFrom = function setFrom(params) { this.location = params.slug.startsWith('/') ? params.slug : '/' + params.slug; this.query = params.q; this.sort = params.sort || this.defaultSort; this.mapPosition = params.mpos; if (params.p && params.p.length > 0) { this.showingProperties = parseInt(params.p); } else { this.showingProperties = this.itemsPerPage; } }; Criteria.prototype.getParameters = function getParameters(includeMapPosition) { var params = { 'slug': this.location.substring(1) }; if (this.query && this.query.length > 0) { params['q'] = this.query; } if (this.sort && this.sort.length > 0 && this.sort !== this.defaultSort) { params['sort'] = this.sort; } if (includeMapPosition && this.mapPosition && this.mapPosition.length > 0) { params['mpos'] = this.mapPosition; } if (this.showingProperties && this.showingProperties > this.itemsPerPage) { params['p'] = this.showingProperties; } return params; }; Criteria.prototype.rebuildQuery = function rebuildQuery(replace, replaceWith) { var currentQuery = this.query || ''; var alternatives = currentQuery.split(' ').where(function (x) { return x !== ''; }); var result = []; var added = false; for (var _iterator = alternatives, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var alternative = _ref; var parts = alternative.split(':'); if (parts[0] === replace) { if (replaceWith !== '') { result.push(replace + ':' + replaceWith); } added = true; } else { result.push(alternative); } } if (!added) { if (replaceWith !== '') { result.push(replace + ':' + replaceWith); } } return result.where(function (x) { return x !== ''; }).join(' '); }; return Criteria; }(); }); define('searchresult/favorites',['exports', 'src/services/location-service.js', 'src/services/search-service.js', 'aurelia-framework', 'aurelia-router', './criteria', './location-search', '../translations-manager'], function (exports, _locationService, _searchService, _aureliaFramework, _aureliaRouter, _criteria, _locationSearch, _translationsManager) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Favorites = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } var _dec, _dec2, _class, _desc, _value, _class2; var Favorites = exports.Favorites = (_dec = (0, _aureliaFramework.inject)(_locationService.LocationService, _searchService.SearchService, _aureliaRouter.Router, _aureliaFramework.BindingEngine, _translationsManager.TranslationsManager), _dec2 = (0, _aureliaFramework.computedFrom)('locationSearch.criteria.location', 'locationSearch.criteria.query', 'locationSearch.criteria.sort', 'locationSearch.criteria.mapPosition', 'locationSearch.criteria.showingProperties'), _dec(_class = (_class2 = function () { function Favorites(locationService, searchService, router, bindingEngine, translationsManager) { _classCallCheck(this, Favorites); this.translations = {}; this.locationService = locationService; this.searchService = searchService; this.router = router; this.translations = translationsManager.getPropertyListTranslations(); this.locationSearch = new _locationSearch.LocationSearch(new _criteria.Criteria(), 'favorites', searchService, bindingEngine, router); } Favorites.prototype.activate = function activate(params) { this.locationSearch.criteria.setFrom(params); this.locationSearch.init(); }; Favorites.prototype.deactivate = function deactivate() { this.locationSearch.dispose(); }; _createClass(Favorites, [{ key: 'availableTabs', get: function get() { var params = this.locationSearch.criteria.getParameters(true); return [{ 'name': this.translations.list, 'url': this.router.generate('search-result-list', params), 'icon': 'list', active: false }, { 'name': this.translations.map, 'url': this.router.generate('search-result-map', params), 'icon': 'globe', active: false }, { 'name': this.translations.descriptionButton, 'url': this.router.generate('search-result-info', params), 'icon': 'info-sign', active: false }, { 'name': this.translations.feriehusFavorites, 'url': this.router.generate('search-result-favorites', params), 'icon': 'heart', active: true }]; } }]); return Favorites; }(), (_applyDecoratedDescriptor(_class2.prototype, 'availableTabs', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'availableTabs'), _class2.prototype)), _class2)) || _class); }); define('searchresult/info',['exports', 'src/services/location-service.js', 'src/services/search-service.js', 'aurelia-framework', 'aurelia-router', './criteria', './location-search', '../translations-manager'], function (exports, _locationService, _searchService, _aureliaFramework, _aureliaRouter, _criteria, _locationSearch, _translationsManager) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Info = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } var _dec, _dec2, _dec3, _class, _desc, _value, _class2; var Info = exports.Info = (_dec = (0, _aureliaFramework.inject)(_locationService.LocationService, _searchService.SearchService, _aureliaRouter.Router, _aureliaFramework.BindingEngine, _translationsManager.TranslationsManager), _dec2 = (0, _aureliaFramework.computedFrom)('locationSearch.criteria.location', 'locationSearch.criteria.query', 'locationSearch.criteria.sort', 'locationSearch.criteria.mapPosition', 'locationSearch.criteria.showingProperties'), _dec3 = (0, _aureliaFramework.computedFrom)('locationSearch.result'), _dec(_class = (_class2 = function () { function Info(locationService, searchService, router, bindingEngine, translationsManager) { _classCallCheck(this, Info); this.translations = {}; this.locationService = locationService; this.searchService = searchService; this.router = router; this.translations = translationsManager.getPropertyListTranslations(); this.locationSearch = new _locationSearch.LocationSearch(new _criteria.Criteria(), 'info', searchService, bindingEngine, router); } Info.prototype.activate = function activate(params) { this.locationSearch.criteria.setFrom(params); this.locationSearch.init(); }; Info.prototype.deactivate = function deactivate() { this.locationSearch.dispose(); }; _createClass(Info, [{ key: 'availableTabs', get: function get() { var params = this.locationSearch.criteria.getParameters(true); return [{ 'name': this.translations.list, 'url': this.router.generate('search-result-list', params), 'icon': 'list', active: false }, { 'name': this.translations.map, 'url': this.router.generate('search-result-map', params), 'icon': 'globe', active: false }, { 'name': this.translations.descriptionButton, 'url': this.router.generate('search-result-info', params), 'icon': 'info-sign', active: true }, { 'name': this.translations.feriehusFavorites, 'url': this.router.generate('search-result-favorites', params), 'icon': 'heart', active: false }]; } }, { key: 'offersData', get: function get() { if (!this.locationSearch.result.count || !this.locationSearch.result.properties) { return ''; } var ratingTotal = 0; var ratingValue = 0; var worstRating = 0; var bestRating = 0; for (var i = 0; i < this.locationSearch.result.properties.length; i++) { var property = this.locationSearch.result.properties[i]; if (property.rating > 0) { ratingTotal += property.rating; if (property.rating > worstRating) { worstRating = property.rating; } if (property.rating > bestRating) { bestRating = property.rating; } } } ratingValue = Math.round(ratingTotal / this.locationSearch.result.properties.length * 10) / 10; console.log('info.js => ', ratingValue); return JSON.stringify({ '@context': 'http://schema.org', '@type': 'Product', 'aggregateRating': { '@type': 'AggregateRating', 'bestRating': bestRating, 'worstRating': worstRating, 'ratingCount': this.locationSearch.result.count.toString(), 'ratingValue': ratingValue }, 'name': this.locationSearch.result.title, 'offers': { '@type': 'AggregateOffer', 'highPrice': this.locationSearch.result.maxPrice.toString(), 'lowPrice': this.locationSearch.result.minPrice.toString(), 'offerCount': this.locationSearch.result.count.toString(), 'priceCurrency': this.locationSearch.result.currency, 'description': this.locationSearch.result.textDescription.toString(), 'offers': this.locationSearch.result.properties.select(function (x) { return { '@type': 'Offer', 'url': x.url, 'image': x.propertyImage.url }; }) } }); } }]); return Info; }(), (_applyDecoratedDescriptor(_class2.prototype, 'availableTabs', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'availableTabs'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'offersData', [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, 'offersData'), _class2.prototype)), _class2)) || _class); }); define('searchresult/list',['exports', 'src/services/location-service.js', 'src/services/search-service.js', 'aurelia-framework', 'aurelia-router', './criteria', './location-search', '../translations-manager', 'linqjs'], function (exports, _locationService, _searchService, _aureliaFramework, _aureliaRouter, _criteria, _locationSearch, _translationsManager) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.List = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2; var List = exports.List = (_dec = (0, _aureliaFramework.inject)(_locationService.LocationService, _searchService.SearchService, _aureliaRouter.Router, _aureliaFramework.BindingEngine, _translationsManager.TranslationsManager), _dec2 = (0, _aureliaFramework.computedFrom)('locationSearch.result'), _dec3 = (0, _aureliaFramework.computedFrom)('locationSearch.criteria.location', 'locationSearch.criteria.query', 'locationSearch.criteria.sort', 'locationSearch.criteria.mapPosition', 'locationSearch.criteria.showingProperties'), _dec4 = (0, _aureliaFramework.computedFrom)('locationSearch.result.itemsCurrentlyShowing', 'locationSearch.result.count'), _dec(_class = (_class2 = function () { function List(locationService, searchService, router, bindingEngine, translationsManager) { _classCallCheck(this, List); this.translations = {}; this.locationService = locationService; this.searchService = searchService; this.router = router; this.translations = translationsManager.getPropertyListTranslations(); this.locationSearch = new _locationSearch.LocationSearch(new _criteria.Criteria(), 'list', searchService, bindingEngine, router, true); } List.prototype.activate = function activate(params) { this.locationSearch.criteria.setFrom(params); this.locationSearch.init().then(function (x) { var lastProperty = localStorage.getItem('lastProperty'); if (lastProperty && $("#" + localStorage.getItem('lastProperty')).length > 0) { $("html, body").animate({ scrollTop: $("#" + localStorage.getItem('lastProperty')).offset().top }, 1000); } }); }; List.prototype.deactivate = function deactivate() { this.locationSearch.dispose(); }; List.prototype.loadMore = function loadMore() { this.locationSearch.loadMore(); }; _createClass(List, [{ key: 'offersData', get: function get() { if (!this.locationSearch.result.count || !this.locationSearch.result.properties) { return ''; } var ratingTotal = 0; var ratingValue = 0; var worstRating = 0; var bestRating = 0; for (var i = 0; i < this.locationSearch.result.properties.length; i++) { var property = this.locationSearch.result.properties[i]; if (property.rating > 0) { ratingTotal += property.rating; if (property.rating > worstRating) { worstRating = property.rating; } if (property.rating > bestRating) { bestRating = property.rating; } } } ratingValue = Math.round(ratingTotal / this.locationSearch.result.properties.length * 10) / 10; return JSON.stringify({ '@context': 'http://schema.org', '@type': 'Product', 'aggregateRating': { '@type': 'AggregateRating', 'bestRating': bestRating, 'worstRating': worstRating, 'ratingCount': this.locationSearch.result.count.toString(), 'ratingValue': ratingValue }, 'name': this.locationSearch.result.title, 'offers': { '@type': 'AggregateOffer', 'highPrice': this.locationSearch.result.maxPrice.toString(), 'lowPrice': this.locationSearch.result.minPrice.toString(), 'offerCount': this.locationSearch.result.count.toString(), 'priceCurrency': this.locationSearch.result.currency, 'offers': this.locationSearch.result.properties.select(function (x) { return { '@type': 'Offer', 'url': x.url, 'image': x.propertyImage.url }; }) } }); } }, { key: 'availableTabs', get: function get() { var params = this.locationSearch.criteria.getParameters(true); return [{ 'name': this.translations.list, 'url': this.router.generate('search-result-list', params), 'icon': 'list', active: true }, { 'name': this.translations.map, 'url': this.router.generate('search-result-map', params), 'icon': 'globe', active: false }, { 'name': this.translations.descriptionButton, 'url': this.router.generate('search-result-info', params), 'icon': 'info-sign', active: false }, { 'name': this.translations.feriehusFavorites, 'url': this.router.generate('search-result-favorites', params), 'icon': 'heart', active: false }]; } }, { key: 'sortOptions', get: function get() { return [{ 'name': this.translations.priceDesc, 'value': '2' }, { 'name': this.translations.priceAsc, 'value': '3' }, { 'name': this.translations.ratingDesc, 'value': '4' }, { 'name': this.translations.ratingAsc, 'value': '5' }]; } }, { key: 'showingOfTranslation', get: function get() { return this.translations.showingNumberOfHousesFromTotal.replace('{showinghouses}', this.locationSearch.result.itemsCurrentlyShowing).replace('{totalhouses}', this.locationSearch.result.count); } }]); return List; }(), (_applyDecoratedDescriptor(_class2.prototype, 'offersData', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'offersData'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'availableTabs', [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, 'availableTabs'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'showingOfTranslation', [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, 'showingOfTranslation'), _class2.prototype)), _class2)) || _class); }); define('searchresult/location-search',['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var LocationSearch = exports.LocationSearch = function () { function LocationSearch(criteria, view, searchService, bindingEngine, router, usePaging) { _classCallCheck(this, LocationSearch); this.result = {}; this.subscriptions = []; this.isSearching = false; this.isLoadingMore = false; this.viewSubscribers = { 'list': function list(x) { x.addSubscription('location'); x.addSubscription('query', function () { return x.search(); }); x.addSubscription('sort', function () { return x.search(); }); x.addSubscription('itemsPerPage', function () { return x.search(); }); }, 'map': function map(x) { x.addSubscription('location'); x.addSubscription('query', function () { return x.search(); }, true); x.addSubscription('mapPosition', null, true); }, 'info': function info(x) { x.addSubscription('location'); x.addSubscription('query', null, false, 'search-result-list'); }, 'favorites': function favorites(x) { x.addSubscription('location'); x.addSubscription('query', null, false, 'search-result-list'); } }; this.criteria = criteria; this.view = view; this.searchService = searchService; this.bindingEngine = bindingEngine; this.router = router; this.usePaging = usePaging; } LocationSearch.prototype.addSubscription = function addSubscription(property, handle, includeMapPosition, overwriteRoute) { var viewModel = this; var subscription = this.bindingEngine.propertyObserver(this.criteria, property).subscribe(function (x) { var params = viewModel.criteria.getParameters(includeMapPosition); if (params.q && property === 'location') { params.q = params.q.replace('citysearch', '').replace(' ', ' '); } if (property === 'location') { delete params.p; } var route = 'search-result-' + viewModel.view; if (overwriteRoute && overwriteRoute.length > 0) { route = overwriteRoute; } viewModel.router.navigateToRoute(route, params); (handle || function () {})(); }); this.subscriptions.push(subscription); return subscription; }; LocationSearch.prototype.init = function init() { this.viewSubscribers[this.view](this); return this.search(); }; LocationSearch.prototype.search = function search() { var _this = this; var viewModel = this; this.isSearching = true; if (this.criteria.showingProperties > 500) { this.criteria.showingProperties = 500; var params = this.criteria.getParameters(true); this.router.navigateToRoute('search-result-' + this.view, params); } return this.searchService.search(this.criteria.location, this.view, this.criteria.query, this.criteria.sort, 1, this.usePaging ? this.view === 'favorites' ? 200 : this.criteria.showingProperties : this.view === 'favorites' ? 200 : this.criteria.itemsPerPage).then(function (x) { viewModel.isSearching = false; viewModel.result = x.content; _this.router.currentInstruction.config.navModel.setTitle(x.content.pageTitle); DropletJS.PubSub.publish('searchlogic.search.finished.' + viewModel.view.toUpperCase(), { criteria: _this.criteria, result: x.content }); }); }; LocationSearch.prototype.loadMore = function loadMore() { var viewModel = this; this.isLoadingMore = true; var startAt = this.criteria.showingProperties + 1; this.criteria.showingProperties = this.criteria.showingProperties + this.criteria.itemsPerPage; var params = this.criteria.getParameters(true); this.router.navigateToRoute('search-result-' + this.view, params); this.searchService.search(this.criteria.location, this.view, this.criteria.query, this.criteria.sort, startAt, this.criteria.itemsPerPage).then(function (x) { viewModel.result.page = x.content.page; viewModel.result.itemsPerPage = x.content.itemsPerPage; viewModel.result.hasMoreResults = x.content.hasMoreResults; viewModel.result.itemsCurrentlyShowing = x.content.itemsCurrentlyShowing; for (var _iterator = x.content.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var property = _ref; viewModel.result.properties.push(property); } viewModel.isLoadingMore = false; }); }; LocationSearch.prototype.dispose = function dispose() { for (var _iterator2 = this.subscriptions, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var subscription = _ref2; subscription.dispose(); } this.subscriptions = []; }; return LocationSearch; }(); }); define('searchresult/map',['exports', 'src/services/location-service.js', 'src/services/search-service.js', 'src/services/property-service.js', 'aurelia-framework', 'aurelia-router', './criteria', './location-search', '../translations-manager', 'linqjs'], function (exports, _locationService, _searchService, _propertyService, _aureliaFramework, _aureliaRouter, _criteria, _locationSearch, _translationsManager) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Map = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2; var Map = exports.Map = (_dec = (0, _aureliaFramework.inject)(_locationService.LocationService, _searchService.SearchService, _aureliaRouter.Router, _aureliaFramework.BindingEngine, _propertyService.PropertyService, _translationsManager.TranslationsManager), _dec2 = (0, _aureliaFramework.computedFrom)('activeProperty'), _dec3 = (0, _aureliaFramework.computedFrom)('locationSearch.result'), _dec4 = (0, _aureliaFramework.computedFrom)('locationSearch.criteria.location', 'locationSearch.criteria.query', 'locationSearch.criteria.sort', 'locationSearch.criteria.mapPosition', 'locationSearch.criteria.showingProperties'), _dec(_class = (_class2 = function () { function Map(locationService, searchService, router, bindingEngine, propertyService, translationsManager) { _classCallCheck(this, Map); this.translations = {}; this.activeProperty = null; this.selectedProperties = []; this.locationService = locationService; this.searchService = searchService; this.router = router; this.bindingEngine = bindingEngine; this.propertyService = propertyService; this.translations = translationsManager.getPropertyListTranslations(); this.locationSearch = new _locationSearch.LocationSearch(new _criteria.Criteria(), 'map', searchService, bindingEngine, router); } Map.prototype.activate = function activate(params) { this.locationSearch.criteria.setFrom(params); this.locationSearch.init(); }; Map.prototype.deactivate = function deactivate() { this.locationSearch.dispose(); }; Map.prototype.activateProperty = function activateProperty(index) { this.activeProperty = this.selectedProperties[index]; }; Map.prototype.showInfoWindow = function showInfoWindow(marker, map, infoWindow) { var _this = this; this.propertyService.getByIds(marker.properties, this.locationSearch.criteria.query).then(function (x) { _this.selectedProperties = x.properties; _this.activeProperty = x.properties.first(); if ($(window).width() > 750) { infoWindow.open(map, marker); } }); }; _createClass(Map, [{ key: 'activePropertyIndex', get: function get() { return this.selectedProperties.indexOf(this.activeProperty); } }, { key: 'markers', get: function get() { var _this2 = this; var result = this.locationSearch.result; if (!result || !result.properties) { return []; } var markers = []; for (var _iterator = result.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var property = _ref; markers.push({ 'id': property.id, 'latitude': property.latitude, 'longitude': property.longitude, 'onclick': function onclick(marker, map, infoWindow) { _this2.showInfoWindow(marker, map, infoWindow); } }); } return markers; } }, { key: 'availableTabs', get: function get() { var params = this.locationSearch.criteria.getParameters(true); return [{ 'name': this.translations.list, 'url': this.router.generate('search-result-list', params), 'icon': 'list', active: false }, { 'name': this.translations.map, 'url': this.router.generate('search-result-map', params), 'icon': 'globe', active: true }, { 'name': this.translations.descriptionButton, 'url': this.router.generate('search-result-info', params), 'icon': 'info-sign', active: false }, { 'name': this.translations.feriehusFavorites, 'url': this.router.generate('search-result-favorites', params), 'icon': 'heart', active: false }]; } }]); return Map; }(), (_applyDecoratedDescriptor(_class2.prototype, 'activePropertyIndex', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'activePropertyIndex'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'markers', [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, 'markers'), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, 'availableTabs', [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, 'availableTabs'), _class2.prototype)), _class2)) || _class); }); define('src/services/booking-service.js',['exports', 'aurelia-http-client', 'aurelia-framework'], function (exports, _aureliaHttpClient, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.BookingService = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _dec, _class; var BookingService = exports.BookingService = (_dec = (0, _aureliaFramework.inject)(_aureliaHttpClient.HttpClient), _dec(_class = function () { function BookingService(httpClient) { _classCallCheck(this, BookingService); this.httpClient = httpClient; } BookingService.prototype.getBooking = function getBooking(id, numberOfPersons, length, arrival) { var _this = this; return new Promise(function (resolve, reject) { _this.httpClient.get('/propertybooking/details/' + id + '?numberOfPersons=' + numberOfPersons + '&length=' + length + '&arrivalDate=' + arrival).then(function (x) { resolve(x.content); }); }); }; BookingService.prototype.updateAddons = function updateAddons(id, numberOfAdults, numberOfChildren, numberOfInfants, numberOfPets, length, arrival) { var _this2 = this; return new Promise(function (resolve, reject) { _this2.httpClient.get('/propertybooking/updateaddons/' + id + '?numberOfAdults=' + numberOfAdults + '&numberOfChildren=' + numberOfChildren + '&numberOfInfants=' + numberOfInfants + '&numberOfPets=' + numberOfPets + '&length=' + length + '&arrivalDate=' + arrival).then(function (x) { resolve(x.content); }); }); }; BookingService.prototype.getBookingProperty = function getBookingProperty(id, numberOfPersons, length, arrival) { var _this3 = this; return new Promise(function (resolve, reject) { _this3.httpClient.get('/booking/getbookingproperty?propertyId=' + id + '&arrivalDate=' + arrival + '&numberOfPersons=' + numberOfPersons + '&length=' + length).then(function (x) { resolve(x.content); }); }); }; BookingService.prototype.book = function book(id, customer, visitors, addons, length, arrival) { return this.httpClient.post('/propertybooking/book/' + id, { 'customer': customer, 'visitors': visitors, 'addons': addons, 'arrivalDate': arrival, 'length': length }).then(function (x) { return x.content; }); }; BookingService.prototype.newsletterSubscribe = function newsletterSubscribe(email, firstName, lastName) { return this.httpClient.post('/MailChimpSubscribe/subscribe?email=' + email + '&firstName=' + firstName + '&lastName=' + lastName); }; return BookingService; }()) || _class); }); define('services/cache',["exports"], function (exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Cache = exports.Cache = function () { function Cache() { _classCallCheck(this, Cache); this._state = {}; } Cache.prototype.getItem = function getItem(key) { return this._state[key]; }; Cache.prototype.setItem = function setItem(key, value) { this._state[key] = value; }; Cache.prototype.removeItem = function removeItem(key) { delete this._state[key]; }; return Cache; }(); }); define('src/services/location-service.js',['exports', 'aurelia-http-client', 'aurelia-framework', 'services/cache'], function (exports, _aureliaHttpClient, _aureliaFramework, _cache) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocationService = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _dec, _class; var LocationService = exports.LocationService = (_dec = (0, _aureliaFramework.inject)(_aureliaHttpClient.HttpClient, _cache.Cache), _dec(_class = function () { function LocationService(httpClient, cache) { _classCallCheck(this, LocationService); this.httpClient = httpClient; this.cache = cache; } LocationService.prototype.getLocation = function getLocation(slug) { var service = this; var key = 'location-' + slug; var location = this.cache.getItem(key); if (location) { return new Promise(function (x) { return x(location); }); } return this.httpClient.get('/location/get?slug=' + slug).then(function (x) { return x.content; }).then(function (x) { service.cache.setItem(key, x); return x; }); }; LocationService.prototype.getLocationTree = function getLocationTree(slug) { var service = this; var key = 'location-tree-' + slug; var result = this.cache.getItem(key); if (result) { return new Promise(function (x) { return x(result); }); } return this.httpClient.get('/location/locationtree?slug=' + slug).then(function (x) { return x.content; }).then(function (x) { service.cache.setItem(key, x); return x; });; }; return LocationService; }()) || _class); }); define('src/services/property-service.js',['exports', 'aurelia-http-client', 'aurelia-framework'], function (exports, _aureliaHttpClient, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertyService = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _dec, _class; var PropertyService = exports.PropertyService = (_dec = (0, _aureliaFramework.inject)(_aureliaHttpClient.HttpClient), _dec(_class = function () { function PropertyService(httpClient) { _classCallCheck(this, PropertyService); this.httpClient = httpClient; } PropertyService.prototype.getByIds = function getByIds(ids, query) { query = query || ''; return this.httpClient.get('/property/byids?ids=' + ids.join(',') + '&q=' + query).then(function (x) { return x.content; }); }; PropertyService.prototype.getHistory = function getHistory() { return this.httpClient.get('/propertylist/history').then(function (x) { return x.content; }); }; return PropertyService; }()) || _class); }); define('src/services/search-service.js',['exports', 'aurelia-http-client', 'aurelia-framework', 'services/cache'], function (exports, _aureliaHttpClient, _aureliaFramework, _cache) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.SearchService = undefined; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _dec, _class; var SearchService = exports.SearchService = (_dec = (0, _aureliaFramework.inject)(_aureliaHttpClient.HttpClient, _cache.Cache), _dec(_class = function () { function SearchService(httpClient, cache) { _classCallCheck(this, SearchService); this.httpClient = httpClient; this.cache = cache; } SearchService.prototype.search = function search(location, view, query, sort, startAt, numberOfItems) { query = query || ''; sort = sort || ''; return this.httpClient.get('/search/location?location=' + location + '&view=' + view + '&q=' + query + '&sort=' + sort + '&startAt=' + startAt + '&numberOfItems=' + numberOfItems); }; SearchService.prototype.getTranslations = function getTranslations() { return this.httpClient.get('/propertylist/translations'); }; SearchService.prototype.getSearchWidgetsInformation = function getSearchWidgetsInformation() { var service = this; var key = 'filter-widgets-information'; var result = this.cache.getItem(key); if (result) { return new Promise(function (x) { return x(result); }); } return this.httpClient.get('/filterwidget/information').then(function (x) { return x.content; }).then(function (x) { service.cache.setItem(key, x); return x; }); }; return SearchService; }()) || _class); }); define('widgets/location-breadcrumbs',['exports', 'aurelia-framework', 'aurelia-router'], function (exports, _aureliaFramework, _aureliaRouter) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocationBreadcrumbs = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4; var LocationBreadcrumbs = exports.LocationBreadcrumbs = (_dec = (0, _aureliaFramework.inject)(_aureliaRouter.Router, _aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function LocationBreadcrumbs(router, bindingEngine) { _classCallCheck(this, LocationBreadcrumbs); _initDefineProp(this, 'currentLocation', _descriptor, this); _initDefineProp(this, 'routeName', _descriptor2, this); _initDefineProp(this, 'searchCriteria', _descriptor3, this); _initDefineProp(this, 'translations', _descriptor4, this); this.breadCrumbs = []; this.subscriptions = []; this.router = router; this.bindingEngine = bindingEngine; } LocationBreadcrumbs.prototype.bind = function bind() { this.setupBreadCrumbs(); var viewModel = this; this.subscriptions.push(this.bindingEngine.propertyObserver(this, 'currentLocation').subscribe(function (x) { viewModel.setupBreadCrumbs(); })); this.subscriptions.push(this.bindingEngine.propertyObserver(this, 'routeName').subscribe(function (x) { viewModel.setupBreadCrumbs(); })); this.subscriptions.push(this.bindingEngine.propertyObserver(this.searchCriteria, 'query').subscribe(function (x) { viewModel.setupBreadCrumbs(); })); }; LocationBreadcrumbs.prototype.unbind = function unbind() { for (var _iterator = this.subscriptions, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var subscription = _ref; subscription.dispose(); } this.subscriptions = []; }; LocationBreadcrumbs.prototype.setupBreadCrumbs = function setupBreadCrumbs() { var breadCrumbs = []; var location = this.currentLocation; if (!location) { return; } var first = true; while (location) { if (location.hidden !== true || first) { var params = {}; params.q = (this.searchCriteria.query || '').replace('citysearch', '').replace(' ', ' '); params.slug = location.slug.substring(1); if (params.q.length < 1) { delete params.q; } breadCrumbs.push({ name: location.name, url: this.router.generate(this.routeName, params), classes: 'client-link' }); } location = location.parentLocation; first = false; } breadCrumbs.push({ name: this.translations.startPageLinkText, url: '/' }); breadCrumbs.reverse(); var position = 1; for (var _iterator2 = breadCrumbs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var breadCrumb = _ref2; breadCrumb.position = position; position++; } this.breadCrumbs = breadCrumbs; }; _createClass(LocationBreadcrumbs, [{ key: 'breadcrumbsData', get: function get() { return JSON.stringify({ '@context': 'http://schema.org', '@type': 'BreadcrumbList', 'itemListElement': this.breadCrumbs.select(function (x) { return { '@type': 'ListItem', 'position': x.position, 'item': { '@id': x.url, 'name': x.name } }; }) }); } }]); return LocationBreadcrumbs; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'currentLocation', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'routeName', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'searchCriteria', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: null })), _class2)) || _class); }); define('widgets/navigation-tabs',['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.NavigationTabs = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _desc, _value, _class, _descriptor; var NavigationTabs = exports.NavigationTabs = (_class = function NavigationTabs() { _classCallCheck(this, NavigationTabs); _initDefineProp(this, 'availableTabs', _descriptor, this); }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'availableTabs', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return []; } })), _class); }); define('widgets/property-history',['exports', 'aurelia-framework', 'src/services/property-service.js'], function (exports, _aureliaFramework, _propertyService) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertyHistory = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor; var PropertyHistory = exports.PropertyHistory = (_dec = (0, _aureliaFramework.inject)(_propertyService.PropertyService), _dec(_class = (_class2 = function () { function PropertyHistory(propertyService) { _classCallCheck(this, PropertyHistory); _initDefineProp(this, 'translations', _descriptor, this); this.houses = []; this.propertyService = propertyService; } PropertyHistory.prototype.bind = function bind() { var viewModel = this; this.propertyService.getHistory().then(function (x) { viewModel.houses = x; }); }; return PropertyHistory; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } })), _class2)) || _class); }); define('resources/elements/bootstrap-select',['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.BootstrapSelect = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3; var BootstrapSelect = exports.BootstrapSelect = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function BootstrapSelect(bindingEngine) { _classCallCheck(this, BootstrapSelect); _initDefineProp(this, 'options', _descriptor, this); _initDefineProp(this, 'style', _descriptor2, this); _initDefineProp(this, 'value', _descriptor3, this); this.bindingEngine = bindingEngine; } BootstrapSelect.prototype.attached = function attached() { var viewModel = this; $(this.selectElement).selectpicker({ style: this.style }); $(this.selectElement).selectpicker('val', this.value); this.bindingEngine.propertyObserver(this, 'value').subscribe(function (x) { $(viewModel.selectElement).selectpicker('val', x); }); $(this.selectElement).next('.bootstrap-select').find('ul.dropdown-menu').on('click', 'li', function (e) { var selectionOptionIndex = Number($(e.currentTarget).attr('rel')) + 1; var selectionOption = $(viewModel.selectElement).find("option:nth-child(" + selectionOptionIndex + ")").val(); $(e.currentTarget).parents('.bootstrap-select').removeClass('open'); viewModel.value = selectionOption; }); }; return BootstrapSelect; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'options', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return []; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'style', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return 'btn-primary'; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'value', [_aureliaFramework.bindable], { enumerable: true, initializer: null })), _class2)) || _class); }); define('resources/elements/google-map',['exports', 'aurelia-framework', '../google-maps-controller', 'https://maps.googleapis.com/maps/api/js?libraries=geometry&key=AIzaSyC_isB7LepAneKroj-pSDSj6vnRCrtumw0', 'linqjs'], function (exports, _aureliaFramework, _googleMapsController) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.GoogleMap = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5; var GoogleMap = exports.GoogleMap = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine, _googleMapsController.GoogleMapsController), _dec2 = (0, _aureliaFramework.computedFrom)('mapPos'), _dec(_class = (_class2 = function () { function GoogleMap(bindingEngine, googleMapsController) { _classCallCheck(this, GoogleMap); _initDefineProp(this, 'infoContent', _descriptor, this); _initDefineProp(this, 'markers', _descriptor2, this); _initDefineProp(this, 'location', _descriptor3, this); _initDefineProp(this, 'translations', _descriptor4, this); _initDefineProp(this, 'mapPos', _descriptor5, this); this.mapOptions = { zoom: 10, disableDefaultUI: true, zoomControl: true, maxZoom: 19, mapTypeId: google.maps.MapTypeId.ROADMAP }; this.defaultMarkerIcon = '/Content/images/pinkMarker.png'; this.greyMarkerIcon = '/Content/images/greyMarker.png'; this.subscriptions = []; this.bindingEngine = bindingEngine; this.googleMapsController = googleMapsController; } GoogleMap.prototype.attached = function attached() { var _this = this; this.bindingEngine.propertyObserver(this, 'markers').subscribe(function (x) { _this.bindMarkers(x); }); this.bindingEngine.propertyObserver(this, 'location').subscribe(function (x) { _this.bindMarkers(_this.markers); }); }; GoogleMap.prototype.detached = function detached() { this.googleMapsController.dispose(); for (var _iterator = this.subscriptions, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var subscription = _ref; subscription.dispose(); } this.subscriptions = []; }; GoogleMap.prototype.initMap = function initMap() { var _this2 = this; if (this.map) { return; } this.map = this.googleMapsController.init(this.mapContainer, this.mapOptions, this.mapPosition, function (x) { _this2.mapPos = x; }); this.infoWindow = new google.maps.InfoWindow({ content: this.infoContent }); this.subscriptions.push(this.bindingEngine.propertyObserver(this, 'location').subscribe(function (x) { _this2.googleMapsController.setMapLocation(x); })); }; GoogleMap.prototype.bindMarkers = function bindMarkers(markers) { var _this3 = this; if (this.markerClusterer) { this.markerClusterer.clearMarkers(); } if (markers.length < 1) { return; } this.initMap(); var currentMapMarkers = []; var markersAtLocation = {}; for (var _iterator2 = markers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var locationMarker = _ref2; var key = locationMarker.latitude + "-" + locationMarker.longitude; if (!markersAtLocation[key]) { markersAtLocation[key] = []; } markersAtLocation[key].push(locationMarker.id); } var activeLocation = this.getPolygon(this.location); for (var _iterator3 = markers, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var marker = _ref3; if (marker.latitude == 0 || marker.longitude == 0) { continue; } var key = marker.latitude + "-" + marker.longitude; var longlat = new google.maps.LatLng(marker.latitude, marker.longitude); var mapMarker = new google.maps.Marker({ position: longlat, lng: marker.longitude, lat: marker.latitude, properties: markersAtLocation[key], onclick: marker.onclick }); this.setMarkerIcon(mapMarker, activeLocation); this.addMarkerClickEvent(mapMarker); currentMapMarkers.push(mapMarker); } this.markerClusterer = new MarkerClusterer(this.map, currentMapMarkers, { minimumClusterSize: 3, maxZoom: 17, activeLocation: activeLocation, imagePath: "/Content/images/markercluster/" }); if (this.mapPosition) { this.googleMapsController.updatePosition(this.mapPosition); var targetMarker = currentMapMarkers.first(function (x) { return x.lat == _this3.mapPosition.lat && x.lng == _this3.mapPosition.lng; }); if (targetMarker) { targetMarker.onclick(targetMarker, this.map, this.infoWindow); } } }; GoogleMap.prototype.addMarkerClickEvent = function addMarkerClickEvent(mapMarker) { var _this4 = this; google.maps.event.addListener(mapMarker, 'click', function () { _this4.mapPos = mapMarker.lat + '_' + mapMarker.lng + '_' + _this4.map.getZoom(); mapMarker.onclick(mapMarker, _this4.map, _this4.infoWindow); }); }; GoogleMap.prototype.getPolygon = function getPolygon(location) { if (!location) { return null; } if (location.polygon == null) { if (location.parentLocation) { return this.getPolygon(location.parentLocation); } return null; } var polygonCoords = []; for (var _iterator4 = location.polygon, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var item = _ref4; var polygonCoord = new google.maps.LatLng(item.latitude, item.longitude); polygonCoords.push(polygonCoord); } return new google.maps.Polygon({ paths: polygonCoords, strokeColor: '#FF0000', strokeWeight: 0, fillColor: '#FF0000', fillOpacity: 0 }); }; GoogleMap.prototype.setMarkerIcon = function setMarkerIcon(marker, activeLocation) { if (activeLocation === null) { marker.setIcon(this.defaultMarkerIcon); return; } var latLng = new google.maps.LatLng(marker.lat, marker.lng); if (google.maps.geometry.poly.containsLocation(latLng, activeLocation)) { marker.setIcon(this.defaultMarkerIcon); } else { marker.setIcon(this.greyMarkerIcon); } }; _createClass(GoogleMap, [{ key: 'mapPosition', get: function get() { var parts = (this.mapPos || '').split('_'); if (parts.length < 3) { return null; } return { lat: parts[0], lng: parts[1], zoom: parseInt(parts[2], 10) }; } }]); return GoogleMap; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'infoContent', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return null; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'markers', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return []; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'location', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'mapPos', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _applyDecoratedDescriptor(_class2.prototype, 'mapPosition', [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, 'mapPosition'), _class2.prototype)), _class2)) || _class); }); define('resources/elements/range-slider',['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.RangeSlider = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6; var RangeSlider = exports.RangeSlider = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function RangeSlider(bindingEngine) { _classCallCheck(this, RangeSlider); _initDefineProp(this, 'min', _descriptor, this); _initDefineProp(this, 'max', _descriptor2, this); _initDefineProp(this, 'step', _descriptor3, this); _initDefineProp(this, 'from', _descriptor4, this); _initDefineProp(this, 'to', _descriptor5, this); _initDefineProp(this, 'disabled', _descriptor6, this); this.bindingEngine = bindingEngine; } RangeSlider.prototype.attached = function attached() { var range = { 'min': this.min, 'max': this.max }; $(this.sliderElement).noUiSlider({ start: [parseInt(this.from, 10), parseInt(this.to, 10)], range: range, step: this.step, serialization: { format: { decimals: 0, to: function to(value) { return parseFloat(value); } } } }); var viewModel = this; $(this.sliderElement).on('slide', function () { var selectedValue = $(this).val(); viewModel.inputFrom = selectedValue[0]; viewModel.inputTo = selectedValue[1]; }); $(this.sliderElement).on('set', function () { var selectedValue = $(this).val(); if (selectedValue[0] == viewModel.min) { viewModel.from = ''; } else { viewModel.from = selectedValue[0]; } if (selectedValue[1] == viewModel.max) { viewModel.to = ''; } else { viewModel.to = selectedValue[1]; } }); this.inputFrom = this.from; this.inputTo = this.to; }; return RangeSlider; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'min', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'max', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'step', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return 1; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'from', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'to', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'disabled', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('resources/elements/slider',['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Slider = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6; var Slider = exports.Slider = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function Slider(bindingEngine) { _classCallCheck(this, Slider); _initDefineProp(this, 'min', _descriptor, this); _initDefineProp(this, 'max', _descriptor2, this); _initDefineProp(this, 'step', _descriptor3, this); _initDefineProp(this, 'value', _descriptor4, this); _initDefineProp(this, 'breakpoint', _descriptor5, this); _initDefineProp(this, 'disabled', _descriptor6, this); this.bindingEngine = bindingEngine; } Slider.prototype.attached = function attached() { var currenValue = this.value ? parseFloat(this.value) : this.max; var range = { 'min': [this.min] }; if (this.breakpoint) { range[this.breakpoint.percentage] = [this.breakpoint.numeric, this.breakpoint.step]; } range['max'] = [this.max]; var options = { 'start': currenValue, 'range': range, 'step': this.step, 'serialization': { 'format': { 'decimals': 0, 'to': function to(x) { return parseFloat(x); } } } }; if (this.breakpoint) { options.step = this.breakpoint.initialStep; options.serialization.format.decimals = this.breakpoint.decimals; } $(this.sliderElement).noUiSlider(options); var viewModel = this; this.inputValue = currenValue; $(this.sliderElement).on('slide', function () { var selectedValue = $(this).val(); viewModel.inputValue = selectedValue; }); $(this.sliderElement).on('set', function () { var selectedValue = $(this).val(); if (selectedValue == viewModel.min || selectedValue == viewModel.max) { viewModel.value = ''; } else { viewModel.value = selectedValue; } }); }; return Slider; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'min', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'max', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'step', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return 1; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'value', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'breakpoint', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'disabled', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('searchresult/widgets/facilities-search',['exports', 'aurelia-framework', 'linqjs'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.FacilitiesSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6; var FacilitiesSearch = exports.FacilitiesSearch = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function FacilitiesSearch(bindingEngine) { _classCallCheck(this, FacilitiesSearch); _initDefineProp(this, 'search', _descriptor, this); _initDefineProp(this, 'translations', _descriptor2, this); _initDefineProp(this, 'availableFacilities', _descriptor3, this); _initDefineProp(this, 'extraStyles', _descriptor4, this); _initDefineProp(this, 'isSearching', _descriptor5, this); _initDefineProp(this, 'menuName', _descriptor6, this); this.selectedFacilities = []; this.id = guid(); this.bindingEngine = bindingEngine; } FacilitiesSearch.prototype.bind = function bind() { var viewModel = this; this.selectedFacilities = this.search.split(',').where(function (x) { return x !== ''; }); this.subscription = this.bindingEngine.collectionObserver(this.selectedFacilities).subscribe(function (x) { viewModel.search = viewModel.selectedFacilities.orderBy(function (y) { return y; }).join(','); }); }; FacilitiesSearch.prototype.unbind = function unbind() { if (this.subscription) { this.subscription.dispose(); } }; return FacilitiesSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'search', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'availableFacilities', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return []; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'menuName', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } })), _class2)) || _class); }); define('searchresult/widgets/location-search',['exports', 'aurelia-framework', 'src/services/location-service.js', 'aurelia-router'], function (exports, _aureliaFramework, _locationService, _aureliaRouter) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.LocationSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4; var LocationSearch = exports.LocationSearch = (_dec = (0, _aureliaFramework.inject)(_locationService.LocationService, _aureliaRouter.Router, _aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function LocationSearch(locationService, router, bindingEngine) { _classCallCheck(this, LocationSearch); _initDefineProp(this, 'translations', _descriptor, this); _initDefineProp(this, 'currentLocation', _descriptor2, this); _initDefineProp(this, 'extraStyles', _descriptor3, this); _initDefineProp(this, 'isSearching', _descriptor4, this); this.levels = []; this.subscriptions = []; this.id = guid(); this.locationService = locationService; this.router = router; this.bindingEngine = bindingEngine; } LocationSearch.prototype.bind = function bind() { var _this = this; var viewModel = this; this.locationService.getLocationTree(this.currentLocation).then(function (x) { viewModel.levels = x; for (var _iterator = viewModel.levels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var level = _ref; _this.addLevelSubscription(level); } }); this.subscriptions.push(this.bindingEngine.propertyObserver(this, 'currentLocation').subscribe(function (y, z) { _this.unbind(); _this.bind(); })); }; LocationSearch.prototype.addLevelSubscription = function addLevelSubscription(level) { var _this2 = this; this.subscriptions.push(this.bindingEngine.propertyObserver(level, 'selected').subscribe(function (y, z) { if (y && y !== '') { _this2.currentLocation = y; return; } _this2.handleLocationChange(); })); }; LocationSearch.prototype.unbind = function unbind() { for (var _iterator2 = this.subscriptions, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var subscription = _ref2; subscription.dispose(); } this.subscriptions = []; }; LocationSearch.prototype.handleLocationChange = function handleLocationChange() { var topSelection = ''; for (var _iterator3 = this.levels, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var level = _ref3; if (level.selected === '') { break; } topSelection = level.selected; } if (topSelection && topSelection !== '') { this.currentLocation = topSelection; } }; LocationSearch.prototype.getLocationLabel = function getLocationLabel(level) { return this.translations['level' + level + 'LocationName']; }; return LocationSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'currentLocation', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('searchresult/widgets/price-range-search',['exports', 'aurelia-framework', 'linqjs'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PriceRangeSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4; var PriceRangeSearch = exports.PriceRangeSearch = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function PriceRangeSearch(bindingEngine) { _classCallCheck(this, PriceRangeSearch); _initDefineProp(this, 'translations', _descriptor, this); _initDefineProp(this, 'search', _descriptor2, this); _initDefineProp(this, 'extraStyles', _descriptor3, this); _initDefineProp(this, 'isSearching', _descriptor4, this); this.from = ''; this.to = ''; this.min = 0; this.max = 0; this.id = guid(); this.bindingEngine = bindingEngine; } PriceRangeSearch.prototype.bind = function bind() { var viewModel = this; this.min = 1; this.max = 100000; var parts = this.search.split('-').where(function (x) { return x !== ''; }); this.from = this.min; this.to = this.max; if (parts.length > 0) { this.from = parts[0] || this.from; } if (parts.length > 1) { this.to = parts[1] || this.to; } if (this.search.indexOf('-') === 0 && parts.length > 0) { this.from = this.min; this.to = parts[0]; } this.subscription = this.bindingEngine.propertyObserver(this, 'from').subscribe(function (x) { if (viewModel.from == '' && viewModel.to == '') { viewModel.search = ''; } else { viewModel.search = viewModel.from + '-' + viewModel.to; } }); this.subscription = this.bindingEngine.propertyObserver(this, 'to').subscribe(function (x) { if (viewModel.from == '' && viewModel.to == '') { viewModel.search = ''; } else { viewModel.search = viewModel.from + '-' + viewModel.to; } }); }; PriceRangeSearch.prototype.unbind = function unbind() { if (this.subscription) { this.subscription.dispose(); } }; return PriceRangeSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'search', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('searchresult/widgets/property-type-search',['exports', 'aurelia-framework', 'linqjs'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertyTypeSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6; var PropertyTypeSearch = exports.PropertyTypeSearch = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function PropertyTypeSearch(bindingEngine) { _classCallCheck(this, PropertyTypeSearch); _initDefineProp(this, 'search', _descriptor, this); _initDefineProp(this, 'translations', _descriptor2, this); _initDefineProp(this, 'availablePropertyTypes', _descriptor3, this); _initDefineProp(this, 'extraStyles', _descriptor4, this); _initDefineProp(this, 'isSearching', _descriptor5, this); _initDefineProp(this, 'menuName', _descriptor6, this); this.id = guid(); this.selectedPropertyTypes = []; this.bindingEngine = bindingEngine; } PropertyTypeSearch.prototype.bind = function bind() { var viewModel = this; this.selectedPropertyTypes = this.search.split(',').where(function (x) { return x !== ''; }); this.subscription = this.bindingEngine.collectionObserver(this.selectedPropertyTypes).subscribe(function (x) { viewModel.search = viewModel.selectedPropertyTypes.orderBy(function (y) { return y; }).join(','); }); }; PropertyTypeSearch.prototype.unbind = function unbind() { if (this.subscription) { this.subscription.dispose(); } }; return PropertyTypeSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'search', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'availablePropertyTypes', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return []; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'menuName', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } })), _class2)) || _class); }); define('searchresult/widgets/range-search',['exports', 'aurelia-framework', 'linqjs'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.RangeSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4; var RangeSearch = exports.RangeSearch = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function RangeSearch(bindingEngine) { _classCallCheck(this, RangeSearch); _initDefineProp(this, 'search', _descriptor, this); _initDefineProp(this, 'facility', _descriptor2, this); _initDefineProp(this, 'extraStyles', _descriptor3, this); _initDefineProp(this, 'isSearching', _descriptor4, this); this.value = ''; this.from = ''; this.to = ''; this.id = guid(); this.bindingEngine = bindingEngine; } RangeSearch.prototype.bind = function bind() { var viewModel = this; this.value = this.search || this.facility.maxPrice; this.from = this.facility.minPrice || 0; this.to = this.facility.maxPrice; var parts = this.search.split('-'); if (parts.length > 0) { this.from = parts[0] || this.from; } if (parts.length > 1) { this.to = parts[1] || this.to; } this.subscription = this.bindingEngine.propertyObserver(this, 'value').subscribe(function (x) { viewModel.search = x; }); this.subscription = this.bindingEngine.propertyObserver(this, 'from').subscribe(function (x) { if (viewModel.from == '' && viewModel.to == '') { viewModel.search = ''; } else { viewModel.search = viewModel.from + '-' + viewModel.to; } }); this.subscription = this.bindingEngine.propertyObserver(this, 'to').subscribe(function (x) { if (viewModel.from == '' && viewModel.to == '') { viewModel.search = ''; } else { viewModel.search = viewModel.from + '-' + viewModel.to; } }); }; RangeSearch.prototype.unbind = function unbind() { if (this.subscription) { this.subscription.dispose(); } }; return RangeSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'search', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'facility', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('searchresult/widgets/rating-search',['exports', 'aurelia-framework', 'linqjs'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.RatingSearch = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5; var RatingSearch = exports.RatingSearch = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine), _dec(_class = (_class2 = function () { function RatingSearch(bindingEngine) { _classCallCheck(this, RatingSearch); _initDefineProp(this, 'translations', _descriptor, this); _initDefineProp(this, 'search', _descriptor2, this); _initDefineProp(this, 'extraStyles', _descriptor3, this); _initDefineProp(this, 'isSearching', _descriptor4, this); _initDefineProp(this, 'menuName', _descriptor5, this); this.selectedRatings = []; this.id = guid(); this.bindingEngine = bindingEngine; } RatingSearch.prototype.bind = function bind() { var viewModel = this; this.selectedRatings = this.search.split(',').where(function (x) { return x !== ''; }); this.subscription = this.bindingEngine.collectionObserver(this.selectedRatings).subscribe(function (x) { viewModel.search = viewModel.selectedRatings.orderBy(function (y) { return y; }).join(','); }); }; RatingSearch.prototype.unbind = function unbind() { if (this.subscription) { this.subscription.dispose(); } }; return RatingSearch; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'search', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'extraStyles', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'menuName', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return ''; } })), _class2)) || _class); }); define('searchresult/widgets/search-criteria',['exports', 'aurelia-framework', 'src/services/search-service.js', 'linqjs'], function (exports, _aureliaFramework, _searchService) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.SearchCriteria = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _dec, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4; var SearchCriteria = exports.SearchCriteria = (_dec = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine, _searchService.SearchService), _dec(_class = (_class2 = function () { function SearchCriteria(bindingEngine, searchService) { _classCallCheck(this, SearchCriteria); _initDefineProp(this, 'criteria', _descriptor, this); _initDefineProp(this, 'translations', _descriptor2, this); _initDefineProp(this, 'isSearching', _descriptor3, this); _initDefineProp(this, 'onlyMobile', _descriptor4, this); this.gettingOptions = true; this.searchAlternatives = { 'rating': '', 'propertyType': '', 'facilities': '', 'price': '' }; this.widgetsSettings = {}; this.subscriptions = []; this.rangeSearches = []; this.bindingEngine = bindingEngine; this.searchService = searchService; } SearchCriteria.prototype.bind = function bind() { var _this = this; this.gettingOptions = true; this.subscribeSearch('rating'); this.subscribeSearch('propertyType'); this.subscribeSearch('facilities'); this.subscribeSearch('price'); var viewModel = this; this.searchService.getSearchWidgetsInformation().then(function (x) { viewModel.widgetsSettings = x; for (var _iterator = x.facilities.where(function (y) { return y.isNumeric; }), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var facility = _ref; viewModel.addRangeSearch(facility); } _this.gettingOptions = false; }); }; SearchCriteria.prototype.unbind = function unbind() { for (var _iterator2 = this.subscriptions, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var subscription = _ref2; subscription.dispose(); } }; SearchCriteria.prototype.addRangeSearch = function addRangeSearch(facility) { var name = 'facility-' + facility.id; this.rangeSearches.push(facility); this.searchAlternatives[name] = ''; this.subscribeSearch(name); }; SearchCriteria.prototype.subscribeSearch = function subscribeSearch(name) { var viewModel = this; this.searchAlternatives[name] = this.criteria.getSearchFor(name); var subscription = this.bindingEngine.propertyObserver(this.searchAlternatives, name).subscribe(function (x) { viewModel.criteria.query = viewModel.criteria.rebuildQuery(name, x); }); this.subscriptions.push(subscription); }; _createClass(SearchCriteria, [{ key: 'availableFacilities', get: function get() { return (this.widgetsSettings.facilities || []).where(function (x) { return !x.isNumeric; }); } }]); return SearchCriteria; }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'criteria', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'isSearching', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'onlyMobile', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return false; } })), _class2)) || _class); }); define('searchresult/widgets/search-loader',['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.SearchLoader = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _desc, _value, _class, _descriptor; var SearchLoader = exports.SearchLoader = (_class = function () { function SearchLoader() { _classCallCheck(this, SearchLoader); _initDefineProp(this, 'translations', _descriptor, this); } SearchLoader.prototype.attached = function attached() { $(this.loader).sticky(); }; return SearchLoader; }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } })), _class); }); define('searchresult/widgets/search-result',['exports', 'aurelia-framework', 'aurelia-cookie', 'linqjs'], function (exports, _aureliaFramework, _aureliaCookie) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.SearchResult = undefined; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } var _desc, _value, _class, _descriptor, _descriptor2; var SearchResult = exports.SearchResult = (_class = function () { function SearchResult() { _classCallCheck(this, SearchResult); _initDefineProp(this, 'result', _descriptor, this); _initDefineProp(this, 'translations', _descriptor2, this); } SearchResult.prototype.isPrivateProvider = function isPrivateProvider(property) { return property.provider.id === 9 && property.brand === '1'; }; SearchResult.prototype.showWeekPrice = function showWeekPrice(property) { return this.result.searchedSpecificDate; }; SearchResult.prototype.toggleFavorite = function toggleFavorite(property) { if (window.validateCookieAccepted()) { if (property.favorite) { this.removeFromFavorites(property); } else { this.addToFavorites(property); } } else { var alertText = this.translations.toggleFavoriteCookiesNotAcceptedText; if (!alertText) { console.error("translation missing, propertyListPage.toggleFavoriteCookiesNotAcceptedText"); } else { alert(alertText); } } }; SearchResult.prototype.addToFavorites = function addToFavorites(property) { property.favorite = true; var currentFavorites = (_aureliaCookie.AureliaCookie.get('feriehus-favorite') || '').split(',').where(function (x) { return x !== ''; }); currentFavorites.push(property.id); _aureliaCookie.AureliaCookie.set('feriehus-favorite', currentFavorites.join(','), { expiry: 24 * 365 * 10, path: '/' }); }; SearchResult.prototype.removeFromFavorites = function removeFromFavorites(property) { property.favorite = false; var currentFavorites = (_aureliaCookie.AureliaCookie.get('feriehus-favorite') || '').split(',').where(function (x) { return x !== ''; }); currentFavorites = currentFavorites.where(function (x) { return x !== property.id.toString(); }); _aureliaCookie.AureliaCookie.set('feriehus-favorite', currentFavorites.join(','), { expiry: 24 * 365 * 10, path: '/' }); }; return SearchResult; }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'result', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'translations', [_aureliaFramework.bindable], { enumerable: true, initializer: function initializer() { return {}; } })), _class); }); define('text!app.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!booking/details.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/favorites.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/info.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/list.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/map.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!widgets/location-breadcrumbs.html', ['module'], function(module) { module.exports = ""; }); define('text!widgets/navigation-tabs.html', ['module'], function(module) { module.exports = ""; }); define('text!widgets/property-history.html', ['module'], function(module) { module.exports = ""; }); define('text!resources/elements/bootstrap-select.html', ['module'], function(module) { module.exports = ""; }); define('text!resources/elements/google-map.html', ['module'], function(module) { module.exports = ""; }); define('text!resources/elements/range-slider.html', ['module'], function(module) { module.exports = ""; }); define('text!resources/elements/slider.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/facilities-search.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/location-search.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/widgets/price-range-search.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/property-type-search.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/range-search.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/rating-search.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/widgets/search-criteria.html', ['module'], function(module) { module.exports = ""; }); define('text!searchresult/widgets/search-loader.html', ['module'], function(module) { module.exports = "\r\n"; }); define('text!searchresult/widgets/search-result.html', ['module'], function(module) { module.exports = "\r\n"; });