{"version":3,"sources":["webpack:///./src/views/SellingProcess/attrs/methods.js","webpack:///./src/views/SellingProcess/attrs/data.js","webpack:///./src/views/SellingProcess/Index.vue?38aa","webpack:///./src/views/SellingProcess/attrs/created.js","webpack:///./src/views/SellingProcess","webpack:///./src/views/SellingProcess/Index.vue","webpack:///./src/views/SellingProcess/index.js","webpack:///./src/views/SellingProcess/Index.vue?4ce1"],"names":["checkAccess","loadData","self","this","api","getApiClient","$store","isAdmin","state","user","roles","includes","agency","commit","get","then","response","data","length","termsOfUse","catch","error","console","log","finally","terms","slice","pop","agencyId","id","updateTerms","termsSuccess","termsError","post","content","version","customToolbar","list","render","_vm","_h","$createElement","_c","_self","_v","staticClass","_e","attrs","model","value","callback","$$v","$set","expression","on","$event","preventDefault","staticRenderFns","component","name","created","methods","components","VueEditor"],"mappings":"kHAAA,uBAEe,cACbA,YAAa,aAIbC,SAAU,WAAY,WACdC,EAAOC,KACXC,EAAMC,qBAAaH,EAAKI,QACxBC,EAAUL,EAAKI,OAAOE,MAAMC,KAAKC,MAAMC,SAAS,eAE7CT,EAAKI,OAAOE,MAAMC,KAAKG,QAAWL,KAIvCL,EAAKI,OAAOO,OAAO,gBACdN,EAeHH,EAAIU,IAAI,qCACLC,MAAK,SAAAC,GACAA,EAASC,KAAK,gBAAgBC,SAChC,EAAKC,WAAaH,EAASC,KAAK,gBAAgB,OAGnDG,OAAM,SAAAC,GACLC,QAAQC,IAAIF,MAEbG,SAAQ,WACPtB,EAAKI,OAAOO,OAAO,kBAxBvBT,EAAIU,IAAJ,aACGC,MAAK,SAAAC,GACAA,EAASC,KAAKL,OAAOa,MAAMP,SAC7B,EAAKC,WAAaH,EAASC,KAAKL,OAAOa,MAAMC,OAAO,GAAGC,MACvDzB,EAAK0B,SAAWZ,EAASC,KAAKL,OAAOiB,OAGxCT,OAAM,SAAAC,GACLC,QAAQC,IAAIF,MAEbG,SAAQ,WACPtB,EAAKI,OAAOO,OAAO,oBAkB3BiB,YAAa,WACX,IAAM5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CAAC,GAAK,aAAa,cAAgBR,EAAIH,eAAeY,MAAM,CAACC,MAAOV,EAAIpB,WAAkB,QAAE+B,SAAS,SAAUC,GAAMZ,EAAIa,KAAKb,EAAIpB,WAAY,UAAWgC,IAAME,WAAW,wBAAwBX,EAAG,MAAMA,EAAG,UAAU,CAACK,MAAM,CAAC,KAAO,SAAS,MAAQ,WAAWO,GAAG,CAAC,MAAQ,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBjB,EAAIT,YAAYyB,MAAW,CAAChB,EAAIK,GAAG,gBAAgB,MAAM,IAAI,IAAI,IAC/jCa,EAAkB,I,kCCDtB,OAAe,wBACX,IAAMvD,EAAOC,KAEbD,EAAKD,a,kCCHT,wGAAkL,2B,kCCAlL,oIAOIyD,EAAY,qBACd,aACA,YACA,sBACA,EACA,KACA,KACA,MAIa,aAAAA,E,2CClBf,2DAMe,cACXC,KAAM,iBACNC,qBACA3C,kBACA4C,qBACAC,WAAY,CACRC,4B,kCCZR","file":"js/chunk-585d1c9a.90d02c29.js","sourcesContent":["import getApiClient from '@/plugins/api'\n\nexport default {\n checkAccess: function () {\n\n },\n\n loadData: function () {\n const self = this,\n api = getApiClient(self.$store),\n isAdmin = self.$store.state.user.roles.includes('ROLE_ADMIN')\n\n if (!self.$store.state.user.agency && !isAdmin) {\n return\n }\n\n self.$store.commit('startLoading')\n if (!isAdmin) {\n api.get(`/users/me`)\n .then(response => {\n if (response.data.agency.terms.length) {\n this.termsOfUse = response.data.agency.terms.slice(-1).pop()\n self.agencyId = response.data.agency.id\n }\n })\n .catch(error => {\n console.log(error)\n })\n .finally(() => {\n self.$store.commit('stopLoading')\n })\n } else {\n api.get('terms?company=true&itemsPerPage=1')\n .then(response => {\n if (response.data['hydra:member'].length) {\n this.termsOfUse = response.data['hydra:member'][0]\n }\n })\n .catch(error => {\n console.log(error)\n })\n .finally(() => {\n self.$store.commit('stopLoading')\n })\n }\n },\n\n updateTerms: function () {\n const self = this,\n api = getApiClient(self.$store),\n isAdmin = self.$store.state.user.roles.includes('ROLE_ADMIN')\n\n self.$store.commit('startLoading')\n self.termsSuccess = false\n self.termsError = false\n\n api.post('terms', {\n content: self.termsOfUse.content\n })\n .then((response) => {\n self.termsOfUse = response.data\n if (!isAdmin) {\n self.$store.commit('setAgencyTermsOfUse', response.data)\n }\n self.termsSuccess = true\n self.loadData()\n })\n .catch(() => {\n self.termsError = true\n })\n .finally(() => {\n self.$store.commit('stopLoading')\n })\n }\n}\n","export default function() {\n return {\n termsOfUse: {\n content: '',\n version: 0\n },\n agencyId: null,\n termsSuccess: false,\n termsError: false,\n customToolbar: [[\"bold\", \"italic\", \"underline\"], [{ list: \"ordered\" }, { list: \"bullet\" }]]\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('CCard',[_c('CCardBody',[_c('h1',[_vm._v(\"Termos de aceite\")]),_c('p',[_vm._v(\"Adicione aqui os termos de uso e regras da viagem para que o usuário possa realizar o aceite antes da compra.\")]),(_vm.termsSuccess)?_c('p',{staticClass:\"alert alert-success\"},[_vm._v(\"Termos atualizados!\")]):_vm._e(),(_vm.termsError)?_c('p',{staticClass:\"alert alert-danger\"},[_vm._v(\"Ocorreu um erro ao atualizar os termos. Tente novamente mais tarde.\")]):_vm._e(),_c('CTabs',{attrs:{\"content-class\":\"mt-3\"}},[_c('CTab',{attrs:{\"title\":\"Termos de uso\",\"active\":\"\"}},[_c('form',{attrs:{\"method\":\"POST\"}},[_c('vue-editor',{attrs:{\"id\":\"termsOfUse\",\"editorToolbar\":_vm.customToolbar},model:{value:(_vm.termsOfUse.content),callback:function ($$v) {_vm.$set(_vm.termsOfUse, \"content\", $$v)},expression:\"termsOfUse.content\"}}),_c('br'),_c('CButton',{attrs:{\"type\":\"submit\",\"color\":\"primary\"},on:{\"click\":function($event){$event.preventDefault();return _vm.updateTerms($event)}}},[_vm._v(\"Atualizar\")])],1)])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default function() {\n const self = this\n\n self.loadData()\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Index.vue?vue&type=template&id=3a336fe4&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\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","import created from './attrs/created'\nimport data from './attrs/data'\nimport methods from './attrs/methods'\n\nimport { VueEditor } from \"vue2-editor\";\n\nexport default {\n name: 'SellingProcess',\n created,\n data,\n methods,\n components: {\n VueEditor\n }\n}\n\n","export * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"4727515f-vue-loader-template\\\"}!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=template&id=3a336fe4&\""],"sourceRoot":""}