{"version":3,"sources":["webpack:///./src/views/AgentProfileAppraisal.vue?58b2","webpack:///./src/views/AgentProfileAppraisal.vue","webpack:///./src/views/AgentProfileAppraisal.vue?5fac","webpack:///./src/views/AgentProfileAppraisal.vue?5f38","webpack:///./src/views/AgentProfileAppraisal.vue?7d97"],"names":["render","_vm","this","_c","_self","_setupProxy","profile","staticClass","attrs","_v","_s","FullName","Position","formData","_e","staticRenderFns","AgentProfile","Mixins","AsyncView","constructor","resolveId","id","$route","params","length","updateAgent","API","Slugs","Resolve","then","resolved","Type","Id","stripHtml","html","el","document","createElement","innerHTML","innerText","head","about","AboutAgent","substring","title","description","image","Photo","Preview","Url","undefined","Profiles","Get","$emit","Items","ContextItemType","EnquiryTargetProfile","ClientWebsiteId","Config","Website","WebsiteId","Settings","WebsiteLevel","mounted","getAnalyticsData","AnalyticsEventObject","FromProfile","Component","components","Masthead","Form","component"],"mappings":"kHAAA,W,yCCAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,OAAO,CAAEF,EAAIK,QAAS,CAACH,EAAG,WAAW,CAACI,YAAY,0BAA0BC,MAAM,CAAC,KAAO,OAAO,MAAQ,wBAAwB,MAAQ,sCAAsC,oBAAmB,EAAK,QAAS,IAAO,CAACL,EAAG,mBAAmB,CAACI,YAAY,8BAA8B,CAACJ,EAAG,MAAM,CAACI,YAAY,yBAAyB,CAACJ,EAAG,MAAM,CAACI,YAAY,kCAAkC,CAACJ,EAAG,KAAK,CAACI,YAAY,2BAA2B,CAACN,EAAIQ,GAAG,2BAA2BN,EAAG,KAAK,CAACI,YAAY,uBAAuB,CAACN,EAAIQ,GAAGR,EAAIS,GAAGT,EAAIK,QAAQK,aAAaR,EAAG,KAAK,CAACI,YAAY,2BAA2B,CAACN,EAAIQ,GAAGR,EAAIS,GAAGT,EAAIK,QAAQM,oBAAoB,GAAGT,EAAG,aAAa,CAACA,EAAG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OAAqB,OAAjB9D,KAAKI,QAAyB,KAE3B2D,OAAqBC,YAAYhE,KAAKI,WAxE5BU,EAAY,GANhCmD,eAAU,CACTC,WAAY,CACVC,gBACAC,gBAGiBtD,WCjB2X,I,wBCQ5YuD,EAAY,eACd,EACAvE,EACAe,GACA,EACA,KACA,WACA,MAIa,aAAAwD,E","file":"js/chunk-3e76b9d8.111f157c.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgentProfileAppraisal.vue?vue&type=style&index=0&id=68b77ae0&prod&scoped=true&lang=css&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('Page',[(_vm.profile)?[_c('Masthead',{staticClass:\"agent-profile__masthead\",attrs:{\"mini\":\"true\",\"title\":\"Get an appraisal with\",\"image\":\"/assets/images/default/masthead.jpg\",\"relative-content\":true,\"darken\":true}},[_c('ContentContainer',{staticClass:\"agent-profile__header-wrap\"},[_c('div',{staticClass:\"agent-profile__header\"},[_c('div',{staticClass:\"agent-profile__header__details\"},[_c('h2',{staticClass:\"agent-profile__position\"},[_vm._v(\"Get an appraisal with\")]),_c('h1',{staticClass:\"agent-profile__name\"},[_vm._v(_vm._s(_vm.profile.FullName))]),_c('h2',{staticClass:\"agent-profile__position\"},[_vm._v(_vm._s(_vm.profile.Position))])])])])],1),_c('ContentRow',[_c('ContentContainer',[(_vm.formData)?_c('Form',{attrs:{\"context\":_vm.formData,\"type\":\"Generic.AppraisalRequestForm\"}}):_vm._e()],1)],1)]:_vm._e()],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Component, Mixins } from 'vue-property-decorator';\r\nimport { Profile, ListingStatus, WebsiteLevel, Context } from 'client-website-ts-library/types';\r\nimport { API, Config } from 'client-website-ts-library/services';\r\nimport { AsyncView, RouteMeta } from 'client-website-ts-library/plugins';\r\n\r\nimport Masthead from '@/components/Common/Masthead.vue';\r\nimport { AnalyticsEventObject } from 'client-website-ts-library/services/Analytics';\r\nimport Form from '@/components/Forms/Form.vue';\r\nimport { ContextItemType } from 'client-website-ts-library/types/Context';\r\n\r\n@Component({\r\n components: {\r\n Masthead,\r\n Form,\r\n },\r\n})\r\nexport default class AgentProfile extends Mixins(AsyncView) {\r\n private profile: Profile | null = null;\r\n\r\n private formData: Context | null = null;\r\n\r\n resolveId() {\r\n const { id } = this.$route.params;\r\n\r\n if (id.length === 36) {\r\n // If the ID is 36 long we'll treat it as a guid\r\n\r\n this.updateAgent(id);\r\n } else {\r\n API.Slugs.Resolve(id).then((resolved) => {\r\n if (resolved.Type === 'Profile') {\r\n this.updateAgent(resolved.Id);\r\n }\r\n });\r\n }\r\n }\r\n\r\n stripHtml(html: string): string {\r\n const el = document.createElement('div');\r\n\r\n el.innerHTML = html;\r\n\r\n return el.innerText;\r\n }\r\n\r\n head(): RouteMeta | null {\r\n if (this.profile === null) return null;\r\n\r\n let about = this.stripHtml(this.profile.AboutAgent);\r\n\r\n if (about.length > 156) {\r\n about = `${about.substring(0, 156)}...`;\r\n }\r\n\r\n return {\r\n title: `Get an Appraisal - ${this.profile.FullName} - ${this.profile.Position}`,\r\n description: about,\r\n image: this.profile.Photo ? this.profile.Photo.Preview.Url : undefined,\r\n };\r\n }\r\n\r\n updateAgent(id: string) {\r\n this.formData = null;\r\n\r\n API.Profiles.Get(id).then((profile) => {\r\n this.profile = profile;\r\n\r\n this.$emit('updateView');\r\n\r\n this.formData = {\r\n Items: [{\r\n Type: ContextItemType.EnquiryTargetProfile,\r\n Id: profile.Id,\r\n }],\r\n ClientWebsiteId: Config.Website.Id,\r\n WebsiteId: Config.Website.Settings!.WebsiteId,\r\n WebsiteLevel: Config.Website.Settings!.WebsiteLevel,\r\n };\r\n });\r\n }\r\n\r\n mounted() {\r\n this.resolveId();\r\n }\r\n\r\n getAnalyticsData(): AnalyticsEventObject | null {\r\n if (this.profile === null) return null;\r\n\r\n return AnalyticsEventObject.FromProfile(this.profile);\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgentProfileAppraisal.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgentProfileAppraisal.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./AgentProfileAppraisal.vue?vue&type=template&id=68b77ae0&scoped=true&\"\nimport script from \"./AgentProfileAppraisal.vue?vue&type=script&lang=ts&\"\nexport * from \"./AgentProfileAppraisal.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./AgentProfileAppraisal.vue?vue&type=style&index=0&id=68b77ae0&prod&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"68b77ae0\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}