{"version":3,"sources":["webpack:///./src/pages/UpdateDepartmentSocialMedia/index.vue?5a1e","webpack:///./src/helpers/loadSocialMedias.ts","webpack:///./src/pages/UpdateDepartmentSocialMedia/index.vue","webpack:///./src/pages/UpdateDepartmentSocialMedia/index.vue?d30b","webpack:///./src/pages/UpdateDepartmentSocialMedia/index.vue?9c6f"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","requestPayload","on","onSuccess","scopedSlots","_u","key","fn","ref","isLoading","onLocationChange","model","value","callback","$$v","pulsemAccountId","expression","locationValid","department","allSocialMediasSelect","source","url","title","_e","_v","accountSocialMediaSelect","after","useAccount","staticRenderFns","loadSocialMedias","post","SocialMediaSource","socialMediaTitles","GOOGLE","FACEBOOK","BBB","YELLOWPAGES","ANGIESLIST","HOMESTAR","HOUZZ","HOMEADVISOR","PORCH","NEXTDOOR","CUSTOM","accountSocialMediaUrls","data","socialMediaUrls","status","selectItems","Object","prototype","hasOwnProperty","call","push","text","components","AccountIdInput","TechTaskCard","component","VCheckbox","VSelect","VTextField"],"mappings":"yKAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,eAAe,CAACE,MAAM,CAAC,YAAY,iCAAiC,MAAQ,iCAAiC,kBAAkBN,EAAIO,gBAAgBC,GAAG,CAAC,YAAYR,EAAIS,WAAWC,YAAYV,EAAIW,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,SAASC,GACpU,IAAIC,EAAYD,EAAIC,UACpB,MAAO,CAACX,EAAG,iBAAiB,CAACI,GAAG,CAAC,cAAgBR,EAAIgB,kBAAkBC,MAAM,CAACC,MAAOlB,EAAmB,gBAAEmB,SAAS,SAAUC,GAAMpB,EAAIqB,gBAAgBD,GAAKE,WAAW,qBAAqBlB,EAAG,eAAe,CAACE,MAAM,CAAC,MAAQ,aAAa,UAAYN,EAAIuB,eAAiBR,EAAU,QAAUA,GAA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1C,qCAYQ,MAAO,CACH7B,gBAAiBpB,KAAKoB,gBACtBG,WAAYvB,KAAKuB,WACjBE,OAAQzB,KAAKyB,OACbC,IAAK1B,KAAK0B,IACVC,MAAO3B,KAAK2B,MACZI,MAAO/B,KAAK+B,MACZC,WAAYhC,KAAKgC,cAnB7B,+BA2BQ,OAAOhC,KAAKyB,SAAWW,EAAkBY,SA3BjD,4CA+BQ,IAAMK,EAAiC,GACvC,IAAK,IAAM1C,KAAOyB,EACd,GAAIkB,OAAOC,UAAUC,eAAeC,KAAKrB,EAAmBzB,GAAM,CAC9D,IAAMc,EAA4BW,EAAkBzB,GACpD0C,EAAYK,KAAK,CACbC,KAAMtB,EAAkBZ,GACxBR,MAAOQ,IAInB,OAAO4B,IAzCf,+CAgDQ,IADwB,EAClBA,EAAiC,GADf,iBAENrD,KAAKiD,wBAFC,IAExB,2BAA+C,KAApCvB,EAAoC,QAC3C2B,EAAYK,KAAK,CACbC,KAAMtB,EAAkBX,EAAID,QAC5BR,MAAOS,EAAID,UALK,8BAQxB,OAAO4B,MAvDf,GAAyD,QAApC,EAA2B,gBAN/C,eAAU,CACPO,WAAY,CACRC,iBAAA,KACAC,eAAA,SAGa,WCpF6X,I,qECO9YC,EAAY,eACd,EACAjE,EACAmC,GACA,EACA,KACA,KACA,MAIa,aAAA8B,EAAiB,QAOhC,IAAkBA,EAAW,CAACC,YAAA,KAAUC,UAAA,KAAQC,aAAA","file":"js/chunk-2d2109ab.670bb26a.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('TechTaskCard',{attrs:{\"task-name\":\"update-department-social-media\",\"title\":\"Update Department Social Media\",\"request-payload\":_vm.requestPayload},on:{\"on-submit\":_vm.onSuccess},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar isLoading = ref.isLoading;\nreturn [_c('AccountIdInput',{on:{\"onStateChange\":_vm.onLocationChange},model:{value:(_vm.pulsemAccountId),callback:function ($$v) {_vm.pulsemAccountId=$$v},expression:\"pulsemAccountId\"}}),_c('v-text-field',{attrs:{\"label\":\"Department\",\"disabled\":!_vm.locationValid || isLoading,\"loading\":isLoading},model:{value:(_vm.department),callback:function ($$v) {_vm.department=$$v},expression:\"department\"}}),_c('v-select',{attrs:{\"items\":_vm.allSocialMediasSelect,\"item-text\":\"text\",\"item-value\":\"value\",\"label\":\"Social Media\",\"disabled\":!_vm.locationValid || isLoading},model:{value:(_vm.source),callback:function ($$v) {_vm.source=$$v},expression:\"source\"}}),_c('v-text-field',{attrs:{\"label\":\"Url\",\"disabled\":!_vm.locationValid || isLoading,\"loading\":isLoading},model:{value:(_vm.url),callback:function ($$v) {_vm.url=$$v},expression:\"url\"}}),(_vm.isCustom)?_c('v-text-field',{attrs:{\"label\":\"Title\",\"disabled\":!_vm.locationValid || isLoading,\"loading\":isLoading},model:{value:(_vm.title),callback:function ($$v) {_vm.title=$$v},expression:\"title\"}}):_vm._e(),_vm._v(\" To place as first social media, leave empty. To place AFTER an existing social media, select the corresponding social media below. \"),_c('v-select',{attrs:{\"items\":_vm.accountSocialMediaSelect,\"item-text\":\"text\",\"item-value\":\"value\",\"label\":\"After\",\"disabled\":!_vm.locationValid || isLoading},model:{value:(_vm.after),callback:function ($$v) {_vm.after=$$v},expression:\"after\"}}),_c('v-checkbox',{attrs:{\"label\":\"Fill with account urls\",\"disabled\":!_vm.locationValid || isLoading,\"loading\":isLoading},model:{value:(_vm.useAccount),callback:function ($$v) {_vm.useAccount=$$v},expression:\"useAccount\"}})]}}])})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import request, { Response } from '@/helpers/requests'\nimport { SocialMediaSource } from '@/types/social-media'\n\n\nexport interface SocialMediaUrl {\n socialMediaId: number;\n source: SocialMediaSource;\n}\n\n\nexport interface LoadSocialMediaResponse extends Response {\n data: {\n pulsemAccountId: number;\n socialMediaUrls: SocialMediaUrl[];\n };\n}\n\n\nexport async function loadSocialMedias(pulsemAccountId: number): Promise {\n return await request.post('/support/social-media-capture-load/load', {\n pulsemAccountId\n }) as LoadSocialMediaResponse\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\nimport { Component, Vue } from 'vue-property-decorator'\nimport { loadSocialMedias, SocialMediaUrl } from '@/helpers/loadSocialMedias'\nimport AccountIdInput from '@/components/ui/AccountIdInput.vue'\nimport TechTaskCard from '@/components/ui/TechTaskCard.vue'\n\n\n// There was an issue importing: '@/types/social-media'\nexport enum SocialMediaSource {\n GOOGLE = 'google',\n FACEBOOK = 'facebook',\n BBB = 'bbb',\n YELLOWPAGES = 'yp',\n ANGIESLIST = 'angieslist',\n HOMESTAR = 'homestar',\n HOUZZ = 'houzz',\n HOMEADVISOR = 'homeadvisor',\n PORCH = 'porch',\n NEXTDOOR = 'nextdoor',\n CUSTOM = 'custom'\n}\n\n\nconst socialMediaTitles: { [key in SocialMediaSource]: string } = {\n [SocialMediaSource.GOOGLE]: 'Google',\n [SocialMediaSource.FACEBOOK]: 'Facebook',\n [SocialMediaSource.BBB]: 'Better Business Bureau',\n [SocialMediaSource.YELLOWPAGES]: 'Yellow Pages',\n [SocialMediaSource.ANGIESLIST]: 'Angie\\'s List',\n [SocialMediaSource.HOMESTAR]: 'HomeStars',\n [SocialMediaSource.HOUZZ]: 'Houzz',\n [SocialMediaSource.HOMEADVISOR]: 'HomeAdvisor',\n [SocialMediaSource.PORCH]: 'Porch',\n [SocialMediaSource.NEXTDOOR]: 'Nextdoor',\n [SocialMediaSource.CUSTOM]: 'Custom'\n}\n\n\ninterface RequestPayload {\n pulsemAccountId: number|null;\n department: string|null;\n source: string|null;\n url: string|null;\n title: string|null;\n after: number|null;\n useAccount: boolean;\n}\n\n\ninterface SelectItem {\n text: string;\n value: string;\n}\n\n\n@Component({\n components: {\n AccountIdInput,\n TechTaskCard\n }\n})\nexport default class UpdateDepartmentSocialMedia extends Vue {\n locationValid = false\n pulsemAccountId: number|null = null\n department: string|null = null\n source: SocialMediaSource|null = null\n url: string|null = null\n title: string|null = null\n after: number|null = null\n useAccount = false\n accountSocialMediaUrls: SocialMediaUrl[] = []\n\n get requestPayload(): RequestPayload {\n return {\n pulsemAccountId: this.pulsemAccountId,\n department: this.department,\n source: this.source,\n url: this.url,\n title: this.title,\n after: this.after,\n useAccount: this.useAccount\n }\n }\n\n /**\n * Is source == 'custom'\n */\n get isCustom(): boolean {\n return this.source === SocialMediaSource.CUSTOM\n }\n\n get allSocialMediasSelect(): Array {\n const selectItems: Array = []\n for (const key in SocialMediaSource) {\n if (Object.prototype.hasOwnProperty.call(SocialMediaSource, key)) {\n const source: SocialMediaSource = SocialMediaSource[key as keyof typeof SocialMediaSource]\n selectItems.push({\n text: socialMediaTitles[source],\n value: source\n })\n }\n }\n return selectItems\n }\n\n /**\n * Account social media urls in format for select picker.\n */\n get accountSocialMediaSelect(): Array {\n const selectItems: Array = []\n for (const url of this.accountSocialMediaUrls) {\n selectItems.push({\n text: socialMediaTitles[url.source as SocialMediaSource],\n value: url.source\n })\n }\n return selectItems\n }\n\n async onLocationChange(locationValid: boolean) {\n this.locationValid = locationValid\n if (this.locationValid) {\n this.accountSocialMediaUrls = (await loadSocialMedias(this.pulsemAccountId as number)).data.socialMediaUrls\n } else {\n this.department = null\n this.source = null\n this.url = null\n this.title = null\n this.after = null\n this.useAccount = false\n this.accountSocialMediaUrls = []\n }\n }\n\n onSuccess(status: boolean) {\n if (status) {\n this.pulsemAccountId = null\n this.department = null\n this.source = null\n this.url = null\n this.title = null\n this.after = null\n this.useAccount = false\n this.accountSocialMediaUrls = []\n }\n }\n}\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!./index.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!./index.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=2ecff5c0&\"\nimport script from \"./index.vue?vue&type=script&lang=ts&\"\nexport * from \"./index.vue?vue&type=script&lang=ts&\"\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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VCheckbox } from 'vuetify/lib/components/VCheckbox';\nimport { VSelect } from 'vuetify/lib/components/VSelect';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VCheckbox,VSelect,VTextField})\n"],"sourceRoot":""}