{"version":3,"sources":["webpack:///./src/views/AgentProfileAppraisal.vue?11ee","webpack:///./node_modules/client-website-ts-library/plugins/view/index.ts","webpack:///./src/views/AgentProfileAppraisal.vue?df12","webpack:///./src/views/AgentProfileAppraisal.vue","webpack:///./src/views/AgentProfileAppraisal.vue?711c","webpack:///./src/views/AgentProfileAppraisal.vue?e408"],"names":["prolistAnalyticsService","ServiceManager","Get","Analytics","headService","Require","Head","evt","obj","this","getAnalyticsEvent","call","getAnalyticsData","$route","path","name","undefined","triggerAnalyticsEvent","event","GetAll","forEach","adapter","Record","result","head","bind","Promise","then","meta","Update","UpdateWithStatic","View","requestAnimationFrame","updateHead","updateAnalytics","AsyncView","$on","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","_v","_s","profile","FullName","Position","PROLISTPhoto","Preview","Url","_e","formData","staticRenderFns","id","params","length","updateAgent","Slugs","Resolve","resolved","Type","Id","html","el","document","createElement","innerHTML","innerText","about","stripHtml","AboutAgent","substring","title","description","image","Photo","Profiles","$emit","Items","Context","EnquiryTargetProfile","ClientWebsiteId","Website","WebsiteId","Settings","WebsiteLevel","resolveId","FromProfile","components","Masthead","Form","component"],"mappings":"kHAAA,yBAAof,EAAG,G,8eCcvf,IAAM,EAAN,cAAuB,aAAvB,c,oBACY,KAAAA,wBAA0BC,EAAA,KAAeC,IAA6B,OAAYC,UAAW,2BAC7F,KAAAC,YAAcH,EAAA,KAAeI,QAAqB,OAAYC,MAEjE,kBACL,IAAIC,EAA6B,KAC7BC,EAAmC,KAED,qBAA3BC,KAAKC,kBACdH,EAAME,KAAKC,kBAAkBC,KAAKF,MACO,qBAA1BA,KAAKG,mBACpBJ,EAAMC,KAAKG,iBAAiBD,KAAKF,OAGvB,OAARF,IAAcA,EAAM,IAAIJ,EAAA,KAAkBM,KAAKI,OAAOC,KAAML,KAAKI,OAAOE,MAAQ,GAAIP,QAAOQ,IAE/FP,KAAKQ,sBAAsBV,GAGtB,sBAAsBW,GAC3BjB,EAAA,KAAekB,OAA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mB,EAAA,KAAgBC,qBACtBnB,GAAIjB,EAAQiB,KAEdoB,gBAAiB,OAAOC,QAAQrB,GAChCsB,UAAW,OAAOD,QAAQE,SAAUD,UACpCE,aAAc,OAAOH,QAAQE,SAAUC,gBAK7C,UACE/E,KAAKgF,YAGP,mBACE,OAAqB,OAAjBhF,KAAKsC,QAAyB,KAE3B5C,EAAA,KAAqBuF,YAAYjF,KAAKsC,WAxE5B,EAAY,yBANhC,eAAU,CACT4C,WAAY,CACVC,WAAA,KACAC,OAAA,SAGiB,WC7C2X,I,wBCQ5YC,EAAY,eACd,EACAzD,EACAkB,GACA,EACA,KACA,WACA,MAIa,aAAAuC,E","file":"js/chunk-40714c93.54a462d0.js","sourcesContent":["import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgentProfileAppraisal.vue?vue&type=style&index=0&id=742e5c0a&scoped=true&lang=css&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgentProfileAppraisal.vue?vue&type=style&index=0&id=742e5c0a&scoped=true&lang=css&\"","import Vue from \"vue\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { AnalyticsEvent, AnalyticsEventObject, AnalyticsPageView, IAnalyticsAdapter, PROListAnalyticsAdapter } from \"../../services/Analytics\";\r\nimport { HeadService } from \"../../services/HeadService\";\r\nimport { ServiceManager, ServiceType } from \"../../services/ServiceManager\";\r\nimport { RouteMeta } from \"../meta\";\r\n\r\ninterface ViewBase {\r\n getAnalyticsEvent?(): AnalyticsEvent | null;\r\n getAnalyticsData?(): AnalyticsEventObject | null;\r\n head?(): RouteMeta | Promise | null;\r\n}\r\n\r\n@Component\r\nclass ViewBase extends Vue {\r\n protected prolistAnalyticsService = ServiceManager.Get(ServiceType.Analytics, 'PROListAnalyticsAdapter');\r\n protected headService = ServiceManager.Require(ServiceType.Head)!;\r\n\r\n public updateAnalytics() {\r\n let evt: AnalyticsEvent | null = null;\r\n let obj: AnalyticsEventObject | null = null;\r\n\r\n if (typeof this.getAnalyticsEvent !== 'undefined') {\r\n evt = this.getAnalyticsEvent.call(this);\r\n } else if(typeof this.getAnalyticsData !== 'undefined') {\r\n obj = this.getAnalyticsData.call(this);\r\n }\r\n\r\n if (evt === null) evt = new AnalyticsPageView(this.$route.path, this.$route.name || '', obj || undefined);\r\n\r\n this.triggerAnalyticsEvent(evt);\r\n }\r\n\r\n public triggerAnalyticsEvent(event: AnalyticsEvent) {\r\n ServiceManager.GetAll(ServiceType.Analytics).forEach((adapter) => {\r\n adapter.Record(event);\r\n });\r\n }\r\n\r\n public triggerCustomAnalyticsEvent(event: AnalyticsEvent) {\r\n if (this.prolistAnalyticsService !== null) this.prolistAnalyticsService.Record(event);\r\n }\r\n\r\n protected updateHead() {\r\n if ('head' in this) {\r\n const result = this.head!.bind(this)();\r\n\r\n if(result instanceof Promise) {\r\n result.then((meta: RouteMeta | null) => {\r\n this.headService.Update(meta);\r\n });\r\n } else {\r\n this.headService.Update(result as RouteMeta | null);\r\n }\r\n } else {\r\n this.headService.UpdateWithStatic(this.$route.path);\r\n }\r\n }\r\n}\r\n\r\n@Component\r\nclass View extends ViewBase {\r\n public mounted() {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n }\r\n}\r\n\r\n@Component\r\nclass AsyncView extends ViewBase {\r\n public mounted() {\r\n this.$on('updateView', () => {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport {\r\n View,\r\n AsyncView\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Page',[(_vm.profile)?[_c('Masthead',{staticClass:\"agent-profile__masthead\",attrs:{\"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('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))])]),(_vm.profile.PROLISTPhoto)?_c('div',{staticClass:\"agent-profile__header__image\"},[_c('img',{staticClass:\"agent-profile__img\",attrs:{\"src\":_vm.profile.PROLISTPhoto.Preview.Url}})]):_vm._e()])])],1),_c('ContentRow',[_c('ContentContainer',[_c('SectionTitle',[_vm._v(\"Get an Appraisal\")]),(_vm.formData)?_c('Form',{attrs:{\"context\":_vm.formData,\"type\":\"Generic.AppraisalRequestForm\"}}):_vm._e()],1)],1)]:_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-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--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-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=742e5c0a&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=742e5c0a&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 \"742e5c0a\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}