{"version":3,"file":"index-BhfFy4i6.js","sources":["../../../app/assets/javascripts/apps/spacious_website/pages/buildings/city_level_overseas_marketing_projects_page/desktop_ver/components/sticky_bar/index.ts","../../../app/assets/javascripts/concepts/buildings/overseas_marketing/filter_bar/desktop/for_city/index.ts","../../../app/assets/javascripts/apps/spacious_website/pages/buildings/city_level_overseas_marketing_projects_page/desktop_ver/components/overseas_marketing_filter/index.ts","../../../app/assets/javascripts/apps/spacious_website/pages/buildings/city_level_overseas_marketing_projects_page/desktop_ver/below_the_fold_section/index.ts","../../../app/assets/javascripts/apps/spacious_website/pages/buildings/city_level_overseas_marketing_projects_page/desktop_ver/index.ts"],"sourcesContent":["\nimport { EventEmitter } from \"events\"\n\nimport $ from \"jquery\"\nimport StickyNavbarHandler from \"app/sticky_navbar_handler/index\"\nimport Notifier from \"app/notifier/index\"\n\n\ninterface Selector {\n scope: string\n country_update_subscription_section: string\n btn_concierge_scroll: string\n}\n\ninterface InputSelector {\n scope?: string\n country_update_subscription_section?: string\n btn_concierge_scroll?: string\n}\n\nconst default_selector = {\n scope: \".page--buildings--city_level_overseas_marketing_projects_page\",\n country_update_subscription_section: \".page-section--overseas-properties-section-city-subscription\",\n btn_concierge_scroll: \".btn-concierge-scroll\",\n}\n\n\nclass OverseasMarketingStickyBar extends EventEmitter {\n private selector: Selector\n\n private $scope: JQuery\n private $country_update_subscription_section: JQuery\n private $btn_concierge_scroll: JQuery\n\n constructor(selector?: InputSelector){\n super()\n\n this.selector = Object.assign({}, default_selector, selector)\n this.$scope = $(this.selector.scope)\n this.$country_update_subscription_section = this.$scope.find(this.selector.country_update_subscription_section)\n this.$btn_concierge_scroll = this.$scope.find(this.selector.btn_concierge_scroll)\n\n this.bind_action()\n }\n\n private reset_to_concierge_box(){\n StickyNavbarHandler.scrollTo(this.$country_update_subscription_section, {\n duration: 0,\n })\n Notifier.closeAll()\n }\n\n private bind_action(){\n this.$btn_concierge_scroll.on(\"click\", (e) =>{\n e.preventDefault()\n this.reset_to_concierge_box()\n })\n return this\n }\n}\n\nconst Factory = {\n create(){\n return new OverseasMarketingStickyBar()\n },\n}\n\nexport {\n Factory,\n}\n","\nimport param from \"jquery-param\"\nimport URI from \"urijs\"\n\nimport {\n DesktopFilter,\n InputSelector,\n} from \"concepts/buildings/overseas_marketing/filter_bar/desktop\"\n\nimport q_ajax_3 from \"app/utils/q_ajax/q_ajax_3\"\nimport DataRetriever from \"app/data_retriever\"\nimport Modal from \"app/modal/show-modal\"\n\nimport BuildingsOverseasMarketingShareBox from \"concepts/buildings/overseas_marketing/share/box\"\n\n\nimport I18n from \"plugins/i18n-js\"\nimport * as Routes from \"plugins/js-routes\"\n\n\nexport class OverseasMarkingFilterBarDesktopCity extends DesktopFilter {\n protected onShareClick(){\n const overseas_properties_listing_search_criteria_set_params =\n (this.get_form_data() as any).overseas_properties_listing_search_criteria_set\n Modal.showLoadingIndicator()\n\n const url_object = URI(Routes.apps_spacious_website_partials_city_level_overseas_marketing_projects_share_modal_path())\n url_object.query(param({\n locale: I18n.locale,\n city_id: DataRetriever.get(\"selected-city-id\"),\n overseas_properties_listing_search_criteria_set: overseas_properties_listing_search_criteria_set_params,\n }))\n\n return q_ajax_3({\n url: url_object.toString(),\n method: \"GET\",\n dataType: \"HTML\",\n })\n .then(({data}) => {\n Modal.hideTopModal()\n Modal.showModalWithContent(data)\n BuildingsOverseasMarketingShareBox.create()\n })\n }\n}\n\nconst Factory = {\n _instance: null as null | OverseasMarkingFilterBarDesktopCity,\n instance(selector?: InputSelector){\n if (this._instance != null) { return this._instance }\n\n this._instance = this.create(selector)\n return this._instance\n },\n create(selector?: InputSelector){\n return new OverseasMarkingFilterBarDesktopCity(selector)\n },\n}\n\nexport {\n Factory,\n}\n","\n// region JS Imports\n\n// region External Modules\nimport $ from \"jquery\"\nimport param from \"jquery-param\"\nimport URI from \"urijs\"\nimport { EventEmitter } from \"events\"\n// endregion External Modules\n\n// region Private Modules\nimport q_ajax_3 from \"app/utils/q_ajax/q_ajax_3\"\nimport NumbersFormatter from \"app/numbers/formatter/index\"\n\nimport StickyNavbarHandler from \"app/sticky_navbar_handler/index\"\nimport {\n Factory as PaginationFactory,\n Pagination,\n} from \"app/pagination\"\n\nimport ImageLazyLoading from \"widgets/image_lazyloading\"\nimport BackgroundImageLazyLoading from \"widgets/background_image_lazyloading\"\n// endregion Private Modules\n\n// region Public Components\nimport {\n Factory as OverseasMarketingFilterBarFactory,\n OverseasMarkingFilterBarDesktopCity,\n} from \"concepts/buildings/overseas_marketing/filter_bar/desktop/for_city/index\"\nimport NewDevelopmentBuildingsRow from \"apps/spacious_website/pages/overseas_properties/shared/components/project_entry_row/wide/index\"\nimport ListingsRowForSearchingDefault from \"concepts/listings/row/for_searching/default\"\nimport Listings_Contact_Button from \"concepts/listings/contact/button/index\"\n// endregion Public Components\n\n// region Private Components\n// endregion Private Components\n\n// endregion JS Imports\n\n\ninterface Selector {\n scope: string | Element | JQuery\n count_text: string | Element | JQuery\n properties_content: string | Element | JQuery\n properties_list: string | Element | JQuery\n section: string | Element | JQuery\n section_content: string | Element | JQuery\n}\ninterface InputSelector {\n scope?: string | Element | JQuery\n count_text?: string | Element | JQuery\n properties_content?: string | Element | JQuery\n properties_list?: string | Element | JQuery\n section?: string | Element | JQuery\n section_content?: string | Element | JQuery\n}\nconst DEFAULT_SELECTOR = {\n scope: \".page--buildings--city_level_overseas_marketing_projects_page\",\n count_text: \".page-section--overseas-properties--count--text\",\n properties_content: \"#page-section--overseas-properties-content\",\n properties_list: \".page-section--overseas-properties-content--properties-list\",\n section: \".page-section--overseas-properties-section\",\n section_content: \".page-section--overseas-properties-section-content\",\n}\n\n\nclass OverseasMarketingFilter extends EventEmitter {\n protected selector: Selector\n protected $scope: JQuery\n protected $properties_content: JQuery\n protected $properties_list: JQuery\n protected $section: JQuery\n protected $count_text: JQuery\n\n protected overseas_marketing_filter_bar: OverseasMarkingFilterBarDesktopCity\n protected paginate_instance: Pagination\n\n constructor(selector?: InputSelector){\n super()\n\n this.selector = Object.assign({}, DEFAULT_SELECTOR, selector)\n this.$scope = $(this.selector.scope)\n this.$properties_content = this.$scope.find(this.selector.properties_content)\n this.$properties_list = this.$properties_content.find(this.selector.properties_list)\n this.$section = this.$properties_content.find(this.selector.section)\n this.$count_text = this.$scope.find(this.selector.count_text)\n\n this.overseas_marketing_filter_bar = OverseasMarketingFilterBarFactory.instance()\n\n this.paginate_instance = PaginationFactory.create()\n this.init_pagination()\n\n this.bind_action()\n this.created()\n }\n\n protected init_pagination(){\n this.paginate_instance.init(this.$properties_list)\n this.paginate_instance.onUpdate(() => {\n StickyNavbarHandler.scrollTo(this.$properties_list, {duration: 1000})\n this.update()\n })\n this.paginate_instance.initEvent()\n }\n protected bind_action(){\n this.overseas_marketing_filter_bar.on(\"val_change\", () => {\n this.paginate_instance.resetPage()\n this.update()\n })\n this.overseas_marketing_filter_bar.on(\"category_change\", () => {\n this.paginate_instance.resetPage()\n this.update()\n this.show_active_category_section()\n })\n }\n protected created(){\n NewDevelopmentBuildingsRow.init()\n ListingsRowForSearchingDefault.init()\n Listings_Contact_Button.init()\n\n BackgroundImageLazyLoading.default_lazyload_instance().update()\n ImageLazyLoading.default_lazyload_instance().update()\n\n this.initialize_active_category_filter()\n this.update_listing_count()\n }\n protected show_active_category_section(){\n const selected_category = this.overseas_marketing_filter_bar.getSelectedCategory()\n this.$section.filter(`[data-category=${selected_category}]`).addClass(\"active\")\n this.$section.filter(`[data-category!=${selected_category}]`).removeClass(\"active\")\n }\n protected update_listing_count(){\n this.$count_text.text(\n NumbersFormatter.numberWithCommas(\n this.$section.filter(\".active\").find(this.selector.section_content).data(\"listing-count\") || 0\n ) || 0\n )\n }\n protected get_form_data(){\n return (Object.assign(this.overseas_marketing_filter_bar.get_form_data(), {page: this.paginate_instance.getPage()}) || {})\n }\n protected get_form_url(){\n return this.overseas_marketing_filter_bar.get_form_url()\n }\n protected initialize_active_category_filter(){\n this.$section = this.$properties_content.find(this.selector.section)\n this.show_active_category_section()\n }\n protected update(){\n this.overseas_marketing_filter_bar.setAsLoading()\n this.$properties_content.addClass(\"loading\")\n\n const url_object = URI(this.get_form_url())\n url_object.query(param(this.get_form_data()))\n\n q_ajax_3({\n type: \"GET\",\n url: url_object.toString(),\n dataType: \"HTML\",\n })\n .then(({data}) => {\n this.overseas_marketing_filter_bar.setAsLoaded()\n this.$properties_list.html(data)\n this.$properties_content.removeClass(\"loading\")\n this.init_pagination()\n this.created()\n })\n .done()\n }\n}\n\nconst Factory = {\n create(){\n return new OverseasMarketingFilter()\n },\n}\n\nexport {\n Factory,\n}\n","\nimport u from \"umbrellajs\"\n\nimport q_ajax_3 from \"app/utils/q_ajax/q_ajax_3\"\n\n\nimport I18n from \"plugins/i18n-js\"\nimport * as Routes from \"plugins/js-routes\"\n\n\nconst load_content = (country_id: string, selected_city_id: string) => {\n return q_ajax_3({\n url: Routes.city_level_overseas_marketing_projects_page__below_the_fold_page_content_path({\n locale: I18n.locale,\n country_id: country_id,\n selected_city_id: selected_city_id,\n }),\n type: \"GET\",\n dataType: \"html\",\n })\n}\n\nconst load_and_inject_content = (country_id: string, selected_city_id: string) => {\n const $container = u(\"#page-section--below-the-fold\")\n if ($container.length === 0) { return Promise.resolve() }\n\n return load_content(country_id, selected_city_id)\n .then(({data}) => {\n $container.html(data)\n })\n}\n\nexport {\n load_and_inject_content,\n}\n","\n// region JS Imports\n\n// region External Modules\nimport on_domready from \"domready\"\n// endregion External Modules\n\n// Private Modules\nimport DataRetriever from \"app/data_retriever\"\nimport ImageLazyLoading from \"widgets/image_lazyloading\"\n// Private Modules\n\n// region Public Components\nimport BS3_Dropdown from \"components/bootstrap3-like-dropdown\"\n\nimport {\n init as CountryFollowButton_init,\n} from \"apps/spacious_website/components/countries/follow_button\"\nimport {\n Factory as CountryFollowPromptModal,\n} from \"apps/spacious_website/components/countries/follow_prompt_modal\"\n// endregion Public Components\n\n// region Private Components\nimport {\n Factory as OverseasMarketingStickyBar,\n} from \"./components/sticky_bar/index\"\nimport {\n Factory as OverseasMarketingFilter,\n} from \"./components/overseas_marketing_filter/index\"\n\nimport {\n load_and_inject_content as load_and_inject_below_the_fold_section,\n} from \"./below_the_fold_section\"\n// endregion Private Components\n\n// endregion JS Imports\n\n\nconst init = () => {\n BS3_Dropdown.init({\n scope: \".main-content-container\",\n dropdown_toggle: \".dropdown-toggle\",\n dropdown_container: \".dropdown\",\n })\n\n CountryFollowPromptModal.create()\n CountryFollowButton_init().done()\n\n OverseasMarketingStickyBar.create()\n OverseasMarketingFilter.create()\n\n on_domready(() => {\n const country_id = DataRetriever.get(\"country-id\")\n const selected_city_id = DataRetriever.get(\"selected-city-id\")\n\n load_and_inject_below_the_fold_section(country_id, selected_city_id)\n .then(() => {\n ImageLazyLoading.default_lazyload_instance().update()\n })\n })\n}\n\nexport default {\n init: init,\n}\n"],"names":["default_selector","OverseasMarketingStickyBar","EventEmitter","selector","$","StickyNavbarHandler","Notifier","e","Factory","OverseasMarkingFilterBarDesktopCity","DesktopFilter","overseas_properties_listing_search_criteria_set_params","Modal","url_object","URI","Routes.apps_spacious_website_partials_city_level_overseas_marketing_projects_share_modal_path","param","I18n","DataRetriever","q_ajax_3","data","BuildingsOverseasMarketingShareBox","DEFAULT_SELECTOR","OverseasMarketingFilter","OverseasMarketingFilterBarFactory","PaginationFactory","NewDevelopmentBuildingsRow","ListingsRowForSearchingDefault","Listings_Contact_Button","BackgroundImageLazyLoading","ImageLazyLoading","selected_category","NumbersFormatter","load_content","country_id","selected_city_id","Routes.city_level_overseas_marketing_projects_page__below_the_fold_page_content_path","load_and_inject_content","$container","u","init","BS3_Dropdown","CountryFollowPromptModal","CountryFollowButton_init","on_domready","load_and_inject_below_the_fold_section","index"],"mappings":"ytIAoBA,MAAMA,EAAmB,CACvB,MAAsC,gEACtC,oCAAsC,+DACtC,qBAAsC,uBACxC,EAGA,MAAMC,UAAmCC,EAAAA,YAAa,CAOpD,YAAYC,EAAyB,CAC7B,MAAA,EAEN,KAAK,SAAW,OAAO,OAAO,CAAC,E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