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,GAC1B,C,4NClCWG,cAAgB,CACzBC,gBAAe,SAACC,OACZ1C,iDAAAA,EAAAA,OAAa,kBAAmB0C,MACpC,EACAC,iBAAgB,WACZ3C,iDAAAA,EAAAA,OAAa,mBACjB,EACA4C,gBAAe,SAACF,OACZ1C,iDAAAA,EAAAA,OAAa,kBAAmB0C,MACpC,EACAG,6BAA4B,SAACH,OACzB1C,iDAAAA,EAAAA,OAAa,+BAAgC0C,MACjD,EACAI,cAAa,SAACJ,OACV1C,iDAAAA,EAAAA,OAAa,gBAAiB0C,MAClC,EACAK,eAAc,WACV/C,iDAAAA,EAAAA,OAAa,iBACjB,EACAgD,gBAAe,SAACN,OACZ1C,iDAAAA,EAAAA,OAAa,kBAAmB0C,MACpC,EACAO,iBAAgB,WACZjD,iDAAAA,EAAAA,OAAa,mBACjB,EACAkD,cAAa,SAACC,aAAcC,cACxBpD,iDAAAA,EAAAA,OAAa,gBAAiB,CAACmD,aAAcC,cACjD,E","sources":["webpack://hm/./wwwroot/js/components/card/card-action.js","webpack://hm/./wwwroot/js/components/inputs/editable-input.js","webpack://hm/./wwwroot/js/components/login.js","webpack://hm/./wwwroot/js/shared/globalize/globalize-formatters.js","webpack://hm/./wwwroot/js/store/advert-actions.js"],"sourcesContent":["import axios from 'axios';\nimport {globalActions} from '../../store/global-actions';\nimport {advertActions} from '../../store/advert-actions';\nimport utils from '../../shared/utils';\nimport {formValidationMixin} from '../mixins/component-mixins';\nimport {defineRule, Field, Form} from 'vee-validate';\nimport {max, min} from '@vee-validate/rules';\n\ndefineRule('min', min);\ndefineRule('max', max);\n\nconst buttonCardActionTemplateName = '#button-card-action';\nconst primaryTextAction = '#primary-text-action';\n\nconst cardActionBase = {\n props: {\n modelValue: {},\n buttonClass: {},\n isEngageAction: {},\n isMobile: {\n type: Boolean,\n required: false,\n },\n },\n data() {\n return Object.assign(this.modelValue, {isMobileDevice: this.isMobile});\n },\n emits: ['set-primary', 'change'],\n methods: {\n setPrimary() {\n this.$emit('set-primary', this.modelValue);\n },\n change() {\n this.modelValue.state = this.state;\n this.$emit('change', this.modelValue);\n },\n },\n};\n\nconst buttonCardAction = {\n extends: cardActionBase,\n template: buttonCardActionTemplateName,\n};\n\nconst stateCardActionMixin = {\n data() {\n return {state: this.modelValue.state};\n },\n computed: {\n currentState() {\n return this.state;\n },\n },\n methods: {\n sendChangeStateRequest() {\n return axios.post(this.url)\n .then((result) => {\n this.state = result.data;\n this.change();\n })\n .catch((result) => globalActions.handleAjaxErrors(result.response));\n },\n\n changeState() {\n this.sendChangeStateRequest();\n },\n },\n};\n\nconst primaryTextActionBase = {\n extends: cardActionBase,\n template: primaryTextAction,\n mixins: [formValidationMixin],\n components: {\n ValidationField: Field,\n VeeValidationFormContext: Form,\n },\n props: {\n forceFocus: {},\n },\n data() {\n return {\n uniqueId: utils.genUid(),\n validationExpression: null,\n message: null,\n showErrors: false,\n };\n },\n computed: {\n validationModel() {\n return this.message || {};\n },\n },\n watch: {\n forceFocus(value) {\n if (value) {\n this.focusTextarea();\n }\n },\n },\n methods: {\n focusTextarea() {\n this.$refs.textarea.focus();\n },\n clearTextarea() {\n this.$refs.textarea.clear();\n },\n },\n};\n\nfunction initCardActionComponents(app) {\n app.component('card-action', {\n extends: cardActionBase,\n template: '#card-action',\n });\n\n app.component('state-card-action', {\n extends: cardActionBase,\n template: '#state-card-action',\n mixins: [stateCardActionMixin],\n });\n\n app.component('visibility-card-action', {\n extends: cardActionBase,\n template: '#state-card-action',\n mixins: [stateCardActionMixin],\n methods: {\n changeState() {\n if (this.state === false) {\n this.sendChangeStateRequest();\n } else {\n advertActions.openHideModal(() => {\n this.sendChangeStateRequest();\n this.state = false;\n this.change();\n });\n }\n },\n },\n });\n\n app.component('fullscreen-card-action', {\n extends: buttonCardAction,\n props: {\n isAdvert: {\n type: Boolean,\n default: true,\n },\n },\n methods: {\n onActionClick() {\n globalActions.openFullscreenModal(this.url, this.isAdvert);\n },\n },\n });\n\n app.component('share-card-action', {\n extends: cardActionBase,\n template: '#share-card-action',\n });\n\n app.component('message-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n this.setPrimary();\n },\n },\n });\n\n app.component('rate-card-action', {\n extends: cardActionBase,\n template: '#rate-card-action',\n });\n\n app.component('message-primary-action', {\n extends: primaryTextActionBase,\n template: primaryTextAction,\n methods: {\n async onSubmit(message) {\n const chat = window.chat;\n if (chat) {\n chat.onConversationOpening = async (convId) => {\n chat.currentMessage = message;\n await chat.sendMessage(convId, false, false);\n chat.currentConversation = null;\n chat.onConversationOpening = async () => {\n };\n };\n\n await chat.initiateConversation(this.targetId, this.targetType);\n this.clearTextarea();\n }\n },\n },\n });\n\n app.component('comment-primary-action', {\n extends: primaryTextActionBase,\n template: primaryTextAction,\n data() {\n return {\n validationExpression: `min: 3, max: 500`,\n };\n },\n methods: {\n async onSubmit(message) {\n const validator = this.$refs.validator;\n const result = await validator.validate();\n if (!result.valid) {\n this.showErrors = true;\n return;\n }\n\n try {\n await axios.post(this.url, {body: message, targetId: this.targetId, commentType: this.targetType});\n if (this.successHeader && this.successMessage) {\n globalActions.openInfoModal(this.successHeader, this.successMessage);\n this.clearTextarea();\n }\n } catch (err) {\n console.error(err);\n globalActions.handleAjaxErrors(err);\n }\n },\n },\n });\n\n app.component('link-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n window.location = this.url;\n },\n },\n });\n\n app.component('post-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n axios.post(this.url, this.data)\n .then((response) => {\n window.location = `${response.data}`;\n })\n .catch((result) => globalActions.handleAjaxErrors(result.response));\n },\n },\n });\n\n app.component('dealcompleted-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n if (this.modelValue.isSale) {\n advertActions.openSoldModal(this.modelValue);\n } else {\n advertActions.openRentedModal(this.modelValue);\n }\n },\n },\n });\n\n app.component('copyas-card-action', {\n extends: cardActionBase,\n template: '#copyas-card-action',\n methods: {\n onActionClick() {\n advertActions.openCopyAsModal(this.modelValue);\n },\n },\n });\n\n app.component('delete-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n if (this.modelValue.hasActiveOrders) {\n advertActions.openConfirmAdvertDeleteModal(this.modelValue);\n } else {\n advertActions.openDeleteModal(this.modelValue);\n }\n },\n },\n });\n\n app.component('raiserelevance-card-action', {\n extends: buttonCardAction,\n template: buttonCardActionTemplateName,\n methods: {\n onActionClick() {\n axios.post(this.modelValue.url)\n .then(() => {\n this.$root.showUpdatedModal = true;\n this.$root.createOrderUrl = this.modelValue.createOrderUrl;\n })\n .catch((result) => globalActions.handleAjaxErrors(result.response));\n },\n },\n });\n}\n\nexport default initCardActionComponents;\n","import {updateModelValueEmit} from './currency-price';\n\nfunction initEditableInputComponent(app) {\n app.component('editableInput',\n {\n template: '#editable-input',\n inheritAttrs: false,\n props: {\n editOkLabel: {required: false},\n editCancelLabel: {required: false},\n editLabel: {required: false},\n showIcons: {default: true},\n modelValue: {required: true},\n inputClass: {required: false},\n isSubmittable: {default: false},\n submitAction: {default: ''},\n inputType: {default: 'text'},\n isRequired: {default: false},\n hasCancel: {default: true},\n onSave: {},\n forceTextMode: {\n required: false,\n type: Boolean,\n default: false,\n },\n haveAdditionalBorderButton: {\n required: false,\n type: Boolean,\n default: false,\n },\n },\n emits: [updateModelValueEmit, 'start-edit', 'cancel', 'save-edit'],\n data() {\n return {\n isEditMode: false,\n initialValue: this.modelValue,\n newValue: this.modelValue,\n isTextMode: this.forceTextMode,\n };\n },\n computed: {\n classObject() {\n return {\n 'input-group_borderless': this.forceTextMode,\n 'input-group_text-inline': this.forceTextMode,\n };\n },\n },\n watch: {\n newValue(val) {\n this.$emit(updateModelValueEmit, val);\n },\n },\n methods: {\n startEdit() {\n this.isEditMode = !this.isEditMode;\n this.$emit('start-edit');\n\n this.$nextTick(() => {\n if (this.$refs.editInput) {\n this.$refs.editInput.focus();\n }\n });\n },\n saveEdit() {\n this.isEditMode = false;\n this.$emit('save-edit');\n if (this.onSave) {\n this.onSave();\n }\n },\n cancelEdit() {\n this.$emit(updateModelValueEmit, this.initialValue);\n this.newValue = this.initialValue;\n this.isEditMode = !this.isEditMode;\n this.$emit('cancel', this.initialValue);\n },\n },\n });\n}\n\nexport default initEditableInputComponent;\n","import {nextTick} from 'vue';\nimport shared from '../shared';\nimport {modal} from './modals/modals';\nimport _u from '../shared/utils';\nimport {store} from '../store/global-store';\nimport {formValidationMixin} from './mixins/component-mixins';\nimport {defineRule, Field, Form} from 'vee-validate';\nimport {min, regex, required} from '@vee-validate/rules';\nimport axios from 'axios';\n\ndefineRule('required', required);\ndefineRule('regex', regex);\ndefineRule('min', min);\n\nconst loginControl = {\n data() {\n return {\n loginMode: false,\n returnUrl: null,\n registrationTrigger: null,\n rememberMe: true,\n invitationId: null,\n password: null,\n isAgent: false,\n referencedUserEmail: null,\n enteredEmail: null,\n // true when login in modal\n // false for static pages - Login and Register\n isNeedToUpdateReturnUrl: true,\n isValidationVisible: false,\n submitting: false,\n authErrors: null,\n };\n },\n components: {\n VeeValidationFormContext: Form,\n ValidationField: Field,\n },\n computed: {\n validationModel() {\n return this.referencedUserEmail || {};\n },\n authErrorKeys() {\n return Object.keys(this.authErrors);\n },\n errorVisibility() {\n return this.authErrors;\n },\n userEmail() {\n return this.referencedUserEmail ? this.referencedUserEmail : this.enteredEmail;\n },\n },\n methods: {\n startFormSubmit() {\n this.submitting = true;\n },\n\n stopFormSubmit() {\n this.submitting = false;\n },\n\n switchMode() {\n this.loginMode = !this.loginMode;\n this.isValidationVisible = false;\n this.clearErrorState();\n },\n showValidation() {\n this.isValidationVisible = true;\n },\n beforeSubmit() {\n this.startFormSubmit();\n this.showValidation();\n },\n async _validate() {\n const validator = this.$refs.validator;\n const result = await validator.validate();\n\n return result.valid;\n },\n async submitForm() {\n this.beforeSubmit();\n\n if (await this._validate()) {\n this.clearErrorState();\n this._updateReturnUrl(this.$refs.form);\n this._deleteReferencedUserData();\n await this.sendDataAction();\n } else {\n this._handleSubmitError();\n this.stopFormSubmit();\n }\n },\n clearErrorState() {\n this.authErrors = null;\n },\n\n getFormRequestConfig() {\n const loginAntiforgeryTokenIndex = 7;\n const antiforgeryToken = this.$refs.form[loginAntiforgeryTokenIndex]?._value;\n return _u.createFormRequestConfig(antiforgeryToken);\n },\n async sendDataAction() {\n const requestConfig = this.getFormRequestConfig();\n const authForm = this.$refs.form;\n\n try {\n const response = await axios.post(authForm.action, authForm, requestConfig);\n\n this.handleSuccessResult(response);\n } catch (error) {\n this.handleErrorResult(error);\n }\n\n this.afterRequestSendingActions();\n },\n handleSuccessResult(response) {\n this.stopFormSubmit();\n if (response && response.status === 200) {\n if (response.data?.redirectUrl) {\n const currentUrl = window.location.href.replace(window.location.origin, '');\n\n if (currentUrl === response.data?.redirectUrl) {\n window.location.reload();\n } else {\n window.location.href = response.data?.redirectUrl;\n }\n }\n }\n },\n handleErrorResult(error) {\n this.stopFormSubmit();\n this.authErrors = error.response?.data?.errors;\n\n if (error.response.data?.email) {\n this.enteredEmail = error.response.data?.email;\n }\n },\n afterRequestSendingActions() {\n },\n async forceSubmitForm() {\n await this.sendDataAction();\n },\n submitSocialForm(formId) {\n const form = this.$refs[formId];\n if (form) {\n this.startFormSubmit(true);\n this._updateReturnUrl(form);\n this._deleteReferencedUserData();\n\n form.submit();\n }\n },\n _subscribeModeSwitch() {\n store.subscribe((mutation) => {\n if (mutation.type === 'loginModeSwitch') {\n this.switchMode();\n }\n });\n },\n _setReferencedUserData() {\n nextTick(() => {\n this.invitationId = localStorage.getItem('invitationId');\n this.referencedUserEmail = localStorage.getItem('referencedUserEmail');\n });\n },\n _deleteReferencedUserData() {\n localStorage.removeItem('invitationId');\n localStorage.removeItem('referencedUserEmail');\n },\n _updateReturnUrl(form) {\n if (this.isNeedToUpdateReturnUrl) {\n const currentUrl = _u.getCurrentUrl();\n const homeUrl = '/';\n\n if (!this.returnUrl && !form.action.includes(currentUrl)) {\n this.returnUrl = currentUrl;\n }\n\n // form action always includes / (slash)onCompleteCode\n // so if currentUrl is home url we should also assign it to returnUrl\n if (!this.returnUrl && currentUrl === homeUrl) {\n this.returnUrl = currentUrl;\n }\n\n if (this.returnUrl && !form.action.includes('returnUrl')) {\n form.action = _u.addQueryParamForUrl(form.action, 'returnUrl', this.returnUrl);\n }\n }\n },\n _subscribeChangePreselectRegistrationReasonStore() {\n store.subscribe((mutation) => {\n if (mutation.type === 'changePreselectRegistrationReason' && mutation.payload) {\n this.registrationTrigger = mutation.payload;\n }\n });\n },\n _handleSubmitError() {\n\n },\n },\n mounted() {\n this._subscribeModeSwitch();\n this._subscribeChangePreselectRegistrationReasonStore();\n this._setReferencedUserData();\n if (this.authErrors) {\n this.showValidation();\n }\n },\n};\n\nfunction initLoginComponents(app) {\n app.component('login-modal', {\n mixins: [modal, formValidationMixin, loginControl],\n template: '#login-modal',\n computed: {\n loginModalOpened: {\n get() {\n return store.state.shared.loginModalOpened;\n },\n set(value) {\n if (value === false) {\n store.commit('closeLoginModal');\n }\n },\n },\n },\n methods: {\n close() {\n this.loginModalOpened = false;\n },\n },\n });\n\n return {shared, loginControl};\n}\n\nexport {\n initLoginComponents,\n loginControl,\n};\n","import Globalize from 'globalize';\n\nconst currencyShortFormatter = (currency) => Globalize.currencyFormatter(currency, {\n compact: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n});\n\nconst currencyMediumFormatter = (currency) => Globalize.currencyFormatter(currency, {\n compact: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n});\n\nconst currencyRoundFormatter = (currency) => Globalize.currencyFormatter(currency, {\n round: 'round',\n maximumFractionDigits: 0,\n});\n\nconst currencyLongFormatter = (currency) => Globalize.currencyFormatter(currency);\n\nconst numberShortFormatter = (locale) => Globalize(locale).numberFormatter({\n compact: 'short',\n minimumSignificantDigits: 3,\n maximumSignificantDigits: 3,\n});\n\nconst numberShortRoundFormatter = (locale) => Globalize(locale).numberFormatter({\n compact: 'short',\n minimumSignificantDigits: 1,\n maximumSignificantDigits: 3,\n});\n\nconst numberLongFormatter = (locale) => Globalize(locale).numberFormatter({\n minimumSignificantDigits: 1,\n maximumSignificantDigits: 3,\n});\n\nexport {currencyShortFormatter, currencyMediumFormatter, currencyLongFormatter, currencyRoundFormatter, numberShortFormatter, numberShortRoundFormatter, numberLongFormatter};\n","import {store} from '../store/global-store';\n\nexport const advertActions = {\n openCopyAsModal(model) {\n store.commit('openCopyAsModal', model);\n },\n closeCopyAsModal() {\n store.commit('closeCopyAsModal');\n },\n openDeleteModal(model) {\n store.commit('openDeleteModal', model);\n },\n openConfirmAdvertDeleteModal(model) {\n store.commit('openConfirmAdvertDeleteModal', model);\n },\n openSoldModal(model) {\n store.commit('openSoldModal', model);\n },\n closeSoldModal() {\n store.commit('closeSoldModal');\n },\n openRentedModal(model) {\n store.commit('openRentedModal', model);\n },\n closeRentedModal() {\n store.commit('closeRentedModal');\n },\n openHideModal(acceptAction, cancelAction) {\n store.commit('openHideModal', {acceptAction, cancelAction});\n },\n};\n"],"names":["defineRule","min","max","cardActionBase","props","modelValue","buttonClass","isEngageAction","isMobile","type","Boolean","required","data","Object","assign","this","isMobileDevice","emits","methods","setPrimary","$emit","change","state","formValidationMixin","Field","Form","app","component","template","inheritAttrs","editOkLabel","editCancelLabel","editLabel","showIcons","default","inputClass","isSubmittable","submitAction","inputType","isRequired","hasCancel","onSave","forceTextMode","haveAdditionalBorderButton","updateModelValueEmit","isEditMode","initialValue","newValue","isTextMode","computed","classObject","watch","val","startEdit","_this","$nextTick","$refs","editInput","focus","saveEdit","cancelEdit","regex","loginControl","loginMode","returnUrl","registrationTrigger","rememberMe","invitationId","password","isAgent","referencedUserEmail","enteredEmail","isNeedToUpdateReturnUrl","isValidationVisible","submitting","authErrors","components","VeeValidationFormContext","ValidationField","validationModel","authErrorKeys","keys","errorVisibility","userEmail","startFormSubmit","stopFormSubmit","switchMode","clearErrorState","showValidation","beforeSubmit","_validate","_asyncToGenerator","regeneratorRuntime","mark","_callee","validator","result","wrap","_context","prev","next","validate","sent","abrupt","valid","stop","submitForm","_this2","_callee2","_context2","_updateReturnUrl","form","_deleteReferencedUserData","sendDataAction","_handleSubmitError","getFormRequestConfig","antiforgeryToken","_value","_u","_this3","_callee3","requestConfig","authForm","response","_context3","axios","action","handleSuccessResult","t0","handleErrorResult","afterRequestSendingActions","status","redirectUrl","window","location","href","replace","origin","reload","error","errors","email","forceSubmitForm","_this4","_callee4","_context4","submitSocialForm","formId","submit","_subscribeModeSwitch","_this5","store","mutation","_setReferencedUserData","_this6","nextTick","localStorage","getItem","removeItem","currentUrl","includes","_subscribeChangePreselectRegistrationReasonStore","_this7","payload","mounted","initLoginComponents","mixins","modal","loginModalOpened","get","set","value","close","shared","currencyShortFormatter","currency","Globalize","compact","minimumFractionDigits","maximumFractionDigits","currencyMediumFormatter","currencyRoundFormatter","round","currencyLongFormatter","numberShortFormatter","locale","numberFormatter","minimumSignificantDigits","maximumSignificantDigits","numberShortRoundFormatter","numberLongFormatter","advertActions","openCopyAsModal","model","closeCopyAsModal","openDeleteModal","openConfirmAdvertDeleteModal","openSoldModal","closeSoldModal","openRentedModal","closeRentedModal","openHideModal","acceptAction","cancelAction"],"sourceRoot":""}