(function(t){function e(e){for(var i,n,o=e[0],l=e[1],c=e[2],u=0,v=[];u=3?[a("v-col",{staticClass:"pa-0"},[a("v-list",{staticClass:"v-list-search"},[a("v-list-item",{staticClass:"my-0 mx-2 pa-1"},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Resultados para "+t._s(t.search))])],1),!t.$store.state.accounts.retrieveLoader&&t.searchList.length?[t._l(t.searchList,(function(e){return["customer"===e._index?a("v-list-item",{key:e.id,staticClass:"my-0 mx-2 pa-1",on:{click:function(a){return t.goTo("CustomerRetrieveUpdate",e._id)}}},[a("v-list-item-title",[a("v-icon",{attrs:{color:"secondary",left:"",small:""}},[t._v("mdi-account-box")]),e._source.name?a("span",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v(t._s(e._source.name))]):t._e()],1)],1):t._e(),"invoice"===e._index?a("v-list-item",{key:e.id,staticClass:"my-0 mx-2 pa-1",on:{click:function(a){return t.goTo("InvoiceRetrieve",e._id)}}},[a("v-list-item-title",[a("v-icon",{attrs:{color:"secondary",left:"",small:""}},[t._v("mdi-receipt")]),a("span",{staticClass:"subtitle-2 text--secondary font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(e._source.total,e._source.currency))+" "+t._s(e._source.currency))]),a("span",{staticClass:"mr-1"},[t._v(t._s(e._source.document))]),"finalized"===e._source.status&&e._source.due_date>t.today?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary","x-small":""}},[t._v("Pendiente de pago")]):"finalized"===e._source.status&&e._source.due_date<=t.today?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary","x-small":""}},[t._v("Vencido")]):"paid"===e._source.status?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary","x-small":""}},[t._v("Pagado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):"cancelled"===e._source.status?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary","x-small":""}},[t._v("Tiene nota de crédito"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):t._e()],1),e._source.date?a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("date")(e._source.date)))]):t._e()],1):t._e()]}))]:t._e()],2)],1),t.$store.state.accounts.retrieveLoader||t.searchList.length?t._e():a("v-col",{staticClass:"text-center py-12"},[a("v-icon",{staticClass:"mb-5",attrs:{color:"secondary",size:"40"}},[t._v("mdi-magnify")]),a("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v("No se han encontrado resultados para tu búsqueda")]),a("span",{staticClass:"d-block"},[t._v("Inténtalo de nuevo con una búsqueda diferente")])],1)]:t._e()],2)],1)],1)},d=[],u=(a("d3b7"),a("ac1f"),a("841c"),a("2f62")),v=(a("b0c0"),a("b64b"),a("5319"),a("99af"),a("7db0"),a("a15b"),a("d81d"),a("13d5"),a("fb6a"),a("25f0"),a("1276"),a("3a60")),m=a("ffec"),p=a("c1df"),h=a.n(p),f=a("6612"),b=a.n(f),g=a("2ef0"),_=a("516b");h.a.locale("es");var y=[{id:"USD",format:{precision:2,thousand:",",decimal:"."},country:"US",name:"Dólar estadounidense",conversion:null},{id:"ARS",format:{precision:2,thousand:",",decimal:"."},country:"AR",name:"Peso argentino",conversion:null},{id:"AUD",format:{precision:2,thousand:",",decimal:"."},country:"AU",name:"Dólar australiano",conversion:null},{id:"CAD",format:{precision:2,thousand:",",decimal:"."},country:"CA",name:"Dólar canadiense",conversion:null},{id:"CHF",format:{precision:2,thousand:",",decimal:"."},country:"CH",name:"Franco suizo",conversion:null},{id:"CLF",format:{precision:2,thousand:",",decimal:"."},country:"CL",name:"Unidad de fomento chilena",conversion:"CLP"},{id:"CLP",format:{precision:0,thousand:".",decimal:","},country:"CL",name:"Peso chileno",conversion:null},{id:"CZK",format:{precision:2,thousand:",",decimal:"."},country:"CZ",name:"Corona checa",conversion:null},{id:"DKK",format:{precision:2,thousand:",",decimal:"."},country:"DK",name:"Corona danesa",conversion:null},{id:"EUR",format:{precision:2,thousand:",",decimal:"."},country:"EU",name:"Euro",conversion:null},{id:"GBP",format:{precision:2,thousand:",",decimal:"."},country:"GB",name:"Libra esterlina",conversion:null},{id:"HKD",format:{precision:2,thousand:",",decimal:"."},country:"HK",name:"Dólar hongkonés",conversion:null},{id:"HUF",format:{precision:2,thousand:",",decimal:"."},country:"HU",name:"Florín húngaro",conversion:null},{id:"IDR",format:{precision:2,thousand:",",decimal:"."},country:"ID",name:"Rupia indonesia",conversion:null},{id:"ILS",format:{precision:2,thousand:",",decimal:"."},country:"IL",name:"Nuevo shekel israelí",conversion:null},{id:"JPY",format:{precision:0,thousand:".",decimal:","},country:"JP",name:"Yen japones",conversion:null},{id:"MYR",format:{precision:2,thousand:",",decimal:"."},country:"MY",name:"Ringgit malayo",conversion:null},{id:"MXN",format:{precision:2,thousand:",",decimal:"."},country:"MX",name:"Peso mexicano",conversion:null},{id:"NOK",format:{precision:2,thousand:",",decimal:"."},country:"NO",name:"Corona noruega",conversion:null},{id:"NZD",format:{precision:2,thousand:",",decimal:"."},country:"NZ",name:"Dólar neozelandés",conversion:null},{id:"PHP",format:{precision:2,thousand:",",decimal:"."},country:"PH",name:"Peso filipino",conversion:null},{id:"PLN",format:{precision:2,thousand:",",decimal:"."},country:"PL",name:"Zloty polaco",conversion:null},{id:"RUB",format:{precision:2,thousand:",",decimal:"."},country:"RU",name:"Rublo ruso",conversion:null},{id:"SEK",format:{precision:2,thousand:",",decimal:"."},country:"SE",name:"Corona sueca",conversion:null},{id:"SGD",format:{precision:2,thousand:",",decimal:"."},country:"SG",name:"Dólar singapurense",conversion:null},{id:"TWD",format:{precision:2,thousand:",",decimal:"."},country:"TW",name:"Nuevo dólar taiwanés",conversion:null}],C=["US1","CL110"],x=[{id:"DE",name:"Alemania",invoiceTypes:C},{id:"AR",name:"Argentina",invoiceTypes:C},{id:"AU",name:"Australia",invoiceTypes:C},{id:"AT",name:"Austria",invoiceTypes:C},{id:"BE",name:"Bélgica",invoiceTypes:C},{id:"BO",name:"Bolivia",invoiceTypes:C},{id:"BR",name:"Brasil",invoiceTypes:C},{id:"CA",name:"Canada",invoiceTypes:C},{id:"CL",name:"Chile",invoiceTypes:["US1","CL33","CL34","CL39","CL41"]},{id:"CO",name:"Colombia",invoiceTypes:C},{id:"CR",name:"Costa Rica",invoiceTypes:C},{id:"DK",name:"Dinamarca",invoiceTypes:C},{id:"EC",name:"Ecuador",invoiceTypes:C},{id:"SV",name:"El Salvador",invoiceTypes:C},{id:"SK",name:"Eslovaquia",invoiceTypes:C},{id:"SI",name:"Eslovenia",invoiceTypes:C},{id:"ES",name:"España",invoiceTypes:C},{id:"US",name:"Estados Unidos",invoiceTypes:C},{id:"EE",name:"Estonia",invoiceTypes:C},{id:"PH",name:"Filipinas",invoiceTypes:C},{id:"FI",name:"Finlandia",invoiceTypes:C},{id:"FR",name:"Francia",invoiceTypes:C},{id:"GR",name:"Grecia",invoiceTypes:C},{id:"GT",name:"Guatemala",invoiceTypes:C},{id:"HK",name:"Hong Kong",invoiceTypes:C},{id:"HU",name:"Hungria",invoiceTypes:C},{id:"ID",name:"Indonesia",invoiceTypes:C},{id:"IE",name:"Irlanda",invoiceTypes:C},{id:"KY",name:"Islas Caimán",invoiceTypes:C},{id:"IL",name:"Israel",invoiceTypes:C},{id:"IT",name:"Italia",invoiceTypes:C},{id:"JP",name:"Japon",invoiceTypes:C},{id:"LV",name:"Letonia",invoiceTypes:C},{id:"LT",name:"Lituania",invoiceTypes:C},{id:"LU",name:"Luxemburgo",invoiceTypes:C},{id:"MY",name:"Malasia",invoiceTypes:C},{id:"MX",name:"México",invoiceTypes:C},{id:"NO",name:"Noruega",invoiceTypes:C},{id:"NZ",name:"Nueva Zelanda",invoiceTypes:C},{id:"NL",name:"Paises Bajos",invoiceTypes:C},{id:"PA",name:"Panama",invoiceTypes:C},{id:"PY",name:"Paraguay",invoiceTypes:C},{id:"PE",name:"Perú",invoiceTypes:C},{id:"PL",name:"Polonia",invoiceTypes:C},{id:"PT",name:"Portugal",invoiceTypes:C},{id:"PR",name:"Puerto Rico",invoiceTypes:C},{id:"GB",name:"Reino Unido",invoiceTypes:C},{id:"CZ",name:"República Checa",invoiceTypes:C},{id:"RU",name:"Rusia",invoiceTypes:C},{id:"SG",name:"Singapur",invoiceTypes:C},{id:"SE",name:"Suecia",invoiceTypes:C},{id:"CH",name:"Suiza",invoiceTypes:C},{id:"TW",name:"Taiwan",invoiceTypes:C},{id:"UY",name:"Uruguay",invoiceTypes:C},{id:"VE",name:"Venezuela",invoiceTypes:C}],w=[{id:"weekly",name:"semanal"},{id:"every_fifteen_days",name:"cada 15 días"},{id:"monthly",name:"mensual"},{id:"bimonthly",name:"cada 2 meses"},{id:"quarterly",name:"cada 3 meses"},{id:"biannual",name:"cada 6 meses"},{id:"annual",name:"anual"}],$={directives:{mask:v["mask"],dni:{update:function(t,e,a){var i=e.value||"CL";a.context.listenerAttached&&(t.removeEventListener("input",a.context.rutFunction),a.context.listenerAttached=!1),a.context.rutFunction=function(t){a.componentInstance.$emit("input","CL"===i?Object(m["rutFormat"])(t.target.value):t.target.value)},t.addEventListener("input",a.context.rutFunction),a.context.listenerAttached=!0}}},data:function(){return{baseCountries:x,currencies:y,currentMonth:h()().format("MMMM"),dropdowns:[],dropdownShow:!1,frequencies:w,listenerAttached:!1,periods:[{label:"3 meses",value:h()().subtract(2,"months").startOf("month").format("YYYY-MM-DD")},{label:"6 meses",value:h()().subtract(5,"months").startOf("month").format("YYYY-MM-DD")},{label:"12 meses",value:h()().subtract(11,"months").startOf("month").format("YYYY-MM-DD")},{label:"24 meses",value:h()().subtract(23,"months").startOf("month").format("YYYY-MM-DD")}],rutFunction:!1,today:h()().format("YYYY-MM-DD")}},computed:Object(u["c"])({account:function(t){return t.auth.account}}),filters:{currency:function(t,e){var a=y.find((function(t){return t.id===e}));if(!a)return t;var i=Object.assign({},a.format,{symbol:""});return Object(_["a"])(t,i)},number:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return b.a.localeData().delimiters.thousands=e?".":",",b.a.localeData().delimiters.decimal=e?",":".",b()(t).format(e?"0,0":"0,0.00")},date:function(t){return h()(t).format("DD MMM YYYY")},dateConditional:function(t){return h()(t,"hmm").format("HH:mm")>"24:00"?h()(t).format("DD MMM YYYY hh:mm"):h()(t).fromNow()},dateTime:function(t){return h()(t).format("DD MMM YYYY HH:mm")},dateFromNow:function(t){return t?h()(t).fromNow():null},capitalize:function(t){return"".concat(t.toString().charAt(0).toUpperCase()).concat(t.toString().slice(1))},lower:function(t){return t.toString().toLowerCase()}},methods:{dateIsBefore:function(t,e){return h()(t).isBefore(e)},debounceMethod:Object(g["debounce"])((function(t){return t()}),700),sumProperty:function(t,e){return t.length?t.map((function(t){return parseInt(t[e])})).reduce((function(t,e){return t+e})):0},toClipboard:function(t){var e=this;this.$copyText(t).then((function(){e.$dialog.message.info("Copiado")}))},parseErrorsDict:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api",i=Object(g["template"])(''),s=[];return Object(g["each"])(t,(function(t,i){var r=Object(g["template"])('
  • <%= name %> <%= content %>
  • '),n=Object(g["template"])('<%= value %>'),o=null,l=null,c=null;if(Object(g["isString"])(t)?o=t:Object(g["isArray"])(t)&&(Object(g["isString"])(t[0])?o=t.join(" "):l=e.parseErrorsList(t)),o?c=n({value:o}):l&&(c=l),c){if(a)if(-1!==i.search(/_(\d+)$/)){var d=i.split("_");i=e.$t("".concat(a,".").concat(d[0]),{number:d[1]})}else i=e.$t("".concat(a,".").concat(i));s.push(r({name:i,content:c}))}})),s=s.join(" "),s&&(s=i({content:s})),s},parseErrorsList:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api",i=Object(g["template"])("<%= content %>"),s=[];return Object(g["each"])(t,(function(t,i){Object(g["isEmpty"])(t)||s.push(e.parseErrorsDict(t,a))})),s=s.join(" "),s&&(s=i({content:s})),s},parseErrors:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";return Object(g["isArray"])(t)?this.parseErrorsList(t,e):this.parseErrorsDict(t,e)},startTour:function(t){window.Intercom("startTour",t)},intercomNewMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";window.Intercom("showNewMessage",t)},formatNumber:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return e?Math.round(t):Math.round(t*Math.pow(10,a))/Math.pow(10,a)}}},k={props:{showPagination:{type:Boolean,required:!1,default:function(){return!0}},showCreate:{type:Boolean,required:!1,default:function(){return!1}},showCriteria:{type:Object,required:!1,default:function(){return{}}},showStatus:{type:Boolean,required:!1,default:function(){return!0}},hasLink:{type:Boolean,required:!1,default:function(){return!0}}},mixins:[$],data:function(){return{page:parseInt((this.$route.query||{}).page||1),query:{},pagination:20,selectedRows:[],dialogCreate:!1}},computed:{showAll:function(){return Object.keys(this.showCriteria).length},totalPages:function(){return this.count>this.pagination?Math.ceil(this.count/this.pagination):1}},created:function(){"function"===typeof this.getList&&this.getList()},watch:{$route:function(){"function"===typeof this.getList&&this.getList()},page:function(){this.setPage()}},methods:{setQuery:function(){this.$router.replace({name:this.$route.name,query:this.query}).catch((function(){}))},setPage:function(){if(this.$route.query.page===this.page)return!1;this.$router.replace({name:this.$route.name,query:Object.assign({},this.$route.query,{page:this.page})})},setSort:function(t){this.$route.query.ordering===t&&(t="-".concat(t)),this.$router.replace({name:this.$route.name,query:Object.assign({},this.$route.query,{ordering:t})}).catch((function(t){return t}))}}},V=a("b047"),L=a.n(V),S={mixins:[k],data:function(){return{search:"",loader:!1,menu:!1}},computed:Object(u["c"])({searchList:function(t){return t.accounts.searchList},searchCount:function(t){return t.accounts.searchCount}}),watch:{search:L()((function(){if(this.search.length<3)return!1;this.menu=!0,this.getSearch()}),600),$route:function(){this.search=""}},methods:{getSearch:function(){var t=this,e={query:this.search};this.loader=!0,this.$store.dispatch("accounts/SEARCH_LIST",{resource:"search",query:e}).finally((function(){t.loader=!1}))},goTo:function(t,e){this.$router.push({name:t,params:{id:e}}).catch((function(t){return t})),this.menu=!1}}},T=S,E=a("2877"),D=a("6544"),A=a.n(D),j=a("cc20"),q=a("62ad"),I=a("132d"),O=a("8860"),R=a("da13"),N=a("5d23"),P=a("e449"),B=a("490a"),z=a("0fd9"),F=a("8654"),M=Object(E["a"])(T,c,d,!1,null,null,null),U=M.exports;A()(M,{VChip:j["a"],VCol:q["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VProgressCircular:B["a"],VRow:z["a"],VTextField:F["a"]});var G=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-menu",{attrs:{"close-on-content-click":!1,"nudge-width":350,"nudge-bottom":18,"offset-y":"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"mr-16",attrs:{text:"",icon:"",ripple:!1}},"v-btn",s,!1),i),[a("v-badge",{attrs:{content:t.unread,value:t.unread,color:"red"}},[a("v-icon",{staticClass:"text--secondary",attrs:{size:"24"}},[t._v("mdi-bell-outline")])],1)],1)]}}]),model:{value:t.menu,callback:function(e){t.menu=e},expression:"menu"}},[a("v-responsive",{staticClass:"overflow-y-auto",attrs:{height:t.editable.length?"600":"400"}},[a("v-subheader",{staticClass:"pl-5 subtitle-1 text--secondary font-weight-medium"},[t._v("Notificaciones")]),a("v-divider",{staticClass:"ma-0 grey lighten-3"}),t.editable.length?[t._l(t.editable,(function(e,i){return a("v-row",{key:i,staticClass:"mx-0",attrs:{align:"center","no-gutters":""}},[a("v-col",{staticClass:"pa-0"},[t.loading?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item-avatar-three-line"}}):[a("v-hover",{attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(i){var s=i.hover;return[a("v-lazy",{attrs:{value:t.pag,options:{threshold:.5},"min-height":"80",transition:"fade-transition"},model:{value:e.isActiveMsg,callback:function(a){t.$set(e,"isActiveMsg",a)},expression:"notification.isActiveMsg"}},[a("v-row",{class:s?"grey lighten-4 pt-2":"pt-2",attrs:{align:"start",justify:"center"}},[a("v-col",{staticClass:"py-1 px-0",attrs:{cols:"10"}},[a("v-row",{attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticStyle:{"line-height":"10px"},attrs:{cols:"11"}},[a("span",{staticClass:"subtitle-2 secondary--text font-weight-medium"},[t._v(t._s(e.title))]),a("span",{staticClass:"d-block subtitle-2"},[t._v(t._s(e.message))])]),a("v-col",{staticClass:"mx-0",attrs:{cols:"1"}},["unread"===e.status?a("v-icon",{attrs:{color:"primary",small:""}},[t._v("mdi-circle")]):t._e()],1)],1),a("v-row",{staticClass:"mt-n2",attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticClass:"ml-0 py-2",attrs:{cols:"7"}},["invoice"===e.model?a("v-chip",{attrs:{color:"primary","x-small":"","text-color":"white"}},[t._v("Facturas")]):"payment"===e.model?a("v-chip",{attrs:{color:"primary","x-small":"","text-color":"white"}},[t._v("Pagos")]):"subscription"===e.model?a("v-chip",{attrs:{color:"primary","x-small":"","text-color":"white"}},[t._v("Suscripciones")]):t._e(),a("span",{class:("unread"===e.status?"primary--text":"secondary--text")+" caption font-weight-medium pl-3"},[t._v(t._s(t._f("dateConditional")(e.created)))])],1),a("v-col",{staticClass:"py-0 text-center",attrs:{cols:"5"}},[s?["unread"===e.status?a("v-btn",{staticClass:"caption",attrs:{text:""},on:{click:function(a){return t.updateStatusNotification(e.id,e.status="read")}}},[a("v-icon",{staticClass:"mr-1",attrs:{color:"primary",small:""}},[t._v("mdi-check")]),t._v("Marcar como leido")],1):t._e(),"read"===e.status?a("v-btn",{staticClass:"caption",attrs:{text:""},on:{click:function(a){return t.updateStatusNotification(e.id,e.status="unread")}}},[a("v-icon",{staticClass:"mr-1",attrs:{color:"primary",small:""}},[t._v("mdi-check")]),t._v("Marcar como no leido")],1):t._e()]:t._e()],2)],1)],1)],1)],1)]}}],null,!0)}),a("v-divider",{staticClass:"mx-0 grey lighten-3"})]],2)],1)})),t.loading||t.totalPages===t.page?t._e():a("v-col",{staticClass:"py-1 text-center"},[a("v-row",{attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:function(e){return t.seeMore()}}},[t._v("Ver más")])],1)],1)]:a("v-row",{staticStyle:{"min-height":"300px"},attrs:{align:"center",justify:"center"}},[a("v-col",{staticClass:"mx-5 text-center"},[a("v-icon",{staticClass:"mb-5",attrs:{color:"secondary",size:"40"}},[t._v("mdi-bell-off")]),a("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v("Aún no tienes notificaciones")])],1)],1)],2)],1)},H=[],Y=(a("4de4"),a("2909")),W=a("0644"),Q=a.n(W),K={mixins:[$,k],data:function(){return{pag:1,menu:!1,isActiveMsg:!1,loading:!1,editable:[{status:"read"}],notificationsPage:[]}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({notificationsList:function(t){return t.accounts.notificationsList},count:function(t){return t.accounts.notificationsCount},memberID:function(t){return t.auth.account.me}})),{},{unread:function(){return this.editable.filter((function(t){return"unread"===t.status})).length}}),created:function(){this.getList()},mounted:function(){var t=this,e=this.$pusher.subscribe(this.memberID);e.bind("new_notification",(function(e){t.getList()}))},methods:{getList:function(){var t=this;this.loading=!0,this.$store.dispatch("accounts/LIST",{resource:"notifications",id:this.$store.state.auth.account.id}).then((function(){t.editable=Q()(t.notificationsList)})).finally((function(){t.loading=!1}))},updateStatusNotification:function(t,e){var a={status:e};this.$store.dispatch("accounts/UPDATE",{resource:"notifications",payload:a,id:t})},seeMore:function(){var t=this;this.pag++,this.pag>0&&this.pag<=this.totalPages&&this.$store.dispatch("accounts/LIST",{resource:"notifications",query:Object.assign({},this.$route.query,{page:this.pag})}).then((function(e){var a=e.data.results;t.notificationsPage=Q()(a),t.editable=[].concat(Object(Y["a"])(t.editable),Object(Y["a"])(t.notificationsPage))}))}}},X=K,J=a("4ca6"),Z=a("8336"),tt=a("ce7e"),et=a("ce87"),at=a("b687"),it=a("6b53"),st=a("3129"),rt=a("e0c7"),nt=Object(E["a"])(X,G,H,!1,null,null,null),ot=nt.exports;A()(nt,{VBadge:J["a"],VBtn:Z["a"],VChip:j["a"],VCol:q["a"],VDivider:tt["a"],VHover:et["a"],VIcon:I["a"],VLazy:at["a"],VMenu:P["a"],VResponsive:it["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSubheader:rt["a"]});var lt={components:{SearchBar:U,Notifications:ot}},ct=lt,dt=a("40dc"),ut=a("2fa4"),vt=Object(E["a"])(ct,o,l,!1,null,null,null),mt=vt.exports;A()(vt,{VAppBar:dt["a"],VBtn:Z["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemTitle:N["c"],VMenu:P["a"],VSpacer:ut["a"]});var pt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.$store.state.auth.account.id&&t.$route.meta.displayNavigationDrawer?i("v-row",{attrs:{"no-gutters":""}},[i("v-navigation-drawer",{key:t.resetDrawer,staticClass:"elevation-0",attrs:{color:t.drawColor,app:"","expand-on-hover":"",temporary:t.test,permanent:!t.test,"overlay-color":"#0022B2","overlay-opacity":".10"},on:{transitionend:function(e){t.test=!t.test}},scopedSlots:t._u([{key:"append",fn:function(){return[i("v-list",{staticClass:"px-4",attrs:{dense:""}},[i("v-list-item",{staticClass:"mb-4",attrs:{to:{name:""+t.items[4].link},ripple:!1,"active-class":"transparent"},on:{click:function(e){e.stopPropagation(),t.drawer=!["AccountDashboard","Applications"].includes(t.selectedIcon)}}},[i("v-list-item-icon",[i("v-icon",{attrs:{color:t.selectedIcon===t.items[4].link?"primary":"darkenGrey"}},[t._v("mdi-cog-outline")])],1),i("v-list-item-title",[[i("span",{staticClass:"text-none subtitle-2 font-weight-medium secondary--text"},[t._v("Configuración")])]],2)],1)],1)]},proxy:!0}],null,!1,3565982661),model:{value:t.draw,callback:function(e){t.draw=e},expression:"draw"}},[i("v-list",{staticClass:"px-4 v-list-drawer"},[i("v-row",{staticClass:"my-6",attrs:{align:"center",justify:"center"}},[i("img",{staticStyle:{"z-index":"100 !important"},attrs:{src:a("026d"),width:"30"}})]),t._l(t.items.slice(0,4),(function(e){return i("v-list-item",{key:e.title,attrs:{link:"",exact:"",ripple:!1},on:{click:function(a){return t.tests(e.show)}}},[i("v-list-item-icon",[i("v-icon",{attrs:{color:t.selectedIcon===e.link?"primary":""}},[t._v(t._s(e.icon))])],1),i("v-list-item-content",{staticClass:"mt-1 ml-n3 my-0 delay_list-drawer"},["Dashboard"===e.title?i("v-list-item",{attrs:{to:"Dashboard"===e.title?{name:""+e.link}:"",ripple:!1,exact:"","exact-active-class":"red"}},[i("v-list-item-title",{staticClass:"text-none subtitle-2 font-weight-medium"},[t._v(t._s(e.title))])],1):i("v-list-group",{staticClass:"delay__groups",attrs:{value:!(!t.test||t.selectedIcon!==e.link)&&e.show,"no-action":"","active-class":"transparent",exact:"",ripple:!1},scopedSlots:t._u([{key:"activator",fn:function(){return[i("v-list-item-title",{staticClass:"text-none subtitle-2 font-weight-medium d-inline-block text-truncate",staticStyle:{"max-width":"110px"}},[t._v(t._s(e.title))])]},proxy:!0}],null,!0)},t._l(e.options,(function(e){return i("v-list-item",{key:e.link,staticClass:"pl-0 my-0 py-1",attrs:{"active-class":"transparent font-weight-black",ripple:!1,to:"Dashboard"!==e.title?{name:""+e.link}:"",exact:""}},[i("v-list-item-title",{staticClass:"text-none subtitle-2 font-weight-medium"},[t._v(t._s(e.title))])],1)})),1)],1)],1)}))],2)],1)],1):t._e()},ht=[],ft=(a("45fc"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-list-group",{attrs:{"no-action":"",value:!0,ripple:!1,"active-class":"transparent"},scopedSlots:t._u([{key:"activator",fn:function(){return[a("v-list-item-title",{staticClass:"text-none subtitle-2 font-weight-medium"},[t._v("Colección de métricas")])]},proxy:!0}])},t._l(t.collection,(function(e){return a("v-list-item",{key:e.metrics,staticClass:"pl-4",attrs:{"active-class":"transparent",exact:"",ripple:!1,to:{name:"MetricList",query:{ref:e.category}}}},[a("v-list-item-title",{staticClass:"text-none body-2 font-weight-medium"},[t._v(t._s(e.category))])],1)})),1)}),bt=[],gt=[{id:0,name:"churn_mrr",description:"Ingresos mensuales recurrentes perdidos por cancelaciones durante el período.",type:{kpi:{displayComparative:!0},graph:{class:"line"}},currency:!0,category:"MRR",active:!0},{id:1,name:"cancellation_mrr_by_plan",description:"Ingresos mensuales recurrentes perdidos debido a cancelaciones durante el período por cada plan.",type:["kpi","graph"],category:"",active:!1},{id:2,name:"net_growth_mrr",description:"Aumento o disminución neto de los ingresos recurrentes mensuales durante el período.",type:{kpi:{displayComparative:!0},graph:{labels:["Nuevo","Expansión","Contracción","Abandono","Crecimiento neto"],colors:["#3F51B5","#9FA8DA","#FFECB3","#FFC107","#1A237E"],class:"barStacked"}},currency:!0,category:"MRR",active:!0},{id:3,name:"abandonment_breakdown_report_by_record_date",description:"Desglose del abandono durante el período especificado en varios intervalos de tiempo.",type:["table"],category:"",active:!1},{id:4,name:"signups",description:"Número total de inscripciones durante el período.",type:["kpi","graph"],category:"",active:!1},{id:5,name:"total_billing",description:"Valor total de las facturas generadas durante el período.",type:{kpi:{displayComparative:!0},graph:{class:"line"}},currency:!0,category:"Facturación",active:!0},{id:6,name:"total_billing_non_recurring",description:"Ingresos no recurrentes totales facturados en un período en particular.",type:{kpi:{displayComparative:!0},graph:{class:"line"}},currency:!0,category:"Facturación",active:!0},{id:7,name:"total_tax",description:"Total de impuestos aplicados a las facturas durante el período de tiempo.",type:{kpi:{displayComparative:!0},graph:{class:"line"}},currency:!0,category:"Impuestos",active:!0},{id:8,name:"total_cancelled_billing",description:"Valor total de todas las facturas anuladas durante el período.",type:{kpi:{append:"CLP",displayComparative:!0},graph:{class:"line"}},currency:!0,category:"Facturación",active:!0},{id:9,name:"net_billing",description:"Valor total de las facturas después de excluir el valor de las notas de crédito emitidas y los impuestos.",type:{kpi:{displayComparative:!0},graph:{class:"line"}},currency:!0,category:"Facturación",active:!0},{id:10,name:"total_receivables_overdue",description:"Total por cobrar de facturas que han superado la fecha de vencimiento del pago.",type:{kpi:{displayComparative:!1}},currency:!0,category:"Cobranza",active:!0},{id:11,name:"total_receivables_current_due",description:"Total por cobrar de facturas que no han superado la fecha de vencimiento.",type:{kpi:{displayComparative:!1}},currency:!0,category:"Cobranza",active:!0},{id:12,name:"overdue_billing_recovery_breakdown",description:"Agrupación de facturas no pagadas según el número de días vencidos.",type:{table:{headers:[{text:"Días",value:"label",class:"font-weight-bold",sortable:!1},{text:"Número de facturas",value:"data",class:"font-weight-bold",sortable:!1}]}},currency:!1,category:"Cobranza",active:!0},{id:13,name:"Desglose de recuperación de facturas vencidas",description:"Tabla que muestra las facturas que se pagaron después de la fecha de vencimiento, agrupadas por número de días que se tomó en pagar después de la fecha de vencimiento.",type:["table"],category:"",active:!1},{id:14,name:"Notas de crédito totales",description:"Valor total de las notas de crédito emitidas durante el período.",type:["kpi","graph"],category:"",active:!1},{id:15,name:"Fuga de ingresos por cupón de descuento",description:"Desglose de la pérdida de ingresos por cada cupón de descuento.",type:["graph"],category:"",active:!1},{id:16,name:"Resumen de fugas de ingresos: cupones",description:"Resumen de la cantidad de veces que se canjeó un cupón y el valor total que se le atribuyó.",type:["table"],category:"",active:!1},{name:"Resumen de ingresos por complementos recurrentes",description:"Desglose de los ingresos generados por complementos recurrentes.",type:["table"],category:"",active:!1},{id:17,name:"Resumen de ingresos por complementos",description:"Desglose de los ingresos generados por complementos no recurrentes.",type:["table"],category:"",active:!1},{id:18,name:"Clientes activos totales",description:"",type:["kpi","graph"],category:"",active:!1},{id:19,name:"Flujo de caja recurrente",description:"Valor total de los pagos recibidos contra facturas recurrentes.",type:["kpi","graph"],category:"",active:!1},{id:20,name:"Flujo de caja no recurrente",description:"Valor total de los pagos recibidos contra facturas no recurrentes.",type:["kpi","graph"],category:"",active:!1},{id:21,name:"Flujo de caja bruto",description:"Total de pagos recurrentes y no recurrentes recibidos durante el período.",type:["kpi","graph"],category:"",active:!1},{id:22,name:"Reembolsos",description:"Valor total de los reembolsos realizados a los clientes durante el período.",type:["kpi","graph"],category:"",active:!1},{id:23,name:"Reembolsos por Gateway",description:"Valor total de los reembolsos realizados a los clientes durante el período, segmentado por pasarela de pagos.",type:["kpi","graph"],category:"",active:!1},{id:24,name:"Reembolsos por método de pago",description:"Valor total de los reembolsos realizados a los clientes durante el período, segmentado por método de pago.",type:["kpi","graph"],category:"",active:!1},{id:25,name:"Número de transacciones de pago",description:"Número total de transacciones de pago durante el período.",type:["kpi","graph"],category:"",active:!1},{id:26,name:"Número de transacciones de reembolso",description:"Número total de transacciones de reembolso durante el período.",type:["kpi","graph"],category:"",active:!1},{id:27,name:"Flujo de caja bruto por Gateway",description:"Valor total de los pagos recibidos durante el período segmentados por pasarela de pago.",type:["graph"],category:"",active:!1},{id:28,name:"Flujo de caja bruto por método de pago",description:"Valor total de los pagos recibidos durante el período segmentados por método de pago.",type:["graph"],category:"",active:!1},{id:29,name:"Resumen de transacciones de pago",description:"Un resumen de las transacciones de pago exitosas, fallidas, anuladas, en progreso y de tiempo de espera mes a mes.",type:["graph"],category:"",active:!1},{id:30,name:"Flujo de efectivo neto",description:"Neto de flujo de caja bruto y reembolsos durante el período.",type:["graph"],category:"",active:!1},{id:31,name:"Resumen de transacciones de reembolso",description:"Un resumen de las transacciones de reembolso exitosas, fallidas, anuladas, en curso y por tiempo de espera, mes a mes.",type:["graph"],category:"",active:!1},{id:32,name:"Número de transacciones de pago anuladas",description:"Número total de transacciones de pago anuladas durante el período.",type:["kpi","graph"],category:"",active:!1},{id:33,name:"Número de transacciones de pago fallidas por Gateway",description:"Número total de transacciones de pago fallidas durante el período segmentadas por Gateway",type:["graph"],category:"",active:!1},{id:34,name:"Número de transacciones de pago fallidas por método de pago",description:"Número total de transacciones de pago fallidas durante el período segmentadas por método de pago.",type:["graph"],category:"",active:!1},{id:35,name:"Número de transacciones de reembolso fallidas",description:"Número total de transacciones de reembolso fallidas durante el período.",type:["kpi","graph"],category:"",active:!1},{id:36,name:"Tarjetas caducadas",description:"Este es el número total de tarjetas de crédito que vencieron en los últimos seis meses.",type:["table"],category:"",active:!1},{id:37,name:"Tarjetas a punto de expirar",description:"Este es el número total de tarjetas de crédito que vencerán en los siguientes seis meses.",type:["table"],category:"",active:!1},{id:38,name:"Cancelación de MRR por país",description:"Ingresos mensuales recurrentes perdidos por cancelaciones durante el período segmentado por país.",type:["graph"],category:"",active:!1},{id:39,name:"Resumen de impuestos por nombre de impuestos",description:"",type:["table"],category:"",active:!1},{id:40,name:"Resumen de errores de pagos",description:"Número total de transacciones de error segmentadas por código de error mientras se procesa una transacción de pago.",type:["table"],category:"",active:!1},{id:41,name:"Resumen de errores de reembolsos",description:"Número total de transacciones de error segmentadas por código de error mientras se procesa un reembolso.",type:["table"],category:"",active:!1},{id:42,name:"total_receivables",description:"Total por cobrar de facturas no vencidas y vencidas.",type:{kpi:{displayComparative:!1}},currency:!0,category:"Cobranza",active:!0}],_t={data:function(){return{metrics:gt}},computed:{collection:function(){var t=[];return t=Object(g["uniqBy"])(this.metrics,"category"),t.filter((function(t){return""!==t.category}))}}},yt=_t,Ct=a("56b0"),xt=Object(E["a"])(yt,ft,bt,!1,null,null,null),wt=xt.exports;A()(xt,{VListGroup:Ct["a"],VListItem:R["a"],VListItemTitle:N["c"]});var $t=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("v-list-item-title",{staticClass:"subtitle-2 d-inline-block text-truncate",staticStyle:{"max-width":"160px"}},[t._v("Mis Dashboards")]),t.loading?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item-three-line"}}):t._l(t.dashboardsList,(function(e){return a("v-list-item",{key:e.id,staticClass:"py-0 pl-4",attrs:{exact:"",ripple:!1},on:{click:function(a){return t.goToDetails(e.id)}}},[a("v-list-item-title",{staticClass:"subtitle-2 d-inline-block text-truncate",staticStyle:{"max-width":"160px"}},[t._v(t._s(e.name))])],1)}))],2)},kt=[],Vt={data:function(){return{loading:!1,updateKey:0}},computed:Object(u["c"])({dashboardsList:function(t){return t.dashboards.dashboardsList}}),created:function(){var t=this;this.dashboardsList.length||(this.loading=!0,this.$store.dispatch("dashboards/LIST",{resource:"metrics/dashboards"}).then((function(){t.loading=!1})))},methods:{goToDetails:function(t){this.$router.push({name:"DashboardUpdate",params:{id:t}}).catch((function(t){return t}))}}},Lt=Vt,St=(a("312f"),Object(E["a"])(Lt,$t,kt,!1,null,"4e6789ee",null)),Tt=St.exports;A()(St,{VListItem:R["a"],VListItemTitle:N["c"],VSkeletonLoader:st["a"]});var Et={components:{MetricsDropDown:wt,DashboardDropDown:Tt},data:function(){return{test:!1,draw:!0,isTransitionend:{},resetDrawer:0,drawer:!1,newRoute:"",selectedIcon:"AccountDashboard",currentOption:{title:"Dashboard",icon:"mdi-view-dashboard-outline",link:"AccountDashboard"},items:[{title:"Dashboard",icon:"mdi-view-dashboard-outline",link:"AccountDashboard"},{title:"Facturación",icon:"mdi-file-document-outline",link:"InvoiceList",show:!0,options:[{title:"Documentos",link:"InvoiceList"},{title:"Facturación por lotes",link:"OrderList"}]},{title:"Compras",icon:"mdi-receipt",link:"CustomerListCreate",show:!0,options:[{title:"Documentos",link:"CustomerListCreate"},{title:"Registro de proveedores",link:"ContactListCreate"}]},{title:"Reportes",icon:"mdi-chart-box-outline",link:"DashboardUpdate",show:!0,options:[{title:"Mis Dashboards"},{title:"Log de envío de facturas"},{title:"Estado de documentos SII",link:"MetricList"}]},{title:"Cuenta",description:"",link:"AccountBasic",options:[{title:"Cuenta",description:"",link:"AccountBasic"},{title:"Branding",description:"",link:"AccountSettingsBranding"},{title:"Facturación",description:"",link:"AccountSettingsInvoicing"},{title:"Cobranzas",description:"",link:"AccountSettingsCollections"},{title:"Correos electrónicos",description:"",link:"AccountSettingsEmail"},{title:"Equipo",description:"",link:"AccountMembers"},{title:"Importar",description:"",link:"AccountImports"},{title:"Exportar",description:"",link:"AccountExports"}]}]}},computed:{drawColor:function(){return this.test?"white":"lightGrey"}},created:function(){},watch:{$route:{immediate:!1,handler:function(t){this.selectedIcon=t.meta.parent,this.resetDrawer+=1,this.test=!1}}},mounted:function(){this.selectedIcon=this.$route.meta.parent,this.test=!1},methods:{isSelected:function(t){return this.$route.matched.some((function(e){return e.name===t}))},tests:function(t){console.log("####",t)}}},Dt=Et,At=a("34c3"),jt=a("f774"),qt=Object(E["a"])(Dt,pt,ht,!1,null,null,null),It=qt.exports;A()(qt,{VIcon:I["a"],VList:O["a"],VListGroup:Ct["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemIcon:At["a"],VListItemTitle:N["c"],VNavigationDrawer:jt["a"],VRow:z["a"]});var Ot={components:{AppBar:mt,NavigationDrawer:It},watch:{$route:function(t,e){t.path!==e.path&&this.$vuetify.goTo(1,{duration:"0",easing:"linear"})}}},Rt=Ot,Nt=a("7496"),Pt=a("a523"),Bt=a("f6c4"),zt=Object(E["a"])(Rt,r,n,!1,null,null,null),Ft=zt.exports;A()(zt,{VApp:Nt["a"],VCol:q["a"],VContainer:Pt["a"],VMain:Bt["a"],VRow:z["a"]});var Mt=a("8c4f"),Ut=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[i("span",{staticClass:"d-block display-1"},[t._v("Error 404")]),i("span",{staticClass:"d-block title"},[t._v("Página no encontrada.")]),i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-img",{attrs:{contain:"",height:"600",src:a("0d69")}})],1),i("span",{staticClass:"d-block text--secondary body-2"},[t._v("¡Ups! Los sentimos, la página que buscas no existe.")]),i("v-btn",{staticClass:"mt-5",attrs:{to:{name:"AccountDashboard"},color:"white"}},[t._v("Volver a Axteroid")])],1)],1)},Gt=[],Ht=a("adda"),Yt={},Wt=Object(E["a"])(Yt,Ut,Gt,!1,null,null,null),Qt=Wt.exports;A()(Wt,{VBtn:Z["a"],VCol:q["a"],VImg:Ht["a"],VRow:z["a"]});var Kt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[i("span",{staticClass:"d-block title"},[t._v("No tienes permisos para acceder a esta cuenta")]),i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-img",{attrs:{contain:"",height:"600",src:a("0d69")}})],1),i("span",{staticClass:"d-block text--secondary body-2"},[t._v("El administrador de la cuenta ha desactivado tus permisos.")]),i("v-btn",{staticClass:"mt-5",attrs:{to:{name:"AccountChoose"},color:"white"}},[t._v("Volver a Axteroid")])],1)],1)},Xt=[],Jt={},Zt=Object(E["a"])(Jt,Kt,Xt,!1,null,null,null),te=Zt.exports;A()(Zt,{VBtn:Z["a"],VCol:q["a"],VImg:Ht["a"],VRow:z["a"]});var ee=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-col",{staticClass:"px-10",attrs:{cols:"4"}},[i("v-card",{staticClass:"mx-auto pt-8",attrs:{"min-width":"400"}},[i("v-col",{staticClass:"text-center"},[i("img",{attrs:{src:a("026d"),width:"140"}}),i("span",{staticClass:"mt-5 d-block body-1 text--secondary font-weight-medium"},[t._v("Iniciar sesión")])]),i("v-card-text",[i("v-form",[i("v-col",{staticClass:"pa-0"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Email")]),i("v-text-field",{attrs:{error:t.$v.user.email.$error,outlined:"","hide-details":"",required:"","single-line":"",dense:""},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.signIn(e)}},model:{value:t.$v.user.email.$model,callback:function(e){t.$set(t.$v.user.email,"$model",e)},expression:"$v.user.email.$model"}})],1),i("v-col",{staticClass:"pa-0 my-6"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Contraseña")]),i("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.user.password.$error,outlined:"","hide-details":"",required:"","single-line":"",dense:"",type:"password"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.signIn(e)}},scopedSlots:t._u([{key:"append",fn:function(){return[i("v-btn",{staticClass:"mt-n1 mr-1",attrs:{to:{name:"AuthPasswordReset"},text:"",color:"primary",small:"",ripple:!1}},[t._v("¿la olvidaste?")])]},proxy:!0}]),model:{value:t.$v.user.password.$model,callback:function(e){t.$set(t.$v.user.password,"$model",e)},expression:"$v.user.password.$model"}})],1),t.error?i("v-col",{staticClass:"pa-0 text-center"},[i("v-alert",{staticClass:"body-2 red--text pa-0",attrs:{border:"left","colored-border":"",color:"white",dense:""}},[t._v(t._s(t.error))])],1):t._e(),i("v-col",{staticClass:"my-6 pa-0"},[i("v-btn",{attrs:{loading:t.signInLoader,color:"primary",height:"40",block:""},on:{click:t.signIn}},[t._v("Iniciar sesión")])],1)],1),i("v-divider"),i("v-col",{staticClass:"text-center pa-0 mt-6"},[i("v-btn",{attrs:{"retain-focus-on-click":"",outlined:"",height:"40",block:""},on:{click:t.signInGoogle}},[i("img",{attrs:{src:a("2980"),width:"24px"}}),i("span",{staticClass:"ml-4"},[t._v("Iniciar sesión con Google")])]),i("span",{staticClass:"d-block text--secondary mt-5"},[t._v("¿No tienes una cuenta de Axteroid?")]),i("v-btn",{attrs:{to:{name:"AuthSignUp"},text:"",color:"primary",ripple:!1}},[t._v("Crea una cuenta gratis")])],1)],1)],1)],1)],1)},ae=[],ie=a("b5ae"),se={data:function(){return{user:{email:"",password:""},error:"",signInLoader:!1}},created:function(){this.$store.state.auth.user.authenticated&&this.$router.push({name:"AccountDashboard"})},methods:{signInGoogle:function(){var t=this;this.$gAuth.getAuthCode().then((function(e){var a={provider:"google-oauth2",code:e};t.$store.dispatch("auth/GET_AUTH",{resource:"/auth/google/",payload:a})})).then((function(t){}))},signIn:function(){var t=this;if(this.$v.$touch(),this.$v.$invalid)return!1;var e={username:this.user.email,password:this.user.password};this.signInLoader=!0,this.$store.dispatch("auth/GET_AUTH",{resource:"/token/",payload:e}).catch((function(e){t.error=e.response.data.detail})).finally((function(){t.signInLoader=!1}))}},validations:{user:{email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},password:{required:ie["required"],minLength:Object(ie["minLength"])(8),maxLength:Object(ie["maxLength"])(64)}}}},re=se,ne=a("0798"),oe=a("b0af"),le=a("99d9"),ce=a("4bd4"),de=Object(E["a"])(re,ee,ae,!1,null,null,null),ue=de.exports;A()(de,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VForm:ce["a"],VRow:z["a"],VTextField:F["a"]});var ve=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-col",{staticClass:"px-10",attrs:{cols:"4"}},[i("v-card",{staticClass:"mx-auto pt-8",attrs:{"min-width":"400"}},[i("v-col",{staticClass:"text-center"},[i("img",{attrs:{src:a("026d"),width:"140"}}),i("span",{staticClass:"mt-5 d-block body-1 text--secondary font-weight-medium"},[t._v(t._s(this.$route.query.invitation?"Aceptar la invitación":"Crear una cuenta"))])]),i("v-card-text",[i("v-form",[this.$route.query.invitation?t._e():i("v-col",{staticClass:"pa-0"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Email")]),i("v-text-field",{attrs:{error:t.$v.user.email.$error,outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"254"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.signUp(e)}},model:{value:t.user.email,callback:function(e){t.$set(t.user,"email",e)},expression:"user.email"}})],1),i("v-col",{class:(t.$v.user.password1.minLength?"my-6":"mt-6 mb-3")+" pa-0"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Contraseña")]),i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.user.password1.$error,"append-icon":t.show1?"mdi-eye":"mdi-eye-off",type:t.show1?"user.password1":"password",outlined:"","hide-details":t.$v.user.password1.minLength,"persistent-hint":"",required:"","single-line":"",dense:"",maxlength:"20",autocomplete:"new-password",hint:"Escribe al menos 8 caracteres."},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.signUp(e)},"click:append":function(e){t.show1=!t.show1}},model:{value:t.user.password1,callback:function(e){t.$set(t.user,"password1",e)},expression:"user.password1"}})],1),i("v-col",{staticClass:"pa-0 my-6"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Confirmar Contraseña")]),i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.user.password2.$error,"append-icon":t.show?"mdi-eye":"mdi-eye-off",type:t.show?"user.password2":"password",outlined:"","hide-details":t.$v.user.password2.sameAsPassword,"persistent-hint":"",required:"","single-line":"",dense:"",maxlength:"20",autocomplete:"new-password",hint:"La contraseña debe ser igual."},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.signUp(e)},"click:append":function(e){t.show=!t.show}},model:{value:t.user.password2,callback:function(e){t.$set(t.user,"password2",e)},expression:"user.password2"}})],1),i("v-col",{staticClass:"pa-0 check"},[t._v(" Al "+t._s(this.$route.query.invitation?" iniciar sesión":"crear la cuenta")+" aceptas nuestros "),i("a",{staticClass:"checkLink font-weight-medium",attrs:{target:"_blank",href:t.$DOCS_BASE+"/terms/"}},[t._v("términos de uso y política de privacidad.")])]),t.error?i("v-col",{staticClass:"pa-0 text-center"},[i("v-alert",{staticClass:"body-2 red--text pa-0",attrs:{border:"left","colored-border":"",color:"white",dense:""}},[t._v(t._s(t.error))])],1):t._e(),i("v-col",{staticClass:"my-6 pa-0"},[i("v-btn",{attrs:{loading:t.signUpLoader,"retain-focus-on-click":"",color:"primary",height:"40",dark:"",block:"",ripple:!1},on:{click:t.signUp}},[t._v(t._s(this.$route.query.invitation?"Unirse":"Comenzar"))])],1)],1),i("v-divider"),i("v-col",{staticClass:"text-center pa-0 mt-6"},[i("span",{staticClass:"d-block text--secondary mt-5"},[t._v("¿Ya tienes una cuenta Axteroid?")]),i("v-btn",{attrs:{to:{name:"AuthSignIn"},text:"",color:"primary",ripple:!1}},[t._v("Inicia sesión")])],1)],1)],1)],1)],1)},me=[],pe={data:function(){return{user:{email:"",password1:"",password2:""},show:!1,show1:!1,error:"",signUpLoader:!1}},computed:Object(u["c"])({invitation:function(t){return t.auth.invitation}}),created:function(){this.$store.state.auth.user.authenticated&&this.$router.push({name:"AccountDashboard"})},methods:{signUp:function(){var t=this;return this.$v.$touch(),!this.$v.$invalid&&(this.signUpLoader=!0,new Promise((function(e,a){t.$route.query.invitation?t.$store.dispatch("auth/ACCEPT_INVITATION",t.$route.query.invitation).then((function(a){t.user.email=a.data.account_verified_email,e()})).catch((function(e){t.$dialog.message.error(e.response.data.detail),a(t.error)})):e()})).then((function(e){t.$store.dispatch("auth/SIGN_UP",{user:t.user,invitation:t.$route.query.invitation}).then((function(){t.$store.dispatch("auth/GET_AUTH",{resource:"/token/",payload:{username:t.user.email,password:t.user.password1}})})).catch((function(e){t.$dialog.message.error(e.response.data.email[0])}))})).finally((function(){t.signUpLoader=!1})))}},validations:{user:{email:{required:Object(ie["requiredIf"])((function(){return!this.$route.query.invitation})),email:ie["email"],maxLength:Object(ie["maxLength"])(254)},password1:{required:ie["required"],minLength:Object(ie["minLength"])(8)},password2:{sameAsPassword:Object(ie["sameAs"])("password1")}}}},he=pe,fe=Object(E["a"])(he,ve,me,!1,null,null,null),be=fe.exports;A()(fe,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VForm:ce["a"],VRow:z["a"],VTextField:F["a"]});var ge=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{justify:"center"}},[a("v-col",{attrs:{cols:"6"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Cuenta de usuario")])],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.user.first_name.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",placeholder:"Escribe un nombre de usuario",maxlength:"30","data-action":"auto-focus"},model:{value:t.$v.user.first_name.$model,callback:function(e){t.$set(t.$v.user.first_name,"$model","string"===typeof e?e.trim():e)},expression:"$v.user.first_name.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Apellido")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.user.last_name.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",placeholder:"Escribe un nombre",maxlength:"30"},model:{value:t.$v.user.last_name.$model,callback:function(e){t.$set(t.$v.user.last_name,"$model","string"===typeof e?e.trim():e)},expression:"$v.user.last_name.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{loading:t.patchLoader,color:"primary"},on:{click:t.patchUser}},[t._v("Guardar")])],1)],1),a("v-card",{staticClass:"my-5"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Seguridad de la cuenta")])],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-list",{staticClass:"v-list-form-extended py-6 transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Contraseña")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"4"}},[a("v-btn",{attrs:{block:"",outlined:""},on:{click:function(e){e.stopPropagation(),t.modalPatchPassword=!0}}},[t._v("Cambiar contraseña")])],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Token")]),a("v-list-item-subtitle",{staticClass:"py-1 pl-5"},[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{staticClass:"icon-field",attrs:{readonly:"","append-icon":t.showToken?"mdi-eye":"mdi-eye-off",type:t.showToken?"value":"password","background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"56","data-action":"auto-focus"},on:{"click:append":function(e){t.showToken=!t.showToken}},model:{value:t.tokensList,callback:function(e){t.tokensList=e},expression:"tokensList"}})],1)],1),a("v-list-item-action",{staticClass:"py-1 mr-4"},[a("v-col",[a("v-btn",{attrs:{loading:t.patchLoaderToken,block:"",outlined:""},on:{click:function(e){return e.stopPropagation(),t.patchTokens(e)}}},[t._v("Actualizar")])],1)],1)],1)],1)],1)],1),a("v-card",{staticClass:"my-5"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Organizaciones")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{staticClass:"mx-0"},[a("v-col",{staticClass:"py-0",attrs:{cols:"12"}},t._l(t.accountsList,(function(e){return a("v-card",{key:e.id,staticClass:"my-4",attrs:{ripple:!1}},[a("v-card-text",{staticClass:"pa-3"},[a("v-list",{staticClass:"transparent"},[a("v-list-item",{staticClass:"my-1"},[a("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))]),a("v-list-item-subtitle",{staticClass:"text-right"},[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(i){var s=i.on;return[a("v-btn",t._g({attrs:{text:""}},s),[a("code",{staticClass:"pa-1 font-weight-regular text--secondary background",on:{click:function(a){return t.toClipboard(e.id)}}},[a("v-icon",{attrs:{"x-small":"",top:""}},[t._v("mdi-content-copy")]),a("span",[t._v(" "+t._s(e.id))])],1)])]}}],null,!0)},[a("span",{staticClass:"caption"},[t._v("Copiar identificador")])])],1)],1)],1)],1)],1)})),1)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"500",persistent:"","no-click-animation":""},model:{value:t.modalPatchPassword,callback:function(e){t.modalPatchPassword=e},expression:"modalPatchPassword"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Cambiar contraseña")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:"","retain-focus-on-click":""},on:{click:function(e){t.modalPatchPassword=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Contraseña actual")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.password.old_password.$error,"append-icon":t.show?"mdi-eye":"mdi-eye-off",type:t.show?"$v.password.old_password.$model":"password","background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"56","data-action":"auto-focus",placeholder:"Escribe tu contraseña actual"},on:{"click:append":function(e){t.show=!t.show}},model:{value:t.$v.password.old_password.$model,callback:function(e){t.$set(t.$v.password.old_password,"$model","string"===typeof e?e.trim():e)},expression:"$v.password.old_password.$model"}})],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Nueva contraseña")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.password.new_password1.$error,"append-icon":t.show1?"mdi-eye":"mdi-eye-off",type:t.show1?"user.password1":"password","background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"56","data-action":"auto-focus",placeholder:"Escribe una nueva contraseña segura"},on:{"click:append":function(e){t.show1=!t.show1}},model:{value:t.$v.password.new_password1.$model,callback:function(e){t.$set(t.$v.password.new_password1,"$model","string"===typeof e?e.trim():e)},expression:"$v.password.new_password1.$model"}})],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Confirmar contraseña")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.password.new_password2.$error,"append-icon":t.show2?"mdi-eye":"mdi-eye-off",type:t.show2?"user.password2":"password","background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"56",placeholder:"Escribe otra vez la nueva contraseña"},on:{"click:append":function(e){t.show2=!t.show2}},model:{value:t.$v.password.new_password2.$model,callback:function(e){t.$set(t.$v.password.new_password2,"$model","string"===typeof e?e.trim():e)},expression:"$v.password.new_password2.$model"}})],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalPatchPassword=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.patchLoader,color:"primary"},on:{click:t.patchPassword}},[t._v("Cambiar contraseña")])],1)],1)],1)],1)},_e=[],ye={mixins:[$],data:function(){return{token:[],user:{first_name:"",last_name:""},password:{new_password1:"",new_password2:"",old_password:""},patchLoader:!1,patchLoaderToken:!1,modalPatchPassword:!1,show:!1,show1:!1,show2:!1,showToken:!1}},computed:Object(u["c"])({accountsList:function(t){return t.accounts.accountsList},tokensList:function(t){return((t.accounts.tokensList||[])[0]||{}).key||""}}),created:function(){var t=this;this.$store.dispatch("auth/GET_USER").then((function(e){t.user=e.data})),this.$store.dispatch("accounts/LIST",{resource:"accounts"}),this.$store.dispatch("accounts/LIST",{resource:"tokens"})},methods:{patchUser:function(){var t=this;if(this.$v.user.$touch(),this.$v.user.$invalid)return!1;this.patchLoader=!0,this.$store.dispatch("auth/PATCH_USER",{first_name:this.user.first_name,last_name:this.user.last_name}).then((function(e){t.$dialog.message.info("La información de usuario se ha actualizado")})).finally((function(){t.patchLoader=!1}))},patchPassword:function(){var t=this;if(this.$v.password.$touch(),this.$v.password.$invalid)return!1;this.patchLoader=!0,this.$store.dispatch("auth/POST_USER_PASSWORD",{new_password1:this.password.new_password1,new_password2:this.password.new_password2,old_password:this.password.old_password}).then((function(e){t.modalPatchPassword=!1,t.patchLoader=!1,t.password={new_password1:"",new_password2:"",old_password:""},t.$v.password.$reset(),t.$dialog.message.info(e.data.detail)})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.patchLoader=!1}))},patchTokens:function(){var t=this;this.$dialog.warning({title:"Actualizar token",text:'\n Al confirmar, el token existente se eliminará y se creará uno nuevo.\n Recuerda actualizar el token usado en tus integraciones.\n ',actions:[{text:"Continuar",color:"primary",handle:function(){t.patchLoaderToken=!0,t.$store.dispatch("accounts/CREATE",{resource:"tokens",payload:{}}).then((function(){t.$store.dispatch("accounts/LIST",{resource:"tokens"}),t.$dialog.message.info("Tu token ha actualizado")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.patchLoaderToken=!1}))}}]})}},validations:{user:{first_name:{maxLength:Object(ie["maxLength"])(30)},last_name:{maxLength:Object(ie["maxLength"])(30)}},password:{new_password1:{required:ie["required"],minLength:Object(ie["minLength"])(8)},new_password2:{sameAsPassword:Object(ie["sameAs"])("new_password1")},old_password:{required:ie["required"]}}}},Ce=ye,xe=a("169a"),we=a("1800"),$e=a("71d9"),ke=a("2a7f"),Ve=a("3a2f"),Le=Object(E["a"])(Ce,ge,_e,!1,null,null,null),Se=Le.exports;A()(Le,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Te=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-col",{staticClass:"px-10",attrs:{cols:"4"}},[i("v-card",{staticClass:"mx-auto pt-8",attrs:{"min-width":"400"}},[i("v-col",{staticClass:"text-center"},[i("img",{attrs:{src:a("026d"),width:"140"}}),i("span",{staticClass:"mt-5 d-block body-1 text--secondary font-weight-medium"},[t._v("Restablecer contraseña")]),i("span",{staticClass:"mt-2 d-block body-2 text--secondary"},[t._v("Escribe tu dirección de correo electrónico y te enviaremos un vínculo para restablecer tu contraseña.")])]),i("v-card-text",[i("v-form",[i("v-col",{staticClass:"pa-0"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Email")]),i("v-text-field",{attrs:{error:t.$v.email.$error,outlined:"","hide-details":"",required:"","single-line":"",dense:"",placeholder:"Escribe un email"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.resetPassword(e)}},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}})],1),t.error?i("v-col",{staticClass:"pa-0 text-center"},[i("v-alert",{staticClass:"body-2 red--text pa-0",attrs:{border:"left","colored-border":"",color:"white",dense:""}},[t._v(t._s(t.error))])],1):t._e(),i("v-col",{staticClass:"my-6 pa-0"},[i("v-btn",{attrs:{loading:t.createLoader,color:"primary",height:"40",block:""},on:{click:t.resetPassword}},[t._v("Enviar email de recuperación")])],1)],1)],1)],1)],1)],1)},Ee=[],De={data:function(){return{email:"",createLoader:!1}},methods:{resetPassword:function(){var t=this;if(this.$v.email.$touch(),this.$v.email.$invalid)return!1;this.createLoader=!0,this.$store.dispatch("auth/PASSWORD_RESET",this.email).then((function(){t.$dialog.message.info("Se ha enviado el email para reestablecer la contraseña."),t.$router.push({name:"AuthSignIn"})})).finally((function(){t.createLoader=!1}))}},validations:{email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)}}},Ae=De,je=Object(E["a"])(Ae,Te,Ee,!1,null,null,null),qe=je.exports;A()(je,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VForm:ce["a"],VRow:z["a"],VTextField:F["a"]});var Ie=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-col",{staticClass:"px-10",attrs:{cols:"4"}},[i("v-card",{staticClass:"mx-auto pt-8",attrs:{"min-width":"400"}},[i("v-col",{staticClass:"text-center"},[i("img",{attrs:{src:a("026d"),width:"140"}}),i("span",{staticClass:"mt-5 d-block body-1 text--secondary font-weight-medium"},[t._v("Restablecer contraseña")]),i("span",{staticClass:"mt-2 d-block body-2 text--secondary"},[t._v("Escribe tu nueva contraseña para iniciar sesión.")])]),i("v-card-text",[i("v-form",[i("v-col",{staticClass:"pa-0"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Contraseña")]),i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.user.new_password1.$error,"append-icon":t.show1?"mdi-eye":"mdi-eye-off",type:t.show1?"user.new_password1":"password",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"20",autocomplete:"new-password"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.resetPassword(e)},"click:append":function(e){t.show1=!t.show1}},model:{value:t.user.new_password1,callback:function(e){t.$set(t.user,"new_password1",e)},expression:"user.new_password1"}})],1),i("v-col",{staticClass:"pa-0 my-6"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Contraseña")]),i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.user.new_password2.$error,"append-icon":t.show?"mdi-eye":"mdi-eye-off",type:t.show?"user.new_password2":"password",outlined:"","hide-details":!t.$v.user.new_password2.sameAsPassword,"persistent-hint":"",required:"","single-line":"",dense:"",maxlength:"20",autocomplete:"new-password",hint:"El password debe ser igual."},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.resetPassword(e)},"click:append":function(e){t.show=!t.show}},model:{value:t.user.new_password2,callback:function(e){t.$set(t.user,"new_password2",e)},expression:"user.new_password2"}})],1),i("v-col",{staticClass:"my-6 pa-0"},[i("v-btn",{attrs:{loading:t.createLoader,color:"primary",height:"40",dark:"",block:""},on:{click:t.resetPassword}},[t._v("Restablecer contraseña")])],1)],1)],1)],1)],1)],1)},Oe=[],Re={data:function(){return{user:{uid:null,token:null,new_password1:"",new_password2:""},createLoader:!1,show:!1,show1:!1}},created:function(){this.user.uid=this.$route.params.uid,this.user.token=this.$route.params.token},methods:{resetPassword:function(){var t=this;if(this.$v.user.$touch(),this.$v.user.$invalid)return!1;this.createLoader=!0,this.$store.dispatch("auth/PASSWORD_RESET_CONFIRM",{uid:this.user.uid,token:this.user.token,new_password1:this.user.new_password1,new_password2:this.user.new_password2}).then((function(){t.$dialog.message.info("Se ha restablecido la contraseña, inicia sesión para continuar."),t.$router.push({name:"AuthSignIn"})})).finally((function(){t.createLoader=!1}))}},validations:{user:{new_password1:{required:ie["required"],minLength:Object(ie["minLength"])(8)},new_password2:{sameAsPassword:Object(ie["sameAs"])("new_password1")}}}},Ne=Re,Pe=Object(E["a"])(Ne,Ie,Oe,!1,null,null,null),Be=Pe.exports;A()(Pe,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VForm:ce["a"],VRow:z["a"],VTextField:F["a"]});var ze=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[t.$store.state.accounts.retrieveLoader||!t.editable.name?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"article"}}):[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información de la organización")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-tooltip",{attrs:{bottom:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"mr-6 font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.accountsDetail.id)}}},i),[t._v("ID "+t._s(t.accountsDetail.id))])]}}])},[a("span",[t._v("Copiar")])])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{staticClass:"py-3"},[a("v-col",{attrs:{md:"8"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.editable.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Acme LLC",maxlength:"64","hide-details":""},model:{value:t.$v.editable.name.$model,callback:function(e){t.$set(t.$v.editable.name,"$model",e)},expression:"$v.editable.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{items:[t.editable.country.name],"item-text":t.editable.country.name,"item-value":t.editable.country.name,"single-line":"",disabled:"","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.editable.country.name,callback:function(e){t.$set(t.editable.country,"name",e)},expression:"editable.country.name"}})],1)],1)],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.editable.state.$error,items:t.statesList,"item-text":"name","item-value":"id","hide-details":"","single-line":"",dense:"",height:"30",outlined:"","background-color":"white","no-data-text":"No existen estados para el país."},model:{value:t.$v.editable.state.$model,callback:function(e){t.$set(t.$v.editable.state,"$model",e)},expression:"$v.editable.state.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.editable.address.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"128","hide-details":""},model:{value:t.$v.editable.address.$model,callback:function(e){t.$set(t.$v.editable.address,"$model",e)},expression:"$v.editable.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-6"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información fiscal")])])],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Número fiscal")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",disabled:"","hide-details":""},model:{value:t.editable.tax_id,callback:function(e){t.$set(t.editable,"tax_id",e)},expression:"editable.tax_id"}})],1)],1)],1),a("v-list-item",{staticClass:"mt-6"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de contacto")])])],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.editable.email.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.email.$model,callback:function(e){t.$set(t.$v.editable.email,"$model",e)},expression:"$v.editable.email.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.editable.country.phone_code+" # #### ####",expression:"`${editable.country.phone_code} # #### ####`"}],attrs:{error:t.$v.editable.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"16","hide-details":""},model:{value:t.$v.editable.phone.$model,callback:function(e){t.$set(t.$v.editable.phone,"$model",e)},expression:"$v.editable.phone.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"my-3"},[a("v-list-item-title",[t._v("Sitio web")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"10"}},[a("v-text-field",{attrs:{error:t.$v.editable.website.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.website.$model,callback:function(e){t.$set(t.$v.editable.website,"$model",e)},expression:"$v.editable.website.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"mt-6"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Programas Beta de Axteroid")])])],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Funciones con acceso temprano")]),a("v-list-item-subtitle",[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.editable.early_access_features,callback:function(e){t.$set(t.editable,"early_access_features",e)},expression:"editable.early_access_features"}})],1)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.patchAccount}},[t._v("Guardar")])],1)],1)]],2)],1)},Fe=[],Me={mixins:[$],data:function(){return{editable:{}}},computed:Object(u["c"])({statesList:function(t){return t.generals.statesList},accountsDetail:function(t){return t.accounts.accountsDetail},activitiesList:function(t){return t.generals.activitiesList}}),created:function(){var t=this;this.$store.dispatch("accounts/RETRIEVE",{resource:"accounts",id:this.$store.state.auth.account.id}).then((function(){var e=Q()(t.accountsDetail);t.editable=e,t.$store.dispatch("generals/LIST",{resource:"generals/states",query:{country__id:t.accountsDetail.country.id,page_size:500}})}))},methods:{patchAccount:function(){var t=this;if(this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;var e={name:this.editable.name,state:this.editable.state.id||this.editable.state,address:this.editable.address,email:this.editable.email,phone:this.editable.phone,website:this.editable.website,early_access_features:this.editable.early_access_features};this.$store.dispatch("accounts/UPDATE",{resource:"accounts",payload:e,id:this.editable.id}).then((function(){t.$dialog.message.info("La información de la organización se ha actualizado")})).catch((function(e){t.$dialog.message.warning(t.parseErrors(e.response.data))}))}},validations:{editable:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},state:{required:ie["required"]},address:{required:ie["required"],minLength:Object(ie["minLength"])(6),maxLength:Object(ie["maxLength"])(128)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(16)},website:{url:ie["url"]}}}},Ue=Me,Ge=a("b974"),He=a("b73d"),Ye=Object(E["a"])(Ue,ze,Fe,!1,null,null,null),We=Ye.exports;A()(Ye,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Qe=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[t.loaderRetrieve?i("v-col",{attrs:{cols:"12"}},[i("v-skeleton-loader",{attrs:{type:"table"}}),i("v-skeleton-loader",{staticClass:"mt-5",attrs:{type:"table"}})],1):i("v-col",{attrs:{cols:"12"}},[i("v-card",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Proveedores de correo electrónico")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[i("thead",[i("tr",[i("th",{staticClass:"text-left"},[t._v("Cuenta")]),i("th",{staticClass:"text-left"},[t._v("Proveedor")]),i("th",{staticClass:"text-left"},[t._v("Verificación")])])]),i("tbody",[t.emailsDetail.uid?i("tr",[i("td",[i("span",{staticClass:"mr-4"},[t._v(t._s(t.emailsDetail.uid))]),i("v-tooltip",{attrs:{right:"",transition:"scale-transition","max-width":"260"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-chip",t._g({attrs:{color:"lightBlue","text-color":"primary",small:""}},a),[t._v("Primario")])]}}],null,!1,4004003137)},[i("span",[t._v("Los correos electrónicos se envían desde "+t._s(t.emailsDetail.uid)+", pero si la conexión falla, se asegura la entrega usando un proveedor de correo electrónico de Axteroid.")])])],1),i("td",{staticClass:"text-uppercase"},[t._v(t._s(t.emailsDetail.provider))]),i("td",[i("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Verificado")])],1)]):t._e(),i("tr",[i("td",[t._v("invoices@on.axteroid.com")]),i("td",{staticClass:"text-uppercase"},[t._v("Axteroid")]),i("td",[i("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Verificado")])],1)]),i("tr",[i("td",[t._v("payments@on.axteroid.com")]),i("td",{staticClass:"text-uppercase"},[t._v("Axteroid")]),i("td",[i("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Verificado")])],1)])])]},proxy:!0}])}),i("v-divider"),i("v-toolbar",{staticClass:"transparent mt-3",attrs:{flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v(t._s(t.emailsDetail.uid?"Actualizar":"Conectar")+" proveedor de correo electrónico")])],1),i("v-row",{staticClass:"mx-0",attrs:{aling:"center",justify:"start"}},[i("v-col",{attrs:{cols:"3"}},[i("v-hover",{attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.hover;return[i("v-card",{staticClass:"card-center",attrs:{elevation:s?3:1,"min-height":"180",width:"300",ripple:!1},on:{click:function(e){t.dialogEmailProvider=!0}}},[i("v-container",{staticClass:"text-center",attrs:{fluid:""}},[i("img",{attrs:{src:a("fd27"),width:"56px"}}),i("span",{class:(s?"primary--text":"")+" d-block font-weight-medium mt-6"},[t._v("Otra cuenta de email")])])],1)]}}])})],1)],1),i("v-divider")],1)],1)],1),i("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":""},model:{value:t.dialogEmailProvider,callback:function(e){t.dialogEmailProvider=e},expression:"dialogEmailProvider"}},[i("v-card",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Conectar otra cuenta de email (SMTP)")]),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{attrs:{icon:"",small:"",ripple:!1},on:{click:function(e){t.dialogEmailProvider=!1}}},[i("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-list",{staticClass:"v-list-form py-6 px-1 transparent"},[i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Email")]),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"10"}},[i("v-text-field",{attrs:{error:t.$v.email.uid.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"254","hide-details":""},model:{value:t.$v.email.uid.$model,callback:function(e){t.$set(t.$v.email.uid,"$model","string"===typeof e?e.trim():e)},expression:"$v.email.uid.$model"}})],1)],1)],1),i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Servidor / dominio")]),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"7"}},[i("v-text-field",{attrs:{error:t.$v.email.extra_data.host.$error,placeholder:"e.g. smtp.gmail.com","background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"254","hide-details":""},model:{value:t.$v.email.extra_data.host.$model,callback:function(e){t.$set(t.$v.email.extra_data.host,"$model","string"===typeof e?e.trim():e)},expression:"$v.email.extra_data.host.$model"}})],1)],1)],1),i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Puerto")]),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"3"}},[i("v-text-field",{attrs:{error:t.$v.email.extra_data.port.$error,placeholder:"e.g. 445","background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"5","hide-details":""},model:{value:t.$v.email.extra_data.port.$model,callback:function(e){t.$set(t.$v.email.extra_data.port,"$model","string"===typeof e?e.trim():e)},expression:"$v.email.extra_data.port.$model"}})],1)],1)],1),i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Conexión segura (SSL)")]),i("v-list-item-subtitle",[i("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.email.extra_data.use_ssl,callback:function(e){t.$set(t.email.extra_data,"use_ssl",e)},expression:"email.extra_data.use_ssl"}})],1)],1),i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Contraseña")]),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"7"}},[i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.email.extra_data.password.$error,"background-color":"white","append-icon":t.show1?"mdi-eye":"mdi-eye-off",type:t.show1?"$v.email.extra_data.password.$model":"password",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"20",autocomplete:"new-password"},on:{"click:append":function(e){t.show1=!t.show1}},model:{value:t.$v.email.extra_data.password.$model,callback:function(e){t.$set(t.$v.email.extra_data.password,"$model","string"===typeof e?e.trim():e)},expression:"$v.email.extra_data.password.$model"}})],1)],1)],1),i("v-list-item",{staticClass:"py-1"},[i("v-list-item-title",[t._v("Contraseña")]),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"7"}},[i("v-text-field",{staticClass:"icon-field",attrs:{error:t.$v.email.extra_data.password2.$error,"background-color":"white","append-icon":t.show1?"mdi-eye":"mdi-eye-off",type:t.show?"$v.email.extra_data.password.$model":"password",outlined:"",required:"","single-line":"",dense:"",maxlength:"20","hide-details":t.$v.email.extra_data.password2.sameAsPassword,"persistent-hint":"",hint:"La contraseña debe coincidir.",autocomplete:"new-password"},on:{"click:append":function(e){t.show=!t.show}},model:{value:t.email.extra_data.password2,callback:function(e){t.$set(t.email.extra_data,"password2",e)},expression:"email.extra_data.password2"}})],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogEmailProvider=!1,t.$v.email.$reset()}}},[t._v("Cancelar")]),i("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.createEmail}},[t._v("Conectar email")])],1)],1)],1)],1)},Ke=[],Xe=(a("3ca3"),a("ddb0"),{mixins:[$],data:function(){return{dialogEmailProvider:!1,email:{provider:"smtp",uid:"",extra_data:{host:"",port:"",use_ssl:!0,password:"",password2:""}},loaderRetrieve:!1,show:!1,show1:!1}},computed:Object(u["c"])({emailsDetail:function(t){return t.accounts.emailsDetail}}),created:function(){var t=this;this.loaderRetrieve=!0,Promise.all([this.$store.dispatch("accounts/RETRIEVE",{resource:"emails",id:this.account.id}),this.$store.dispatch("accounts/RETRIEVE",{resource:"accounts",id:this.account.id})]).finally((function(){t.loaderRetrieve=!1}))},methods:{createEmail:function(){var t=this;if(this.$v.email.$touch(),this.$v.email.$invalid)return!1;delete this.email.password2,this.$store.dispatch("accounts/CREATE",{resource:"emails",payload:this.email}).then((function(){t.$dialog.message.info("El email ha sido conectado con éxito"),t.dialogEmailProvider=!1})).catch((function(){t.$dialog.message.error("No se pudo conectar el email")}))}},validations:{email:{uid:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},extra_data:{host:{required:ie["required"]},port:{required:ie["required"],numeric:ie["numeric"],maxLength:Object(ie["maxLength"])(254)},password:{required:Object(ie["requiredIf"])((function(){return"smtp"===this.email.provider}))},password2:{sameAsPassword:Object(ie["sameAs"])("password")}}}}}),Je=Xe,Ze=a("1f4f"),ta=Object(E["a"])(Je,Qe,Ke,!1,null,null,null),ea=ta.exports;A()(ta,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VContainer:Pt["a"],VDialog:xe["a"],VDivider:tt["a"],VHover:et["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var aa=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{attrs:{cols:"12"}},[t.$store.state.reminders.retrieveLoader?i("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"article"}}):[i("v-card",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Branding")])],1),i("v-divider"),i("v-card-text",[i("v-row",[i("v-col",{attrs:{cols:"3"}},[i("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v("Elementos de diseño")])]),i("v-col",{attrs:{cols:"4"}},[i("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("Logo")]),i("v-sheet",{staticClass:"mt-3"},[i("input",{ref:"editable.logo",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/png"},on:{change:t.getLogoPreview}}),t.logoPreview||t.editable.logo?t._e():i("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){return t.$refs["editable.logo"].click()}}},[i("v-icon",[t._v("mdi-plus")])],1),t.logoPreview||t.editable.logo?i("v-hover",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.hover;return[i("v-img",{staticClass:"rounded",staticStyle:{border:"1px solid #D8E0EA"},attrs:{loading:t.logoPreview,"aspect-ratio":4,contain:"",src:t.logoPreview?t.logoPreview:t.editable.logo,"max-width":"200","min-height":"90"},on:{click:function(e){return t.$refs["editable.logo"].click()}},scopedSlots:t._u([{key:"placeholder",fn:function(){return[i("v-row",{staticClass:"fill-height ma-0",attrs:{align:"center",justify:"center"}},[i("v-progress-circular",{attrs:{size:"30",indeterminate:"",color:"blue lighten-4"}})],1)]},proxy:!0}],null,!0)},[i("v-expand-transition",[a?i("div",{staticClass:"d-flex transition-fast-in-fast-out background v-card--reveal primary--text font-weight-medium",staticStyle:{cursor:"pointer",height:"100%"}},[t._v("Seleccionar")]):t._e()])],1)]}}],null,!1,3770160611)}):t._e()],1)],1),i("v-col",{attrs:{cols:"2"}},[i("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("Color principal")]),i("v-sheet",{staticClass:"mt-3",attrs:{width:"140"}},[i("v-text-field",{attrs:{reverse:"","background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[i("v-menu",{attrs:{bottom:"","close-on-content-click":!1},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("div",t._g({style:t.swatchStyle},a))]}}]),model:{value:t.menu,callback:function(e){t.menu=e},expression:"menu"}},[i("v-card",[i("v-card-text",{staticClass:"pa-0"},[i("v-color-picker",{attrs:{flat:"",width:"250"},model:{value:t.$v.editable.color_background.$model,callback:function(e){t.$set(t.$v.editable.color_background,"$model",e)},expression:"$v.editable.color_background.$model"}})],1)],1)],1)]},proxy:!0}]),model:{value:t.$v.editable.color_background.$model,callback:function(e){t.$set(t.$v.editable.color_background,"$model",e)},expression:"$v.editable.color_background.$model"}})],1)],1),i("v-col",{attrs:{cols:"2"}},[i("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("Color secundario")]),i("v-sheet",{staticClass:"mt-3",attrs:{width:"140"}},[i("v-text-field",{attrs:{value:t.editable.color_asset,reverse:"","background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[i("v-menu",{attrs:{bottom:"","close-on-content-click":!1},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("div",t._g({style:t.swatchStyle1},a))]}}]),model:{value:t.menu1,callback:function(e){t.menu1=e},expression:"menu1"}},[i("v-card",[i("v-card-text",{staticClass:"pa-0"},[i("v-color-picker",{attrs:{flat:"",width:"250"},model:{value:t.$v.editable.color_asset.$model,callback:function(e){t.$set(t.$v.editable.color_asset,"$model",e)},expression:"$v.editable.color_asset.$model"}})],1)],1)],1)]},proxy:!0}])})],1)],1)],1)],1),i("v-divider"),i("v-card-text",[i("v-row",[i("v-col",{attrs:{cols:"3"}},[i("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v("Diseño de correo electrónico")])]),t._l(t.emailTemplates,(function(e){return i("v-col",{key:e,attrs:{cols:"3"}},[i("v-sheet",{staticStyle:{cursor:"pointer"},on:{click:function(a){t.editable.email_template=e}}},[i("v-radio-group",{staticClass:"py-0 mt-0 rounded",staticStyle:{border:"1px solid #D8E0EA"},attrs:{mandatory:!1},model:{value:t.editable.email_template,callback:function(e){t.$set(t.editable,"email_template",e)},expression:"editable.email_template"}},[i("v-img",{staticClass:"rounded",attrs:{cover:"","aspect-ratio":.8,src:a("12d4")("./appAsset-Branding--TemplateEmail-"+e+".svg")}}),i("v-radio",{staticClass:"px-3 pt-4 pb-0",attrs:{value:e,label:t._f("capitalize")(e)}})],1)],1)],1)}))],2)],1),i("v-divider"),i("v-card-text",{staticClass:"background"},[i("v-row",[i("v-col",{attrs:{cols:"3"}},[i("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v("Previsualización")])]),i("v-col",{attrs:{cols:"9"}},[i("v-card",{staticClass:"overflow-hidden",attrs:{outlined:""}},[i("v-card-title",{staticClass:"pa-0"},[i("v-tabs",{attrs:{color:"primary",height:"48","slider-size":"2"},model:{value:t.previewTabs,callback:function(e){t.previewTabs=e},expression:"previewTabs"}},[i("v-tab",{staticClass:"text-none font-weight-medium",attrs:{ripple:!1}},[t._v("Emails")])],1)],1),i("v-divider"),i("v-card-text",{staticClass:"py-6"},[i("v-tabs-items",{staticClass:"transparent",model:{value:t.previewTabs,callback:function(e){t.previewTabs=e},expression:"previewTabs"}},[i("v-tab-item",{attrs:{transition:"fade-transition","reverse-transition":"fade-transition"}},[i("v-row",{attrs:{align:"start",justify:"center"}},[i("v-col",{attrs:{cols:"7"}},[i("reminder-invoice-email",{attrs:{instance:t.previewReminderTemplate,action:"pay",template:t.editable.email_template,"color-background":t.editable.color_background,"color-asset":t.editable.color_asset},on:{"update:colorAsset":function(e){return t.$set(t.editable,"color_asset",e)},"update:color-asset":function(e){return t.$set(t.editable,"color_asset",e)}}})],1)],1)],1)],1)],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.patchAccount}},[t._v("Guardar")])],1)],1)]],2)],1)},ia=[],sa=(a("2b3d"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",["admiral"===t.template?a("header-admiral",{attrs:{instance:t.instance,action:t.action,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"classic"===t.template?a("header-classic",{attrs:{instance:t.instance,action:t.action,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"modern"===t.template?a("header-modern",{attrs:{instance:t.instance,action:t.action,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):t._e(),a("email-footer")],1)],1)}),ra=[],na=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-sheet",{staticClass:"text-center"},[i("img",{staticClass:"mt-6 mb-3",attrs:{src:a("026d"),width:"45"}}),i("span",{staticClass:"d-block caption"},[t._v("Estás recibiendo este email porque eres cliente de "+t._s(t.account.name)+", quien utiliza Axteroid para sus procesos de facturación.")])])},oa=[],la={mixins:[$]},ca=la,da=a("8dd9"),ua=Object(E["a"])(ca,na,oa,!1,null,null,null),va=ua.exports;A()(ua,{VSheet:da["a"]});var ma=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{staticClass:"background"},[a("v-row",{staticClass:"px-3",attrs:{justify:"start"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{staticClass:"background"},[a("v-row",[a("v-col",{staticClass:"pb-0",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-3"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0"},[a("v-row",[a("v-col",{staticClass:"pa-0",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1),a("v-card-actions",["pay"===t.action?a("v-row",{staticClass:"px-3"},[a("v-col",[a("v-btn",{style:"background-color:"+(t.colorBackground?t.colorBackground:t.account.color_background)+";",attrs:{"min-width":"180",height:"50",dark:""}},[t._v("Pagar")])],1)],1):t._e()],1)],1)},pa=[],ha=a("3f9d");s["default"].use(ha["a"]);var fa={props:{instance:{type:Object,required:!1,default:function(){return{}}},action:{type:String,required:!1,default:function(){return null}},message:{type:String,required:!1,default:function(){return""}},colorBackground:{type:String,required:!1,default:function(){return"#4051B5"}},colorAsset:{type:String,required:!1,default:function(){return"#525F7F"}},placeholder:{type:String,required:!1,default:function(){return"Escribe un mensaje..."}}},mixins:[$],computed:{messageBody:{set:function(){return this.message},get:function(){return this.message}}},methods:{updateMessage:function(t){this.$emit("update:message",t)}}},ba={mixins:[fa]},ga=ba,_a=a("a844"),ya=Object(E["a"])(ga,ma,pa,!1,null,null,null),Ca=ya.exports;A()(ya,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var xa=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"border-top: 3px solid "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-5"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0 background"},[a("v-row",[a("v-col",{staticClass:"pa-0",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"background-color":"background","auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1),a("v-card-actions",{staticClass:"background"},["pay"===t.action?a("v-row",{staticClass:"px-3"},[a("v-col",[a("v-btn",{style:"background-color:"+(t.colorBackground?t.colorBackground:t.account.color_background)+";",attrs:{block:"",height:"50",dark:""}},[t._v("Pagar")])],1)],1):t._e()],1)],1)},wa=[],$a={mixins:[fa]},ka=$a,Va=Object(E["a"])(ka,xa,wa,!1,null,null,null),La=Va.exports;A()(Va,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var Sa=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",color:"white",rounded:"circle",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 white--text font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 white--text font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))])])],1)],1),a("v-card-text",{staticClass:"py-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("span",{staticClass:"d-block body-1 font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0"},[a("v-row",[a("v-col",{staticClass:"pa-0",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1),a("v-card-actions",["pay"===t.action?a("v-row",{staticClass:"px-3"},[a("v-col",[a("v-btn",{style:"background-color:"+(t.colorBackground?t.colorBackground:t.account.color_background)+";",attrs:{block:"",height:"50",dark:""}},[t._v("Pagar")])],1)],1):t._e()],1)],1)},Ta=[],Ea={mixins:[fa]},Da=Ea,Aa=Object(E["a"])(Da,Sa,Ta,!1,null,null,null),ja=Aa.exports;A()(Aa,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var qa={props:{template:{type:String,required:!1,default:function(){return"modern"}}},components:{EmailFooter:va,HeaderAdmiral:Ca,HeaderClassic:La,HeaderModern:ja},mixins:[fa]},Ia=qa,Oa=Object(E["a"])(Ia,sa,ra,!1,null,null,null),Ra=Oa.exports;A()(Oa,{VCol:q["a"],VRow:z["a"]});var Na={components:{ReminderInvoiceEmail:Ra},mixins:[$],data:function(){return{radios:"radio-1",modes:["hsla","rgba","hexa"],menu:!1,menu1:!1,previewReminderTemplate:{customer:{name:"Acme Inc"},date:"2021-01-01",document:{name:"Invoice"},currency:"USD",number:17743,total:186},emailTemplates:["classic","modern","admiral"],logoPreview:"",editable:{logo:"",email_template:"",color_background:"",color_asset:""},previewTabs:0}},computed:Object(i["a"])({swatchStyle:function(){return{backgroundColor:this.$v.editable.color_background.$model,cursor:"pointer",height:"30px",width:"30px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}},swatchStyle1:function(){return{backgroundColor:this.$v.editable.color_asset.$model,cursor:"pointer",height:"30px",width:"30px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}}},Object(u["c"])({accountsDetail:function(t){return t.accounts.accountsDetail}})),created:function(){var t=this;this.$store.dispatch("accounts/RETRIEVE",{resource:"accounts",id:this.account.id}).then((function(){t.editable={logo:t.accountsDetail.logo,email_template:t.accountsDetail.email_template,color_background:t.accountsDetail.color_background,color_asset:t.accountsDetail.color_asset}}))},methods:{patchAccount:function(){var t=this;if(this.editable.logo=this.$refs["editable.logo"].files[0],this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;var e=new FormData;this.editable.logo&&e.append("logo",this.editable.logo,this.editable.logo.name),e.append("email_template",this.editable.email_template),e.append("color_background",this.editable.color_background),e.append("color_asset",this.editable.color_asset),this.$store.dispatch("accounts/UPDATE",{resource:"accounts",payload:e,id:this.accountsDetail.id,headers:{"Content-Type":"multipart/form-data"}}).then((function(e){t.$store.commit("auth/SET_ACCOUNT",{account:e.data,redirect:!1}),t.editable={logo:e.data.logo,email_template:e.data.email_template,color_background:e.data.color_background,color_asset:e.data.color_asset},t.$dialog.message.info("La información de la organización se ha actualizado"),t.resetLogoField()})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},getLogoPreview:function(t){t.target.files.length?this.logoPreview=URL.createObjectURL(t.target.files[0]):this.logoPreview=""},resetLogoField:function(){this.$refs["editable.logo"].type="text",this.$refs["editable.logo"].type="file",this.logoPreview=""}},validations:{editable:{email_template:{required:ie["required"]},color_background:{required:ie["required"],minLength:Object(ie["minLength"])(7),maxLength:Object(ie["maxLength"])(7)},color_asset:{required:ie["required"],minLength:Object(ie["minLength"])(7),maxLength:Object(ie["maxLength"])(7)}}}},Pa=Na,Ba=(a("b244"),a("03a4")),za=a("0789"),Fa=a("67b6"),Ma=a("43a6"),Ua=a("71a3"),Ga=a("c671"),Ha=a("fe57"),Ya=a("aac8"),Wa=Object(E["a"])(Pa,aa,ia,!1,null,"4006cf4e",null),Qa=Wa.exports;A()(Wa,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VColorPicker:Ba["a"],VDivider:tt["a"],VExpandTransition:za["a"],VHover:et["a"],VIcon:I["a"],VImg:Ht["a"],VMenu:P["a"],VProgressCircular:B["a"],VRadio:Fa["a"],VRadioGroup:Ma["a"],VRow:z["a"],VSheet:da["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTab:Ua["a"],VTabItem:Ga["a"],VTabs:Ha["a"],VTabsItems:Ya["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var Ka=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{staticClass:"px-0 pb-0",attrs:{cols:"12"}},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"48"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Procesadores de facturación")])],1)],1),t._l(t.billers,(function(e){return i("v-col",{key:e.id,attrs:{cols:"3"}},[i("v-card",{staticClass:"py-0 card-apps",attrs:{to:{name:e.routeName,params:{id:e.id}},ripple:!1}},[i("v-card-text",{staticClass:"px-2 pb-0 text-center"},[i("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1.5}},[i("img",{staticClass:"mt-4",attrs:{src:a("e4d1")("./appAsset-brand--"+e.brand+".svg"),height:"40px"}})])],1),i("v-card-actions",{staticClass:"pt-0 px-3 pb-3"},[i("v-spacer"),i("span",{staticClass:"d-block body-2 text--secondary"},[t._v(" "+t._s(e.title)+" ")]),i("v-spacer")],1)],1)],1)})),i("v-col",{attrs:{cols:"12"}},[i("v-card",[t.$store.state.reminders.retrieveLoader?i("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"heading"}}):i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Plantillas de envío de facturas")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("common-templates",{attrs:{templates:t.remindersTemplates,kind:"invoicing"}})],1)],1)],1),t.$store.state.accounts.retrieveLoader?i("v-col",{attrs:{cols:"12"}},[i("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"list-item-three-line"}})],1):i("v-col",{attrs:{cols:"12"}},[i("v-card",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Preferencias de facturación")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-row",{staticClass:"py-6"},[i("v-col",{attrs:{md:"9"}},[i("v-list",{staticClass:"v-list-form transparent"},[i("v-list-item",{staticClass:"my-3"},[i("v-list-item-title",[t._v(" CCO Emails "),i("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({attrs:{small:"",color:"secondary"}},a),[t._v("mdi-information")])]}}])},[i("span",[t._v("Envía como copia oculta los emails de facturas de suscripciones, facturas masivas, facturas manuales y órdenes a las direcciones de correo electrónico especificados.")])])],1),i("v-list-item-subtitle",[t._l(t.accountSettings.bcc_emails,(function(e,a){return i("v-row",{key:a,staticClass:"mx-0"},[i("v-col",{staticClass:"py-1",attrs:{cols:"10"}},[i("v-text-field",{attrs:{error:t.$v.accountSettings.bcc_emails.$each[a].email.$error,"hide-details":"",maxlength:"64","background-color":"white",outlined:"",required:"","single-line":"",dense:""},model:{value:t.$v.accountSettings.bcc_emails.$each[a].email.$model,callback:function(e){t.$set(t.$v.accountSettings.bcc_emails.$each[a].email,"$model","string"===typeof e?e.trim():e)},expression:"$v.accountSettings.bcc_emails.$each[i].email.$model"}})],1),i("v-col",{staticClass:"py-1",attrs:{cols:"1"}},[i("v-btn",{staticClass:"mt-1",attrs:{icon:"",color:"red","retain-focus-on-click":"",ripple:!1},on:{click:function(e){return t.accountSettings.bcc_emails.splice(a,1)}}},[i("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)})),i("v-row",[i("v-col",{staticClass:"py-0"},[i("v-btn",{attrs:{text:"",color:"primary",ripple:!1,disabled:3===t.accountSettings.bcc_emails.length},on:{click:t.addBccEmail}},[i("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar email")],1)],1)],1)],2)],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.patchAccount}},[t._v("Guardar")])],1)],1)],1)],2)},Xa=[],Ja=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[t.$store.state.reminders.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item-three-line"}})],1):a("v-col",{attrs:{cols:"12"}},[t.templatesList.length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Nombre")]),a("th",[t._v("Creado por")]),a("th",{staticClass:"text-right"},[t._v("Fecha de creación")]),a("th",{staticClass:"text-right"},[t._v("Última modificación")]),a("th")])]),a("tbody",[t._l(t.templatesList,(function(e,i){return[a("tr",{key:i,on:{click:function(a){t.template=e,t.modalTemplate=!0}}},[a("td",[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(e.name))])]),a("td",[a("span",[t._v(t._s(e.user))])]),a("td",{staticClass:"text-right"},[t._v(t._s(t._f("dateTime")(e.created)))]),a("td",{staticClass:"text-right"},[t._v(t._s(t._f("dateTime")(e.updated)))]),a("td",{staticClass:"text-right"},[a("v-btn",{attrs:{icon:"",color:"red","retain-focus-on-click":"",ripple:!1},on:{click:function(e){return e.stopPropagation(),t.deleteTemplate(i)}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)])]}))],2)]},proxy:!0}],null,!1,3732851641)}),a("v-divider"),a("v-col",{staticClass:"text-center py-5",attrs:{md:"12"}},[a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalTemplate=!0}}},[t._v("Nueva plantilla")])],1)]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-email")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Aún no tienes plantillas para "+t._s("collection"===t.kind?"recordatorios de pago":"envío de facturas")+".")]),a("v-btn",{staticClass:"my-5",attrs:{outlined:""},on:{click:function(e){t.modalTemplate=!0}}},[t._v("Crear una plantilla")])],1)],2),a("v-dialog",{attrs:{width:"800",persistent:"","no-click-animation":""},model:{value:t.modalTemplate,callback:function(e){t.modalTemplate=e},expression:"modalTemplate"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v(t._s(t.modalTemplate.id?"Editar plantilla":"Nueva plantilla"))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:"",ripple:!1},on:{click:function(e){t.modalTemplate=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{staticClass:"mx-0",attrs:{align:"center",justify:"start"}},t._l(t.messages,(function(e){return a("v-col",{key:e.value,staticClass:"px-4",attrs:{cols:"6"}},[a("v-card",{staticClass:"pt-1 pb-0"},[a("v-radio-group",{staticClass:"py-0",attrs:{disabled:"sms"===e.value,mandatory:!1},model:{value:t.channel,callback:function(e){t.channel=e},expression:"channel"}},[a("v-radio",{staticClass:"px-3 text--secondary font-weight-medium",attrs:{value:e.value,label:e.label}}),a("span",{staticClass:"ml-11"},[t._v(t._s(e.text))])],1)],1)],1)})),1),a("v-divider"),a("v-list",{staticClass:"transparent"},[a("v-list-item",{attrs:{"three-line":""}},[a("v-list-item-content",[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium"},[t._v("Nombre de la plantilla")]),a("v-list-item-subtitle",{staticClass:"pt-1"},[a("v-text-field",{attrs:{error:t.$v.template.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"40",placeholder:"Escribe un nombre para tu plantilla","hide-details":t.$v.template.name.maxLength,"persistent-hint":"",hint:"Escribe un máximo de 40 caracteres"},model:{value:t.$v.template.name.$model,callback:function(e){t.$set(t.$v.template.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.template.name.$model"}})],1)],1)],1),a("v-list-item",{attrs:{"three-line":""}},[a("v-list-item-content",[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium"},[t._v("Asunto")]),a("v-list-item-subtitle",{staticClass:"pt-1"},[a("v-text-field",{attrs:{error:t.$v.template.subject.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"40",placeholder:"Escribe un asunto para el email","hide-details":t.$v.template.subject.maxLength,"persistent-hint":"",hint:"Escribe un máximo de 60 caracteres"},model:{value:t.$v.template.subject.$model,callback:function(e){t.$set(t.$v.template.subject,"$model","string"===typeof e?e.trim():e)},expression:"$v.template.subject.$model"}})],1)],1)],1)],1),a("v-row",{staticClass:"mx-0"},[a("v-col",{staticClass:"px-4"},[a("span",{staticClass:"font-weight-medium text--secondary"},[t._v("Mensaje")]),a("v-card",{staticClass:"pa-0 background elevation-0",staticStyle:{border:"1px solid #D8E0EA !important"}},[a("v-row",{staticClass:"ma-0"},[a("v-spacer"),a("v-divider",{attrs:{vertical:""}}),a("v-menu",{attrs:{right:"","close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"180px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticStyle:{"border-top-right-radius":"4px"},attrs:{color:"white",ripple:!1,tile:""}},"v-btn",s,!1),i),[t._v("Insertar token"),a("v-icon",[t._v("mdi-menu-down")])],1)]}}]),model:{value:t.menu,callback:function(e){t.menu=e},expression:"menu"}},[t._l(t.tokens,(function(e,i){return[e.kind.includes(t.kind)?a("v-col",{key:i,staticClass:"py-1"},[a("a",{staticClass:"body-2 text--secondary",domProps:{innerHTML:t._s(e.label)},on:{click:function(e){t.setToken(i),t.menu=!1}}})]):t._e()]}))],2)],1),a("v-divider"),a("v-col",{staticClass:"py-0 white",style:t.$v.template.message.$error?"border:1px solid #ff5252 !important":""},[a("v-textarea",{ref:"message",staticClass:"pb-0 elevation-0",attrs:{solo:"",flat:"","hide-details":"",placeholder:"Escribe un mensaje para el email"},model:{value:t.$v.template.message.$model,callback:function(e){t.$set(t.$v.template.message,"$model","string"===typeof e?e.trim():e)},expression:"$v.template.message.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalTemplate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.invoices.createLoader,color:"primary"},on:{click:function(e){t.template.id?t.patchTemplate():t.postTemplate()}}},[t._v("Guardar plantilla")])],1)],1)],1)],1)},Za=[],ti={props:{kind:{type:String,required:!0}},mixins:[$],data:function(){return{deleteTemp:null,menu:!1,accountConfig:{},messages:[{text:"Envío de mensaje a través de email.",value:"email",label:"Mensaje de email"},{text:"Envío de mensaje a través de mensaje de texto.",value:"sms",label:"Mensaje de SMS"}],template:{id:null,kind:this.kind,name:"",subject:"",message:""},tokens:[{value:"number",label:"Factura número",kind:["invoicing","collection"]},{value:"document.name",label:"Factura tipo",kind:["invoicing","collection"]},{value:"date",label:"Factura fecha",kind:["invoicing","collection"]},{value:"due_date",label:"Pago fecha",kind:["collection"]},{value:"total",label:"Pago total",kind:["collection"]},{value:"total",label:"Factura total",kind:["invoicing"]},{value:"customer.name",label:"Cliente nombre",kind:["invoicing","collection"]}],channel:"email",modalTemplate:!1}},computed:Object(u["c"])({templatesList:function(t){return Q()(t.reminders.templatesList)}}),watch:{modalTemplate:function(){this.modalTemplate||(this.template={id:null,kind:this.kind,name:"",subject:"",message:""},this.$v.template.$reset())}},methods:{postTemplate:function(){var t=this;if(this.$v.template.$touch(),this.$v.template.$invalid)return!1;this.$store.dispatch("reminders/CREATE",{resource:"reminders/templates",payload:this.template}).finally((function(){t.modalTemplate=!1,t.$dialog.message.info("La plantilla se ha creado con éxito")}))},patchTemplate:function(){var t=this;if(this.$v.template.$touch(),this.$v.template.$invalid)return!1;this.$store.dispatch("reminders/UPDATE",{resource:"reminders/templates",id:this.template.id,payload:this.template}).finally((function(){t.modalTemplate=!1,t.$dialog.message.info("La plantilla se ha actualizado con éxito")}))},deleteTemplate:function(t){var e=this;this.$dialog.warning({title:"Eliminar",text:'\n Al confirmar se eliminará la plantilla de tu cuenta y todo lo asociado con esta utilizará un mensaje por defecto.\n ',actions:[{color:"red",text:"Continuar",handle:function(){e.$store.dispatch("reminders/DESTROY",{resource:"reminders/templates",id:e.templatesList[t].id}).then((function(t){e.$dialog.message.info("La plantilla ha sido eliminada")})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))}}]})},setToken:function(t){var e=this.template.message,a=this.$refs.message.$refs.input,i=a.value,s=i.length,r=a.selectionStart;void 0===r&&(r=0),this.template.message=i.substr(0,r)+"{{"+this.tokens[t].value+"}}"+i.substr(r,s),this.$nextTick().then((function(){a.selectionStart=r+e.length}))}},validations:{template:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(40)},subject:{required:ie["required"],maxLength:Object(ie["maxLength"])(60)},message:{required:ie["required"]}}}},ei=ti,ai=Object(E["a"])(ei,Ja,Za,!1,null,null,null),ii=ai.exports;A()(ai,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRadio:Fa["a"],VRadioGroup:Ma["a"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VTextarea:_a["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var si=[{id:"facturapi",apiKeyLabel:"Api Key",brand:"facturapi",countries:["MX"],docs:"/guide/settings/invoicing/billers/facturapi",invoiceTypes:["Factura de ingreso","Factura de pago"],otherTypes:[],routeName:"BillersBiller",title:"Facturapi",website:"https://www.facturapi.io"},{id:"defontana",apiKeyLabel:"Email",brand:"defontana",countries:["CL"],docs:"/guide/settings/invoicing/billers/defontana",invoiceTypes:["Factura electrónica","Factura exenta electrónica","Boleta electrónica","Boleta electrónica exenta"],otherTypes:["Nota de crédito electrónica","Nota de débito electrónica"],routeName:"BillersBiller",title:"Defontana",website:"https://www.defontana.com"},{id:"bsale",apiKeyLabel:"Access Token",brand:"bsale",countries:["CL"],docs:"/guide/settings/invoicing/billers/bsale",invoiceTypes:["Factura electrónica","Factura exenta electrónica","Boleta electrónica","Boleta electrónica exenta"],otherTypes:["Nota de crédito electrónica","Nota de débito electrónica"],routeName:"BillersBiller",title:"Bsale",website:"https://www.bsale.cl"}],ri={components:{CommonTemplates:ii},mixins:[$],data:function(){return{accountSettings:{bcc_emails:[]},billers:si,remindersTemplates:[]}},mounted:function(){this.getTemplates()},created:function(){var t=this;this.$store.dispatch("accounts/RETRIEVE",{resource:"accounts",id:this.account.id}).then((function(e){t.accountSettings.bcc_emails&&(t.accountSettings.bcc_emails=e.data.bcc_emails.map((function(t){return{email:t}})))}))},methods:{getTemplates:function(){this.$store.dispatch("reminders/LIST",{resource:"reminders/templates",query:{kind:"invoicing"}})},patchAccount:function(){var t=this;if(this.$v.accountSettings.$touch(),this.$v.accountSettings.$invalid)return!1;this.$store.dispatch("accounts/UPDATE",{resource:"accounts",payload:{bcc_emails:this.accountSettings.bcc_emails.map((function(t){return t.email}))},id:this.account.id}).then((function(){t.$dialog.message.info("Las preferencias de la organización se han actualizado")})).catch((function(e){t.$dialog.message.warning(t.parseErrors(e.response.data))}))},addBccEmail:function(){this.accountSettings.bcc_emails.push({email:""})}},validations:{accountSettings:{bcc_emails:{$each:{email:{required:ie["required"],email:ie["email"],maxLenght:Object(ie["maxLength"])(64)}}}}}},ni=ri,oi=Object(E["a"])(ni,Ka,Xa,!1,null,null,null),li=oi.exports;A()(oi,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var ci=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{attrs:{cols:"3"}},[i("v-sheet",{staticClass:"pt-4",attrs:{color:"transparent"}},[i("v-card",{attrs:{width:"180px",outlined:""}},[i("v-card-text",[i("v-responsive",{staticClass:"align-center text-center",attrs:{"aspect-ratio":1}},[i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+t.activeBiller.brand+".svg"),alt:t.activeBiller.title,width:"90%"}})])],1)],1),i("v-list",{staticClass:"pl-0",attrs:{color:"transparent"}},[i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",{staticClass:"d-block text--secondary font-weight-medium"},[t._v("Compatibilidad")])],1),i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Países")]),i("v-list-item-subtitle",{staticClass:"d-block pt-1 caption text--primary"},t._l(t.activeBiller.countries,(function(e){return i("img",{key:e,staticClass:"mr-2",attrs:{src:a("8b22")("./appAsset-flag--"+e+".svg"),alt:t.activeBiller.title,height:"16px"}})})),0)],1)],1),i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Tipos de facturas")]),i("v-list-item-subtitle",{staticClass:"pt-1"},t._l(t.activeBiller.invoiceTypes,(function(e){return i("span",{key:e,staticClass:"d-block mb-1 caption text--primary"},[t._v(t._s(e))])})),0)],1)],1),t.activeBiller.otherTypes&&t.activeBiller.otherTypes.length?i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Otros tipos de documentos")]),i("v-list-item-subtitle",{staticClass:"pt-1"},t._l(t.activeBiller.otherTypes,(function(e){return i("span",{key:e,staticClass:"d-block mb-1 caption text--primary"},[t._v(t._s(e))])})),0)],1)],1):t._e()],1)],1)],1),i("v-col",{attrs:{cols:"9"}},[i("v-row",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"ml-n1 subtitle-1 text--secondary font-weight-medium"},[i("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"AccountSettingsInvoicing"}}},[t._v("Procesadores de facturación")]),i("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(t._s(t.activeBiller.title)+" ")],1)],1)],1),i("v-row",{attrs:{"no-gutters":""}},[i("v-col",{attrs:{md:"3"}},[i("span",{staticClass:"d-block caption"},[t._v("Documentación")]),i("v-btn",{attrs:{href:""+t.$DOCS_BASE+t.activeBiller.docs,target:"_blank",color:"primary",text:"",ripple:!1}},[t._v("Ir a la documentación"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1),i("v-divider",{attrs:{vertical:""}}),i("v-col",{staticClass:"ml-2",attrs:{md:"3"}},[i("span",{staticClass:"d-block caption"},[t._v("Sitio web")]),i("v-btn",{attrs:{href:t.activeBiller.website,target:"_blank",color:"primary",text:"",ripple:!1}},[t._v("Visitar el sitio"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1)],1),i("v-row",[i("v-col",{attrs:{cols:"12"}},[i("v-card",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t.instance.id?[t._v("Actualizar conexión")]:[t._v("Conectar")],t._v(" "+t._s(t.activeBiller.title)+" ")],2)],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0"},[i("v-list",{staticClass:"py-5",attrs:{color:"background",dense:""}},[i("v-list-item",[i("v-list-item-content",[i("v-list-item-title",{staticClass:"ml-1 text--secondary subtitle-2 font-weight-medium"},[t._v(t._s(t.activeBiller.apiKeyLabel))]),i("v-list-item-subtitle",{staticClass:"font-weight-regular"},[i("v-col",{staticClass:"pa-0",attrs:{cols:"6"}},[i("v-text-field",{attrs:{error:t.$v.billerConnection.api_key.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"254",placeholder:t.activeBiller.placeholder,"hide-details":""},model:{value:t.$v.billerConnection.api_key.$model,callback:function(e){t.$set(t.$v.billerConnection.api_key,"$model",e)},expression:"$v.billerConnection.api_key.$model"}})],1)],1)],1)],1),"defontana"===t.activeBiller.id?[i("v-list-item",[i("v-list-item-content",[i("v-list-item-title",{staticClass:"ml-1 text--secondary subtitle-2 font-weight-medium"},[t._v("Contraseña")]),i("v-list-item-subtitle",{staticClass:"font-weight-regular"},[i("v-col",{staticClass:"pa-0",attrs:{cols:"6"}},[i("v-text-field",{attrs:{error:t.$v.billerConnection.extra_data.password.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":"",type:"password",autocomplete:"new-password"},model:{value:t.$v.billerConnection.extra_data.password.$model,callback:function(e){t.$set(t.$v.billerConnection.extra_data.password,"$model",e)},expression:"$v.billerConnection.extra_data.password.$model"}})],1)],1)],1)],1)]:t._e(),t.activeBiller.warning?i("v-list-item",{staticClass:"pt-16"},[i("v-list-item-content",[i("v-alert",{staticClass:"mb-0 body-2",attrs:{dark:"",dense:"",color:"primary",border:"left",type:"info"}},[t._v(t._s(t.activeBiller.warning))])],1)],1):t._e()],2)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[t.instance.id?i("v-btn",{attrs:{dark:"",color:"red"},on:{click:t.destroyBillerConnection}},[t._v("Desconectar")]):t._e(),i("v-spacer"),i("v-btn",{attrs:{loading:t.loaderConnect,color:"primary"},on:{click:function(e){t.instance.id?t.updateBillerConnection():t.createBillerConnection()}}},[t.instance.id?[t._v("Actualizar conexión")]:[t._v("Conectar")]],2)],1)],1)],1)],1)],1)],1)},di=[],ui={mixins:[$],data:function(){return{billers:si,billerConnection:{biller:"",api_key:"",extra_data:{password:null}},loaderConnect:!1}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({instance:function(t){return t.billers.billerconnectionsList[0]||{}}})),{},{activeBiller:function(){var t=this;return this.billers.find((function(e){return e.id===t.$route.params.id}))}}),created:function(){this.billerConnection.biller=this.$route.params.id,this.$store.dispatch("billers/LIST",{resource:"billerconnections",query:{biller:this.$route.params.id}})},methods:{createBillerConnection:function(){var t=this;if(this.$v.billerConnection.$touch(),this.$v.billerConnection.$invalid)return!1;this.loaderConnect=!0,this.$store.dispatch("billers/CREATE",{resource:"billerconnections",payload:this.billerConnection}).then((function(){t.$dialog.message.info("Se ha conectado ".concat(t.activeBiller.title,".")),t.resetBillerConnection()})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loaderConnect=!1}))},destroyBillerConnection:function(){var t=this;this.$dialog.warning({title:"Desconectar ".concat(this.activeBiller.title),text:'\n ¿Estás seguro de desconectar este proveedor de facturación?\n Esta acción no se puede deshacer.\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("billers/DESTROY",{resource:"billerconnections",id:t.instance.id}).then((function(){t.$dialog.message.info("El proveedor de facturación ".concat(t.activeBiller.title," ha sido desconectado.")),t.$router.push({name:"AccountSettingsInvoicing"})})).catch((function(e){t.$dialog.message.warning(t.parseErrors(e.response.data))}))}}]})},resetBillerConnection:function(){this.billerConnection={biller:this.activeBiller.id,api_key:"",extra_data:{password:null}},this.$v.billerConnection.$reset()},updateBillerConnection:function(){var t=this;if(this.$v.billerConnection.$touch(),this.$v.billerConnection.$invalid)return!1;this.loaderConnect=!0,this.$store.dispatch("billers/UPDATE",{resource:"billerconnections",id:this.instance.id,payload:this.billerConnection}).then((function(){t.$dialog.message.info("Se ha actualizado la conexión con ".concat(t.activeBiller.title,".")),t.resetBillerConnection()})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loaderConnect=!1}))}},validations:{billerConnection:{api_key:{required:ie["required"],maxLength:Object(ie["maxLength"])(254),email:function(){return"defontana"!==this.activeBiller.id||Object(ie["email"])(this.billerConnection.api_key)}},extra_data:{password:{required:Object(ie["requiredIf"])((function(){return"defontana"===this.activeBiller.id}))}}}}},vi=ui,mi=Object(E["a"])(vi,ci,di,!1,null,null,null),pi=mi.exports;A()(mi,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var hi=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{attrs:{cols:"3"}},[i("v-sheet",{staticStyle:{position:"sticky",top:"100px"},attrs:{color:"transparent"}},[i("v-card",{attrs:{width:"180px",outlined:""}},[i("v-card-text",[i("v-responsive",{staticClass:"align-center text-center",attrs:{"aspect-ratio":1}},[i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+t.biller.brand+".svg"),alt:t.biller.title,height:"40px"}})])],1)],1),i("v-list",{staticClass:"pl-0",attrs:{color:"transparent"}},[i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",{staticClass:"d-block text--secondary font-weight-medium"},[t._v("Compatibilidad")])],1),i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Países")]),i("v-list-item-subtitle",{staticClass:"d-block pt-1 caption text--primary"},[i("img",{staticClass:"mr-2",attrs:{src:a("196a"),alt:t.biller.title,height:"16px"}})])],1)],1),i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Tipos de facturas")]),i("v-list-item-subtitle",{staticClass:"pt-1"},t._l(t.biller.invoiceTypes,(function(e){return i("span",{key:e,staticClass:"d-block mb-1 caption text--primary"},[t._v(t._s(e))])})),0)],1)],1),i("v-list-item",{staticClass:"pl-0"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"text--secondary"},[t._v("Otros tipos de documentos")]),i("v-list-item-subtitle",{staticClass:"pt-1"},t._l(t.biller.otherTypes,(function(e){return i("span",{key:e,staticClass:"d-block mb-1 caption text--primary"},[t._v(t._s(e))])})),0)],1)],1)],1)],1)],1),i("v-col",{attrs:{cols:"9"}},[i("v-row",[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"ml-n1 subtitle-1 text--secondary font-weight-medium"},[i("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"AccountSettingsInvoicing"}}},[t._v("Procesadores de facturación")]),i("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(t._s(t.biller.title)+" ")],1),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on,s=e.attrs;return[i("v-btn",t._g(t._b({staticClass:"ml-1",attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),a),[i("v-icon",{attrs:{left:""}},[t._v("mdi-chart-box")]),t._v("Reportes"),i("v-icon",{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}])},[i("v-list",{staticClass:"pa-0"},[i("v-list-item",{staticClass:"px-5 py-1",attrs:{to:{name:"BillersBuiltInReportTransactional"},ripple:!1}},[i("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Transaccional")])],1),i("v-list-item",{staticClass:"px-5 py-1",attrs:{to:{name:"BillersBuiltInRvds"},ripple:!1}},[i("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Resumen de ventas diarias (RVD)")])],1)],1)],1)],1)],1)],1)],1),i("v-row",{attrs:{"no-gutters":""}},[i("v-col",{attrs:{md:"3"}},[i("span",{staticClass:"d-block caption"},[t._v("Documentación")]),i("v-btn",{attrs:{href:""+t.$DOCS_BASE+t.biller.docs,target:"_blank",color:"primary",text:"",ripple:!1}},[t._v("Ir a la documentación"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1),i("v-divider",{attrs:{vertical:""}}),i("v-col",{staticClass:"ml-2",attrs:{md:"3"}},[i("span",{staticClass:"d-block caption"},[t._v("Sitio web")]),i("v-btn",{attrs:{href:t.biller.website,target:"_blank",color:"primary",text:"",ripple:!1}},[t._v("Visitar el sitio"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1)],1),i("v-row",[t.hasSequences?t._e():i("v-col",{attrs:{cols:"12"}},[i("v-alert",{staticClass:"mb-0 body-2",attrs:{dark:"",dense:"",prominent:"",color:"indigo",border:"left",type:"info"}},[i("v-row",{attrs:{align:"center"}},[i("v-col",{staticClass:"grow"},[t._v(" Si actualmente usas el "),i("span",{staticClass:"font-weight-medium"},[t._v("software de facturación gratuito del SII")]),t._v(" es necesario que solicites la certificación de tu empresa para poder usar "),i("span",{staticClass:"font-weight-medium"},[t._v("Axteroid")])]),i("v-col",{staticClass:"shrink"},[i("v-btn",{attrs:{color:"indigo darken-3"},on:{click:function(e){return t.intercomNewMessage("Hola, quiero certificar mi empresa en el SII para poder usar Axteroid")}}},[t._v("Solicitar certificación")])],1)],1)],1)],1),i("v-col",{attrs:{cols:"12"}},[t.hasCertificate&&t.hasSequences&&t.hasBillerConnection?t._e():i("v-card",{staticClass:"mb-5"},[i("v-toolbar",{attrs:{flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Activación de la facturación incorporada")])],1),i("v-divider"),i("v-card-text",{staticClass:"px-0"},[i("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[i("v-col",{staticClass:"text-center"},[i("v-progress-circular",{attrs:{rotate:260,size:120,width:12,value:t.activation,color:"primary"}},[i("span",{staticClass:"title"},[t._v(t._s(t.activation)+"%")])])],1),i("v-divider",{attrs:{vertical:""}}),i("v-col",{staticClass:"text-center"},[t.hasCertificate?i("v-icon",{attrs:{color:"primary",size:"32"}},[t._v("mdi-check-circle")]):i("v-icon",{attrs:{color:"secondary",size:"32"}},[t._v("mdi-account-check")]),i("span",{staticClass:"d-block mt-4 body-2 text--secondary font-weight-medium"},[t._v("Certificado digital")]),i("span",{staticClass:"d-block mt-2",class:{"mb-10":t.hasCertificate}},[t._v("Es requerido para firmar tus facturas electrónicamente")]),t.hasCertificate?t._e():i("v-btn",{staticClass:"mt-3",attrs:{outlined:"",small:""},on:{click:function(e){return t.$vuetify.goTo(t.$refs.certificate,{offset:20})}}},[t._v("Cargar")])],1),i("v-divider",{attrs:{vertical:""}}),i("v-col",{staticClass:"text-center"},[t.hasSequences?i("v-icon",{attrs:{color:"primary",size:"32"}},[t._v("mdi-check-circle")]):i("v-icon",{attrs:{color:"secondary",size:"32"}},[t._v("mdi-numeric-1-box-multiple-outline")]),i("span",{staticClass:"d-block mt-4 body-2 text--secondary font-weight-medium"},[t._v("Folios")]),i("span",{staticClass:"d-block mt-2",class:{"mb-10":t.hasSequences}},[t._v("Axteroid asignará un número correlativo autorizado a tus facturas")]),t.hasSequences?t._e():i("v-btn",{staticClass:"mt-3",attrs:{outlined:"",small:""},on:{click:function(e){return t.$vuetify.goTo(t.$refs.folios,{offset:20})}}},[t._v("Cargar")])],1),i("v-divider",{attrs:{vertical:""}}),i("v-col",{staticClass:"text-center"},[t.hasBillerConnection?i("v-icon",{attrs:{color:"primary",size:"32"}},[t._v("mdi-check-circle")]):i("v-icon",{attrs:{color:"secondary",size:"32"}},[t._v("mdi-domain")]),i("span",{staticClass:"d-block mt-4 body-2 text--secondary font-weight-medium"},[t._v("Información fiscal")]),i("span",{staticClass:"d-block mt-2",class:{"mb-10":t.hasBillerConnection}},[t._v("Requerido para que tus facturas estén en norma con el SII")]),t.hasBillerConnection?t._e():i("v-btn",{staticClass:"mt-3",attrs:{outlined:"",small:""},on:{click:function(e){return t.$vuetify.goTo(t.$refs.taxsettings,{offset:20})}}},[t._v("Actualizar información")])],1)],1)],1)],1),i("v-card",{ref:"certificate",staticClass:"mb-5"},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v(" Certificado digital "),t.certificatesDetail.date_end&&t.dateIsBefore(t.certificatesDetail.date_end,t.today)?i("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({attrs:{small:"",color:"red"}},a),[t._v("mdi-information")])]}}],null,!1,1265787342)},[i("span",[t._v("El certificado digital está vencido. Tus facturas por suscripción, únicas o masivas no pueden ser creadas. Para resolver el problema compra un nuevo certificado y súbelo a Axteroid.")])]):t._e()],1),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalCertificate=!0}}},[i("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v(" Nuevo certificado")],1)],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"px-0 background"},[t.mainLoader?i("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}}):t.certificatesDetail.name?[i("v-list",{staticClass:"v-list-form-extended transparent"},[i("v-list-item",[i("v-list-item-title",[t._v("Nombre")]),i("v-list-item-subtitle",[t._v(t._s(t.certificatesDetail.name)+" • RUN "+t._s(t.certificatesDetail.run))])],1),i("v-list-item",[i("v-list-item-title",[t._v("Validez")]),i("v-list-item-subtitle",[t._v("desde el "+t._s(t._f("date")(t.certificatesDetail.date_start))+" hasta el "+t._s(t._f("date")(t.certificatesDetail.date_end)))])],1),i("v-list-item",[i("v-list-item-title",[t._v("Emisor")]),i("v-list-item-subtitle",[t._v(t._s(t.certificatesDetail.maker))])],1)],1)]:i("v-row",{staticClass:"mx-0"},[i("v-col",{staticClass:"py-2 text-center"},[i("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-account-check")]),i("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes certificados")]),i("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalCertificate=!0}}},[t._v("Nuevo certificado")])],1)],1)],2)],1),i("v-card",{ref:"folios",staticClass:"my-5"},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Folios")]),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{staticClass:"ml-5",attrs:{outlined:""},on:{click:function(e){t.dialogCreateFolio=!0}}},[t._v("Subir folio")])],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[t.mainLoader?i("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}}):[t.sequencesList.length?i("v-expansion-panels",{attrs:{accordion:"",tile:"",flat:""},model:{value:t.expansionPanelCafs,callback:function(e){t.expansionPanelCafs=e},expression:"expansionPanelCafs"}},t._l(t.sequencesList,(function(e,a){return i("v-expansion-panel",{key:e.id},[i("v-expansion-panel-header",[i("v-row",{attrs:{"no-gutters":"",align:"center",justify:"space-between"}},[i("v-col",[i("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v(" "+t._s(e.document.name)+" "),t.cafExists(e.document.id,e.next_number)?t._e():i("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({attrs:{small:"",color:"red"}},a),[t._v("mdi-information")])]}}],null,!0)},[i("span",[t._v("No tienes folios disponibles para "),i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(e.document.name))]),t._v(". Solicita y sube un folio para resolver el problema.")])])],1)]),t.expansionPanelCafs===a?i("v-col",[i("v-tooltip",{attrs:{"max-width":"280px",top:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({staticClass:"mt-n1",attrs:{small:"",color:"secondary"}},a),[t._v("mdi-information")])]}}],null,!0)},[i("span",[t._v("Es el número que será asignado al siguente documento de tipo "),i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(e.document.name))]),t._v(" que sea creado.")])]),t._v(" Núm. siguiente "+t._s(e.next_number)+" ")],1):t._e()],1)],1),i("v-expansion-panel-content",[i("v-row",{staticClass:"mx-0"},[i("v-col",{staticClass:"px-0",attrs:{cols:"12"}},[i("v-card",{staticClass:"overflow-hidden",attrs:{outlined:""}},[i("v-simple-table",{staticClass:"text-primary",attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[i("thead",[i("tr",[i("th",[t._v("Números")]),i("th",[t._v("Vigencia")])])]),i("tbody",[t._l(t.orderedCafs[e.document.id],(function(a,s){return[i("tr",{key:s},[i("td",[i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(a.from_number))]),t._v(" al "),i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(a.to_number))]),e.next_number>=a.from_number&&e.next_number<=a.to_number?[t.cafIsLive(a.life_to)?i("v-chip",{staticClass:"ml-2",attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("En uso")]):i("v-chip",{staticClass:"ml-2",attrs:{color:"red lighten-5","text-color":"red",small:""}},[t._v("Vencido")])]:t._e()],2),i("td",[t._v("desde "),i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(t._f("date")(a.life_from)))]),t._v(" hasta "),i("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(t._f("date")(a.life_to)))])])])]}))],2)]},proxy:!0}],null,!0)})],1)],1)],1)],1),i("v-divider")],1)})),1):i("v-row",{staticClass:"mx-0"},[i("v-col",{staticClass:"py-5 text-center"},[i("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-numeric-0-box-multiple")]),i("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes folios")]),i("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogCreateFolio=!0}}},[t._v("Subir folio")])],1)],1)],i("v-row",{staticClass:"mx-1 py-3"},[i("v-col",{staticClass:"py-0",attrs:{cols:"12"}},[i("v-list-item",{staticClass:"px-0"},[i("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Ayuda")])],1),i("v-list",{staticClass:"transparent"},[i("v-list-item",{staticClass:"px-0"},[i("v-list-item-title",[i("v-btn",{attrs:{href:""+t.$DOCS_BASE+t.guides[0],target:"_blank",text:"",color:"primary",ripple:!1}},[t._v("Cómo solicitar timbraje de folios en SII"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1)],1),i("v-list-item",{staticClass:"px-0"},[i("v-list-item-title",[i("v-btn",{attrs:{href:""+t.$DOCS_BASE+t.guides[1],target:"_blank",text:"",color:"primary",ripple:!1}},[t._v("Cómo subir folios"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1)],1),i("v-list-item",{staticClass:"px-0"},[i("v-list-item-title",[i("v-btn",{attrs:{href:""+t.$DOCS_BASE+t.guides[2],target:"_blank",text:"",color:"primary",ripple:!1}},[t._v("Cómo anular folios vencidos"),i("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-open-in-new")])],1)],1)],1)],1)],1)],1)],2)],1),i("v-card",{ref:"taxsettings",staticClass:"my-5"},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información fiscal")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-list",{staticClass:"py-6",attrs:{color:"transparent"}},[i("v-list-item",{attrs:{"two-line":""}},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Descripción de actividad")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pa-0",attrs:{cols:"8"}},[i("v-text-field",{attrs:{error:t.$v.billerConnection.activity_description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.billerConnection.activity_description.$model,callback:function(e){t.$set(t.$v.billerConnection.activity_description,"$model",e)},expression:"$v.billerConnection.activity_description.$model"}})],1)],1)],1)],1),i("v-list-item",{attrs:{"two-line":""}},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Código de actividad SII")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pa-0",attrs:{cols:"8"}},[i("v-select",{attrs:{error:t.$v.billerConnection.activity.$error,items:t.activitiesList,"item-text":"name","item-value":"id","hide-details":"","single-line":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.$v.billerConnection.activity.$model,callback:function(e){t.$set(t.$v.billerConnection.activity,"$model",e)},expression:"$v.billerConnection.activity.$model"}})],1)],1)],1)],1),i("v-list-item",{attrs:{"two-line":""}},[i("v-list-item-content",[i("v-list-item-subtitle",[i("v-row",{attrs:{align:"center","no-gutters":""}},[i("v-col",{staticClass:"pa-0",attrs:{cols:"3"}},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Fecha de resolución")]),i("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on,s=e.attrs;return[i("v-text-field",t._g(t._b({attrs:{error:t.$v.billerConnection.resolution_date.$error,"background-color":"white",outlined:"","single-line":"",dense:"",readonly:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[i("v-icon",{staticClass:"mr-3",attrs:{small:"",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.billerConnection.resolution_date.$model,callback:function(e){t.$set(t.$v.billerConnection.resolution_date,"$model",e)},expression:"$v.billerConnection.resolution_date.$model"}},"v-text-field",s,!1),a))]}}]),model:{value:t.menu,callback:function(e){t.menu=e},expression:"menu"}},[i("v-date-picker",{attrs:{"no-title":"",type:"date",locale:"es-cl",width:"280",color:"primary"},on:{input:function(e){t.menu=!1}},model:{value:t.$v.billerConnection.resolution_date.$model,callback:function(e){t.$set(t.$v.billerConnection.resolution_date,"$model",e)},expression:"$v.billerConnection.resolution_date.$model"}},[i("div",{staticClass:"mx-auto"},[i("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.billerConnection.resolution_date.$model=t.today,t.menu=!1}}},[t._v("Hoy")]),i("v-btn",{staticClass:"ml-2",attrs:{outlined:""},on:{click:function(){t.$v.billerConnection.resolution_date.$model="",t.menu=!1}}},[t._v("Limpiar")])],1)])],1)],1),i("v-col",{staticClass:"pa-0 pl-3",attrs:{cols:"3"}},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Número de resolución")]),i("v-text-field",{attrs:{error:t.$v.billerConnection.resolution_number.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.billerConnection.resolution_number.$model,callback:function(e){t.$set(t.$v.billerConnection.resolution_number,"$model","string"===typeof e?e.trim():e)},expression:"$v.billerConnection.resolution_number.$model"}})],1)],1)],1)],1)],1),i("v-list-item",{attrs:{"two-line":""}},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-2 text--secondary font-weight-medium"},[i("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},attrs:{label:"Agregar cedible en la factura"},model:{value:t.billerConnection.invoice_assignable_copy,callback:function(e){t.$set(t.billerConnection,"invoice_assignable_copy",e)},expression:"billerConnection.invoice_assignable_copy"}})],1)],1)],1),i("v-list-item",{attrs:{"two-line":""}},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-2 text--secondary font-weight-medium"},[i("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},attrs:{label:"Activar el modo de prueba"},model:{value:t.billerConnection.test_mode,callback:function(e){t.$set(t.billerConnection,"test_mode",e)},expression:"billerConnection.test_mode"}})],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{loading:t.$store.state.billers.createLoader,color:"primary"},on:{click:function(e){t.instance.id?t.updateBillerConnection():t.createBillerConnection()}}},[t._v("Guardar")])],1)],1),i("v-card",{staticClass:"my-5"},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Importaciones")]),i("v-spacer"),i("v-chip",{attrs:{color:"primary","text-color":"white",small:""}},[t._v("Beta")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-list",{staticClass:"transparent"},t._l(t.imports,(function(e){return i("v-list-item",{key:e.title,staticStyle:{"border-bottom":"1px solid #D8E0EA"},attrs:{"three-line":""}},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(e.title))]),i("v-list-item-subtitle",[t._v(t._s(e.description))])],1),i("v-list-item-action",{staticClass:"mt-7"},[i("v-btn",{staticClass:"font-weight-medium",attrs:{to:{name:""+e.url},text:"",color:"primary"}},[t._v("Importar "),i("v-icon",{attrs:{color:"primary",small:""}},[t._v("mdi-arrow-right")])],1)],1)],1)})),1)],1)],1)],1)],1)],1),i("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogCreateFolio,callback:function(e){t.dialogCreateFolio=e},expression:"dialogCreateFolio"}},[i("v-card",[i("v-card-title",{staticClass:"pa-0"},[i("v-toolbar",{attrs:{flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Subir folios")]),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogCreateFolio=!1}}},[i("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-col",{staticClass:"mx-auto",attrs:{cols:"10"}},[i("v-list",{staticClass:"transparent"},[i("v-list-item",{attrs:{"three-line":""}},[i("v-list-item-content",[i("v-list-item-title",[i("v-file-input",{ref:"newCaf",attrs:{type:"file",error:t.$v.newCaf.file.$error,accept:".xml",prepend:"mdi-paper-clip","background-color":"transparent","hide-details":"",placeholder:"No se eligió ningún archivo",solo:"",flat:"",chips:""},model:{value:t.newCaf.file,callback:function(e){t.$set(t.newCaf,"file",e)},expression:"newCaf.file"}})],1),i("v-list-item-subtitle",{staticClass:"pt-3"},[t._v("Selecciona o arrastra un archivo de folios obtenidos desde sii.cl")])],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreateFolio=!1}}},[t._v("Cancelar")]),i("v-btn",{attrs:{loading:t.$store.state.billers.createLoader,color:"primary"},on:{click:t.createCaf}},[t._v("Subir folio")])],1)],1)],1),i("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalCertificate,callback:function(e){t.modalCertificate=e},expression:"modalCertificate"}},[i("v-card",[i("v-card-title",{staticClass:"pa-0"},[i("v-toolbar",{attrs:{flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Nuevo certificado digital")]),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.modalCertificate=!1}}},[i("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"px-0 py-4 background"},[i("v-list",{staticClass:"v-list-form transparent"},[i("v-list-item",{staticClass:"py-2"},[i("v-list-item-title",[t._v(" Archivo del certificado "),i("v-tooltip",{attrs:{right:"",transition:"scale-transition","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({attrs:{small:"",color:"secondary"}},a),[t._v("mdi-information")])]}}])},[i("span",[t._v("Asegúrate que el certificado digital tenga formato/extensión .p12")])])],1),i("v-list-item-subtitle",[i("v-file-input",{ref:"newCertificate.file",attrs:{error:t.$v.newCertificate.file.$error,type:"file",accept:"application/x-pkcs12",prepend:"mdi-paper-clip","background-color":"transparent","hide-details":"",placeholder:"No se eligió ningún archivo",solo:"",flat:"",chips:""},model:{value:t.newCertificate.file,callback:function(e){t.$set(t.newCertificate,"file",e)},expression:"newCertificate.file"}})],1)],1),i("v-list-item",{staticClass:"py-2"},[i("v-list-item-title",[t._v(" Contraseña "),i("v-tooltip",{attrs:{right:"",transition:"scale-transition","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-icon",t._g({attrs:{small:"",color:"secondary"}},a),[t._v("mdi-information")])]}}])},[i("span",[t._v("La contraseña que ingresaste al comprar el certificado digital")])])],1),i("v-list-item-subtitle",[i("v-col",{attrs:{cols:"8"}},[i("v-text-field",{attrs:{error:t.$v.newCertificate.password.$error,type:"password","background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.newCertificate.password.$model,callback:function(e){t.$set(t.$v.newCertificate.password,"$model",e)},expression:"$v.newCertificate.password.$model"}})],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalCertificate=!1}}},[t._v("Cancelar")]),i("v-btn",{attrs:{loading:t.$store.state.billers.createLoader,color:"primary"},on:{click:t.createCertificate}},[t._v("Subir certificado")])],1)],1)],1)],1)},fi=[],bi=(a("4160"),a("a9e3"),a("159b"),si.find((function(t){return"built_in"===t.id}))),gi={mixins:[$],data:function(){return{biller:bi,expansionPanelCafs:null,guides:["/guide/settings/invoicing/proveedores-de-facturacion/facturacion-incorporada#solicitud-de-timbraje-de-folios","/guide/settings/invoicing/proveedores-de-facturacion/facturacion-incorporada#folios","/guide/settings/invoicing/proveedores-de-facturacion/facturacion-incorporada#anulacion-de-folios-vencidos"],menu:!1,file:null,hasBillerConnection:!0,hasCertificate:!0,hasSequences:!0,imports:[{title:"Facturas",description:"Importa documentos de venta desde archivos XML.",ref:"",url:"AccountImportInvoices"}],mainLoader:!1,modalCertificate:!1,newCaf:{file:null},newCertificate:{file:null,password:""},billerConnection:{test_mode:!1,activity:null,activity_description:"",resolution_date:"",resolution_number:null,invoice_assignable_copy:!1},editableSequence:{next_number:null},dialogCreateFolio:!1,sequenceDocuments:["CL33","CL34","CL39","CL41","CL46","CL52","CL56","CL61","CL110","CL111","CL112"]}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({activitiesList:function(t){return t.billers.activitiesList},instance:function(t){return t.billers.billerconnectionsList[0]||{}},cafsList:function(t){return t.billers.cafsList},certificatesDetail:function(t){return t.billers.certificatesList[0]||[]},sequencesList:function(t){return t.invoices.sequencesList}})),{},{activation:function(){var t=3,e=Number(this.hasCertificate)+Number(this.hasSequences)+Number(this.hasBillerConnection);return Math.round(e/t*100)},orderedCafs:function(){var t=this,e=this.sequencesList.map((function(t){return t.document.id})),a={};return e.forEach((function(e){a[e]=t.cafsList.filter((function(t){return t.document===e}))})),a}}),created:function(){var t=this;this.mainLoader=!0,Promise.all([this.$store.dispatch("billers/LIST",{resource:"billerconnections",query:{biller:"built_in"}}),this.$store.dispatch("billers/LIST",{resource:"billers/built_in/certificates",query:{page_size:1}}),this.$store.dispatch("invoices/LIST",{resource:"sequences",query:{document__id__in:this.sequenceDocuments.join(","),expand:"document",page_size:100}}),this.$store.dispatch("billers/LIST",{resource:"billers/built_in/activities",query:{page_size:1e3}})]).then((function(){t.certificatesDetail.name||(t.hasCertificate=!1)})).then((function(){t.sequencesList.length?t.$store.dispatch("billers/LIST",{resource:"billers/built_in/cafs",query:{page_size:100}}):t.hasSequences=!1})).then((function(){t.instance.id?Object.keys(t.billerConnection).forEach((function(e){t.billerConnection[e]=t.instance.extra_data[e]})):t.hasBillerConnection=!1})).finally((function(){t.mainLoader=!1}))},mounted:function(){var t=this;setTimeout((function(){t.$route.query.ref&&t.$refs[t.$route.query.ref]&&t.$vuetify.goTo(t.$refs[t.$route.query.ref].$el,{offset:20})}),1500)},methods:{cafExists:function(t,e){var a=this;return this.orderedCafs[t].find((function(t){return e>=t.from_number&&e<=t.to_number&&a.cafIsLive(t.life_to)}))},cafIsLive:function(t){return h()(t).isSameOrAfter(this.today)},createCertificate:function(){var t=this;if(this.$v.newCertificate.$touch(),this.$v.newCertificate.$invalid)return!1;var e=new FormData;e.append("file",this.newCertificate.file,this.newCertificate.file.name),e.append("password",this.newCertificate.password),this.$store.dispatch("billers/CREATE",{resource:"billers/built_in/certificates",payload:e,headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.$store.dispatch("billers/LIST",{resource:"billers/built_in/certificates",query:{page_size:1}}),t.hasCertificate=!0,t.modalCertificate=!1,t.newCertificate={file:null,password:""}})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},createCaf:function(){var t=this;if(this.$v.newCaf.$touch(),this.$v.newCaf.$invalid)return!1;var e=new FormData;e.append("file",this.newCaf.file,this.newCaf.file.name),this.$store.dispatch("billers/CREATE",{resource:"billers/built_in/cafs",payload:e,headers:{"Content-Type":"multipart/form-data"}}).then((function(){t.$store.dispatch("invoices/LIST",{resource:"sequences",query:{document__id__in:t.sequenceDocuments.join(","),expand:"document",page_size:100}}).then((function(){t.dialogCreateFolio=!1,t.newCaf.file=null})),t.hasSequences=!0})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},createBillerConnection:function(){var t=this;if(this.$v.billerConnection.$touch(),this.$v.billerConnection.$invalid)return!1;var e={api_key:"api_key",biller:"built_in",extra_data:this.billerConnection};this.$store.dispatch("billers/CREATE",{resource:"billerconnections",payload:e}).then((function(){t.hasBillerConnection=!0,t.$dialog.message.info("La información fiscal de la organización se ha actualizado")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},updateBillerConnection:function(){var t=this;if(this.$v.billerConnection.$touch(),this.$v.billerConnection.$invalid)return!1;var e={extra_data:this.billerConnection};this.$store.dispatch("billers/UPDATE",{resource:"billerconnections",id:this.instance.id,payload:e}).then((function(){t.hasBillerConnection=!0,t.$dialog.message.info("La información fiscal de la organización se ha actualizado")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{newCertificate:{file:{required:ie["required"]},password:{required:ie["required"]}},newCaf:{file:{required:ie["required"]}},billerConnection:{activity:{required:ie["required"]},activity_description:{required:ie["required"],maxLength:Object(ie["maxLength"])(56)},resolution_date:{required:ie["required"]},resolution_number:{required:ie["required"],numeric:ie["numeric"]}}}},_i=gi,yi=a("2e4b"),Ci=a("cd55"),xi=a("49e2"),wi=a("c865"),$i=a("0393"),ki=a("23a7"),Vi=Object(E["a"])(_i,hi,fi,!1,null,null,null),Li=Vi.exports;A()(Vi,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VExpansionPanel:Ci["a"],VExpansionPanelContent:xi["a"],VExpansionPanelHeader:wi["a"],VExpansionPanels:$i["a"],VFileInput:ki["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VProgressCircular:B["a"],VResponsive:it["a"],VRow:z["a"],VSelect:Ge["a"],VSheet:da["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Si=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"BillersBuiltInSettings"}}},[t._v("Facturación incorporada")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v("Reporte de ventas diarias (RVD) ")],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[t.$store.state.billers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.list.length?[a("v-data-table",{attrs:{headers:t.headers,items:t.list,"items-per-page":t.pagination,"disable-sort":"","mobile-breakpoint":"","hide-default-footer":""},scopedSlots:t._u([{key:"item.date",fn:function(e){var a=e.item;return[t._v(" "+t._s(t._f("date")(a.date))+" ")]}},{key:"item.sequence",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.sequence))])]}},{key:"item.local_file",fn:function(e){var i=e.item;return[a("v-btn",{attrs:{href:i.local_file,target:"_blank",color:"secondary",outlined:""}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-file")])],1)]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-col",{staticClass:"text-center py-8"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-grid-off")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No se han informado reportes")])],1)]],2)],1)],1)],1)},Ti=[],Ei={mixins:[k],data:function(){return{headers:[{text:"Fecha",value:"date",width:200,sortable:!0},{text:"Secuencia",value:"sequence",align:"end",width:150,sortable:!1},{text:"Track ID",value:"track_id",align:"end",width:100,sortable:!1},{text:"",value:"local_file",align:"end",width:180,sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.billers.rvdsCount},list:function(t){return t.billers.rvdsList}}),methods:{getList:function(){this.$store.dispatch("billers/LIST",{resource:"billers/built_in/rvds"})}}},Di=Ei,Ai=a("8fea"),ji=a("891e"),qi=Object(E["a"])(Di,Si,Ti,!1,null,null,null),Ii=qi.exports;A()(qi,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var Oi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"BillersBuiltInSettings"}}},[t._v("Facturación incorporada")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v("Reporte transaccional ")],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("v-row",[a("v-col",{staticClass:"py-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"48"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Resultado de revisión SII")]),a("v-spacer"),a("v-chip",{attrs:{color:"primary","text-color":"white",small:""}},[t._v("Beta")])],1),a("v-divider")],1)],1),a("v-row",[t._l(t.statusesInvoiceStatus,(function(e,i){return[a("v-col",{key:"status-"+i},[a("v-sheet",{staticClass:"py-5 py-0 text-center"},[t.loaderReport?a("v-progress-circular",{staticClass:"mb-6",attrs:{indeterminate:"",color:"primary",width:2,size:24}}):a("span",{staticClass:"d-block mb-4 headline text--secondary font-weight-regular"},[t._v(t._s(t._f("number")(t.valuesInvoiceStatus[e.code])))]),a("span",{staticClass:"d-block body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))]),a("v-btn",{attrs:{to:{name:"InvoiceList",query:{tax_agency__contains:e.routeQueryValue}},exact:"",color:"primary",text:"",small:"",ripple:!1}},[t._v("Ver facturas")])],1)],1),i0&&"D"===t.rulesList[i-1].scheme,"item-value":"value","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},on:{change:function(e){return t.setTipo(i)}},model:{value:e.scheme,callback:function(a){t.$set(e,"scheme",a)},expression:"d.scheme"}})],1),a("v-row",{staticClass:"defaultGrey text--secondary mx-2",staticStyle:{"border-radius":"4px","max-width":"200px",height:"40px"},attrs:{align:"center","no-gutters":"",justify:"center"}},[t._v("del vencimiento enviar")]),a("div",{staticClass:"mx-2",staticStyle:{width:"180px"}},[a("v-select",{attrs:{error:t.$v.rulesList.$each[i].days.$error,items:t.templatesList,"single-line":"","v-ripple":!1,"item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:e.template,callback:function(a){t.$set(e,"template",a)},expression:"d.template"}})],1),a("v-row",{staticClass:"defaultGrey text--secondary mx-2",staticStyle:{"border-radius":"4px","max-width":"140px",height:"40px"},attrs:{align:"center","no-gutters":"",justify:"center"}},[t._v("como mensaje")]),e.id?t._e():a("div",{staticClass:"mx-2",staticStyle:{width:"80px"}},[a("v-btn",{attrs:{outlined:"",height:"40"},on:{click:function(e){return t.postRule(i)}}},[t._v("Guardar")])],1),a("div",{staticClass:"mx-2",staticStyle:{width:"100px"}},[i>=1||t.rulesList.length>1?a("v-btn",{attrs:{icon:"",color:"red"},on:{click:function(e){return t.deleteRule(i)}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1):t._e()],1)],1)])})),a("v-col",{staticClass:"py-0",attrs:{cols:"12"}},[a("v-btn",{attrs:{disabled:t.rulesList.length>=5,text:"",color:"primary",ripple:!1},on:{click:t.addRowReminderRules}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar regla")],1)],1)],2)]:a("v-row",{staticClass:"py-8"},[a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-icon",{attrs:{color:"red"}},[t._v("mdi-alert-circle")]),a("span",{staticClass:"body-2 ml-1"},[t._v("Antes de configurar las reglas de envío debes tener al menos un recordatorio creado")])],1)],1)],2)],1)]],2)],1)},Qi=[],Ki={components:{CommonTemplates:ii},mixins:[$],data:function(){return{sendPaymentsReminders:!1,newRules:[],scheme:[{text:"Antes",value:"B"},{text:"Después",value:"A"}]}},computed:Object(u["c"])({accountsDetail:function(t){return t.accounts.accountsDetail},templatesList:function(t){return Q()(t.reminders.templatesList)},rulesList:function(t){return Q()(t.reminders.rulesList)}}),created:function(){this.retrieveAccount(),this.getTemplates()},methods:{retrieveAccount:function(){var t=this;this.$store.dispatch("accounts/RETRIEVE",{resource:"accounts",id:this.$store.state.auth.account.id}).then((function(){t.getRules(),t.sendPaymentsReminders=t.accountsDetail.send_payments_reminders}))},getTemplates:function(){this.$store.dispatch("reminders/LIST",{resource:"reminders/templates",query:{kind:"collection"}})},getRules:function(){var t=this;this.$store.dispatch("reminders/LIST",{resource:"reminders/rules"}).then((function(){t.rulesList.length||t.addRowReminderRules()}))},postRule:function(t){var e=this;if(this.$v.rulesList.$each[t].$touch(),this.$v.rulesList.$each[t].$invalid)return!1;this.$store.dispatch("reminders/CREATE",{resource:"reminders/rules",payload:this.rulesList[t]}).then((function(){e.$dialog.message.info("La regla ha sido guardada"),e.$store.dispatch("reminders/DESTROY_TEMPORAL_OBJECT",t)}))},patchRule:function(t){if(this.$v.rulesList.$each[t].$touch(),this.$v.rulesList.$each[t].$invalid)return!1;var e={days:this.rulesList[t].days,scheme:this.rulesList[t].scheme,template:this.rulesList[t].template};this.$store.dispatch("reminders/UPDATE",{resource:"reminders/rules",id:this.rulesList[t].id,payload:e})},deleteRule:function(t){var e=this;this.rulesList[t].id?this.$dialog.warning({title:"Eliminar la regla",text:'\n Al confirmar se eliminará la regla de tu cuenta y todo lo asociado con esta utilizará un mensaje por defecto.\n ',actions:[{color:"red",text:"Continuar",handle:function(){e.$store.dispatch("reminders/DESTROY",{resource:"reminders/rules",id:e.rulesList[t].id}).then((function(t){e.$dialog.message.info("La regla ha sido eliminada")})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))}}]}):this.$store.dispatch("reminders/DESTROY_TEMPORAL_OBJECT",t)},updateAccount:function(){var t=this;this.$store.dispatch("accounts/UPDATE",{resource:"accounts",payload:{send_payments_reminders:this.sendPaymentsReminders},id:this.account.id}).then((function(){t.$dialog.message.info("Se han ".concat(t.sendPaymentsReminders?"habilitado":"deshabilitado"," los recordatorios automáticos de pagos"))})).catch((function(){t.$dialog.message.warning("Error al ".concat(t.sendPaymentsReminders?"habilitado":"deshabilitado"," los recordatorios automáticos de pagos"))}))},addRowReminderRules:function(){this.$store.dispatch("reminders/ADD_TEMPORAL_OBJECT",{days:null,scheme:"A",template:this.templatesList[0].id})}},validations:{rulesList:{$each:{days:{required:ie["required"],numeric:ie["numeric"]},scheme:{required:ie["required"]},template:{required:ie["required"]}}}}},Xi=Ki,Ji=Object(E["a"])(Xi,Wi,Qi,!1,null,null,null),Zi=Ji.exports;A()(Ji,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var ts=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Webhooks")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.$store.state.accounts.retrieveLoader?a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}}):[t.webhooksList.length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Estado")]),a("th",[t._v("URL")])])]),a("tbody",[t._l(t.webhooksList,(function(e){return[a("tr",{key:e.id,on:{click:function(a){return t.$router.push({name:"AccountSettingsWebhooksRetrieveUpdate",params:{id:e.id}})}}},[a("td",["enabled"===e.status?a("v-chip",{attrs:{color:"lightBlue",small:"","text-color":"primary"}},[t._v("Habilitado")]):"disabled"===e.status?a("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Deshabilitado")]):t._e()],1),a("td",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(e.url))])])])]}))],2)]},proxy:!0}],null,!1,3331868578)}),a("v-divider"),a("v-col",{staticClass:"text-center py-5",attrs:{md:"12"}},[a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!0}}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v(" Nuevo webhook")],1)],1)]:a("v-row",{staticClass:"mx-0"},[a("v-col",{staticClass:"py-5 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-call-split")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes webhooks")]),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!0}}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v(" Nuevo webhook")],1)],1)],1)]],2)],1)],1),a("v-dialog",{attrs:{width:"800",persistent:"","no-click-animation":""},model:{value:t.dialogCreate,callback:function(e){t.dialogCreate=e},expression:"dialogCreate"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear un nuevo webhook")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.dialogCreate=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background-card"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("URL de conexión")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.newWebhook.url.$error,placeholder:"Ej: https://webhooks.myproduct.com/axteroid/","background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.newWebhook.url.$model,callback:function(e){t.$set(t.$v.newWebhook.url,"$model",e)},expression:"$v.newWebhook.url.$model"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Descripción")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.newWebhook.description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.newWebhook.description.$model,callback:function(e){t.$set(t.$v.newWebhook.description,"$model",e)},expression:"$v.newWebhook.description.$model"}})],1)],1)],1),a("v-divider"),a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[a("span",{staticClass:"d-block"},[t._v("Eventos")]),a("v-btn",{staticClass:"my-1",attrs:{href:"#",text:"",color:"primary",ripple:!1,small:""}},[t._v("Aprende más sobre los eventos")])],1),a("v-list-item-subtitle",[a("v-row",{staticClass:"mx-0"},[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.newWebhook.events.$error,items:t.eventsList,label:"Seleccionar eventos","item-value":"name","item-text":"name","background-color":"white",outlined:"",solo:"",flat:"",dense:"",multiple:"","hide-details":""},scopedSlots:t._u([{key:"selection",fn:function(e){var i=e.index;return[0===i?a("span",{staticClass:"mx-1"},[t._v("Seleccionar eventos")]):t._e()]}}]),model:{value:t.$v.newWebhook.events.$model,callback:function(e){t.$set(t.$v.newWebhook.events,"$model",e)},expression:"$v.newWebhook.events.$model"}})],1),a("v-col",{staticClass:"text-right",attrs:{cols:"4"}},[a("v-btn",{staticClass:"my-1",attrs:{text:"",color:"primary",ripple:!1},on:{click:function(e){t.newWebhook.events=[]}}},[t._v("Limpiar")])],1)],1)],1)],1),a("v-list-item",[a("v-list-item-title"),a("v-list-item-subtitle",[a("v-card",{staticClass:"mx-1",staticStyle:{overflow:"scroll"},attrs:{outlined:"",height:"189px"}},[a("v-card-text",{staticClass:"pa-0"},[t.newWebhook.events.length?a("v-list",{staticClass:"v-list-form py-0",attrs:{dense:""}},[t._l(t.newWebhook.events,(function(e,i){return[a("v-list-item",{key:i+"-item",staticClass:"py-0 my-0"},[a("v-list-item-title",[t._v(t._s(e))]),a("v-list-item-action",{staticClass:"ma-0 text-right"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1,small:""},on:{click:function(e){return t.newWebhook.events.splice(i,1)}}},[a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-close")])],1)],1)],1),a("v-divider",{key:i+"-divider"})]}))],2):a("v-col",{staticClass:"text-center py-14 px-6"},[a("span",{staticClass:"d-block text--secondary subtitle-1 font-weight-medium"},[t._v("Sin eventos seleccionados.")]),a("span",{staticClass:"d-block body-2"},[t._v("Usa el menú desplegable de arriba para buscar y seleccionar los eventos.")])])],1)],1),a("span",{staticClass:"d-block mx-1 py-1 text--secondary body-2"},[t._v(t._s(t.newWebhook.events.length)+" eventos")])],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogCreate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.postWebhook}},[t._v("Crear webhook")])],1)],1)],1)],1)},es=[],as={mixins:[$],data:function(){return{newWebhook:{description:"",events:[],url:""},dialogCreate:!1}},computed:Object(u["c"])({eventsList:function(t){return t.accounts.eventsList},webhooksList:function(t){return t.accounts.webhooksList}}),created:function(){this.$store.dispatch("accounts/LIST",{resource:"events",params:{page_size:100}}),this.$store.dispatch("accounts/LIST",{resource:"webhooks"})},methods:{postWebhook:function(){var t=this;if(this.$v.newWebhook.$touch(),this.$v.newWebhook.$invalid)return!1;this.$store.dispatch("accounts/CREATE",{resource:"webhooks",payload:this.newWebhook}).then((function(e){t.$router.push({name:"AccountSettingsWebhooksRetrieveUpdate",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},toggleSelectedEvents:function(){var t=this;this.$nextTick((function(){t.allEventsSelected?t.newWebhook.events=[]:t.newWebhook.events=t.eventsList.slice()}))}},validations:{newWebhook:{description:{maxLength:Object(ie["maxLength"])(512)},events:{required:ie["required"]},url:{required:ie["required"],url:ie["url"]}}}},is=as,ss=Object(E["a"])(is,ts,es,!1,null,null,null),rs=ss.exports;A()(ss,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var ns=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.accounts.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"AccountSettingsWebhooksListCreate"}}},[t._v("Webhooks")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 200px;":"max-width: 500px;"},[t._v(t._s(t.instance.url))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"mr-1",attrs:{outlined:"","retain-focus-on-click":"",color:"secondary"},on:{click:t.toggleStatus}},["enabled"===t.instance.status?[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-cancel")]),t._v("Deshabilitar")]:[t._v("Habilitar")]],2),a("v-btn",{staticClass:"mr-1",attrs:{outlined:"","retain-focus-on-click":"",color:"secondary"},on:{click:t.destroyWebhook}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-close")]),t._v("Eliminar")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0 background"},[a("v-row",{staticClass:"mx-0"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Tipo de webhook")]),a("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Cuenta")])],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Estado")]),"enabled"===t.instance.status?a("v-chip",{attrs:{color:"lightBlue",small:"","text-color":"primary"}},[t._v("Habilitado")]):"disabled"===t.instance.status?a("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Deshabilitado")]):t._e()],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Disponible desde")]),a("div",{staticClass:"font-weight-medium mt-1"},[t._v(t._s(t._f("date")(t.instance.created)))])])],1)],1)],1),a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"mr-1",attrs:{outlined:"","retain-focus-on-click":"",color:"secondary"},on:{click:function(e){t.modalUpdate=!0}}},[t._v("Actualizar datos")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-4"},[a("v-row",[a("v-col",{attrs:{cols:"10"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("URL")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.url))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Descripción")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.description||"--"))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Eventos")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.events[0]))])],1),t.instance.events.length>1?a("v-list-item",[a("v-list-item-title"),a("v-list-item-subtitle",[t._l(t.instance.events,(function(e,i){return[i>0?a("span",{key:i,staticClass:"d-block mb-2"},[t._v(t._s(e))]):t._e()]}))],2)],1):t._e()],1)],1)],1)],1)],1),a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Secreto")])],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0 background"},[a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"icon-field",attrs:{"append-icon":t.showSecret?"mdi-eye":"mdi-eye-off",type:t.showSecret?"value":"password",readonly:"","background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:""},on:{"click:append":function(e){t.showSecret=!t.showSecret}},model:{value:t.instance.secret,callback:function(e){t.$set(t.instance,"secret",e)},expression:"instance.secret"}})],1),a("v-col",{staticClass:"text-right",attrs:{cols:"4"}},[a("v-btn",{staticClass:"mr-1",attrs:{outlined:"","retain-focus-on-click":"",color:"secondary"},on:{click:t.secretRenew}},[t._v("Renovar secreto")]),a("v-btn",{attrs:{outlined:"","retain-focus-on-click":"",color:"secondary"},on:{click:function(e){return t.toClipboard(t.instance.secret)}}},[a("v-icon",{attrs:{"x-small":"",left:""}},[t._v("mdi-content-copy")]),t._v(" Copiar secreto")],1)],1)],1)],1)],1),a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Conversaciones del webhook")])],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0 background"},[a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[t.$store.state.accounts.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.conversationsList.length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Evento")]),a("th",[t._v("Código de estado de HTTP")]),a("th",[t._v("Fecha de ejecución")])])]),a("tbody",t._l(t.conversationsList,(function(e){return a("tr",{key:e.id},[a("td",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(e.event))])]),a("td",[t._v(t._s(e.status_code))]),a("td",[t._v(t._s(t._f("dateTime")(e.created)))])])})),0)]},proxy:!0}],null,!1,910135639)}),a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[a("v-col",{attrs:{cols:"12"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.conversationsCount)+" registros")])])],1)]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"48"}},[t._v("mdi-message-bulleted-off")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Sin conversaciones recientes con el webhook")])],1)]],2)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"800",persistent:"","no-click-animation":""},model:{value:t.modalUpdate,callback:function(e){t.modalUpdate=e},expression:"modalUpdate"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Editar webhook")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.modalUpdate=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background-card"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("URL de conexión")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.editable.url.$error,placeholder:"Ej: https://webhooks.myproduct.com/axteroid/","background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.editable.url.$model,callback:function(e){t.$set(t.$v.editable.url,"$model",e)},expression:"$v.editable.url.$model"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Descripción")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.editable.description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.editable.description.$model,callback:function(e){t.$set(t.$v.editable.description,"$model",e)},expression:"$v.editable.description.$model"}})],1)],1)],1),a("v-divider"),a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[a("span",{staticClass:"d-block"},[t._v("Eventos")]),a("v-btn",{staticClass:"my-1",attrs:{href:""+t.$DOCS_BASE+t.guides[0],target:"_blank",text:"",color:"primary",ripple:!1,small:""}},[t._v("Aprende más sobre los eventos")])],1),a("v-list-item-subtitle",[a("v-row",{staticClass:"mx-0"},[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.editable.events.$error,items:t.eventsList,label:"Seleccionar eventos","item-value":"name","item-text":"name","background-color":"white",outlined:"",solo:"",flat:"",dense:"",multiple:"","hide-details":""},scopedSlots:t._u([{key:"selection",fn:function(e){var i=e.index;return[0===i?a("span",{staticClass:"mx-1"},[t._v("Seleccionar eventos")]):t._e()]}}]),model:{value:t.$v.editable.events.$model,callback:function(e){t.$set(t.$v.editable.events,"$model",e)},expression:"$v.editable.events.$model"}})],1),a("v-col",{staticClass:"text-right",attrs:{cols:"4"}},[a("v-btn",{staticClass:"my-1",attrs:{text:"",color:"primary",ripple:!1},on:{click:function(e){t.editable.events=[]}}},[t._v("Limpiar")])],1)],1)],1)],1),a("v-list-item",[a("v-list-item-title"),a("v-list-item-subtitle",[a("v-card",{staticClass:"mx-1",staticStyle:{overflow:"scroll"},attrs:{outlined:"",height:"189px"}},[a("v-card-text",{staticClass:"pa-0"},[t.editable.events.length?a("v-list",{staticClass:"v-list-form py-0",attrs:{dense:""}},[t._l(t.editable.events,(function(e,i){return[a("v-list-item",{key:i+"-item",staticClass:"py-0 my-0"},[a("v-list-item-title",[t._v(t._s(e))]),a("v-list-item-action",{staticClass:"ma-0 text-right"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1,small:""},on:{click:function(e){return t.editable.events.splice(i,1)}}},[a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-close")])],1)],1)],1),a("v-divider",{key:i+"-divider"})]}))],2):a("v-col",{staticClass:"text-center py-14 px-6"},[a("span",{staticClass:"d-block text--secondary subtitle-1 font-weight-medium"},[t._v("Sin eventos seleccionados.")]),a("span",{staticClass:"d-block body-2"},[t._v("Usa el menú desplegable de arriba para buscar y seleccionar los eventos.")])])],1)],1),a("span",{staticClass:"d-block mx-1 py-1 text--secondary body-2"},[t._v(t._s(t.editable.events.length)+" eventos")])],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalUpdate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.updateWebhook}},[t._v("Actualizar webhook")])],1)],1)],1)],1)},os=[],ls=(a("a4d3"),a("e01a"),{inject:["theme"],components:{VTableHeaders:Mi,VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},mixins:[$],data:function(){return{editable:{description:"",events:[],url:""},guides:["/guide/desarrolladores/webhooks#eventos"],modalUpdate:!1,showSecret:!1,secretRenewLoader:!1}},computed:Object(u["c"])({instance:function(t){return t.accounts.webhooksDetail},conversationsCount:function(t){return t.accounts.conversationsCount},conversationsList:function(t){return t.accounts.conversationsList},eventsList:function(t){return t.accounts.eventsList}}),created:function(){var t=this;this.$store.dispatch("accounts/RETRIEVE",{resource:"webhooks",id:this.$route.params.id}).then((function(){t.editable=Object.assign({},{description:t.instance.description,events:t.instance.events,url:t.instance.url}),t.$store.dispatch("accounts/LIST",{resource:"conversations",query:{webhook:t.instance.id}})})),this.$store.dispatch("accounts/LIST",{resource:"events",query:{page_size:100}})},methods:{updateWebhook:function(){var t=this;if(this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;this.$store.dispatch("accounts/UPDATE",{resource:"webhooks",id:this.instance.id,payload:this.editable}).then((function(){t.modalUpdate=!1,t.$dialog.message.info("Webhook actualizado.")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},destroyWebhook:function(){var t=this;this.$dialog.warning({title:"Eliminar webhook",text:'\n Al eliminar el webhook, no seguirá recibiendo notificaciones en la URL.\n ¿Estás seguro de continuar?\n ',actions:[{color:"red",text:"Eliminar webhook",handle:function(){t.$store.dispatch("accounts/DESTROY",{resource:"webhooks",id:t.instance.id}).then((function(){t.$dialog.message.info("Webhook eliminado."),t.$router.push({name:"AccountSettingsWebhooksListCreate"})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})},toggleStatus:function(){var t=this,e='\n Al deshabilitar el webhook, no seguirá recibiendo notificaciones hasta que nuevamente sea habilitado.\n ¿Estás seguro de continuar?\n ',a='\n Al habilitar el webhook, volvera a recibir notificaciones hasta que sea deshabilitado o eliminado.\n ¿Estás seguro de continuar?\n ';this.$dialog.warning({title:("enabled"===this.instance.status?"Deshablitar":"Habilitar")+" webhook",text:"enabled"===this.instance.status?e:a,actions:[{color:"primary",text:("enabled"===this.instance.status?"Deshablitar":"Habilitar")+" webhook",handle:function(){t.$store.dispatch("accounts/UPDATE",{resource:"webhooks",id:t.instance.id,payload:{status:"enabled"===t.instance.status?"disabled":"enabled"}}).then((function(){t.$dialog.message.info("Webhook actualizado.")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})},secretRenew:function(){var t=this;this.$dialog.warning({title:"Renovar secreto",text:'\n Al renovar el secreto del webhook asegúrate de actualizar el destino con el nuevo secreto.\n ¿Estás seguro de continuar?\n ',actions:[{color:"primary",text:"Renovar secreto",handle:function(){t.$store.dispatch("accounts/RETRIEVE",{resource:"webhooks",detail:"secret_renew",id:t.instance.id,loader:!1}).then((function(){t.$dialog.message.info("Secreto del webhook renovado.")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})}},validations:{editable:{description:{maxLength:Object(ie["maxLength"])(512)},events:{required:ie["required"]},url:{required:ie["required"],url:ie["url"]}}}}),cs=ls,ds=Object(E["a"])(cs,ns,os,!1,null,null,null),us=ds.exports;A()(ds,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var vs=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[t.loaderRetrieve?i("v-col",{attrs:{cols:"12"}},[i("v-skeleton-loader",{attrs:{type:"table-heading, list-item-two-line"}}),i("v-skeleton-loader",{staticClass:"mt-5",attrs:{type:"table-heading, list-item-two-line"}}),i("v-skeleton-loader",{staticClass:"mt-5",attrs:{type:"table"}})],1):[t.isDue?i("v-col",{attrs:{cols:"12"}},[i("v-alert",{staticClass:"my-0 body-2",attrs:{dark:"",dense:"",prominent:"",color:"deep-orange",border:"left",type:"info",icon:"mdi-update"}},[i("v-row",{attrs:{align:"center"}},[i("v-col",{staticClass:"grow"},[t._v(" La organización se encuentra en "),i("span",{staticClass:"font-weight-medium"},[t._v("proceso de suspensión")]),t._v(" dado que tiene pagos vencidos. ")]),i("v-col",{staticClass:"shrink"},[i("v-btn",{attrs:{color:"deep-orange darken-4"},on:{click:function(e){return t.$vuetify.goTo(t.$refs.payments,{offset:20})}}},[t._v("Pagar facturas pendientes")])],1)],1)],1)],1):t._e(),i("v-col",{attrs:{cols:"12"}},[i("v-expansion-panels",{attrs:{multiple:"",inset:""},model:{value:t.panelSource,callback:function(e){t.panelSource=e},expression:"panelSource"}},[i("v-expansion-panel",[i("v-expansion-panel-header",{staticClass:"px-4 py-3"},[i("span",{staticClass:"d-block text--secondary subtitle-1 font-weight-medium"},[t._v("Método de pago")])]),i("v-expansion-panel-content",{staticClass:"px-0"},[i("v-row",{staticClass:"mx-n7 px-0"},[i("v-col",{staticClass:"ml-n1",attrs:{cols:"12"}},[t.sourcesList.length?i("v-list",{staticClass:"transparent"},t._l(t.sourcesList,(function(e,s){return i("v-list-item",{key:s},[i("v-list-item-icon",[i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+e.card.brand+".svg"),alt:e.card.brand,height:"24"}})]),i("v-list-item-title",[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("•••• •••• •••• "+t._s(e.card.last4))]),0===s?i("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on;return[i("v-chip",t._g({staticClass:"ml-4",attrs:{color:"lightBlue",small:"","text-color":"primary"}},a),[t._v("Predeterminado")])]}}],null,!0)},[i("span",[t._v("La usaremos por defecto cuando cobremos tu suscripción")])]):t._e()],1)],1)})),1):[i("v-alert",{staticClass:"mx-4 mt-2 body-2",attrs:{dark:"",dense:"",prominent:"",color:"indigo",border:"left",type:"info",icon:"mdi-credit-card-remove"}},[i("v-row",{attrs:{align:"center"}},[i("v-col",{staticClass:"grow"},[t._v(" La organización no tiene una tarjeta registrada. En las próximas semanas será requerido registrar una tarjeta de crédito / débito en esta organización. ")]),i("v-col",{staticClass:"shrink"},[i("v-btn",{attrs:{color:"indigo darken-3"},on:{click:function(e){return t.intercomNewMessage("Hola, quiero registrar una tarjeta para esta organización.")}}},[t._v("Registrar tarjeta ahora")])],1)],1)],1)]],2)],1)],1)],1)],1)],1),i("v-col",{attrs:{cols:"12"}},[i("v-card",{ref:"payments"},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Pagos")])],1),i("v-divider"),i("v-card-text",{staticClass:"pa-0 background"},[i("v-row",{attrs:{"no-gutters":""}},[t.paymentsList.length?i("v-col",{attrs:{cols:"12"}},[i("v-data-table",{attrs:{headers:t.headersPayments,items:t.paymentsList,"items-per-page":10,"mobile-breakpoint":"","hide-default-footer":"","disable-sort":""},scopedSlots:t._u([{key:"item.invoice",fn:function(e){var a=e.item;return[i("div",{staticClass:"py-2"},[i("span",{staticClass:"d-block"},[t._v(t._s(a.invoice.document))]),"draft"!==a.status?i("span",{staticClass:"d-block text--secondary font-weight-medium"},[t._v("Nº "+t._s(a.invoice.number))]):t._e()])]}},{key:"item.status",fn:function(e){var a=e.item;return[i("v-row",{attrs:{align:"center",justify:"end"}},["succeeded"===a.status?i("v-chip",{attrs:{color:"lightBlue",small:"","text-color":"primary"}},[t._v("Pagado"),i("v-icon",{staticClass:"mx-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):"requires_payment_method"===a.status?i("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Incompleto")]):"failed"===a.status?i("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Fallido")]):"cancelled"===a.status?i("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Cancelado"),i("v-icon",{staticClass:"mx-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):"processing"===a.status?i("v-chip",{attrs:{color:"defaultGrey",small:"","text-color":"secondary"}},[t._v("Procesando")]):t._e()],1)]}},{key:"item.date",fn:function(e){var a=e.item;return[i("span",{staticClass:"body-2"},[t._v(t._s(t._f("date")(a.invoice.date)))])]}},{key:"item.due_date",fn:function(e){var a=e.item;return[a.invoice.due_date?i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("date")(a.invoice.due_date)))]):i("span",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])]}},{key:"item.amount",fn:function(e){var a=e.item;return[i("div",{staticClass:"text-right"},[i("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("number")(a.amount,a.currency.rounded)))]),t._v(" "),i("span",[t._v(t._s(a.currency.id))])])]}},{key:"item.actions",fn:function(e){var a=e.item;return[["requires_payment_method","failed"].includes(a.status)?i("div",{staticClass:"text-right"},[i("v-btn",{attrs:{href:t.$PAY_BASE+"/payments/"+a.id,target:"_blank",height:"24",text:"",color:"primary",ripple:!1}},[t._v("Pagar"),i("v-icon",{attrs:{right:""}},[t._v("mdi-arrow-right")])],1)],1):t._e()]}}],null,!0)})],1):i("v-col",{staticClass:"text-center py-5"},[i("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-receipt")]),i("span",{staticClass:"d-block subtitle-1"},[t._v("Aún no se han registrado pagos en la organización")])],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer")],1)],1)],1)]],2)},ms=[],ps=(a("caad"),{mixins:[$],data:function(){return{headersPayments:[{text:"Documento",value:"invoice"},{text:"",value:"status"},{text:"Fecha",value:"date",align:"end"},{text:"Vencimiento",value:"due_date",align:"end"},{text:"Total",value:"amount",align:"end"},{text:"",value:"actions"}],isDue:!1,nextBilling:h()().add(1,"M").startOf("month").format("YYYY-MM-DD"),panelSource:[0],panelSubscription:[0],loaderRetrieve:!1}},computed:Object(u["c"])({statesList:function(t){return t.generals.statesList},accountsDetail:function(t){return t.accounts.accountsDetail},membersList:function(t){return t.accounts.membersList},paymentsList:function(t){return t.accounts.paymentsList},sourcesList:function(t){return t.accounts.sourcesList}}),created:function(){var t=this;this.loaderRetrieve=!0,Promise.all([this.$store.dispatch("accounts/LIST",{resource:"members",query:{is_active:"True"}})]).then((function(){t.isDue=t.paymentsList.filter((function(e){return["requires_payment_method","failed"].includes(e.status)&&t.dateIsBefore(e.invoice.due_date,t.today)})).length,t.loaderRetrieve=!1})).catch((function(e){e.response&&t.$dialog.message.error(t.parseErrors(e.response.data))}))}}),hs=ps,fs=Object(E["a"])(hs,vs,ms,!1,null,null,null),bs=fs.exports;A()(fs,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VExpansionPanel:Ci["a"],VExpansionPanelContent:xi["a"],VExpansionPanelHeader:wi["a"],VExpansionPanels:$i["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemIcon:At["a"],VListItemTitle:N["c"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var gs=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.accounts.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Equipo de "+t._s(t.account.name))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!0}}},[t._v("Invitar personas")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Nombre")]),a("th",[t._v("Tipo de cuenta")]),a("th",{staticClass:"text-left"},[t._v("Estado")]),a("th",{staticClass:"text-right"},[t._v("Activo desde")]),a("th",{staticClass:"text-right"})])]),a("tbody",t._l(t.membersList,(function(e,i){return a("tr",{key:i,attrs:{disabled:!e.is_active}},[a("td",{staticClass:"py-2"},[a("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v(t._s(e.first_name)+" "+t._s(e.last_name))]),a("span",[t._v(t._s(e.email))])]),a("td",[e.is_active?e.is_owner?a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Dueño del espacio")]):[e.is_admin?a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Administrador")]):a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Miembro")])]:a("span",[t._v("--")])],2),a("td",[t._v(t._s(e.is_active?"Activo":"Desactivado"))]),a("td",{staticClass:"text-right"},[t._v(t._s(t._f("dateTime")(e.created)))]),a("td",{staticClass:"text-right"},[e.is_owner?t._e():a("v-menu",{attrs:{"offset-y":"",left:"",transition:"scale-transition","min-width":"160px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("•••")])]}}],null,!0)},[a("v-list",[a("v-list-item",{on:{click:function(e){return t.patchMember(i)}}},[a("v-list-item-title",[t._v(t._s(e.is_admin?"Cambiar a miembro":"Cambiar a administrador"))])],1),e.is_active?a("v-list-item",{on:{click:function(e){return t.deleteMember(i)}}},[a("v-list-item-title",[t._v("Desactivar usuario")])],1):a("v-list-item",{on:{click:function(e){return t.deleteMember(i)}}},[a("v-list-item-title",[t._v("Activar usuario")])],1)],1)],1)],1)])})),0)]},proxy:!0}])})],1)],1),t.invitationsList.length?a("v-card",{staticClass:"mt-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Invitaciones pendientes")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!0}}},[t._v("Invitar personas")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Nombre")]),a("th",{staticClass:"text-right"},[t._v("Enviado el")]),a("th")])]),a("tbody",t._l(t.invitationsList,(function(e,i){return a("tr",{key:i},[a("td",[a("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v(t._s(e.email))]),a("span",[t._v(t._s(e.name))])]),a("td",{staticClass:"text-right"},[t._v(t._s(t._f("dateTime")(e.sent)))]),a("td",{staticClass:"text-right"},[e.is_owner?t._e():a("v-menu",{attrs:{"offset-y":"",left:"",transition:"scale-transition","min-width":"160px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("•••")])]}}],null,!0)},[a("v-btn",{directives:[{name:"ripple",rawName:"v-ripple",value:!1,expression:"false"}],staticClass:"d-block",attrs:{height:"34",width:"160",text:"",small:"","retain-focus-on-click":"",color:"red"},on:{click:function(e){return t.deleteInvitation(i)}}},[t._v("Cancelar invitación")])],1)],1)])})),0)]},proxy:!0}],null,!1,2439976180)})],1)],1):t._e()],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":""},model:{value:t.dialogCreate,callback:function(e){t.dialogCreate=e},expression:"dialogCreate"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Invitar personas a "+t._s(t.account.name))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:"","retain-focus-on-click":""},on:{click:function(e){t.dialogCreate=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-col",{attrs:{cols:"12"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-col",{attrs:{cols:"12"}},[a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{staticClass:"py-0",attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Email")])]),a("v-col",{staticClass:"py-0",attrs:{cols:"4"}},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v("Nombre")])])],1),t._l(t.invitations,(function(e,i){return a("v-row",{key:i,attrs:{"no-gutters":""}},[a("v-col",{staticClass:"py-1 pr-2",attrs:{cols:"6"}},[a("v-text-field",{attrs:{error:t.$v.invitations.$each[i].email.$error,"hide-details":"",placeholder:"nombre@ejemplo.com",maxlength:"254","background-color":"white",outlined:"",required:"","single-line":"",dense:""},model:{value:t.$v.invitations.$each[i].email.$model,callback:function(e){t.$set(t.$v.invitations.$each[i].email,"$model","string"===typeof e?e.trim():e)},expression:"$v.invitations.$each[i].email.$model"}}),t.$v.invitations.$each[i].email.isUser?t._e():a("span",{staticClass:"d-block red--text caption py-1"},[t._v("Ya es miembro de la cuenta")]),t.$v.invitations.$each[i].email.isInvited?t._e():a("span",{staticClass:"d-block red--text caption py-1"},[t._v("Tiene una invitación pendiente")])],1),a("v-col",{staticClass:"py-1 pr-2",attrs:{cols:"4"}},[a("v-text-field",{attrs:{error:t.$v.invitations.$each[i].name.$error,"hide-details":"","background-color":"white",outlined:"","single-line":"",dense:""},model:{value:t.$v.invitations.$each[i].name.$model,callback:function(e){t.$set(t.$v.invitations.$each[i].name,"$model","string"===typeof e?e.trim():e)},expression:"$v.invitations.$each[i].name.$model"}})],1),a("v-list-item-action",[i>=1||t.invitations.length>1?a("v-btn",{staticClass:"mt-n1",attrs:{icon:"",color:"red",ripple:!1},on:{click:function(e){return t.invitations.splice(i,1)}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1):t._e()],1)],1)})),a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{staticClass:"pa-0"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:function(e){return e.preventDefault(),t.addRowInvitations(e)}}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar otro")],1)],1)],1)],2)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogCreate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.createLoader,color:"primary"},on:{click:t.postInvitations}},[t._v("Enviar invitaciones")])],1)],1)],1)],1)},_s=[],ys={mixins:[$],data:function(){return{invitations:[{email:"",name:""},{email:"",name:""}],dialogCreate:!1,createLoader:!1}},computed:Object(u["c"])({membersList:function(t){return Q()(t.accounts.membersList)},invitationsList:function(t){return t.accounts.invitationsList}}),created:function(){var t=this;this.$store.dispatch("accounts/LIST",{resource:"members"}).then((function(){t.$store.dispatch("accounts/LIST",{resource:"invitations",query:{accepted:"False"}})})).catch((function(e){t.$dialog.message.error(e.response.data.detail)}))},watch:{dialogCreate:function(){if(this.dialogCreate)return!1;this.$v.invitations.$reset(),this.invitations=[{email:"",name:""},{email:"",name:""}]}},methods:{postInvitations:function(){var t=this;if(this.$v.invitations.$touch(),this.$v.invitations.$invalid)return!1;this.createLoader=!0,this.$store.dispatch("accounts/BULK_INVITATION",{persons:this.invitations}).then((function(){t.dialogCreate=!1,t.$store.dispatch("accounts/LIST",{resource:"invitations",query:{accepted:"False"}}),t.$dialog.message.info("Las invitaciones han sido enviadas")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.createLoader=!1}))},patchMember:function(t){var e=this;this.$store.dispatch("accounts/UPDATE",{resource:"members",payload:{is_admin:!this.membersList[t].is_admin},id:this.membersList[t].id}).then((function(t){e.$store.dispatch("accounts/LIST",{resource:"members",loader:!1}),e.$dialog.message.info("El tipo de cuenta del miembro se ha actualizado")})).catch((function(t){e.$dialog.message.error(t.response.data.detail)}))},deleteMember:function(t){var e=this;this.$dialog.warning({title:"".concat(this.membersList[t].is_active?"Desactivar":"Activar"," usuario"),text:'\n ¿Qué ocurre cuando se '.concat(this.membersList[t].is_active?"desactiva":"activa",' un usuario?\n 1. El miembro ').concat(this.membersList[t].is_active?"ya no":"",' podrá trabajar en el espacio de trabajo.\n 2. Toda la información creada por el miembro seguirá estando disponible.\n '),actions:[{text:"Continuar",color:this.membersList[t].is_active?"red":"primary",handle:function(){e.$store.dispatch("accounts/UPDATE",{resource:"members",payload:{is_active:!e.membersList[t].is_active},id:e.membersList[t].id}).then((function(a){e.$store.dispatch("accounts/LIST",{resource:"members",loader:!1}),e.$dialog.message.info("El miembro ha sido ".concat(e.membersList[t].is_active?"desactivado":"activado"," en la organización"))})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))}}]})},deleteInvitation:function(t){var e=this;this.$dialog.warning({title:"Eliminar invitación",text:'\n '.concat(this.invitationsList[t].email," no podrá unirse a ").concat(this.account.name,'.\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer.\n '),actions:[{color:"red",text:"Continuar",handle:function(){e.$store.dispatch("accounts/DESTROY",{resource:"invitations",id:e.invitationsList[t].id}).then((function(t){e.$dialog.message.info("La invitación ha sido eliminada")})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data.detail))}))}}]})},addRowInvitations:function(){this.invitations.push({email:"",name:""})}},validations:{invitations:{$each:{email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254),isUser:function(t){return!this.membersList.filter((function(e){return e.email===t})).length},isInvited:function(t){return!this.invitationsList.filter((function(e){return e.email===t})).length}},name:{required:ie["required"],maxLength:Object(ie["maxLength"])(32)}}}}},Cs=ys,xs=a("269a"),ws=a.n(xs),$s=a("5607"),ks=Object(E["a"])(Cs,gs,_s,!1,null,null,null),Vs=ks.exports;A()(ks,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]}),ws()(ks,{Ripple:$s["a"]});var Ls=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{align:"center",justify:"center"}},[t.$store.state.accounts.retrieveLoader?a("v-col",{staticClass:"mx-auto",attrs:{cols:"6"}},[a("v-boilerplate",{attrs:{type:"card-heading"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"card-heading"}})],1):[a("v-col",{attrs:{cols:"6"}},[t._l(t.accountsList,(function(e){return a("v-hover",{key:e.id,staticClass:"mb-4",attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(i){var s=i.hover;return[a("v-card",{class:{background:s},attrs:{ripple:!1},on:{click:function(a){return t.setAccount(e)}}},[a("v-card-text",{staticClass:"pa-3"},[a("v-list",{staticClass:"transparent"},[a("v-list-item",{staticClass:"my-1"},[a("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))]),a("v-list-item-icon",[a("v-icon",{attrs:{color:"primary"}},[t._v("mdi-chevron-right")])],1)],1)],1)],1)],1)]}}],null,!0)})})),a("v-btn",{attrs:{to:{name:"AccountSetup"},loading:t.$store.state.accounts.createLoader,outlined:"",color:"secondary",width:"100%",ripple:!1}},[t._v("Crear una nueva organización")])],2)]],2)},Ss=[],Ts={inject:["theme"],components:{VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{}},computed:Object(u["c"])({accountsCount:function(t){return t.accounts.accountsCount},accountsList:function(t){return t.accounts.accountsList}}),created:function(){var t=this;this.$store.dispatch("accounts/LIST",{resource:"accounts"}).then((function(){t.accountsCount||t.$router.push({name:"AccountSetup"})}))},methods:{setAccount:function(t){window.analytics.group(t.id,{name:t.name}),this.$store.dispatch("auth/SET_ACCOUNT",t)}}},Es=Ts,Ds=Object(E["a"])(Es,Ls,Ss,!1,null,null,null),As=Ds.exports;A()(Ds,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VHover:et["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemIcon:At["a"],VListItemTitle:N["c"],VRow:z["a"],VSkeletonLoader:st["a"]});var js,qs,Is,Os,Rs=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{staticClass:"pt-0",attrs:{cols:"12"}},[a("v-row",[a("v-col",{staticClass:"py-0",attrs:{cols:"6"}},[a("v-row",[a("v-col",{attrs:{cols:"order-sm6"}},[a("metric-kpi",{attrs:{metric:"total_billing",interval:"yearly",comparative:"this_v_last_mtd"}})],1),a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_billing",interval:"monthly",comparative:"this_v_last"}})],1),a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_billing_non_recurring",interval:"monthly",comparative:"this_v_last"}})],1),a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_cancelled_billing",interval:"monthly",comparative:"this_v_last"}})],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("metric-graph",{attrs:{metric:"total_billing"}})],1)],1),a("v-row",[a("v-col",{staticClass:"px-0 pb-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55",dense:""}},[a("v-toolbar-title",{staticClass:"pa-0 ml-n1 text--secondary subtitle-1 font-weight-medium"},[t._v("Cobranza")])],1)],1),a("v-col",{attrs:{cols:"6"}},[a("metric-table",{attrs:{metric:"overdue_billing_recovery_breakdown"}})],1),a("v-col",{staticClass:"py-0",attrs:{cols:"6"}},[a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_receivables_current_due",interval:"monthly",comparative:"this_v_last"}})],1),a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_receivables_overdue",interval:"monthly",comparative:"this_v_last"}})],1),a("v-col",{attrs:{cols:"6"}},[a("metric-kpi",{attrs:{metric:"total_receivables",interval:"monthly",comparative:"this_v_last"}})],1)],1)],1)],1)],1)],1)},Ns=[],Ps=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{attrs:{height:285,flat:""}},[t.loaderMetric?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"article"}}):a("v-hover",{attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.hover;return[a("v-card-text",[t.draggable&&i?a("v-icon",{staticClass:"vue-draggable-handle vue-draggable-handle--icon",attrs:{color:"secondary",size:"30"}},[t._v("mdi-drag-horizontal")]):t._e(),a("v-row",{attrs:{align:"center",justify:"space-between","no-gutters":""}},[a("v-col",{attrs:{cols:"9"}},[a("span",{staticClass:"d-inline-block body-2 text--secondary font-weight-medium text-truncate",staticStyle:{"max-width":"100%"}},[t._v(t._s(t.$t("metrics."+t.metric)))])]),i?a("v-col",{staticClass:"text-right"},[a("v-tooltip",{attrs:{"max-width":"280px",transition:"scale-transition",top:""},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-icon",t._g(t._b({staticClass:"mt-n1",attrs:{small:"",color:"secondary"}},"v-icon",s,!1),i),[t._v("mdi-information")])]}}],null,!0)},[a("span",[t._v(t._s(t.config.description||"Sin descripción"))])]),t.removable?a("v-btn",{staticClass:"ml-2 mt-n1",attrs:{icon:"","x-small":""},on:{click:function(e){return t.$emit("destroy",!0)}}},[a("v-icon",{attrs:{color:"secondary",size:"20"}},[t._v("mdi-delete-outline")])],1):t._e()],1):t._e()],1),a("v-row",{attrs:{align:"center","no-gutters":""}},["line"===t.config.type.graph.class?a("v-col",{staticClass:"my-2"},[a("chart-line",{staticClass:"d-block",staticStyle:{position:"relative"},attrs:{"axe-type-y":"number","background-color":t.config.type.graph.background_color,colors:t.config.type.graph.colors,"chart-data":t.dataset,"chart-id":t.settings.i||t.metric+"_graph","custom-labels":[t.$t("metrics."+t.metric)],height:220,"number-rounded":!0,"show-axe-x":!1,"show-draw-border-grid-lines-axe-y":!0,"show-grid-lines-axe-y":!0,"show-point":!0}})],1):t._e(),"barStacked"===t.config.type.graph.class?a("v-col",{staticClass:"mb-5"},[a("chart-bar-stacked",{staticClass:"d-block mt-4 chartjs-final-dataset-as-compute",staticStyle:{position:"relative"},attrs:{"axe-type-y":"number","chart-data":t.dataset,colors:t.config.type.graph.colors,"custom-labels":[t.$t("metrics."+t.metric)],"final-as-compute":!0,height:220,labels:t.config.type.graph.labels,"number-rounded":!0,"show-draw-border-grid-lines-axe-y":!0}})],1):t._e()],1),t.resizable&&i?a("v-btn",{staticClass:"vue-draggable-resize px-0",attrs:{color:"primary",height:"60","x-small":""},on:{click:function(e){return t.$emit("resize",!0)}}},[a("v-icon",{staticClass:"ml-0",attrs:{dark:"","x-small":"",tab:""}},[t._v(t._s(12===t.settings.w?"mdi-minus":"mdi-plus"))])],1):t._e()],1)]}}])})],1)},Bs=[],zs=a("1fca"),Fs={extends:zs["b"],props:{axeTypeY:{type:String,required:!1,default:"number"},numberLabel:{type:String,required:!1,default:""},numberRounded:{type:Boolean,required:!1,default:!1},axeTypeX:{type:String,required:!1,default:"date"},colors:{type:Array,required:!1,default:function(){return["#3F51B5"]}},backgroundColor:{type:String,required:!1,default:"rgba(63, 81, 181, 0.1)"},customLabels:{type:Array,required:!1,default:function(){return[]}},showAxeX:{type:Boolean,required:!1,default:!0},showAxeY:{type:Boolean,required:!1,default:!1},showGridLinesAxeY:{type:Boolean,required:!1,default:!1},showDrawBorderGridLinesAxeY:{type:Boolean,required:!1,default:!1},showPoint:{type:Boolean,required:!1,default:!1}},mixins:[zs["c"].reactiveProp],data:function(){return{colorsHover:["#004FE2"]}},mounted:function(){this.addPlugin({id:"vertical-line",afterDraw:function(t){if(t.tooltip._active&&t.tooltip._active.length){var e=t.tooltip._active[0],a=t.ctx,i=e.tooltipPosition().x,s=t.legend.bottom,r=t.chartArea.bottom;a.save(),a.beginPath(),a.moveTo(i,s),a.lineTo(i,r),a.lineWidth=1,a.strokeStyle="#D8E0EA",a.stroke(),a.restore()}}}),this.drawChart()},watch:{chartData:function(){this.drawChart()}},computed:{options:function(){var t=this;return{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},layout:{padding:4},hover:{mode:"index",intersect:!0},tooltips:{mode:"index",intersect:!1,enabled:!1,custom:this.customTooltips,displayColors:!1,backgroundColor:"#FFFFFF",titleFontColor:"#525F7F",titleFontSize:12,titleMarginBottom:10,bodyFontStyle:"bold",bodyFontColor:"red",borderColor:"#D8E0EA",borderWidth:1,xPadding:20,yPadding:10,callbacks:{title:function(t,e){return h()(t[0].xLabel.split("T")[0]).format("MMM YYYY")},label:function(e,a){var i=a.datasets[e.datasetIndex].label,s=e.yLabel;return"number"===t.axeTypeY&&(b.a.localeData().delimiters.thousands=t.numberRounded?".":",",b.a.localeData().delimiters.decimal=t.numberRounded?",":".",s=b()(s).format(t.numberRounded?"0,0":"0,0.00")),t.numberLabel&&(s="".concat(s," ").concat(t.numberLabel)),{label:i,value:s}}}},scales:{yAxes:[{gridLines:{color:"#D8E0EA",display:this.showGridLinesAxeY,drawBorder:!1,drawTicks:!1,zeroLineColor:"#D8E0EA",zeroLineWidth:1},ticks:{display:this.showAxeY,fontSize:12,fontColor:"#6B7C93",fontFamily:"Open Sans",maxRotation:0,maxTicksLimit:3}}],xAxes:[{gridLines:{display:!1,drawBorder:!1,drawTicks:!1},ticks:{display:this.showAxeX,fontSize:12,fontColor:"#6B7C93",fontFamily:"Open Sans",maxRotation:0,maxTicksLimit:2,padding:10,callback:function(t){return h()(t.split("T")[0]).format("MMM YY")}}}]}}}},methods:{drawDatasets:function(){var t=this;this.chartData.datasets.forEach((function(e,a){t.chartData.datasets[a]=Object.assign({},t.chartData.datasets[a],{backgroundColor:0===a?"".concat(t.backgroundColor):"transparent",borderColor:t.colors[a],borderWidth:1.5,pointStyle:"circle",pointRadius:3,pointHoverRadius:3,pointBorderWidth:0,pointBackgroundColor:t.colors[a],lineTension:0})}))},drawChart:function(){this.drawDatasets(),this.renderChart(this.chartData,this.options)},customTooltips:function(t){var e=this,a=this.customLabels.some((function(t){return"Cancelación de suscripciones"===t||"Contracción del MRR"===t})),i=document.getElementById("chartjs-tooltip__".concat(this.chartId));if(i||(i=document.createElement("div"),i.id="chartjs-tooltip__".concat(this.chartId),i.innerHTML="
    ",this.$refs.canvas.parentNode.appendChild(i)),0!==t.opacity){if(t.body){var s=t.title||[],r=t.body.map((function(t){return t.lines[0]})),n="";s.forEach((function(i){if(n+="",n+=''.concat(i,""),e.chartData.datasets[0].percent_change){var s=e.chartData.datasets[0].percent_change[t.dataPoints[0].index],r="";r=s>0?a?"red--text text--darken-1":"green--text text--darken-1":s<0?a?"green--text text--darken-1":"red--text text--darken-1":"text--secondary";var o=b()(s).format("0,0.00");n+='').concat(o,"%")}n+=""})),n+="",n+="",r.forEach((function(a,i){var s=t.labelColors[i],r=e.customLabels[i]?e.customLabels[i]:a.label;n+='\n \n \n
    \n ').concat(r,'\n
    \n \n ').concat(a.value,"\n \n ")})),n+="",i.querySelector("table").innerHTML=n}i.style.opacity=1;var o=document.getElementById("chartjs-tooltip__".concat(this.chartId));Math.round(t.caretX/4)>=0&&(i.style.left="".concat(this.$refs.canvas.offsetLeft+t.caretX-35,"px"),o.style.setProperty("--left-pseudo","25px")),this.$refs.canvas.width/2",this.$refs.canvas.parentNode.appendChild(a)),0!==t.opacity){if(t.body){var i=t.title||[],s=t.body.map((function(t){return t.lines[0]}));this.finalAsCompute&&(s.push(s.splice(0,1)[0]),t.labelColors.push(t.labelColors.splice(0,1)[0]));var r="";i.forEach((function(a){if(r+="",r+=''.concat(a,""),e.chartData.datasets[0].percent_change){var i=e.chartData.datasets[0].percent_change[t.dataPoints[0].index],s="";s=i>0?"green--text text--darken-1":i<0?"red--text text--darken-1":"text--secondary";var n=b()(i).format("0,0.00");r+='').concat(n,"%")}r+=""})),r+="",r+="",s.forEach((function(e,a){var i=t.labelColors[a];r+='\n \n ').concat(e.label,'\n ').concat(e.value,"\n \n ")})),r+="",a.querySelector("table").innerHTML=r}a.style.opacity=1;var n=document.getElementById("chartjs-tooltip__".concat(this.chartId));Math.round(t.caretX/4)>=0&&(a.style.left="".concat(this.$refs.canvas.offsetLeft+t.caretX-35,"px"),n.style.setProperty("--left-pseudo","25px")),this.$refs.canvas.width/28}},[t._v(t._s(t.account.base_currency.id))]):t._e()]),a("v-col",{attrs:{cols:"12"}},[0!==t.dataset.comparative_percent&&(((t.config||{}).type||{}).kpi||{}).displayComparative?[a("span",{staticClass:"mr-2 body-2 text--primary"},[t._v(t._s(t._f("number")(t.dataset.comparative_value,t.account.base_currency.rounded))+" "+t._s(t.account.base_currency.id))]),"up"===t.dataset.indicator_symbol?[a("span",{staticClass:"green--text text--lighten-1"},[t.dataset.comparative_percent>0?[t._v("+")]:t._e(),t._v(t._s(t.dataset.comparative_percent)+"%")],2),a("v-icon",{staticClass:"mt-n1 ml-1",attrs:{color:"green lighten-1",small:""}},[t._v("mdi-trending-up")])]:"down"===t.dataset.indicator_symbol?[a("span",{staticClass:"red--text text--lighten-1"},[t.dataset.comparative_percent>0?[t._v("+")]:t._e(),t._v(t._s(t.dataset.comparative_percent)+"%")],2),a("v-icon",{staticClass:"mt-n1 ml-1",attrs:{color:"red lighten-1",small:""}},[t._v("mdi-trending-down")])]:t._e()]:[a("span",{staticClass:"text--primary"},[t._v("-")])]],2),a("v-col",{attrs:{cols:"12"}},[(((t.config||{}).type||{}).kpi||{}).displayComparative?a("span",{staticClass:"d-block mt-1 text--primary caption"},[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(t.$t("api."+t.dataset.interval)))]),t._v(" • período "+t._s(t.$t("api."+t.dataset.comparative)))]):t._e()])],1)],1)]}}])})],1)},ar=[],ir={props:{draggable:{type:Boolean,required:!1,default:function(){return!1}},metric:{type:String,required:!0},interval:{type:String,required:!0,default:function(){return"monthly"}},comparative:{type:String,required:!1,default:function(){return"this_v_last"}},removable:{type:Boolean,required:!1,default:function(){return!1}},settings:{type:Object,required:!1,default:function(){return{}}}},mixins:[Ks],data:function(){return{dataset:{},config:{}}},created:function(){this.retrieveMetric()},watch:{comparative:function(){this.retrieveMetric()},interval:function(){this.retrieveMetric()},metric:function(){this.retrieveMetric()}},methods:{retrieveMetric:function(){var t=this,e={interval:this.interval,comparative:this.comparative};this.loaderMetric=!0,this.$store.dispatch("analytics/GET",{resource:"metrics/".concat(this.metric,"/kpi"),query:Object.assign({},e)}).then((function(e){t.dataset=e.data,t.config=t.getMetric(t.metric)})).finally((function(){t.loaderMetric=!1}))}}},sr=ir,rr=Object(E["a"])(sr,er,ar,!1,null,null,null),nr=rr.exports;A()(rr,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VHover:et["a"],VIcon:I["a"],VRow:z["a"],VSkeletonLoader:st["a"],VTooltip:Ve["a"]});var or=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{attrs:{height:285,flat:""}},[t.loaderMetric?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"article"}}):a("v-hover",{attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.hover;return[a("v-card-text",{staticClass:"px-0"},[t.draggable&&i?a("v-icon",{staticClass:"vue-draggable-handle vue-draggable-handle--icon",attrs:{color:"secondary",size:"30"}},[t._v("mdi-drag-horizontal")]):t._e(),a("v-row",{attrs:{align:"center",justify:"space-between","no-gutters":""}},[a("v-col",{staticClass:"pl-3",attrs:{cols:"9"}},[a("span",{staticClass:"d-inline-block body-2 text--secondary font-weight-medium text-truncate",staticStyle:{"max-width":"100%"}},[t._v(t._s(t.$t("metrics."+t.metric)))])]),i?a("v-col",{staticClass:"pr-3 text-right"},[a("v-tooltip",{attrs:{"max-width":"280px",transition:"scale-transition",top:""},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-icon",t._g(t._b({staticClass:"mt-n1",attrs:{small:"",color:"secondary"}},"v-icon",s,!1),i),[t._v("mdi-information")])]}}],null,!0)},[a("span",[t._v(t._s(t.config.description||"Sin descripción"))])]),t.removable?a("v-btn",{staticClass:"ml-2 mt-n1",attrs:{icon:"","x-small":""},on:{click:function(e){return t.$emit("destroy",!0)}}},[a("v-icon",{attrs:{color:"secondary",size:"20"}},[t._v("mdi-delete-outline")])],1):t._e()],1):t._e()],1),a("v-divider"),a("v-row",{attrs:{align:"center",justify:"space-between","no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[a("v-data-table",{attrs:{headers:t.config.type.table.headers,items:t.dataset.datasets,"mobile-breakpoint":"","hide-default-footer":"","hide-default-header":"","disable-sort":""},scopedSlots:t._u([{key:"header",fn:function(t){var e=t.props.headers;return[a("v-table-headers",{attrs:{headers:e}})]}},{key:"item.label",fn:function(e){var a=e.item;return[t._v(" "+t._s(t.$t("metrics."+a.label))+" ")]}}],null,!0)})],1)],1),t.resizable&&i?a("v-btn",{staticClass:"vue-draggable-resize px-0",attrs:{color:"primary",height:"60","x-small":""},on:{click:function(e){return t.$emit("resize",!0)}}},[a("v-icon",{staticClass:"ml-0",attrs:{dark:"","x-small":"",tab:""}},[t._v(t._s(12===t.settings.w?"mdi-minus":"mdi-plus"))])],1):t._e()],1)]}}])})],1)},lr=[],cr={props:{draggable:{type:Boolean,required:!1,default:function(){return!1}},metric:{type:String,required:!0},removable:{type:Boolean,required:!1,default:function(){return!1}},resizable:{type:Boolean,required:!1,default:function(){return!1}},settings:{type:Object,required:!1,default:function(){return{}}}},mixins:[Ks],components:{VTableHeaders:Mi},data:function(){return{dataset:{},config:{}}},created:function(){var t=this;this.loaderMetric=!0,this.$store.dispatch("analytics/GET",{resource:"metrics/".concat(this.metric,"/table")}).then((function(e){t.dataset=e.data,t.config=t.getMetric(t.metric)})).finally((function(){t.loaderMetric=!1}))}},dr=cr,ur=Object(E["a"])(dr,or,lr,!1,null,null,null),vr=ur.exports;A()(ur,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VHover:et["a"],VIcon:I["a"],VRow:z["a"],VSkeletonLoader:st["a"],VTooltip:Ve["a"]});var mr={components:{MetricGraph:tr,MetricKpi:nr,MetricTable:vr},mixins:[$]},pr=mr,hr=Object(E["a"])(pr,Rs,Ns,!1,null,null,null),fr=hr.exports;A()(hr,{VCol:q["a"],VRow:z["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var br=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",{attrs:{align:"center",justify:"center"}},[i("v-col",{attrs:{cols:"10"}},[i("v-card",[i("v-card-text",{staticClass:"pa-0 background"},[i("v-row",{staticClass:"py-6"},[i("v-col",{staticClass:"pt-0",attrs:{cols:"5"}},[i("v-img",{attrs:{contain:"",src:a("1aae"),height:"400"}}),i("v-list",{staticClass:"transparent"},[i("v-list-item",[i("v-list-item-title",[i("v-icon",{attrs:{left:"",small:"",color:"primary"}},[t._v("mdi-check")]),i("span",{staticClass:"ml-1 body-2 text--secondary font-weight-medium"},[t._v("Automatiza tu facturación")])],1)],1),i("v-list-item",[i("v-list-item-title",[i("v-icon",{attrs:{left:"",small:"",color:"primary"}},[t._v("mdi-check")]),i("span",{staticClass:"ml-1 body-2 text--secondary font-weight-medium"},[t._v("Gestiona tus suscripciones")])],1)],1),i("v-list-item",[i("v-list-item-title",[i("v-icon",{attrs:{left:"",small:"",color:"primary"}},[t._v("mdi-check")]),i("span",{staticClass:"ml-1 body-2 text--secondary font-weight-medium"},[t._v("Experimenta diferentes modos de cobro")])],1)],1),i("v-list-item",[i("v-list-item-title",[i("v-icon",{attrs:{left:"",small:"",color:"primary"}},[t._v("mdi-check")]),i("span",{staticClass:"ml-1 body-2 text--secondary font-weight-medium"},[t._v("Analiza detalladamente tus ingresos")])],1)],1)],1)],1),i("v-col",{attrs:{cols:"7"}},[i("v-list",{staticClass:"transparent",attrs:{dense:""}},[i("v-list-item",{staticClass:"my-3"},[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("1. ¿Cúal es el país donde opera la compañía?")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pl-0",attrs:{cols:"6"}},[i("v-select",{attrs:{error:t.$v.newAccount.country.$error,items:t.countriesList,"single-line":"","item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.$v.newAccount.country.$model,callback:function(e){t.$set(t.$v.newAccount.country,"$model",e)},expression:"$v.newAccount.country.$model"}})],1)],1)],1)],1),i("v-list-item",[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("2. ¿Cúal es el nombre de la compañía?")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pl-0",attrs:{cols:"8"}},[i("v-text-field",{attrs:{error:t.$v.newAccount.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newAccount.name.$model,callback:function(e){t.$set(t.$v.newAccount.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.newAccount.name.$model"}})],1)],1)],1)],1),i("v-list-item",[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("3. Número fiscal")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pl-0",attrs:{cols:"8"}},[i("v-text-field",{directives:[{name:"dni",rawName:"v-dni",value:t.newAccount.country,expression:"newAccount.country"}],attrs:{error:t.$v.newAccount.tax_id.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newAccount.tax_id.$model,callback:function(e){t.$set(t.$v.newAccount.tax_id,"$model","string"===typeof e?e.trim():e)},expression:"$v.newAccount.tax_id.$model"}})],1)],1)],1)],1),i("v-list-item",[i("v-list-item-content",[i("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("4. ¿Cúal es la forma de cobro?")]),i("v-list-item-subtitle",[i("v-col",{staticClass:"pl-0",staticStyle:{position:"absolute"},attrs:{cols:"8"}},t._l(t.chargeSchemes,(function(e){return i("div",{key:e.value},[i("v-radio-group",{staticClass:"my-2",attrs:{"hide-details":""},model:{value:t.$v.newAccount.charge_scheme.$model,callback:function(e){t.$set(t.$v.newAccount.charge_scheme,"$model",e)},expression:"$v.newAccount.charge_scheme.$model"}},[i("v-radio",{attrs:{label:e.label,value:e.value}})],1)],1)})),0)],1)],1)],1)],1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"pa-4"},[i("v-spacer"),i("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.postAccount}},[t._v("Crear una nueva organización")])],1)],1)],1)],1)},gr=[],_r=a("f137"),yr={mixins:[$],data:function(){return{newAccount:{country:"",name:"",tax_id:"",charge_scheme:""},chargeSchemes:[{value:"recurring",label:"Cobro recurrente, por suscripción o membresía"},{value:"transactional",label:"Transaccional (intercambio de producto por dinero)"},{value:"commission",label:"Comisionista"}]}},computed:Object(i["a"])({chargeScheme:function(){var t=this;return this.newAccount.charge_scheme?this.chargeSchemes.find((function(e){return e.value===t.newAccount.charge_scheme})).label:""}},Object(u["c"])({countriesList:function(t){return t.generals.countriesList},trace:function(t){return t.auth.trace}})),watch:{"newAccount.country":function(){this.newAccount.tax_id=""}},created:function(){var t=this;this.$store.dispatch("generals/LIST",{resource:"generals/countries"}),this.$store.dispatch("auth/RETRIEVE_TRACE").then((function(){t.newAccount.country=t.trace.loc}))},methods:{postAccount:function(){var t=this;if(this.$v.newAccount.$touch(),this.$v.newAccount.$invalid)return!1;this.$store.dispatch("accounts/CREATE",{resource:"accounts",payload:this.newAccount}).then((function(e){var a=e.data;window.analytics.group(a.id,{name:a.name,createdAt:a.created}),t.$store.commit("auth/SET_ACCOUNT",{account:a,redirect:!1})})).catch((function(e){t.$dialog.message.error(e.response.data.tax_id[0]||"Error al crear la cuenta")}))},validateAccount:function(){return this.$v.$touch(),!this.$v.$invalid}},validations:{newAccount:{country:{required:ie["required"]},name:{required:ie["required"],minLength:Object(ie["minLength"])(6),maxLength:Object(ie["maxLength"])(64)},tax_id:{required:Object(ie["requiredIf"])((function(){var t=this,e=this.countriesList.find((function(e){return e.id===t.newAccount.country}));return!!e&&e.has_regulation})),taxId:function(t){return"CL"!==this.newAccount.country||Object(_r["rutValidator"])(t)},maxLength:Object(ie["maxLength"])(32)},charge_scheme:{required:ie["required"]}}}},Cr=yr,xr=Object(E["a"])(Cr,br,gr,!1,null,null,null),wr=xr.exports;A()(xr,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VImg:Ht["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRadio:Fa["a"],VRadioGroup:Ma["a"],VRow:z["a"],VSelect:Ge["a"],VSpacer:ut["a"],VTextField:F["a"]});var $r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Importación de facturas")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.status?[a("v-row",{staticClass:"mx-0"},[a("v-col",{staticClass:"white",attrs:{cols:"12"}},[a("v-list",{staticClass:"v-list-form-extended transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estatus de la importación")]),a("v-list-item-subtitle",[a("code",[t._v(t._s(t.status))])])],1),a("v-list-item",[a("v-list-item-title",[t._v("Facturas importadas")]),a("v-list-item-subtitle",[t._v(t._s(t.count))])],1)],1)],1)],1),a("v-divider"),t.issues.length?[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Problemas")])],1),a("v-row",[a("v-timeline",{attrs:{dense:""}},t._l(t.issues,(function(e,i){return a("v-timeline-item",{key:i,attrs:{color:"secondary","fill-dot":"",right:"",small:""}},[a("v-card",{staticClass:"elevation-1"},[a("v-card-title",{staticClass:"body-2 text--secondary font-weight-medium pb-0 pt-3"},[t._v(t._s(e.file_name))]),a("v-card-text",{staticClass:"pb-3"},t._l(e.issues,(function(e,i){return a("span",{key:i,staticClass:"d-block"},[t._v(t._s(e))])})),0)],1)],1)})),1)],1)]:t._e()]:a("v-col",{staticClass:"mx-auto",attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",{attrs:{"three-line":""}},[a("v-list-item-content",[a("v-list-item-title",[a("v-file-input",{attrs:{type:"file",accept:".xml",multiple:"",prepend:"mdi-paper-clip","background-color":"transparent","hide-details":"",placeholder:"No se eligió ningún archivo",solo:"",flat:"",chips:""},model:{value:t.files,callback:function(e){t.files=e},expression:"files"}})],1),a("v-list-item-subtitle",{staticClass:"pt-3"},[a("span",{staticClass:"font-weight-medium"},[t._v("Selecciona hasta 100 archivos por cada importación.")])])],1)],1)],1)],1)],2),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),t.status?a("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.clearImport}},[t._v("Nueva importación")]):a("v-btn",{attrs:{loading:t.$store.state.accounts.createLoader,color:"primary"},on:{click:t.createImport}},[t._v("Importar")])],1)],1)],1)],1)},kr=[],Vr={data:function(){return{files:null,status:null,count:null,issues:[]}},methods:{createImport:function(){var t=this;if(!this.files.length||this.files.length>100)return!1;for(var e=new FormData,a=0;a1?a("v-col",{staticClass:"py-0",attrs:{cols:"6"}},[a("v-select",{attrs:{items:t.rule.operators,"return-object":"",outlined:"","single-line":"",dense:"","background-color":"white","hide-details":""},model:{value:t.query.operator,callback:function(e){t.$set(t.query,"operator",e)},expression:"query.operator"}})],1):t._e(),a("v-col",{staticClass:"py-0",attrs:{cols:"undefined"!==typeof t.rule.operands||"undefined"!==typeof t.rule.operators&&t.rule.operators.length>1?6:12}},["text"===t.rule.inputType?a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.query.value,callback:function(e){t.$set(t.query,"value","string"===typeof e?e.trim():e)},expression:"query.value"}}):t._e(),"number"===t.rule.inputType?a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"","hide-details":""},model:{value:t.query.value,callback:function(e){t.$set(t.query,"value",t._n(e))},expression:"query.value"}}):t._e(),"date"===t.rule.inputType?a("input",{directives:[{name:"model",rawName:"v-model",value:t.query.value,expression:"query.value"}],staticClass:"form-control",attrs:{type:"date"},domProps:{value:t.query.value},on:{input:function(e){e.target.composing||t.$set(t.query,"value",e.target.value)}}}):t._e(),t.isCustomComponent?a("div",{staticClass:"vqb-custom-component-wrap"},[a(t.rule.component,{tag:"component",attrs:{value:t.query.value},on:{input:t.updateQuery}})],1):t._e(),"checkbox"===t.rule.inputType?t._l(t.rule.choices,(function(e){return a("div",{key:e.value,staticClass:"form-check form-check-inline"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.query.value,expression:"query.value"}],staticClass:"form-check-input",attrs:{id:"depth"+t.depth+"-"+t.rule.id+"-"+t.index+"-"+e.value,type:"checkbox"},domProps:{value:e.value,checked:Array.isArray(t.query.value)?t._i(t.query.value,e.value)>-1:t.query.value},on:{change:function(a){var i=t.query.value,s=a.target,r=!!s.checked;if(Array.isArray(i)){var n=e.value,o=t._i(i,n);s.checked?o<0&&t.$set(t.query,"value",i.concat([n])):o>-1&&t.$set(t.query,"value",i.slice(0,o).concat(i.slice(o+1)))}else t.$set(t.query,"value",r)}}}),a("label",{staticClass:"form-check-label",attrs:{for:"depth"+t.depth+"-"+t.rule.id+"-"+t.index+"-"+e.value}},[t._v(t._s(e.label))])])})):t._e(),"radio"===t.rule.inputType?a("v-radio-group",{attrs:{row:""},model:{value:t.query.value,callback:function(e){t.$set(t.query,"value",e)},expression:"query.value"}},t._l(t.rule.choices,(function(e){return a("v-radio",{key:e.value,attrs:{name:"depth"+t.depth+"-"+t.rule.id+"-"+t.index,label:e.label,value:e.value}})})),1):t._e(),"select"!==t.rule.inputType||t.hasOptionGroups?t._e():a("v-select",{attrs:{items:Object.values(t.selectOptions),"item-text":"label","item-value":"value",outlined:"","single-line":"",dense:"","background-color":"white","hide-details":""},model:{value:t.query.value,callback:function(e){t.$set(t.query,"value",e)},expression:"query.value"}}),"select"===t.rule.inputType&&t.hasOptionGroups?a("v-select",{attrs:{items:Object.values(t.selectOptions),"item-text":"label","item-value":"value",outlined:"","single-line":"",dense:"","background-color":"white","hide-details":""},model:{value:t.query.value,callback:function(e){t.$set(t.query,"value",e)},expression:"query.value"}}):t._e()],2)],1)],1),a("v-col",{staticClass:"py-0",attrs:{cols:"1"}},[a("v-btn",{attrs:{icon:"",small:"",color:"red"},on:{click:t.remove}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)},Kr=[],Xr=a("c2cf"),Jr={extends:Xr["a"]},Zr=Jr,tn=Object(E["a"])(Zr,Qr,Kr,!1,null,null,null),en=tn.exports;A()(tn,{VBtn:Z["a"],VCol:q["a"],VIcon:I["a"],VRadio:Fa["a"],VRadioGroup:Ma["a"],VRow:z["a"],VSelect:Ge["a"],VTextField:F["a"]});var an={name:"QueryBuilderGroup",components:{QueryBuilderRule:en},extends:Wr["a"]},sn=an,rn=Object(E["a"])(sn,Hr,Yr,!1,null,null,null),nn=rn.exports;A()(rn,{VBtn:Z["a"],VCol:q["a"],VRow:z["a"],VSelect:Ge["a"]});var on={mixins:[k],props:{queryMap:{type:Array,required:!0},model:{type:String,required:!0},flat:{type:Boolean,required:!1,default:function(){return!1}},filterText:{type:String,required:!1,default:function(){return"Filtrar"}}},components:{VueQueryBuilder:Gr.a,VQueryBuilderGroup:nn},data:function(){return{queryObject:{logicalOperator:"all",children:[]},labels:{matchType:"Match Type",matchTypes:[{id:"all",label:"Todos"}],addRule:"Agregar filtro",removeRule:"×",addGroup:"Agregar grupo",removeGroup:"×",textInputPlaceholder:""},operators:{contiene:"__icontains","es menor a":"__lte","es mayor a":"__gte","es igual":""},newFilter:{name:"",model:this.model},dialogSavedFilters:!1,dialogCreateFilter:!1}},computed:Object(u["c"])({filtersCount:function(t){return t.accounts.filtersCount},filtersList:function(t){return t.accounts.filtersList}}),created:function(){this.getFilters(),this.$route.query!=={}&&this.setInitialQuery()},methods:{getFilters:function(){var t={model:this.model,limit:0};this.$store.dispatch("accounts/LIST",{resource:"filters",query:t})},buildQuery:function(){var t=this;this.query={},this.queryObject.children&&this.queryObject.children.forEach((function(e,a){e.query.operator?t.query["".concat(e.query.rule).concat(t.operators[e.query.operator])]=e.query.value:t.query["".concat(e.query.rule)]=e.query.value})),this.setQuery()},setInitialQuery:function(){var t=this,e={logicalOperator:"All",children:[]};Object.keys(this.$route.query).forEach((function(a){var i=Object.values(t.operators).find((function(t){return a.includes(t)})),s=Object.keys(t.operators).find((function(e){return t.operators[e]===i})),r=a.replace(i,""),n=t.queryMap.find((function(t){return t.id===r}));n&&e.children.push({type:"query-builder-rule",query:{operand:n.label,operator:s,rule:r,value:t.$route.query[a]}}),t.queryObject=e}))},removeQuery:function(){this.$refs.vqb.query.children=[]},setFilter:function(t){this.queryObject=t.query_object,this.dialogSavedFilters=!1},createFilter:function(){var t=this;if(this.$v.newFilter.$touch(),this.$v.newFilter.$invalid)return!1;this.newFilter.query_object=this.queryObject,this.$store.dispatch("accounts/CREATE",{resource:"filters",payload:this.newFilter}).then((function(e){t.dialogCreateFilter=!1})).catch((function(){t.$dialog.message.error("Error al crear el filtro.")}))},destroyFilter:function(t){var e=this;this.$store.dispatch("accounts/DESTROY",{resource:"filters",id:this.filtersList[t].id}).catch((function(){e.$dialog.message.error("Error al eliminar el filtro.")}))}},validations:{newFilter:{name:{required:ie["required"],minLength:Object(ie["minLength"])(3),maxLength:Object(ie["maxLength"])(56)}}}},ln=on,cn=Object(E["a"])(ln,Fr,Mr,!1,null,null,null),dn=cn.exports;A()(cn,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var un=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.customersList.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.customersList,"items-per-page":t.pagination,"mobile-breakpoint":"","hide-default-header":"","disable-sort":"","hide-default-footer":""},on:{"click:row":function(e){t.$router.push({name:"CustomerRetrieveUpdate",params:{id:e.id}})}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.name",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.name))])]}},{key:"item.email",fn:function(e){var a=e.item;return[t._v(" "+t._s(a.email)+" ")]}},{key:"item.created",fn:function(e){var i=e.item;return[a("span",{staticClass:"text-right"},[t._v(t._s(t._f("date")(i.created)))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showAll?a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-btn",{attrs:{to:{name:"CustomerListCreate",query:t.showCriteria},outlined:"",color:"secondary"}},[t._v("Ver todos los clientes")])],1):t._e(),t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-row",[a("v-col",{staticClass:"pb-6 pt-4 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-badge-account-horizontal")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes clientes registrados")]),t.showCreate?a("v-btn",{attrs:{outlined:""},on:{click:function(e){return t.$emit("update:create",!0)}}},[t._v("Crear un cliente")]):t._e()],1)],1)]],2)],1)},vn=[],mn={components:{VTableHeaders:Mi},mixins:[k],data:function(){return{headers:[{text:"Cliente",value:"name",class:"font-weight-bold",sortable:!0},{text:"Email",value:"email",sortable:!0},{text:"Creado el",value:"created",align:"end",sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.customers.customersCount},customersList:function(t){return t.customers.customersList}})},pn=mn,hn=Object(E["a"])(pn,un,vn,!1,null,null,null),fn=hn.exports;A()(hn,{VBtn:Z["a"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"]});var bn={components:{CustomerList:fn,VQueryBuilder:dn},mixins:[k],data:function(){return{isPreview:!1,filters:[{type:"text",id:"name",label:"Nombre",operators:["contiene"]},{type:"text",id:"tax_id",label:"Número fiscal",operators:["contiene"]},{type:"text",id:"created",label:"Fecha de creación",operators:["es igual","es menor a","es mayor a"]},{type:"radio",id:"sources",label:"Método de pago",choices:[{label:"Si",value:"True"},{label:"No",value:"False"}]},{type:"text",id:"email",label:"Email",operators:["contiene"]},{type:"text",id:"country__name",label:"País",operators:["contiene"]}]}},computed:Object(u["c"])({count:function(t){return t.customers.customersCount},customersList:function(t){return t.customers.customersList}}),methods:{getList:function(){this.$store.dispatch("customers/LIST",{resource:"customers",query:Object.assign({},this.$route.query,{page_size:10})})},str2bytes:function(t){for(var e=new Uint8Array(t.length),a=0;a3?a("v-list-item",{staticClass:"px-0 my-1"},[a("v-list-item-title",[t._v("y otros "+t._s(i.lines.length-3)+" productos")])],1):t._e()],2),a("v-divider",{staticClass:"mx-4"}),a("v-card-actions",[a("v-spacer"),a("v-btn",{attrs:{to:{name:"draft"===i.status?"InvoiceUpdate":"InvoiceRetrieve",params:{id:i.id}},text:"",color:"primary"}},[t._v("Ver detalle "),a("v-icon",{attrs:{small:"",right:""}},[t._v("mdi-arrow-right")])],1),a("v-spacer")],1)],1)],1)],1)]}},{key:"item.date",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(t._f("date")(i.date)))])]}},{key:"item.due_date",fn:function(e){var i=e.item;return[i.due_date?a("span",[t._v(t._s(t._f("date")(i.due_date)))]):a("span",[t._v("---")])]}},{key:"item.total",fn:function(e){var i=e.item;return[a("div",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(i.total,i.currency)))]),a("span",{staticClass:"ml-1"},[t._v(t._s(i.currency))])])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showAll?a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-btn",{attrs:{to:{name:"InvoiceList",query:t.showCriteria},outlined:"",color:"secondary"}},[t._v("Ver todas las facturas")])],1):t._e(),t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-file")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen documentos")]),t.showCreate?a("v-btn",{staticClass:"my-5",attrs:{to:{name:"InvoiceCreate"},outlined:""}},[t._v("Crear un documento")]):t._e()],1)]],2)],1)},kn=[],Vn={components:{VTableHeaders:Mi},mixins:[k],data:function(){return{headers:[{text:"Cliente",value:"customer",class:"font-weight-bold",sortable:!0},{text:"",value:"status"},{text:"Documento",value:"document"},{text:"Fecha",value:"date",align:"end",sortable:!0},{text:"Vencimiento",value:"due_date",align:"end",sortable:!0},{text:"Total",value:"total",align:"end",sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.invoices.invoicesCount},invoicesList:function(t){return t.invoices.invoicesList}})},Ln=Vn,Sn=Object(E["a"])(Ln,$n,kn,!1,null,null,null),Tn=Sn.exports;A()(Sn,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSubheader:rt["a"]});var En={components:{VQueryBuilder:dn,InvoiceList:Tn},mixins:[k],data:function(){return{isPreview:!1,rules:wn}},computed:Object(u["c"])({count:function(t){return t.invoices.invoicesCount},invoicesList:function(t){return t.invoices.invoicesList}}),methods:{getList:function(){this.$store.dispatch("invoices/LIST",{resource:"invoices",query:Object.assign({},this.$route.query,{status__in:["finalized","paid","cancelled"].join(","),page_size:10})})},str2bytes:function(t){for(var e=new Uint8Array(t.length),a=0;a3?a("v-list-item",{staticClass:"px-0 my-1"},[a("v-list-item-title",[t._v("y otros "+t._s(i.invoice.lines.length-3)+" productos")])],1):t._e()],2),a("v-divider",{staticClass:"mx-4"}),a("v-card-actions",[a("v-spacer"),a("v-btn",{attrs:{to:{name:"draft"===i.invoice.status?"InvoiceUpdate":"InvoiceRetrieve",params:{id:i.invoice.id}},text:"",color:"primary"}},[t._v("Ver detalle "),a("v-icon",{attrs:{small:"",right:""}},[t._v("mdi-arrow-right")])],1),a("v-spacer")],1)],1)],1)],1)]}},{key:"item.invoice.total",fn:function(e){var i=e.item;return[a("div",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(i.invoice.total,i.invoice.currency)))]),a("span",{staticClass:"ml-1"},[t._v(t._s(i.invoice.currency))])])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showAll?a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-btn",{attrs:{to:{name:"InvoiceList",query:t.showCriteria},outlined:"",color:"secondary"}},[t._v("Ver todas las facturas")])],1):t._e(),t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-file")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen documentos")])],1)]],2)],1)},Rn=[],Nn={components:{VTableHeaders:Mi},mixins:[k],data:function(){return{headers:[{text:"Cliente",value:"invoice.customer",class:"font-weight-bold",sortable:!0},{text:"Documento",value:"document"},{text:"Fecha",value:"document.date",align:"end",sortable:!0},{text:"Anulación",value:"invoice.document"},{text:"Total",value:"invoice.total",align:"end",sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.invoices.creditnotesCount},creditnotesList:function(t){return t.invoices.creditnotesList}})},Pn=Nn,Bn=Object(E["a"])(Pn,On,Rn,!1,null,null,null),zn=Bn.exports;A()(Bn,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSubheader:rt["a"]});var Fn={components:{VQueryBuilder:dn,CreditNoteList:zn},mixins:[k],data:function(){return{isPreview:!1,filters:[{type:"text",id:"invoice__customer__name",label:"Cliente",operators:["contiene"]},{type:"text",id:"date",label:"Fecha",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"number",label:"Número",operators:["es igual","es menor a","es mayor a"]},{type:"select",id:"document",label:"Tipo de nota de crédito",choices:[]},{type:"text",id:"note",label:"Nota",operators:["contiene"]},{type:"numeric",id:"total",label:"Total",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"invoice__number",label:"Número de la factura",operators:["es igual","es menor a","es mayor a"]},{type:"text",id:"invoice__date",label:"Fecha de la factura",operators:["es igual","es menor a","es mayor a"]},{type:"select",id:"invoice__document",label:"Tipo de la factura asociada",choices:[]},{type:"select",id:"invoice__collection_method",label:"Forma de pago de la factura",choices:[{label:"Contado",value:"automatically"},{label:"Crédito",value:"deferred"}]},{type:"radio",id:"invoice__subscription__isnull",label:"Suscripción",choices:[{label:"Si",value:"False"},{label:"No",value:"True"}]}]}},computed:Object(u["c"])({count:function(t){return t.invoices.creditnotesCount},invoicesList:function(t){return t.invoices.creditnotesList}}),created:function(){var t=this;this.$store.dispatch("generals/LIST",{resource:"generals/documents",query:{country__id__in:"".concat(this.account.country.id,", US"),is_sale:"True"}}).then((function(e){if(e.data.results&&e.data.results.length){var a=t.filters.findIndex((function(t){return"invoice__document"===t.id}));t.filters[a].choices=e.data.results.map((function(t){return{label:t.name,value:t.id}}))}})),this.$store.dispatch("generals/LIST",{resource:"generals/documents",query:{country__id__in:"".concat(this.account.country.id,", US"),is_sale:"False",is_purshase:"False",is_order:"False"}}).then((function(e){if(e.data.results&&e.data.results.length){var a=t.filters.findIndex((function(t){return"document"===t.id}));t.filters[a].choices=e.data.results.map((function(t){return{label:t.name,value:t.id}}))}}))},methods:{getList:function(){this.$store.dispatch("invoices/LIST",{resource:"creditnotes",query:Object.assign({},this.$route.query,{page_size:10,expand:"document,invoice"})})},str2bytes:function(t){for(var e=new Uint8Array(t.length),a=0;a¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("invoices/DESTROY",{resource:"invoices",id:t.instance.id}).then((function(){t.$router.push({name:"InvoiceList"})})).catch((function(){t.$dialog.message.error()}))}}]})},finalizeInvoice:function(){var t=this;if(this.$v.invoice.$touch(),this.$v.invoice.$invalid)return!1;this.$dialog.warning({title:"Confirmar documento",text:'\n Al confirmar este documento, se:\n 1. Validará con la agencia fiscal de '.concat(this.account.country.name,"\n ").concat("automatically"===this.invoice.collection_method?'2. Cargará el total al método de pago del cliente':"",'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n '),actions:[{color:"primary",text:"Continuar",handle:function(){t.loadingFinalize=!0,t.$store.dispatch("invoices/RETRIEVE",{resource:"invoices",detail:"finalize",id:t.instance.id,loader:!1}).then((function(){"automatically"===t.instance.collection_method?t.$store.dispatch("payments/CREATE",{resource:"payments",payload:{customer:t.instance.customer.id,invoice:t.instance.id,source:t.sourcesDetail.id},detail:"authorize",id:t.instance.payments[0].id}).then((function(){t.$router.push({name:"InvoiceRetrieve",params:{id:t.instance.id}})})).catch((function(){t.$dialog.message.info("La factura se ha creado pero el pago no se ha logrado procesar.")})):t.$router.push({name:"InvoiceRetrieve",params:{id:t.instance.id}})})).catch((function(e){var a=e.response.data;if(a.non_field_errors){var i=t.handledErrors.find((function(t){return a.non_field_errors.includes(t.snippet)}));i?t.$dialog.message.error(i.message,{timeout:1e4,actions:[{text:i.action,color:"red darken-4",handle:function(){if(i.route){var e=t.$router.resolve(i.route);window.open(e.href,"_blank")}}}]}):t.$dialog.message.error(t.parseErrors(e.response.data))}else t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loadingFinalize=!1}))}}]})},getCustomers:function(){if([1,2].includes(this.customerQuery.length))return!1;var t={page_size:10};this.customerQuery.length>=3&&(t.name__icontains=this.customerQuery.toLowerCase()),this.$store.dispatch("customers/LIST",{resource:"customers",query:t})},setAggregations:function(){var t=this,e=this.activeCurrency.format&&0===this.activeCurrency.format.precision,a=0,i=0;if(this.invoice.lines.forEach((function(s,r){t.aggregations.lines[r]={subtotal:t.formatNumber((s.amount||0)*(s.quantity||0),e)},s.discount&&("%"===s.discount_scheme?t.aggregations.lines[r].subtotal-=t.aggregations.lines[r].subtotal*s.discount/100:(t.aggregations.lines[r].discount=t.formatNumber(s.discount,e),t.aggregations.lines[r].subtotal-=t.aggregations.lines[r].discount)),s.exempt||!t.activeDocument.has_taxes?a+=t.formatNumber(t.aggregations.lines[r].subtotal,e):i+=t.formatNumber(t.aggregations.lines[r].subtotal,e)})),this.aggregations.exempt=this.formatNumber(a,e),this.aggregations.amount=this.formatNumber(i,e),this.aggregations.subtotal=a+i,this.invoice.discount)if("%"===this.invoice.discount_scheme){var s=this.invoice.discount/100;this.aggregations.amount-=this.formatNumber(this.aggregations.amount*s,e),this.aggregations.exempt-=this.formatNumber(this.aggregations.exempt*s,e)}else if("$"===this.invoice.discount_scheme){var r=100*this.aggregations.amount/this.aggregations.subtotal,n=100*this.aggregations.exempt/this.aggregations.subtotal;this.aggregations.amount-=this.formatNumber(this.invoice.discount*r/100,e),this.aggregations.exempt-=this.formatNumber(this.invoice.discount*n/100,e)}if(this.activeDocument.has_taxes)if(this.activeDocument.has_lines_total){var o=this.aggregations.amount;this.aggregations.amount=this.formatNumber(o/(this.activeDocument.tax/100+1),e),this.aggregations.taxes=this.formatNumber(o-this.aggregations.amount,e)}else this.aggregations.taxes=this.formatNumber(this.aggregations.amount*(this.activeDocument.tax/100),e);else this.aggregations.taxes=0;this.aggregations.total=this.formatNumber(this.aggregations.exempt+this.aggregations.amount+this.aggregations.taxes,e)},setCustomer:function(t){var e=this;this.activeCustomer=t,this.invoice.customer=t.id,this.customerQuery="",this.dialogCustomer=!1,t.sources.length?this.$store.dispatch("payments/RETRIEVE",{resource:"sources",id:t.sources[0]}).then((function(t){e.sourcesDetail=t.data})).catch((function(){e.sourcesDetail={}})):(this.sourcesDetail={},this.invoice.collection_method="deferred")},setPayment:function(){"deferred"===this.invoice.collection_method&&(this.invoice.due_date=h()(this.invoice.date).add(this.paymentDue,"days").format("YYYY-MM-DD"))},updateInvoice:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"invoice",a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.$v[e].$touch(),this.$v[e].$invalid)return!1;var i=Q()(this.invoice);delete i.subtotal,delete i.amount,delete i.exempt,delete i.tax,delete i.tax_percent,delete i.total,["automatically","deferred"].includes(this.invoice.collection_method)&&delete i.payments,this.loadingSave=!0,this.$store.dispatch("invoices/UPDATE",{resource:"invoices",id:this.instance.id,payload:i}).then((function(){a&&t.$router.push({name:"InvoiceList"})})).finally((function(){t.loadingSave=!1}))}},validations:function(){var t={customer:{required:ie["required"]},document:{required:ie["required"],currencyIsValid:function(){if(!this.invoice.customer)return!0;var t=this.activeDocument.currencies||[];return!!t.length&&t.includes(this.activeCustomer.currency)}},date:{required:ie["required"]},period_start:{required:Object(ie["requiredIf"])((function(){return this.period_end}))},period_end:{required:Object(ie["requiredIf"])((function(){return this.period_start}))},discount:{maxAmount:function(){return"$"!==this.invoice.discount_scheme||this.invoice.discount<=this.aggregations.subtotal},maxPercent:function(){return"%"!==this.invoice.discount_scheme||this.invoice.discount<=100},numeric:ie["numeric"],required:ie["required"]},lines:{$each:{amount:{required:ie["required"],decimal:ie["decimal"]},code:{maxLength:Object(ie["maxLength"])(32)},code_scheme:{maxLength:Object(ie["maxLength"])(10)},description:{maxLength:Object(ie["maxLength"])(512)},discount:{maxValue:function(t,e){return"$"===e.discount_scheme?t<=e.quantity*e.amount:"%"!==e.discount_scheme||t<=100},minValue:Object(ie["minValue"])(0),numeric:ie["numeric"],required:ie["required"]},name:{required:ie["required"],maxLength:Object(ie["maxLength"])(128)},quantity:{required:ie["required"],decimal:ie["decimal"]},unit_label:{maxLength:Object(ie["maxLength"])(4)}}},payments:{$each:{date:{required:ie["required"]},amount:{required:ie["required"],decimal:ie["decimal"]},description:{required:ie["required"],maxLength:Object(ie["maxLength"])(40)}}},references:{$each:{date:{required:ie["required"]},document:{required:ie["required"]},serial:{required:ie["required"],maxLength:Object(ie["maxLength"])(18)},description:{maxLength:Object(ie["maxLength"])(64)}}}};return{invoice:t,invoiceClone:Q()(t),paymentDue:{numeric:ie["numeric"]}}}},co=lo,uo=Object(E["a"])(co,so,ro,!1,null,null,null),vo=uo.exports;A()(uo,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRadio:Fa["a"],VRadioGroup:Ma["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var mo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.invoices.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-skeleton-template",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"InvoiceList"}}},[t._v("Facturas")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 250px;":"max-width: 300px;"},[t._v(t._s(t.instance.document.name)+" para "+t._s(t.instance.customer.name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogReminder=!0}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-email")]),t._v("Enviar factura")],1),a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("invoices")}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document")]),t._v("PDF")],1),a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"ml-1",attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("Más"),a("v-icon",{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}])},[a("v-list",{staticClass:"pa-0"},[a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:t.cloneInvoice}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[a("v-icon",{attrs:{color:"secondary",small:"",left:""}},[t._v("mdi-file-replace")]),t._v("Duplicar")],1)],1),["finalized","uncollectible"].includes(t.instance.status)?a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:t.updateCollectible}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[a("v-icon",{attrs:{color:"secondary",small:"",left:""}},[t._v("mdi-selection-ellipse-arrow-inside")]),"finalized"===t.instance.status?[t._v("Marcar como incobrable")]:[t._v("Marcar como cobrable")]],2)],1):t._e(),t.totalAdjustedInvoice>0?a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){t.dialogCreditNote=!0}}},[a("v-list-item-title",{staticClass:"subtitle-2 red--text font-weight-medium"},[a("v-icon",{attrs:{color:"red",small:"",left:""}},[t._v("mdi-arrow-collapse-down")]),t._v("Crear nota de crédito")],1)],1):t._e()],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{attrs:{md:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Total")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency)))]),a("span",[t._v(t._s(t.instance.currency))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),t.totalAdjustedInvoice1?a("v-tooltip",{attrs:{right:"","min-width":"200px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(i){var s=i.on;return[a("span",t._g({},s),[t._v("y otros "+t._s(e.recipient.length-1)+" contactos")])]}}],null,!0)},[t._l(e.recipient,(function(e,i){return[i>0?a("span",{key:i,staticClass:"d-block"},[t._v(t._s(e))]):t._e()]}))],2):t._e()],1),a("span",{staticClass:"d-block"},[t._v(t._s(t._f("dateTime")(e.created)))])])],1),a("v-divider",{key:"divider-"+i})]}))]:t._e()],2),a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Tipo de factura")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.document.name))])],1),"draft"!==t.instance.status?a("v-list-item",[a("v-list-item-title",[t._v("Número")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.number))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v("ID")]),a("v-list-item-subtitle",[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.instance.id)}}},i),[t._v(t._s(t.instance.id))])]}}])},[a("span",[t._v("Copiar")])])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información de cobranza")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Fecha de vencimiento")]),t.instance.due_date?a("v-list-item-subtitle",[t._v(t._s(t._f("date")(t.instance.due_date)))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin fecha de vencimiento")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Período de facturación")]),t.instance.period_start&&t.instance.period_end?a("v-list-item-subtitle",[t._v(t._s(t._f("date")(t.instance.period_start))+" al "+t._s(t._f("date")(t.instance.period_end)))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin especificar")])],1)],1)],1)],1)],1)],1),"CL"==t.account.country.id&&t.instance.document.has_local_format?a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Agencia fiscal")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("Opciones")])]}}],null,!1,2157976467)},[a("v-list",{staticClass:"pa-0"},[t.instance.local_file?a("v-list-item",{staticClass:"px-5 py-1",attrs:{href:t.instance.local_file,target:"_blank",ripple:!1}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Ver XML")])],1):t._e(),!t.grant.id&&[33,34].includes(t.instance.document.code)?a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){t.dialogGrant=!0}}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Ceder factura")])],1):t._e()],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-list",{staticClass:"v-list-form-extended transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),t.instance.imported?a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No disponible para facturas importados.")]):a("v-list-item-subtitle",[t.instance.tax_agency.cl_status?t.instance.tax_agency.cl_status.includes("Rechazado")?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","invoices","tax_agency_status")}}},[t._v("Actualizar estado")])],1)],1),t.instance.tax_agency.cl_status_detail?a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_agency.cl_status_detail))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v(" Track ID "),t.instance.imported||t.instance.tax_agency.cl_id?t._e():a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"red"}},i),[t._v("mdi-alert")])]}}],null,!1,2543809772)},[a("span",[t._v("Es requerido enviar a la agencia fiscal")])])],1),t.instance.imported?a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No disponible para facturas importados.")]):a("v-list-item-subtitle",[t.instance.tax_agency.cl_id?a("span",[t._v(t._s(t.instance.tax_agency.cl_id))]):a("span",[a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","invoices","tax_agency_send")}}},[t._v("Enviar a la agencia fiscal")])],1)])],1),a("v-list-item",[a("v-list-item-title",[t._v("Referencias")]),a("v-list-item-subtitle",[t.instance.references.length?t._l(t.instance.references,(function(e){return a("span",{key:e.document,staticClass:"d-block"},[t._v("• Documento tipo "+t._s(e.document)+" del "+t._s(t._f("date")(e.date))+" ID "+t._s(e.serial)+". "+t._s(e.description))])})):a("span",{staticClass:"font-italic text--disabled"},[t._v("No se registraron referencias.")])],2)],1),t.grant.id?[a("v-list-item",[a("v-list-item-title",[t._v("Archivo de cesión")]),a("v-list-item-subtitle",[a("v-btn",{attrs:{href:t.grant.file,target:"_blank",text:"",color:"primary",ripple:!1,height:"24"}},[t._v("Ir al archivo")])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Track ID de la cesión")]),a("v-list-item-subtitle",[t._v(t._s(t.grant.track_id))])],1)]:t._e(),[33,34].includes(t.instance.document.code)?a("v-list-item",[a("v-list-item-title",[t._v("Eventos")]),a("v-list-item-subtitle",[t.supplierresponsesList.length?t._l(t.supplierresponsesList,(function(e){return a("span",{key:e.id,staticClass:"d-block"},[t._v(t._s(e.code)+" "+t._s(e.description)+" Registrado el "+t._s(t._f("dateTime")(e.date_time)))])})):[a("span",{staticClass:"font-italic text--disabled mr-1"},[t._v("No existen eventos registrados en SII.")]),a("v-btn",{staticClass:"mt-n1",attrs:{loading:t.$store.state.billers.createLoader,text:"",color:"primary",ripple:!1},on:{click:t.builtInSupllierResponses}},[t._v("Actualizar eventos")])]],2)],1):t._e()],2)],1)],1):t._e(),a("v-card",{staticClass:"pa-0 my-5"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Productos")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-simple-table",{attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Producto")]),a("th",{staticClass:"text-right"},[t._v("Cantidad")]),a("th",[t._v("Unidad")]),a("th",{staticClass:"text-right"},[t._v("Precio")]),a("th",{staticClass:"text-center"},[t._v("Exento")]),a("th",{staticClass:"text-right"},[t._v("Subtotal")])])]),a("tbody",[t._l(t.instance.lines,(function(e){return[a("tr",{key:e.id,staticClass:"no-hover"},[a("td",[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(e.name))]),a("span",{staticClass:"d-block"},[t._v(t._s(e.description))])]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"d-block text--secondary"},[t._v(t._s(e.quantity))]),e.code?a("span",{staticClass:"d-block"},[e.code_scheme?[t._v(t._s(e.code_scheme)+" - ")]:t._e(),t._v(t._s(e.code))],2):t._e()]),a("td",[a("span",{staticClass:"d-block"},[t._v(t._s(e.unit||"-"))])]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"d-block text--secondary font-weight-medium"},[t._v(t._s(t._f("number")(e.amount,!1)))]),e.discount?a("span",{staticClass:"d-block"},["%"===e.discount_scheme?[t._v("- "+t._s(e.discount)+"%")]:[t._v("- "+t._s(t._f("currency")(e.discount,t.instance.currency))+" "+t._s(t.instance.currency))]],2):t._e()]),a("td",{staticClass:"text-center"},[a("v-switch",{staticClass:"mt-0 mr-n2 d-inline-block",attrs:{disabled:"",dense:"","hide-details":""},model:{value:e.exempt,callback:function(a){t.$set(e,"exempt",a)},expression:"d.exempt"}})],1),a("td",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.total,t.instance.currency))+" "+t._s(t.instance.currency))])])])]}))],2)]},proxy:!0}])}),a("v-divider"),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"4"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Subtotal")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.subtotal,t.instance.currency))+" "+t._s(t.instance.currency))])],1),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Descuento")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t.instance.discount?[t._v(" "+t._s(t._f("number")(t.instance.discount))+" "),"%"===t.instance.discount_scheme?[t._v(t._s(t.instance.discount_scheme))]:t._e(),"$"===t.instance.discount_scheme?[t._v(t._s(t.instance.currency))]:t._e()]:[t._v("-")]],2)],1),t.instance.document.has_taxes_detail?[a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.exempt,t.instance.currency))+" "+t._s(t.instance.currency))])],1),t.instance.document.has_taxes?[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.amount,t.instance.currency))+" "+t._s(t.instance.currency))])],1),a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Impuestos ("+t._s(t.instance.tax_percent)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.tax,t.instance.currency))+" "+t._s(t.instance.currency))])],1)]:t._e()]:t._e(),a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("Total factura")]),a("v-list-item-subtitle",{staticClass:"text-right body-1 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],2)],1)],1),t.creditnotesList.length?[a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{staticClass:"py-0 mt-n2",attrs:{cols:"12"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-divider"),t._l(t.creditnotesList,(function(e,i){return[a("v-list-item",{key:i,staticClass:"py-0"},[a("v-list-item-title",[a("v-btn",{attrs:{to:{name:"CreditNoteRetrieve",params:{id:e.id}},height:"20",text:"",color:"primary",ripple:!1}},[a("span",{staticClass:"d-inline-block"},[t._v(t._s(e.document.name)+" Nº "+t._s(e.number)+" de "+t._s(t._f("date")(e.date)))]),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1)],1),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.total,t.instance.currency))+" "+t._s(t.instance.currency))])],1),a("v-divider",{key:i+"-divider"})]}))],2)],1),a("v-col",{staticClass:"pt-2",attrs:{cols:"4"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Total créditos")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v("- "+t._s(t._f("currency")(t.totalCredits,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],1)],1)],1),t.debitnotesList.length?[a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{staticClass:"py-0 mt-n2",attrs:{cols:"12"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-divider"),t._l(t.debitnotesList,(function(e,i){return[a("v-list-item",{key:i,staticClass:"py-0"},[a("v-list-item-title",[a("v-btn",{attrs:{height:"20",text:"",color:"primary",ripple:!1}},[a("span",{staticClass:"d-inline-block"},[t._v(t._s(e.document.name)+" Nº "+t._s(e.number)+" de "+t._s(t._f("date")(e.date)))]),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1)],1),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.total,t.instance.currency))+" "+t._s(t.instance.currency))])],1),a("v-divider",{key:i+"-divider"})]}))],2)],1),a("v-col",{staticClass:"pt-2",attrs:{cols:"4"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Total débitos")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v("+ "+t._s(t._f("currency")(t.totalDebits,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],1)],1)],1)]:t._e(),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{staticClass:"pt-2",attrs:{cols:"4"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium"},[t._v("Total factura ajustada")]),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.totalAdjustedInvoice,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],1)],1)],1)]:t._e()],2)],1)],1),t.$store.state.invoices.retrieveLoader?t._e():a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogReminder,callback:function(e){t.dialogReminder=e},expression:"dialogReminder"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Enviar factura")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.dialogReminder=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-subtitle",{staticClass:"py-2 px-3 background"},[a("v-row",{attrs:{align:"start","no-gutters":""}},[a("v-col",{attrs:{cols:"9"}},[a("v-autocomplete",{staticClass:"ma-0",attrs:{items:t.contactsList.concat({name:"Email de facturación",email:t.instance.customer.email}),error:t.$v.reminder.recipient.$error,prefix:"Para","small-chips":"","deletable-chips":"","hide-details":!t.$v.reminder.recipient.$error,required:"",multiple:"",chips:"","item-text":"name","item-value":"email",hint:"Selecciona al menos un destinatario","no-data-text":"No existen contactos asociados al cliente","persistent-hint":"",autofocus:"",dense:"",outlined:"",color:"blue-grey lighten-2","background-color":"white"},scopedSlots:t._u([{key:"item",fn:function(e){return[t._v(t._s(e.item.name)+" ("+t._s(e.item.email)+")")]}}],null,!1,2113046645),model:{value:t.$v.reminder.recipient.$model,callback:function(e){t.$set(t.$v.reminder.recipient,"$model",e)},expression:"$v.reminder.recipient.$model"}})],1),a("v-col",{staticClass:"text-right",attrs:{cols:"3"}},[a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"ml-2",attrs:{height:"40",outlined:"",color:"secondary",ripple:!1,"retain-focus-on-click":""}},"v-btn",s,!1),i),[t._v("Elegir una plantilla")])]}}],null,!1,3721512030)},[a("v-list",{staticClass:"pa-0"},[t._l(t.templatesList,(function(e,i){return[a("v-list-item",{key:i,staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){return t.setReminderMessage(i)}}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v(t._s(e.name))])],1)]})),t.templatesList.length?a("v-divider"):t._e(),a("v-list-item",{staticClass:"px-5 py-1",attrs:{to:{name:"AccountSettingsInvoicing"},target:"_blank",ripple:!1}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Crear una plantilla"),a("v-icon",{attrs:{small:"",right:""}},[t._v("mdi-open-in-new")])],1)],1)],2)],1)],1)],1),a("v-row",{attrs:{align:"center","no-gutters":""}},[a("v-col",{attrs:{cols:"9"}},[a("v-text-field",{staticClass:"mx-0",attrs:{prefix:"Asunto",error:t.$v.reminder.subject.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"60",hint:"Escribe un asunto para el mensaje","persistent-hint":"","hide-details":!t.$v.reminder.subject.$error},model:{value:t.$v.reminder.subject.$model,callback:function(e){t.$set(t.$v.reminder.subject,"$model",e)},expression:"$v.reminder.subject.$model"}})],1),a("v-col",{attrs:{cols:"3"}},[!t.instance.payments[0]||t.instance.payments[0].enable_checkout&&["requires_payment_method","failed"].includes(t.instance.payments[0].status)?[a("v-switch",{staticClass:"ma-0 ml-3",attrs:{value:"pay",width:32,height:18,label:"Botón de pago","hide-details":""},model:{value:t.reminder.action,callback:function(e){t.$set(t.reminder,"action",e)},expression:"reminder.action"}})]:a("v-tooltip",{attrs:{bottom:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("span",t._g({staticClass:"d-block"},i),[a("v-switch",{staticClass:"ma-0 ml-3",attrs:{width:32,height:18,label:"Botón de pago",disabled:"","hide-details":""}})],1)]}}],null,!1,2571074249)},[["requires_payment_method","failed"].includes(t.instance.payments[0].status)?t.instance.payments[0].enable_checkout?t._e():a("span",[t._v("La página de pago no está habilitada para el pago de esta factura.")]):a("span",[t._v("El pago de la factura está pagado o cancelado.")])])],2)],1)],1),a("v-divider"),a("v-card-text",[a("v-row",{staticClass:"mx-0 py-5",attrs:{align:"center",justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("reminder-invoice-email",{attrs:{instance:t.instance,template:t.account.email_template,action:t.reminder.action,"color-background":t.account.color_background,message:t.reminder.message},on:{"update:message":[function(e){t.reminder.message=e},function(e){return t.$set(t.reminder,"message",e)}]}})],1)],1),a("v-row",{staticClass:"mx-0 pb-2",attrs:{justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("span",{staticClass:"mr-2 body-2 text--secondary"},[t._v("Archivos adjuntos")]),a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".pdf")],1),t.instance.local_file?a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".xml")],1):t._e()],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogReminder=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.reminders.createLoader,color:"primary"},on:{click:t.createReminder}},[t._v("Enviar")])],1)],1)],1),t.instance.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalRender,callback:function(e){t.modalRender=e},expression:"modalRender"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v(t._s("PDF "+t.instance.document.name+" Nº "+t.instance.number))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalRender=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.loaderRender?a("v-row",[a("v-col",{staticClass:"py-0 ma-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"rounded-0",attrs:{transition:"fade-transition",type:"table"}})],1)],1):t.loaderRender||t.renderUrl?t._e():a("v-row",[a("v-col",{staticClass:"py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-image-broken-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("PDF no disponible")])],1)],1),a("div",{attrs:{id:"render"}})],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{href:t.renderUrl,download:t.instance.document.id+"_N"+t.instance.number,color:"primary",dark:""}},[t._v("Descargar PDF")])],1)],1)],1):t._e(),t.$store.state.invoices.retrieveLoader?t._e():a("credit-note-create",{attrs:{"show-create":t.dialogCreditNote},on:{"update:dialog":function(e){t.dialogCreditNote=e},"update:create":t.retrieve}}),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogGrant,callback:function(e){t.dialogGrant=e},expression:"dialogGrant"}},[a("v-card",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Crear cesión de la factura")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogGrant=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{staticClass:"py-6"},[a("v-col",{attrs:{md:"10"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",{staticClass:"pt-2"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Cedente")])])],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("RUT")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{directives:[{name:"dni",rawName:"v-dni",value:"CL",expression:"'CL'"}],staticClass:"mt-3",attrs:{error:t.$v.grant.tax_id.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"32"},model:{value:t.$v.grant.tax_id.$model,callback:function(e){t.$set(t.$v.grant.tax_id,"$model",e)},expression:"$v.grant.tax_id.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-text-field",{staticClass:"mt-3",attrs:{error:t.$v.grant.name.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"32"},model:{value:t.$v.grant.name.$model,callback:function(e){t.$set(t.$v.grant.name,"$model",e)},expression:"$v.grant.name.$model"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-text-field",{staticClass:"mt-3",attrs:{error:t.$v.grant.email.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"56"},model:{value:t.$v.grant.email.$model,callback:function(e){t.$set(t.$v.grant.email,"$model",e)},expression:"$v.grant.email.$model"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{staticClass:"mt-3",attrs:{error:t.$v.grant.address.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"36"},model:{value:t.$v.grant.address.$model,callback:function(e){t.$set(t.$v.grant.address,"$model",e)},expression:"$v.grant.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-6"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Cesionario")])])],1),a("v-list-item",{staticClass:"pb-2"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-text-field",{staticClass:"mt-3",attrs:{error:t.$v.grant.assignor_email.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"36"},model:{value:t.$v.grant.assignor_email.$model,callback:function(e){t.$set(t.$v.grant.assignor_email,"$model",e)},expression:"$v.grant.assignor_email.$model"}})],1)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogGrant=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.billers.createLoader,color:"primary"},on:{click:t.createGrant}},[t._v("Crear cesión")])],1)],1)],1)],1)},po=[],ho=(a("c975"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-dialog",{attrs:{width:"980",persistent:"","no-click-animation":"",scrollable:"",fullscreen:t.fullscreen},model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[a("v-card",{staticClass:"pa-0"},[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Crear nota de crédito"),a("v-chip",{staticClass:"ml-3",attrs:{color:"primary","text-color":"white",small:""}},[t._v("Beta")])],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-tooltip",{attrs:{bottom:"","max-width":"280px",transition:"scale-transition","open-delay":"1000"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.fullscreen=!t.fullscreen}}},i),[t.fullscreen?a("v-icon",{attrs:{size:"24"}},[t._v("mdi-fullscreen-exit")]):a("v-icon",{attrs:{size:"24"}},[t._v("mdi-fullscreen")])],1)]}}])},[t.fullscreen?a("span",[t._v("Salir de pantalla completa")]):a("span",[t._v("Pantalla completa")])]),a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialog=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",[a("v-col",{staticClass:"px-3 py-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Items de crédito")])],1),a("v-divider"),a("v-simple-table",{attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Nombre")]),a("th",{staticClass:"text-left",staticStyle:{width:"80px"}},[t._v("Exento")]),a("th",{staticClass:"text-right",staticStyle:{width:"100px"}},[t._v("Cant.")]),a("th",{staticClass:"text-right",staticStyle:{width:"140px"}},[t._v("Precio")]),a("th",{staticClass:"text-right",staticStyle:{width:"200px"}},[t._v("Descuento")]),a("th",{staticClass:"text-right",staticStyle:{width:"120px"}},[t._v("Subtotal")]),a("th",{staticClass:"text-right",staticStyle:{width:"60px"}})])]),a("tbody",[t._l(t.creditNote.lines,(function(e,i){return[a("tr",{key:i,staticClass:"no-hover"},[a("td",[a("v-text-field",{attrs:{error:t.$v.creditNote.lines.$each[i].name.$error,"background-color":"transparent",solo:"",required:"","single-line":"",flat:"",dense:"",placeholder:"Escribe un nombre para el producto",maxlength:"80","hide-details":""},model:{value:e.name,callback:function(a){t.$set(e,"name","string"===typeof a?a.trim():a)},expression:"d.name"}}),a("v-text-field",{staticClass:"mt-n4",attrs:{error:t.$v.creditNote.lines.$each[i].description.$error,"background-color":"transparent",required:"","single-line":"",solo:"",flat:"",dense:"",placeholder:"Descripción del producto",maxlength:"1000","hide-details":""},model:{value:e.description,callback:function(a){t.$set(e,"description","string"===typeof a?a.trim():a)},expression:"d.description"}})],1),a("td",[a("v-switch",{attrs:{disabled:!t.invoice.document.has_taxes},model:{value:e.exempt,callback:function(a){t.$set(e,"exempt",a)},expression:"d.exempt"}})],1),a("td",[a("v-tooltip",{attrs:{top:"","max-width":"280px",transition:"scale-transition",disabled:t.$v.creditNote.lines.$each[i].quantity.required},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("v-text-field",t._g({attrs:{error:t.$v.creditNote.lines.$each[i].quantity.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"","background-color":"transparent","single-line":"",reverse:"",outlined:"",dense:"",placeholder:"0",maxlength:"12","hide-details":""},model:{value:t.$v.creditNote.lines.$each[i].quantity.$model,callback:function(e){t.$set(t.$v.creditNote.lines.$each[i].quantity,"$model",t._n(e))},expression:"$v.creditNote.lines.$each[i].quantity.$model"}},s))]}}],null,!0)},[t._v(" La cantidad del item no puede estar en blanco. El valor mínimo es 0. ")])],1),a("td",[a("v-tooltip",{attrs:{top:"","max-width":"280px",transition:"scale-transition",disabled:t.$v.creditNote.lines.$each[i].amount.required},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("v-text-field",t._g({attrs:{error:t.$v.creditNote.lines.$each[i].amount.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"","background-color":"transparent","single-line":"",reverse:"",outlined:"",dense:"",placeholder:"0",maxlength:"12","hide-details":""},model:{value:t.$v.creditNote.lines.$each[i].amount.$model,callback:function(e){t.$set(t.$v.creditNote.lines.$each[i].amount,"$model",t._n(e))},expression:"$v.creditNote.lines.$each[i].amount.$model"}},s))]}}],null,!0)},[t._v(" El precio del item no puede estar en blanco. El valor mínimo es 0. ")])],1),a("td",[a("v-row",{attrs:{justify:"end",dense:""}},[a("v-col",{attrs:{cols:"5"}},[a("v-select",{attrs:{items:t.discountSchemes,"item-text":"name","item-value":"value","hide-details":"true",solo:"",outlined:"",flat:"",dense:""},scopedSlots:t._u([{key:"selection",fn:function(e){var i=e.item;return[a("span",{staticClass:"px-1 ml-1"},[t._v(t._s(i.value))])]}}],null,!0),model:{value:e.discount_scheme,callback:function(a){t.$set(e,"discount_scheme",a)},expression:"d.discount_scheme"}})],1),a("v-col",{attrs:{cols:"7"}},[a("v-tooltip",{attrs:{top:"","max-width":"280px",transition:"scale-transition",disabled:t.$v.creditNote.lines.$each[i].discount.maxValue},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("v-text-field",t._g({attrs:{error:t.$v.creditNote.lines.$each[i].discount.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"","background-color":"transparent","single-line":"",reverse:"",outlined:"",dense:"",placeholder:"0",maxlength:"12","hide-details":""},model:{value:t.$v.creditNote.lines.$each[i].discount.$model,callback:function(e){t.$set(t.$v.creditNote.lines.$each[i].discount,"$model",t._n(e))},expression:"$v.creditNote.lines.$each[i].discount.$model"}},s))]}}],null,!0)},["%"===t.creditNote.lines[i].discount_scheme?[t._v("El porcentaje del descuento no puede ser mayor al 100% del subtotal del item.")]:t._e(),"$"===t.creditNote.lines[i].discount_scheme?[t._v("El monto del descuento no puede ser mayor a "+t._s(t._f("currency")((t.creditNote.lines[i].amount||0)*(t.creditNote.lines[i].quantity||0),t.invoice.currency))+" "+t._s(t.invoice.currency))]:t._e()],2)],1)],1)],1),a("td",{staticClass:"text-right",staticStyle:{"max-width":"156px"}},[t.$v.creditNote.lines.$each[i].amount.$error||t.$v.creditNote.lines.$each[i].discount.$error||t.$v.creditNote.lines.$each[i].quantity.$error?a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("-")]):a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v(t._s(t._f("currency")(t.aggregations.lines[i].total,t.invoice.currency))+" "+t._s(t.invoice.currency))])]),a("td",{staticClass:"text-right"},[i>=1||t.creditNote.lines.length>1?a("v-btn",{attrs:{icon:"",small:"",color:"red"},on:{click:function(e){return t.creditNote.lines.splice(i,1)}}},[a("v-icon",{attrs:{size:"18"}},[t._v("mdi-close")])],1):t._e()],1)])]}))],2)]},proxy:!0}])}),a("v-divider")],1)],1),t.totalAdjustedInvoice<0?a("v-row",[a("v-col",{staticClass:"px-7 pb-0",attrs:{cols:"12"}},[a("v-alert",{staticClass:"mb-0",attrs:{text:"",dense:"",border:"left",type:"error",icon:"mdi-alert"}},[t._v(" El total de la nota de crédito supera el total de la factura ("+t._s(t._f("currency")(t.totalInvoice,t.invoice.currency))+" "+t._s(t.invoice.currency)+"). Reduce la cantidad o precio en los items. ")])],1)],1):t._e(),a("v-row",[a("v-col",{staticClass:"px-7",attrs:{cols:"6"}},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:t.addLine}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar un item de crédito")],1)],1),a("v-col",{staticClass:"px-3",attrs:{cols:"6"}},[a("v-list",{staticClass:"pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Subtotal")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.subtotal,t.invoice.currency)))]],2)],1),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Descuento")]),a("v-list-item-subtitle",{staticClass:"text-right"},[a("v-row",{attrs:{align:"center",justify:"end",dense:""}},[a("v-col",{attrs:{cols:"4"}},[a("v-select",{staticClass:"mr-1",attrs:{items:t.discountSchemes,"item-text":"name","item-value":"value","hide-details":"true",solo:"",outlined:"",flat:"",dense:""},scopedSlots:t._u([{key:"selection",fn:function(e){var i=e.item;return[a("span",{staticClass:"px-1 ml-1"},[t._v(t._s(i.value))])]}}]),model:{value:t.creditNote.discount_scheme,callback:function(e){t.$set(t.creditNote,"discount_scheme",e)},expression:"creditNote.discount_scheme"}})],1),a("v-col",{attrs:{cols:"6"}},[a("v-tooltip",{attrs:{top:"","max-width":"280px",transition:"scale-transition",disabled:t.$v.creditNote.discount.maxValue},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-text-field",t._g({attrs:{error:t.$v.creditNote.discount.$error,oninput:"this.value=this.value.replace(/[^0-9]/g,'');","background-color":"white",reverse:"",outlined:"",required:"","single-line":"",dense:"",maxlength:"20",placeholder:"0","hide-details":""},model:{value:t.$v.creditNote.discount.$model,callback:function(e){t.$set(t.$v.creditNote.discount,"$model",t._n(e))},expression:"$v.creditNote.discount.$model"}},i))]}}])},["%"===t.creditNote.discount_scheme?[t._v("El descuento no puede superar el 100%")]:t._e(),"$"===t.creditNote.discount_scheme?[t._v("El monto del descuento no puede ser mayor a "+t._s(t._f("currency")(t.aggregations.subtotal,t.invoice.currency))+" "+t._s(t.invoice.currency))]:t._e()],2)],1)],1),t.aggregations.discount&&"%"===t.creditNote.discount_scheme?a("span",[t._v("- "+t._s(t._f("number")(t.aggregations.discount)))]):t._e()],1)],1),a("v-divider",{staticClass:"ml-4 my-1"}),t.invoice.document.has_taxes_detail?[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.exempt,t.invoice.currency)))]],2)],1),t.invoice.document.has_taxes?[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.amount,t.invoice.currency)))]],2)],1),a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",[a("v-list-item-title",[t._v("Impuestos ("+t._s(t.invoice.document.tax)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.taxes,t.invoice.currency)))]],2)],1)]:t._e(),a("v-divider",{staticClass:"ml-4 my-1"})]:t._e(),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",{staticClass:"text-left body-1 text--secondary font-weight-medium"},[t._v("Total de la nota crédito")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.total,t.invoice.currency))+" "+t._s(t.invoice.currency))]],2)],1),a("v-list-item",{staticClass:"py-0 mt-6"},[a("v-list-item-title",{staticClass:"text-left text--secondary font-weight-medium"},[t._v(" Total de la factura "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Es el total original de la factura menos el total de todas las notas de crédito previamente creadas.")])])],1),a("v-list-item-subtitle",{staticClass:"text-right text--secondary font-weight-medium",class:{"red--text":t.aggregations.total<0}},[t._v(t._s(t._f("currency")(t.totalInvoice,t.invoice.currency))+" "+t._s(t.invoice.currency))])],1),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",{staticClass:"text-left text--secondary font-weight-medium"},[t._v("Total de la factura ajustada")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.totalAdjustedInvoice<0||t.linesWithError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.totalAdjustedInvoice,t.invoice.currency))+" "+t._s(t.invoice.currency))]],2)],1)],2)],1)],1),a("v-divider",{staticClass:"my-3"}),a("v-row",[a("v-col",{staticClass:"py-0",attrs:{cols:"10"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Fecha")])]),a("v-list-item-subtitle",[a("v-row",{staticClass:"mx-0"},[a("v-col",{attrs:{cols:"6"}},[a("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"",transition:"scale-transition","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-text-field",t._g(t._b({attrs:{error:t.$v.creditNote.date.$error,"background-color":"white",outlined:"","single-line":"",dense:"",readonly:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[a("v-icon",{staticClass:"mr-3",attrs:{size:"20px",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.creditNote.date.$model,callback:function(e){t.$set(t.$v.creditNote.date,"$model",e)},expression:"$v.creditNote.date.$model"}},"v-text-field",s,!1),i))]}}]),model:{value:t.dateMenu,callback:function(e){t.dateMenu=e},expression:"dateMenu"}},[a("v-date-picker",{attrs:{"no-title":"",min:t.invoice.date,max:t.today,type:"date",locale:"es-cl",width:"280",color:"blue"},on:{input:function(e){t.dateMenu=!1}},model:{value:t.$v.creditNote.date.$model,callback:function(e){t.$set(t.$v.creditNote.date,"$model",e)},expression:"$v.creditNote.date.$model"}},[a("div",{staticClass:"mx-auto"},[a("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.creditNote.date.$model=t.today}}},[t._v("Hoy")]),a("v-btn",{staticClass:"ml-2",attrs:{outlined:""},on:{click:function(){t.$v.creditNote.date.$model=""}}},[t._v("Limpiar")])],1)])],1)],1)],1)],1)],1)],1),a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Razón de la anulación")]),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Escribe una razón por la cual crearás la nota de crédito. Esto será visible para tu cliente.")])])],1),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.creditNote.note.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"60"},model:{value:t.$v.creditNote.note.$model,callback:function(e){t.$set(t.$v.creditNote.note,"$model",e)},expression:"$v.creditNote.note.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Nota interna "),a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Opcional")])],1),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Utiliza este campo para proveer información adicional sobre el ajuste de crédito. Esto no será visible para tu cliente.")])])],1),a("v-list-item-subtitle",[a("v-textarea",{attrs:{error:t.$v.creditNote.internal_note.$error,"background-color":"white",outlined:"","hide-details":"",required:"",maxlength:"512"},model:{value:t.$v.creditNote.internal_note.$model,callback:function(e){t.$set(t.$v.creditNote.internal_note,"$model",e)},expression:"$v.creditNote.internal_note.$model"}})],1)],1)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:t.setCreditNote}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-undo-variant")]),t._v("Restablecer valores")],1),a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialog=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.createLoader,color:"primary"},on:{click:t.create}},[t._v("Crear nota de crédito")])],1)],1)],1)}),fo=[],bo={props:{showCreate:{type:Boolean}},mixins:[$]},go={mixins:[bo,no],data:function(){return{aggregations:{lines:[{total:0}],amount:0,exempt:0,subtotal:0,taxes:0,total:0},createLoader:!1,creditNote:{date:"",discount:0,discount_scheme:"%",invoice:"",internal_note:"",lines:[{amount:null,description:"",discount:0,discount_scheme:"%",exempt:!1,name:"",quantity:null}],note:""},dateMenu:!1,discountSchemes:[{name:"% - Porcentaje",value:"%"},{name:"$ - Monto",value:"$"}],dialog:!1,fullscreen:!1}},created:function(){this.setCreditNote()},computed:Object(i["a"])({activeCurrency:function(){var t=this;return this.currencies.find((function(e){return e.id===t.invoice.currency}))||{}},aggregationsSource:function(){return{discount:this.creditNote.discount,discount_scheme:this.creditNote.discount_scheme,lines:this.creditNote.lines.map((function(t){return{amount:t.amount,discount:t.discount,discount_scheme:t.discount_scheme,exempt:t.exempt,quantity:t.quantity}}))}},handledErrors:function(){return this.baseHandledErrors.concat([{action:"Cargar folios",message:"La cuenta no tiene un folio válido para Nota de crédito.",route:{name:"BillersBuiltIn",query:{ref:"folios"}},snippet:"not have a valid folio"}])},linesWithError:function(){var t=this.$v.creditNote.lines;return this.creditNote.lines.filter((function(e,a){return t.$each[a].amount.$error||t.$each[a].discount.$error||t.$each[a].quantity.$error}))},totalCredits:function(){return this.sumProperty(this.creditnotesList,"total")},totalDebits:function(){return this.sumProperty(this.debitnotesList,"total")},totalInvoice:function(){return this.invoice.total-this.totalCredits+this.totalDebits},totalAdjustedInvoice:function(){return this.totalInvoice-this.aggregations.total}},Object(u["c"])({invoice:function(t){return t.invoices.invoicesDetail},creditnotesList:function(t){return t.invoices.creditnotesList},debitnotesList:function(t){return t.invoices.debitnotesList}})),watch:{dialog:{handler:function(t){this.$emit("update:dialog",t)}},showCreate:{handler:function(t){this.dialog=!!t}},aggregationsSource:{handler:function(){this.setAggregations()},deep:!0}},methods:{create:function(){var t=this;if(this.$v.creditNote.$touch(),this.$v.creditNote.$invalid||this.$v.aggregations.$invalid)return!1;this.$dialog.warning({title:"Crear nota de crédito",text:'\n Al continuar se\n 1. Ajustará el total de la factura a '.concat(this.$options.filters.currency(this.totalAdjustedInvoice,this.invoice.currency)," ").concat(this.invoice.currency,"\n ").concat(this.invoice.document.has_local_format?'2. Enviará la nota de crédito a la agencia fiscal de '+this.account.country.name+"":"",'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n '),actions:[{color:"primary",text:"Crear nota de crédito",handle:function(){t.createLoader=!0,t.$store.dispatch("invoices/CREATE",{resource:"creditnotes",payload:t.creditNote,commitInstance:!1}).then((function(e){t.$store.dispatch("invoices/RETRIEVE",{resource:"creditnotes",detail:"finalize",id:e.data.id,loader:!1,setDetail:!1}).then((function(e){t.dialog=!1,t.$router.push({name:"CreditNoteRetrieve",params:{id:e.data.id}})})).catch((function(a){t.$store.dispatch("invoices/DESTROY",{resource:"creditnotes",id:e.data.id,commitInstance:!1});var i=a.response.data;if(i.non_field_errors){var s=t.handledErrors.find((function(t){return i.non_field_errors.includes(t.snippet)}));s?t.$dialog.message.error(s.message,{timeout:1e4,actions:[{text:s.action,color:"red darken-4",handle:function(){if(s.route){var e=t.$router.resolve(s.route);window.open(e.href,"_blank")}}}]}):t.$dialog.message.error(t.parseErrors(a.response.data))}else t.$dialog.message.error(t.parseErrors(a.response.data))})).finally((function(){t.createLoader=!1}))})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data)),t.createLoader=!1}))}}]})},addLine:function(){this.creditNote.lines.push({amount:null,description:"",discount:0,discount_scheme:"%",exempt:!this.invoice.document.has_taxes,name:"",quantity:1})},setCreditNote:function(){var t=this;this.creditNote=Object.assign({},{date:this.today,discount:this.invoice.discount,discount_scheme:this.invoice.discount_scheme,invoice:this.invoice.id,internal_note:"",lines:this.invoice.lines.map((function(e,a){var i={amount:e.amount,description:e.description,discount:e.discount||0,discount_scheme:e.discount_scheme||"%",exempt:!t.invoice.document.has_taxes||e.exempt,name:e.name,quantity:e.quantity};return t.invoice.document.has_taxes&&t.invoice.document.has_lines_total&&(i.amount=t.formatNumber(i.amount/(t.invoice.document.tax/100+1),!1)),i})),note:""}),this.setAggregations(),this.$v.creditNote.lines.$touch()},setAggregations:function(){var t=this,e=this.activeCurrency.format&&0===this.activeCurrency.format.precision,a=0,i=0;if(this.creditNote.lines.forEach((function(s,r){t.aggregations.lines[r]={total:t.formatNumber((s.amount||0)*(s.quantity||0),e)},s.discount&&("%"===s.discount_scheme?t.aggregations.lines[r].total-=t.aggregations.lines[r].total*s.discount/100:(t.aggregations.lines[r].discount=t.formatNumber(s.discount,e),t.aggregations.lines[r].total-=t.aggregations.lines[r].discount)),s.exempt?a+=t.formatNumber(t.aggregations.lines[r].total,e):i+=t.formatNumber(t.aggregations.lines[r].total,e)})),this.aggregations.exempt=this.formatNumber(a,e),this.aggregations.amount=this.formatNumber(i,e),this.aggregations.subtotal=a+i,this.creditNote.discount)if("%"===this.creditNote.discount_scheme){var s=this.creditNote.discount/100;this.aggregations.amount-=this.formatNumber(this.aggregations.amount*s,e),this.aggregations.exempt-=this.formatNumber(this.aggregations.exempt*s,e)}else if("$"===this.creditNote.discount_scheme){var r=100*this.aggregations.amount/this.aggregations.subtotal,n=100*this.aggregations.exempt/this.aggregations.subtotal;this.aggregations.amount-=this.formatNumber(this.creditNote.discount*r/100,e),this.aggregations.exempt-=this.formatNumber(this.creditNote.discount*n/100,e)}this.aggregations.taxes=this.formatNumber(this.invoice.document.has_taxes_detail?this.aggregations.amount*(this.invoice.document.tax/100):0,e),this.aggregations.total=this.formatNumber(this.aggregations.exempt+this.aggregations.amount+this.aggregations.taxes,e)}},validations:{aggregations:{total:{maxValue:function(){return this.totalAdjustedInvoice>=0}}},creditNote:{date:{required:ie["required"]},discount:{numeric:ie["numeric"],maxValue:function(){return"$"===this.creditNote.discount_scheme?this.creditNote.discount<=this.aggregations.subtotal:"%"!==this.creditNote.discount_scheme||this.creditNote.discount<=100}},internal_note:{maxLength:Object(ie["maxLength"])(1024)},lines:{$each:{amount:{required:ie["required"],decimal:ie["decimal"]},description:{maxLength:Object(ie["maxLength"])(512)},discount:{numeric:ie["numeric"],maxValue:function(t,e){return"$"===e.discount_scheme?t<=e.quantity*e.amount:"%"!==e.discount_scheme||t<=100}},name:{required:ie["required"],maxLength:Object(ie["maxLength"])(128)},quantity:{required:ie["required"],decimal:ie["decimal"]}}},note:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)}}}},_o=go,yo=Object(E["a"])(_o,ho,fo,!1,null,null,null),Co=yo.exports;A()(yo,{VAlert:ne["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VTextarea:_a["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var xo={data:function(){return{loaderRender:!1,renderUrl:null,modalRender:!1}},created:function(){this.$loadScript("/static/js/pdfobject.min.js")},methods:{renderDocument:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pdf",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.$route.params.id;if(this.modalRender=!0,this.renderUrl)return!1;this.loaderRender=!0,this.$store.dispatch("".concat(t,"/RETRIEVE"),{resource:null===a?t:a,detail:i,id:s,setDetail:!1,loader:!1}).then((function(t){for(var a=atob(t.data.file),i=new Array(a),s=0;s=0&&this.$v.reminder.recipient.$model.splice(e,1)},createGrant:function(){var t=this;if(this.$v.grant.$touch(),this.$v.grant.$invalid)return!1;this.grant.invoice=this.instance.id,this.$store.dispatch("billers/CREATE",{resource:"billers/built_in/grants",payload:this.grant}).then((function(e){t.grant=e.data,t.dialogGrant=!1})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},cloneInvoice:function(){var t=this,e=h()(this.today).add(30,"days").format("YYYY-MM-DD"),a=Q()(this.instance);delete a.id,delete a.imported,delete a.local_file,delete a.metadata,delete a.number,delete a.status,delete a.subscription,delete a.tax_agency,delete a.test_mode,delete a.created,delete a.updated,a.collection_method="deferred",a.customer=this.instance.customer.id,a.date=this.today,a.document=this.instance.document.id,a.due_date=e,a.lines.map((function(t){return Object.keys(t).forEach((function(e){["created","id","invoice","updated","total","total_adjusted"].includes(e)&&delete t[e],t.discount||(t.discount=0,t.discount_scheme="%")})),t})),a.payments=[{amount:this.instance.total,date:e,description:"Pago de factura",currency:this.instance.currency}],this.loadingInvoiceDuplicate=!0,this.$store.dispatch("invoices/CREATE",{resource:"invoices",payload:a}).then((function(e){t.$router.push("/invoices/".concat(e.data.id,"/edit"))})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loadingInvoiceDuplicate=!1}))},builtInSupllierResponses:function(){var t=this;this.$store.dispatch("billers/CREATE",{resource:"billers/built_in/supplierresponses",payload:{invoice:this.instance.id}}).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},updateCollectible:function(){var t=this,e="Marcar como incobrable",a="Esta factura no será considerada como pendiente de pago, pero será posible pagarla si el cliente lo intenta.",i="La factura se marcó como incobrable";"uncollectible"===this.instance.status&&(e="Marcar como cobrable",a="Esta factura volverá a ser considerada como pendiente de pago.",i="La factura se marcó como cobrable"),this.$dialog.warning({title:e,text:'\n '.concat(a,'\n ¿Estás seguro de continuar?\n '),actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("invoices/RETRIEVE",{resource:"invoices",id:t.$route.params.id,detail:"uncollectible",loader:!1}).then((function(){t.$dialog.message.info(i)})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})}},validations:{reminder:{recipient:{required:ie["required"],maxLength:Object(ie["maxLength"])(8)},subject:{required:ie["required"],minLength:Object(ie["minLength"])(6),maxLength:Object(ie["maxLength"])(60)},message:{required:ie["required"]}},grant:{tax_id:{required:ie["required"],maxLength:Object(ie["maxLength"])(32),rutValidator:_r["rutValidator"]},name:{required:ie["required"],maxLength:Object(ie["maxLength"])(32)},address:{required:ie["required"],maxLength:Object(ie["maxLength"])(56)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(36)},assignor_email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(36)}}}},$o=wo,ko=a("c6a6"),Vo=Object(E["a"])($o,mo,po,!1,null,null,null),Lo=Vo.exports;A()(Vo,{VAutocomplete:ko["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemIcon:At["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var So=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-tabs",{attrs:{"background-color":"background",color:"primary",grow:"",height:"55","slider-size":"4"}},[a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/invoices",exact:""}},[t._v("Todas las facturas")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/invoices?status=draft",exact:""}},[t._v("Borradores")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/invoices?status=finalized",exact:""}},[t._v("Por cobrar")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/invoices?status=finalized&due_date__lte="+t.today,exact:""}},[t._v("Vencidas")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/invoices?status=paid",exact:""}},[t._v("Pagadas")])],1)],1),a("v-card",{staticClass:"px-0 mt-5"},[t.$store.state.invoices.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Facturas")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"invoice"}}),a("v-menu",{attrs:{"min-width":"160px","close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{outlined:"",color:"secondary"}},"v-btn",s,!1),i),[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v(" Nuevo")],1)]}}])},[a("v-list",{staticClass:"pa-0 text-right"},[a("v-list-item",{staticClass:"px-5 py-1",attrs:{to:{name:"InvoiceCreate"}}},[a("v-list-item-title",{staticClass:"subtitle-2 font-weight-medium"},[t._v("Factura única")])],1),a("v-list-item",{staticClass:"px-5 py-1",attrs:{to:{name:"InvoiceBulkListCreate"}}},[a("v-list-item-title",{staticClass:"subtitle-2 font-weight-medium"},[t._v("Facturación masiva")])],1)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("invoice-list",{attrs:{"show-create":!0}})],1)],1)],1)],1)},To=[],Eo={components:{InvoiceList:Tn,VQueryBuilder:dn},mixins:[k],data:function(){return{filters:wn}},created:function(){var t=this;this.$store.dispatch("generals/LIST",{resource:"generals/documents",query:{country__id__in:"".concat(this.account.country.id,", US"),is_sale:"True"}}).then((function(e){if(e.data.results&&e.data.results.length){var a=t.filters.findIndex((function(t){return"document"===t.id}));t.filters[a].choices=e.data.results.map((function(t){return{label:t.name,value:t.id}}))}}))},methods:{getList:function(){this.$store.dispatch("invoices/LIST",{resource:"invoices",query:this.$route.query})}}},Do=Eo,Ao=Object(E["a"])(Do,So,To,!1,null,null,null),jo=Ao.exports;A()(Ao,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTab:Ua["a"],VTabs:Ha["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var qo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.bulks.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"InvoiceBulkListCreate"}}},[t._v("Facturación masiva")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("code",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.instance.id))])],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[t.instance.only_draft&&["pending","failed","finalized"].includes(t.instance.status)||!t.instance.only_draft&&["pending","failed"].includes(t.instance.status)?[a("v-btn",{staticClass:"d-block",attrs:{outlined:"",color:"red","retain-focus-on-click":"",ripple:!1},on:{click:t.destroy}},[t._v("Eliminar proceso")])]:t._e()],2)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0 background"},[a("v-row",{staticClass:"px-4"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Facturas")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t.count))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Creado el")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("date")(t.instance.created)))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Estado")]),"pending"===t.instance.status?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Pendiente")]):t._e(),"processing"===t.instance.status?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Procesando")]):t._e(),"finalized"===t.instance.status?a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Finalizado"),a("v-icon",{attrs:{"x-small":""}},[t._v("mdi-check")])],1):t._e(),"failed"===t.instance.status?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Fallido"),a("v-icon",{attrs:{"x-small":""}},[t._v("mdi-close")])],1):t._e()],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"4"}},[a("div",{staticClass:"text-left d-flex",attrs:{"d-flex":""}},[t.instance.send_email?a("v-icon",{attrs:{small:"",color:"primary"}},[t._v("mdi-check")]):a("v-icon",{attrs:{small:"",color:"red"}},[t._v("mdi-close")]),a("span",{staticClass:"ml-1"},[t._v("Enviar email")])],1),a("div",{staticClass:"text-left d-flex mt-2"},[t.instance.only_draft?a("v-icon",{attrs:{small:"",color:"primary"}},[t._v("mdi-check")]):a("v-icon",{attrs:{small:"",color:"red"}},[t._v("mdi-close")]),a("span",{staticClass:"ml-1"},[t._v("Generar solo borradores")])],1)])],1),a("v-divider"),a("invoice-list",{attrs:{"has-link":!1,"show-status":"pending"!==t.instance.status,"show-create":!0,"show-sort":!1,"show-select-row":"pending"===t.instance.status,"show-pagination":!1}}),a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[a("v-col",{attrs:{cols:"6"}},[a("v-btn",{attrs:{to:{name:"InvoiceList",query:{bulk:t.instance.id}},outlined:"",color:"secondary"}},[t._v("Ver todas las facturas")])],1),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},["pending"===t.instance.status?a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:t.finalize}},[t._v("Aprobar todo")]):t._e()],1)],1)],1)],1)],1)],1)},Io=[],Oo={mixins:[$],components:{InvoiceList:Tn,VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{}},created:function(){this.retrieve()},computed:Object(u["c"])({count:function(t){return t.invoices.invoicesCount},instance:function(t){return t.bulks.invoicesDetail},invoicesList:function(t){return t.invoices.invoicesList}}),methods:{retrieve:function(){var t=this;this.$store.dispatch("bulks/RETRIEVE",{resource:"bulks/invoices",id:this.$route.params.id}).then((function(){t.$store.dispatch("invoices/LIST",{resource:"invoices",query:{bulk:t.$route.params.id,page_size:10}})}))},destroy:function(){var t=this;this.$dialog.warning({title:"Eliminar proceso",text:'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("bulks/DESTROY",{resource:"bulks/invoices",id:t.$route.params.id}).then((function(){t.$router.push({name:"InvoiceBulkListCreate"})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})},finalize:function(){var t=this;this.$dialog.warning({title:"Crear facturación",text:'\n Al confirmar:\n Se crearán '.concat(this.instance.only_draft?"los borradores":"las facturas",'\n ').concat(this.instance.send_email?"Se enviarán a cada cliente":"",'\n Esta acción no se puede deshacer\n '),actions:[{color:"primary",text:"Continuar",handle:function(){t.$store.dispatch("bulks/CREATE",{resource:"bulks/invoices",detail:"finalize",id:t.$route.params.id,payload:{invoices:"all"}}).then((function(){t.instance.only_draft?t.$router.push({name:"InvoiceList",query:{bulk:t.instance.id}}):t.$router.push({name:"InvoiceBulkListCreate",query:{status:"processing"}})})).catch((function(e){t.$dialog.message.error(e.response.data.non_field_errors||"Error al confirmar la facturación.")}))}}]})}}},Ro=Oo,No=Object(E["a"])(Ro,qo,Io,!1,null,null,null),Po=No.exports;A()(No,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var Bo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-tabs",{attrs:{"background-color":"background",color:"primary",grow:"",height:"55","slider-size":"4"}},[a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/bulks/invoices",exact:""}},[t._v("Todos los procesos")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/bulks/invoices?status=pending",exact:""}},[t._v("Pendiente")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/bulks/invoices?status=processing",exact:""}},[t._v("Procesando")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/bulks/invoices?status=finalized",exact:""}},[t._v("Finalizado")])],1)],1),a("v-card",{staticClass:"px-0 mt-5"},[t.$store.state.bulks.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Facturación masiva")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"invoices"}}),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!0}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v(" Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[t.$store.state.bulks.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.invoicesList.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.invoicesList,"items-per-page":t.pagination,"mobile-breakpoint":"","hide-default-footer":"","hide-default-header":"","disable-sort":""},on:{"click:row":function(e){return t.$router.push({name:"InvoiceBulkRetrieve",params:{id:e.id}})}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.id",fn:function(e){var i=e.item;return[a("code",{staticClass:"body-2 text--secondary"},[t._v(t._s(i.id))])]}},{key:"item.status",fn:function(e){var i=e.item;return[t.showStatus?a("div",{staticClass:"text-right"},["pending"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Pendiente")]):"processing"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Procesando")]):"finalized"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Finalizado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):"failed"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Fallido"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):t._e()],1):t._e()]}},{key:"item.invoices",fn:function(e){var i=e.item;return[a("div",{staticClass:"text-right"},[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.invoices.length))])])]}},{key:"item.created",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(t._f("date")(i.created)))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-file")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen procesos")]),a("v-btn",{staticClass:"my-5",attrs:{outlined:""},on:{click:function(e){t.dialogCreate=!0}}},[t._v("Crear facturación masiva")])],1)]],2)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":""},model:{value:t.dialogCreate,callback:function(e){t.dialogCreate=e},expression:"dialogCreate"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear facturación masiva")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",ripple:!1,small:""},on:{click:function(e){t.dialogCreate=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background-card"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Fuente de datos")]),a("v-list-item-subtitle",[a("v-file-input",{attrs:{error:t.$v.newBulk.file.$error,type:"file",accept:".csv,.xlsx,.json",prepend:"mdi-paper-clip","hide-details":"","background-color":"transparent",placeholder:"No se eligió ningún archivo",solo:"",flat:"",chips:""},model:{value:t.file,callback:function(e){t.file=e},expression:"file"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Formato")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"4"}},[a("v-select",{attrs:{error:t.$v.newBulk.import_format.$error,items:t.importFormats,"item-text":"importFormats","item-value":"importFormats","hide-details":"","single-line":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.$v.newBulk.import_format.$model,callback:function(e){t.$set(t.$v.newBulk.import_format,"$model",e)},expression:"$v.newBulk.import_format.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Generar sólo borradores")]),a("v-list-item-subtitle",{attrs:{absolute:""}},[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.newBulk.only_draft,callback:function(e){t.$set(t.newBulk,"only_draft",e)},expression:"newBulk.only_draft"}})],1)],1),a("v-list-item",{staticClass:"py-2"},[a("v-list-item-title",[t._v("Enviar vía email al cliente")]),a("v-list-item-subtitle",[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},attrs:{disabled:t.newBulk.only_draft},model:{value:t.newBulk.send_email,callback:function(e){t.$set(t.newBulk,"send_email",e)},expression:"newBulk.send_email"}})],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCreate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.bulks.createLoader,color:"primary"},on:{click:t.createInvoiceBulk}},[t._v("Continuar")])],1)],1)],1)],1)},zo=[],Fo={components:{VQueryBuilder:dn,VTableHeaders:Mi},mixins:[k],data:function(){return{file:null,newBulk:{file:null,import_format:"",send_email:!1,only_draft:!1},importFormats:["csv","xlsx","json"],filters:[{type:"text",id:"invoices__customer",label:"Cliente",operators:["contiene"]},{type:"text",id:"date",label:"Fecha de creación",operators:["es igual","es menor a","es mayor a"]}],headers:[{text:"ID",value:"id",class:"font-weight-bold",sortable:!0},{text:"",value:"status",sortable:!1},{text:"Documentos",value:"invoices",align:"end",sortable:!1},{text:"Creado",value:"created",align:"end",sortable:!0}],dialogCreate:!1}},computed:Object(u["c"])({count:function(t){return t.bulks.invoicesCount},invoicesList:function(t){return t.bulks.invoicesList}}),watch:{"newBulk.only_draft":function(){this.newBulk.only_draft&&(this.newBulk.send_email=!1)}},methods:{getList:function(){this.$store.dispatch("bulks/LIST",{resource:"bulks/invoices",query:this.$route.query})},createInvoiceBulk:function(){var t=this;if(this.newBulk.file=this.file,this.$v.newBulk.$touch(),this.$v.newBulk.$invalid)return!1;var e=new FormData;e.append("file",this.newBulk.file,this.newBulk.file.name),e.append("import_format",this.newBulk.import_format),e.append("send_email",this.newBulk.send_email),e.append("only_draft",this.newBulk.only_draft),this.$store.dispatch("bulks/CREATE",{resource:"bulks/invoices",payload:e,headers:{"Content-Type":"multipart/form-data"}}).then((function(e){t.$router.push({name:"InvoiceBulkRetrieve",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{newBulk:{file:{required:ie["required"]},import_format:{required:ie["required"]}}}},Mo=Fo,Uo=Object(E["a"])(Mo,Bo,zo,!1,null,null,null),Go=Uo.exports;A()(Uo,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDataTable:Ai["a"],VDialog:xe["a"],VDivider:tt["a"],VFileInput:ki["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VPagination:ji["a"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTab:Ua["a"],VTabs:Ha["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var Ho=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.invoices.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-skeleton-template",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"InvoiceList"}}},[t._v("Facturas")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"InvoiceRetrieve",params:{id:t.instance.invoice.id}}}},[t._v(t._s(t.instance.invoice.document.name)+" Nº "+t._s(t.instance.invoice.number))]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium"},[t._v("Nota de crédito Nº "+t._s(t.instance.number))])],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogReminder=!0}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-email")]),t._v("Enviar nota de crédito")],1),a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("invoices","creditnotes")}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document")]),t._v("PDF")],1),"finalized"===t.instance.status?a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"red darken-2","retain-focus-on-click":""},on:{click:function(e){t.dialogDebitNote=!0}}},[t._v("Nota de débito")]):t._e()],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Total")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.invoice.currency)))]),a("span",[t._v(t._s(t.instance.invoice.currency))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"3"}},[a("span",{staticClass:"d-block mb-1 text-truncate",staticStyle:{"max-width":"200px"}},[t._v(t._s(t.instance.invoice.customer.name))]),a("v-btn",{attrs:{to:{name:"InvoiceRetrieve",params:{id:t.instance.invoice.id}},text:"",color:"primary",height:"20","retain-focus-on-click":"",ripple:!1}},[t._v(t._s(t.instance.invoice.document.name)+" Nº "+t._s(t.instance.invoice.number)),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1)],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Fecha")]),a("div",{staticClass:"body-1 font-weight-medium mt-1"},[t._v(t._s(t._f("date")(t.instance.date)))])])],1),a("v-divider"),a("v-list",[t.debitnotesList.length?[t._l(t.debitnotesList,(function(e,i){return[a("v-list-item",{key:e.id,staticClass:"py-3"},[a("v-list-item-icon",[a("v-icon",{attrs:{color:"primary"}},[t._v("mdi-text-box")])],1),a("v-list-item-title",[a("v-btn",{attrs:{to:{name:"DebitNoteRetrieve",params:{id:e.id}},text:"",color:"primary",height:"20",ripple:!1}},[t._v(t._s(e.document.name)+" Nº "+t._s(e.number))]),a("span",{staticClass:"ml-1"},[t._v("por "+t._s(e.note))]),a("span",{staticClass:"d-block"},[t._v(t._s(t._f("dateTime")(e.created)))])],1)],1),a("v-divider",{key:i+"-cd-divider"})]}))]:t._e(),t.messagesList.length?[t._l(t.messagesList,(function(e,i){return[a("v-list-item",{key:i,staticClass:"py-3"},[a("v-list-item-icon",[a("v-icon",{attrs:{color:"primary"}},[t._v("mdi-email-send")])],1),a("v-list-item-title",[a("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v("La nota de crédito fue enviada a "+t._s(e.recipient[0])+" "),e.recipient.length>1?[t._v("y otros "+t._s(e.recipient.length-1)+" contactos")]:t._e(),t._v(" por "+t._s(e.user))],2),a("span",{staticClass:"d-block"},[t._v(t._s(t._f("dateTime")(e.created)))])])],1),a("v-divider",{key:"divider-"+i})]}))]:t._e()],2),a("v-row",[a("v-col",{staticClass:"pb-0",attrs:{cols:"12"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nota de la anulación")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.note))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado por")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.user))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nota interna")])],1),a("v-list-item",[t.instance.internal_note?a("v-list-item-subtitle",[t._v(t._s(t.instance.internal_note))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin nota interna")])],1)],1)],1)],1)],1)],1),"CL"==t.account.country.id&&t.instance.document.has_local_format?a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Gestión agencia fiscal")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-menu",{attrs:{left:"","close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"160px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{outlined:"","retain-focus-on-click":""}},"v-btn",s,!1),i),[t._v("Acciones")])]}}],null,!1,3254774847)},[a("v-btn",{attrs:{href:t.instance.local_file,target:"_blank",text:"",height:"30",width:"160","retain-focus-on-click":"",ripple:!1}},[t._v("Descargar XML")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"8"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t.instance.tax_agency.cl_status?t.instance.tax_agency.cl_status.includes("Rechazado")?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","creditnotes","tax_agency_status")}}},[t._v("Actualizar estado")])],1)],1),t.instance.tax_agency.cl_status_detail?a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_agency.cl_status_detail))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v(" Track ID "),t.instance.tax_agency.cl_id?t._e():a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"red"}},i),[t._v("mdi-alert")])]}}],null,!1,2543809772)},[a("span",[t._v("Es requerido enviar a la agencia fiscal")])])],1),a("v-list-item-subtitle",{staticClass:"text-left"},[t.instance.tax_agency.cl_id?a("span",[t._v(t._s(t.instance.tax_agency.cl_id))]):a("span",[a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","creditnotes","tax_agency_send")}}},[t._v("Enviar a la agencia fiscal")])],1)])],1)],1)],1)],1)],1)],1):t._e()],1),t.$store.state.invoices.retrieveLoader?t._e():a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogReminder,callback:function(e){t.dialogReminder=e},expression:"dialogReminder"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Enviar nota de crédito")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.dialogReminder=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-subtitle",{staticClass:"py-2 px-3 background"},[a("v-row",{attrs:{align:"center","no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[a("v-autocomplete",{staticClass:"mx-0",attrs:{items:t.contactsList.concat({name:"Email de facturación",email:t.instance.invoice.customer.email}),error:t.$v.reminder.recipient.$error,prefix:"Para","small-chips":"","deletable-chips":"","hide-details":!t.$v.reminder.recipient.$error,required:"",multiple:"",chips:"","item-text":"name","item-value":"email",hint:"Selecciona al menos un destinatario","no-data-text":"No existen contactos asociados al cliente","persistent-hint":"",autofocus:"",dense:"",outlined:"",color:"blue-grey lighten-2","background-color":"white"},scopedSlots:t._u([{key:"item",fn:function(e){return[t._v(t._s(e.item.name)+" ("+t._s(e.item.email)+")")]}}],null,!1,2113046645),model:{value:t.$v.reminder.recipient.$model,callback:function(e){t.$set(t.$v.reminder.recipient,"$model",e)},expression:"$v.reminder.recipient.$model"}})],1)],1),a("v-row",{attrs:{align:"center","no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{staticClass:"mx-0",attrs:{error:t.$v.reminder.subject.$error,prefix:"Asunto","background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"60",hint:"Escribe un asunto para el mensaje","persistent-hint":"","hide-details":!t.$v.reminder.subject.$error},model:{value:t.$v.reminder.subject.$model,callback:function(e){t.$set(t.$v.reminder.subject,"$model",e)},expression:"$v.reminder.subject.$model"}})],1)],1)],1),a("v-divider"),a("v-card-text",[a("v-row",{staticClass:"mx-0 py-5",attrs:{align:"center",justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("reminder-credit-note-email",{attrs:{instance:t.instance,template:t.account.email_template,"color-background":t.account.color_background,message:t.reminder.message},on:{"update:message":[function(e){t.reminder.message=e},function(e){return t.$set(t.reminder,"message",e)}]}})],1)],1),a("v-row",{staticClass:"mx-0 pb-2",attrs:{justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("span",{staticClass:"mr-2 body-2 text--secondary"},[t._v("Archivos adjuntos")]),a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".pdf")],1),t.instance.local_file?a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".xml")],1):t._e()],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogReminder=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.reminders.createLoader,color:"primary"},on:{click:t.createReminder}},[t._v("Enviar")])],1)],1)],1),t.instance.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalRender,callback:function(e){t.modalRender=e},expression:"modalRender"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("PDF Nota de crédito Nº "+t._s(t.instance.number))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalRender=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.loaderRender?a("v-row",[a("v-col",{staticClass:"py-0 ma-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"rounded-0",attrs:{transition:"fade-transition",type:"table"}})],1)],1):t.loaderRender||t.renderUrl?t._e():a("v-row",[a("v-col",{staticClass:"py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-image-broken-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("PDF no disponible")])],1)],1),a("div",{attrs:{id:"render"}})],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{href:t.renderUrl,download:"Credit_Note_N"+t.instance.number,color:"primary"}},[t._v("Descargar PDF")])],1)],1)],1):t._e(),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogDebitNote,callback:function(e){t.dialogDebitNote=e},expression:"dialogDebitNote"}},[a("v-card",{staticClass:"pa-0"},[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Crear nota de débito"),a("v-chip",{staticClass:"ml-3",attrs:{color:"primary","text-color":"white",small:""}},[t._v("Beta")])],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogDebitNote=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Fecha")])]),a("v-list-item-subtitle",[a("v-row",{staticClass:"mx-0"},[a("v-col",{attrs:{cols:"6"}},[a("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"",transition:"scale-transition","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-text-field",t._g(t._b({attrs:{error:t.$v.debitNote.date.$error,"background-color":"white",outlined:"","single-line":"",dense:"",readonly:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[a("v-icon",{staticClass:"mr-3",attrs:{size:"20px",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.debitNote.date.$model,callback:function(e){t.$set(t.$v.debitNote.date,"$model",e)},expression:"$v.debitNote.date.$model"}},"v-text-field",s,!1),i))]}}]),model:{value:t.dateMenu,callback:function(e){t.dateMenu=e},expression:"dateMenu"}},[a("v-date-picker",{attrs:{"no-title":"",min:t.instance.date,max:t.today,type:"date",locale:"es-cl",width:"280",color:"blue"},on:{input:function(e){t.dateMenu=!1}},model:{value:t.$v.debitNote.date.$model,callback:function(e){t.$set(t.$v.debitNote.date,"$model",e)},expression:"$v.debitNote.date.$model"}},[a("div",{staticClass:"mx-auto"},[a("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.debitNote.date.$model=t.today}}},[t._v("Hoy")]),a("v-btn",{staticClass:"ml-2",attrs:{outlined:""},on:{click:function(){t.$v.debitNote.date.$model=""}}},[t._v("Limpiar")])],1)])],1)],1)],1)],1)],1)],1),a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Razón de la anulación")]),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Escribe una razón por la cual crearás la nota de débito. Esto será visible para tu cliente.")])])],1),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.debitNote.note.$error,"background-color":"white",outlined:"","hide-details":"",required:"","single-line":"",dense:"",maxlength:"60"},model:{value:t.$v.debitNote.note.$model,callback:function(e){t.$set(t.$v.debitNote.note,"$model",e)},expression:"$v.debitNote.note.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-content",[a("v-list-item-title",[a("span",{staticClass:"mr-3 text--secondary font-weight-medium"},[t._v("Nota interna "),a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Opcional")])],1),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Utiliza este campo para proveer información adicional sobre esta nota de débito. Esto no será visible para tu cliente.")])])],1),a("v-list-item-subtitle",[a("v-textarea",{attrs:{error:t.$v.debitNote.internal_note.$error,"background-color":"white",outlined:"","hide-details":"",required:"",maxlength:"512"},model:{value:t.$v.debitNote.internal_note.$model,callback:function(e){t.$set(t.$v.debitNote.internal_note,"$model",e)},expression:"$v.debitNote.internal_note.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogDebitNote=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.invoices.createLoader,color:"primary"},on:{click:t.createDebitNote}},[t._v("Crear nota de débito")])],1)],1)],1)],1)},Yo=[],Wo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",["admiral"===t.template?a("header-admiral",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"classic"===t.template?a("header-classic",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"modern"===t.template?a("header-modern",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):t._e(),a("email-footer")],1)],1)},Qo=[],Ko=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{staticClass:"background"},[a("v-row",{staticClass:"px-3",attrs:{justify:"start"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{staticClass:"background"},[a("v-row",[a("v-col",{staticClass:"pb-0",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.invoice.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-3"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.invoice.currency))+" "+t._s(t.instance.invoice.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0"},[a("v-row",[a("v-col",{staticClass:"pa-0 pb-2",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},Xo=[],Jo={mixins:[fa]},Zo=Jo,tl=Object(E["a"])(Zo,Ko,Xo,!1,null,null,null),el=tl.exports;A()(tl,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var al=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"border-top: 3px solid "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.invoice.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-5"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.invoice.currency))+" "+t._s(t.instance.invoice.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0 pb-2 background"},[a("v-row",[a("v-col",{staticClass:"pa-0",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"background-color":"background","auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},il=[],sl={mixins:[fa]},rl=sl,nl=Object(E["a"])(rl,al,il,!1,null,null,null),ol=nl.exports;A()(nl,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var ll=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",color:"white",rounded:"circle",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 white--text font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 white--text font-weight-regular"},[t._v("para "+t._s(t.instance.invoice.customer.name))])])],1)],1),a("v-card-text",{staticClass:"py-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("span",{staticClass:"d-block body-1 font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.invoice.currency))+" "+t._s(t.instance.invoice.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0 pb-2"},[a("v-row",[a("v-col",{staticClass:"pa-0",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},cl=[],dl={mixins:[fa]},ul=dl,vl=Object(E["a"])(ul,ll,cl,!1,null,null,null),ml=vl.exports;A()(vl,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var pl={props:{template:{type:String,required:!1,default:function(){return"modern"}}},components:{EmailFooter:va,HeaderAdmiral:el,HeaderClassic:ol,HeaderModern:ml},mixins:[fa]},hl=pl,fl=Object(E["a"])(hl,Wo,Qo,!1,null,null,null),bl=fl.exports;A()(fl,{VCol:q["a"],VRow:z["a"]});var gl={inject:["theme"],mixins:[$,xo,no],components:{ReminderCreditNoteEmail:bl,VSkeletonTemplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{dateMenu:!1,debitNote:{credit_note:"",date:"",internal_note:"",note:""},dialogDebitNote:!1,dialogReminder:!1,reminder:{credit_note:"",recipient:"",subject:"",message:""}}},created:function(){this.retrieve()},computed:Object(u["c"])({instance:function(t){return t.invoices.creditnotesDetail},contactsList:function(t){return t.customers.contactsList},debitnotesList:function(t){return t.invoices.debitnotesList},messagesList:function(t){return t.reminders.messagesList}}),methods:{retrieve:function(){var t=this;this.$store.dispatch("invoices/RETRIEVE",{resource:"creditnotes",id:this.$route.params.id,query:{expand:"document,invoice"}}).then((function(){t.$store.dispatch("invoices/LIST",{resource:"debitnotes",query:{expand:"document",credit_note:t.instance.id}})})).then((function(){t.$store.dispatch("reminders/LIST",{resource:"reminders/messages",query:{credit_note:t.instance.id}})})).then((function(){t.$store.dispatch("customers/LIST",{resource:"contacts",query:{customer:t.instance.invoice.customer.id}})})).then((function(){t.reminder.credit_note=t.instance.id,t.reminder.subject="".concat(t.instance.document.name," Nº ").concat(t.instance.number),t.reminder.message="Hola ".concat(t.instance.invoice.customer.name,",\n\n"),t.reminder.message+="adjunto ".concat(t.instance.document.name," N° ").concat(t.instance.number," "),t.reminder.message+="para ".concat(t.instance.invoice.document.name," "),t.reminder.message+="Nº ".concat(t.instance.invoice.number," del ").concat(t.$options.filters.date(t.instance.date)," "),t.reminder.message+="por un monto de ".concat(t.$options.filters.currency(t.instance.total,t.instance.invoice.currency)," "),t.reminder.message+="".concat(t.instance.invoice.currency,"\n\nAtte. ").concat(t.account.name)})).then((function(){t.debitNote.credit_note=t.instance.id,t.debitNote.date=t.today}))},createReminder:function(){var t=this;if(this.$v.reminder.$touch(),this.$v.reminder.$invalid)return!1;this.$store.dispatch("reminders/CREATE",{resource:"reminders/messages",payload:this.reminder}).then((function(){t.dialogReminder=!1})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},createDebitNote:function(){var t=this;if(this.$v.debitNote.$touch(),this.$v.debitNote.$invalid)return!1;this.$dialog.warning({title:"Crear nota de débito",text:'\n Al continuar\n 1. La nota de crédito será anulada\n 2. El total de '.concat(this.instance.invoice.document.name," Nº ").concat(this.instance.invoice.number," será ajustado a ").concat(this.$options.filters.currency(this.instance.invoice.total_adjusted+this.instance.total,this.instance.invoice.currency)," ").concat(this.instance.invoice.currency,'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n '),actions:[{color:"primary",text:"Crear nota de débito",handle:function(){t.createLoader=!0,t.$store.dispatch("invoices/CREATE",{resource:"debitnotes",payload:t.debitNote}).then((function(e){t.$router.push({name:"DebitNoteRetrieve",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})}},validations:{reminder:{recipient:{required:ie["required"],maxLength:Object(ie["maxLength"])(8)},subject:{required:ie["required"],minLength:Object(ie["minLength"])(6),maxLength:Object(ie["maxLength"])(60)},message:{required:ie["required"]}},debitNote:{date:{required:ie["required"]},internal_note:{maxLength:Object(ie["maxLength"])(1024)},note:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)}}}},_l=gl,yl=Object(E["a"])(_l,Ho,Yo,!1,null,null,null),Cl=yl.exports;A()(yl,{VAutocomplete:ko["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemIcon:At["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VTextarea:_a["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var xl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.invoices.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-skeleton-template",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"CreditNoteRetrieve",params:{id:t.instance.credit_note.id}}}},[t._v(t._s(t.instance.credit_note.document.name)+" Nº "+t._s(t.instance.credit_note.number))]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium"},[t._v("Nota de débito Nº "+t._s(t.instance.number))])],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("invoices","debitnotes")}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document")]),t._v("PDF")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Total")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.credit_note.invoice.currency)))]),a("span",[t._v(t._s(t.instance.credit_note.invoice.currency))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"3"}},[a("span",{staticClass:"d-block mb-1 text-truncate",staticStyle:{"max-width":"200px"}},[t._v(t._s(t.instance.credit_note.invoice.customer.name))]),a("v-btn",{attrs:{to:{name:"CreditNoteRetrieve",params:{id:t.instance.credit_note.id}},text:"",color:"primary",height:"20","retain-focus-on-click":"",ripple:!1}},[t._v(t._s(t.instance.credit_note.document.name)+" Nº "+t._s(t.instance.credit_note.number)),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1)],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Fecha")]),a("div",{staticClass:"body-1 font-weight-medium mt-1"},[t._v(t._s(t._f("date")(t.instance.date)))])])],1),a("v-divider"),a("v-row",[a("v-col",{staticClass:"pb-0",attrs:{cols:"12"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nota de la anulación")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.note))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado por")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.user))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nota interna")])],1),a("v-list-item",[t.instance.internal_note?a("v-list-item-subtitle",[t._v(t._s(t.instance.internal_note))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin nota interna")])],1)],1)],1)],1)],1)],1),"CL"==t.account.country.id&&t.instance.document.has_local_format?a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Gestión agencia fiscal")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-menu",{attrs:{left:"","close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"160px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{outlined:"","retain-focus-on-click":""}},"v-btn",s,!1),i),[t._v("Acciones")])]}}],null,!1,3254774847)},[a("v-btn",{attrs:{href:t.instance.local_file,target:"_blank",text:"",height:"30",width:"160","retain-focus-on-click":"",ripple:!1}},[t._v("Descargar XML")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"8"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t.instance.tax_agency.cl_status?t.instance.tax_agency.cl_status.includes("Rechazado")?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","debitnotes","tax_agency_status")}}},[t._v("Actualizar estado")])],1)],1),t.instance.tax_agency.cl_status_detail?a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_agency.cl_status_detail))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v(" Track ID "),t.instance.tax_agency.cl_id?t._e():a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"red"}},i),[t._v("mdi-alert")])]}}],null,!1,2543809772)},[a("span",[t._v("Es requerido enviar a la agencia fiscal")])])],1),a("v-list-item-subtitle",{staticClass:"text-left"},[t.instance.tax_agency.cl_id?a("span",[t._v(t._s(t.instance.tax_agency.cl_id))]):a("span",[a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("invoices","debitnotes","tax_agency_send")}}},[t._v("Enviar a la agencia fiscal")])],1)])],1)],1)],1)],1)],1)],1):t._e()],1),t.instance.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalRender,callback:function(e){t.modalRender=e},expression:"modalRender"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("PDF Nota de débito Nº "+t._s(t.instance.number))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalRender=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.loaderRender?a("v-row",[a("v-col",{staticClass:"py-0 ma-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"rounded-0",attrs:{transition:"fade-transition",type:"table"}})],1)],1):t.loaderRender||t.renderUrl?t._e():a("v-row",[a("v-col",{staticClass:"py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-image-broken-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("PDF no disponible")])],1)],1),a("div",{attrs:{id:"render"}})],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{href:t.renderUrl,download:"Debit_Note_N"+t.instance.number,color:"primary"}},[t._v("Descargar PDF")])],1)],1)],1):t._e()],1)},wl=[],$l={inject:["theme"],mixins:[$,xo,no],components:{VSkeletonTemplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},created:function(){this.retrieve()},computed:Object(u["c"])({instance:function(t){return t.invoices.debitnotesDetail}}),methods:{retrieve:function(){this.$store.dispatch("invoices/RETRIEVE",{resource:"debitnotes",id:this.$route.params.id,query:{expand:"credit_note.invoice,credit_note.document,document"}})}}},kl=$l,Vl=Object(E["a"])(kl,xl,wl,!1,null,null,null),Ll=Vl.exports;A()(Vl,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Sl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.loadingInitial?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"card-heading, image, actions"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-card-text",{staticClass:"py-4 background"},[a("v-row",{attrs:{justify:"space-between"}},[t.order.customer?a("v-col",{attrs:{cols:"6"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"48"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Cliente")])],1),a("v-divider"),a("v-list",{staticClass:"transparent",attrs:{"two-line":""}},[a("v-list-item",[a("v-menu",{attrs:{"open-on-hover":"",bottom:"","offset-y":"","nudge-bottom":15,"close-delay":100,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-list-item-content",t._g({},i),[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v(t._s(t.activeCustomer.name))]),a("v-list-item-subtitle",{staticClass:"text--primary"},[t._v(t._s(t.activeCurrency.id)+" - "+t._s(t.activeCurrency.name))])],1)]}}])},[a("v-card",[a("v-card-text",[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("ID Fiscal")]),t.activeCustomer.tax_id?a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.tax_id))]):a("v-list-item-subtitle",{staticClass:"text--disabled font-italic"},[t._v("Sin ID Fiscal")])],1),a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.address))])],1),a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.state.name))])],1),a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.country.name))])],1),a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.email))])],1),a("v-list-item",{staticClass:"px-0"},[a("v-list-item-title",[t._v("Teléfono")]),t.activeCustomer.phone?a("v-list-item-subtitle",[t._v(t._s(t.activeCustomer.phone))]):a("v-list-item-subtitle",{staticClass:"text--disabled font-italic"},[t._v("Sin teléfono")])],1)],1)],1)],1)],1),a("v-list-item-action",[a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCustomer=!0}}},[t._v("Cambiar...")])],1)],1)],1),a("v-divider")],1):a("v-col",{staticClass:"text-center py-5",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-account")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Selecciona un cliente para continuar")]),a("v-btn",{staticClass:"my-5",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogCustomer=!0}}},[t._v("Seleccionar un cliente")])],1),t.order.customer?a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-right text--secondary font-weight-medium"},[t._v("Tipo de factura")]),a("v-list-item-subtitle",{staticClass:"ml-4"},[a("v-select",{attrs:{error:t.$v.order.document.$error,items:t.selectDocuments,"item-value":"id","item-text":"name","menu-props":{overflowY:!0,transition:"slide-y-transition"},height:"30","background-color":"white","single-line":"",outlined:"",dense:"","hide-details":""},scopedSlots:t._u([{key:"item",fn:function(e){return[a("v-list-item-title",{staticClass:"font-weight-regular"},[t._v(t._s(e.item.name))])]}}],null,!1,245714575),model:{value:t.$v.order.document.$model,callback:function(e){t.$set(t.$v.order.document,"$model",e)},expression:"$v.order.document.$model"}})],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-right text--secondary font-weight-medium"},[t._v("Fecha")]),a("v-list-item-subtitle",{staticClass:"ml-4"},[a("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-text-field",t._g(t._b({attrs:{error:t.$v.order.date.$error,"background-color":"white",outlined:"","single-line":"",dense:"",readonly:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[a("v-icon",{staticClass:"mr-3",attrs:{small:"",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.order.date.$model,callback:function(e){t.$set(t.$v.order.date,"$model",e)},expression:"$v.order.date.$model"}},"v-text-field",s,!1),i))]}}],null,!1,2377017402),model:{value:t.datePickerMenuOrderDate,callback:function(e){t.datePickerMenuOrderDate=e},expression:"datePickerMenuOrderDate"}},[a("v-date-picker",{attrs:{min:"2020-01-01","no-title":"","first-day-of-week":1,type:"date",locale:"es",width:"270",color:"primary"},on:{input:function(e){t.datePickerMenuOrderDate=!1}},model:{value:t.$v.order.date.$model,callback:function(e){t.$set(t.$v.order.date,"$model",e)},expression:"$v.order.date.$model"}},[a("v-row",{staticClass:"py-2 px-6",attrs:{align:"center",justify:"end"}},[a("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.order.date.$model=t.today,t.datePickerMenuOrderDate=!1}}},[t._v("Hoy")])],1)],1)],1)],1)],1)],1)],1):t._e()],1),a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información del despacho")])],1),a("v-divider"),a("v-list",{staticClass:"v-list-form transparent py-6"},[a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list-item",[a("v-list-item-title",[t._v("Tipo de envío")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.order.shipping_type.$error,items:t.shippingTypes,"item-text":"label","item-value":"value","menu-props":{overflowY:!0,transition:"slide-y-transition"},height:"30","background-color":"white","single-line":"",outlined:"",dense:"","hide-details":""},model:{value:t.$v.order.shipping_type.$model,callback:function(e){t.$set(t.$v.order.shipping_type,"$model",e)},expression:"$v.order.shipping_type.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Dirección de envío")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"12"}},[a("v-text-field",{attrs:{outlined:"","single-line":"",maxlength:"70",error:t.$v.order.address.$error,dense:"","hide-details":"","background-color":"white"},model:{value:t.$v.order.address.$model,callback:function(e){t.$set(t.$v.order.address,"$model",e)},expression:"$v.order.address.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"8"}},[a("v-select",{attrs:{items:t.countriesList,"item-value":"id","item-text":"name","menu-props":{overflowY:!0,transition:"slide-y-transition"},height:"30","background-color":"white","single-line":"",outlined:"",dense:"","hide-details":""},model:{value:t.order.country,callback:function(e){t.$set(t.order,"country",e)},expression:"order.country"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"8"}},[a("v-select",{attrs:{items:t.statesList,"item-value":"id","item-text":"name","menu-props":{overflowY:!0,transition:"slide-y-transition"},height:"30","background-color":"white","single-line":"",outlined:"",dense:"","hide-details":"","no-data-text":"No existen estados para el país."},model:{value:t.order.state,callback:function(e){t.$set(t.order,"state",e)},expression:"order.state"}})],1)],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list-item",[a("v-list-item-title",[t._v("Nombre del conductor")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.order.carrier_name.$error,outlined:"","single-line":"",dense:"",maxlength:"30","hide-details":"","background-color":"white"},model:{value:t.$v.order.carrier_name.$model,callback:function(e){t.$set(t.$v.order.carrier_name,"$model",e)},expression:"$v.order.carrier_name.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("ID del conductor")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"7"}},[a("v-text-field",{attrs:{error:t.$v.order.carrier_id.$error,outlined:"","single-line":"",dense:"",maxlength:"10","hide-details":"","background-color":"white"},model:{value:t.$v.order.carrier_id.$model,callback:function(e){t.$set(t.$v.order.carrier_id,"$model",e)},expression:"$v.order.carrier_id.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Patente del transporte")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"7"}},[a("v-text-field",{staticClass:"pa-0",attrs:{outlined:"","single-line":"",error:t.$v.order.licence_plate.$error,dense:"",maxlength:"7","hide-details":"","background-color":"white"},model:{value:t.$v.order.licence_plate.$model,callback:function(e){t.$set(t.$v.order.licence_plate,"$model",e)},expression:"$v.order.licence_plate.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Comentario adicional")]),a("v-list-item-subtitle",[a("v-col",{staticClass:"px-0 py-1",attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.order.note.$error,outlined:"","single-line":"",dense:"",maxlength:"100","hide-details":"","background-color":"white"},model:{value:t.$v.order.note.$model,callback:function(e){t.$set(t.$v.order.note,"$model",e)},expression:"$v.order.note.$model"}})],1)],1)],1)],1)],1)],1),a("v-row",{staticClass:"mt-8",attrs:{justify:"space-between"}},[a("v-col",{attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"20"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Productos")])],1)],1)],1),a("v-divider"),a("v-row",{staticClass:"px-5",attrs:{justify:"space-between"}},[a("v-col",{staticClass:"pl-2",attrs:{cols:"4"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Producto")])]),a("v-col",{staticClass:"px-0",attrs:{cols:"1"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Cantidad")])]),a("v-col",{staticClass:"px-0",attrs:{cols:"1"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Unidad")])]),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"110px"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Precio")])]),a("v-col",{staticClass:"px-0 text-center",staticStyle:{"max-width":"50px"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Exento")])]),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"110px"}},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v("Subtotal")])]),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"30px"}})],1),a("v-divider"),t._l(t.order.lines,(function(e,i){return[a("v-row",{key:"line-"+i,staticClass:"v-sm-text-fields px-5",attrs:{align:"start",justify:"space-between"}},[a("v-col",{staticClass:"pl-1",attrs:{cols:"4"}},[a("v-text-field",{attrs:{error:t.$v.order.lines.$each[i].name.$error,required:"",maxlength:"80",placeholder:"Escribe un nombre...","background-color":"white",height:"16",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.lines.$each[i].name.$model,callback:function(e){t.$set(t.$v.order.lines.$each[i].name,"$model","string"===typeof e?e.trim():e)},expression:"$v.order.lines.$each[i].name.$model"}}),a("v-text-field",{attrs:{error:t.$v.order.lines.$each[i].description.$error,required:"",maxlength:"512",placeholder:"Escribe una descripción...","background-color":"white",height:"16",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.lines.$each[i].description.$model,callback:function(e){t.$set(t.$v.order.lines.$each[i].description,"$model","string"===typeof e?e.trim():e)},expression:"$v.order.lines.$each[i].description.$model"}})],1),a("v-col",{staticClass:"px-0",attrs:{cols:"1"}},[a("v-text-field",{attrs:{error:t.$v.order.lines.$each[i].quantity.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"",maxlength:"12",placeholder:"0","background-color":"white",height:"16",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.lines.$each[i].quantity.$model,callback:function(e){t.$set(t.$v.order.lines.$each[i].quantity,"$model",t._n(e))},expression:"$v.order.lines.$each[i].quantity.$model"}})],1),a("v-col",{staticClass:"px-0",attrs:{cols:"1"}},[a("v-text-field",{attrs:{error:t.$v.order.lines.$each[i].unit_label.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",maxlength:"4",placeholder:"C/U","background-color":"white",height:"16",outlined:"",flat:"",dense:"","hide-details":""},model:{value:e.unit_label,callback:function(a){t.$set(e,"unit_label","string"===typeof a?a.trim():a)},expression:"d.unit_label"}})],1),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"110px"}},[a("v-text-field",{attrs:{error:t.$v.order.lines.$each[i].amount.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"",maxlength:"12",placeholder:"0","single-line":"","background-color":"white",height:"16",reverse:"",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.lines.$each[i].amount.$model,callback:function(e){t.$set(t.$v.order.lines.$each[i].amount,"$model",t._n(e))},expression:"$v.order.lines.$each[i].amount.$model"}})],1),a("v-col",{staticClass:"px-0 text-center",staticStyle:{"max-width":"50px"}},[a("v-switch",{staticClass:"mt-0 mr-n2 d-inline-block",attrs:{disabled:!t.activeDocument.has_taxes,dense:"","hide-details":""},model:{value:e.exempt,callback:function(a){t.$set(e,"exempt",a)},expression:"d.exempt"}})],1),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"110px"}},[a("span",{staticClass:"d-block mt-0 mb-9 text--secondary body-2 font-weight-medium"},[t.$v.order.lines.$each[i].amount.$error||t.$v.order.lines.$each[i].quantity.$error?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.lines[i].subtotal,t.activeCurrency.id))+" "+t._s(t.activeCurrency.id))]],2)]),a("v-col",{staticClass:"px-0 text-right",staticStyle:{"max-width":"30px"}},[a("v-btn",{staticClass:"mt-0 mb-9",attrs:{disabled:1===t.order.lines.length,"min-width":"20","max-width":"20","min-height":"28","max-height":"28",text:"",color:"red",ripple:!1},on:{click:function(e){return t.order.lines.splice(i,1)}}},[a("v-icon",{attrs:{size:"20"}},[t._v("mdi-delete")])],1)],1)],1),a("v-divider",{key:"divider-"+i})]})),a("v-row",{staticClass:"px-4",attrs:{"no-gutters":""}},[a("v-col",{staticClass:"text-left"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:t.addOrderLine}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar un producto")],1)],1)],1),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"5"}},[a("v-list",{staticClass:"v-list-form pa-0 transparent"},[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Subtotal")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.linesWithAmountsError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.subtotal,t.activeCurrency.id)))]],2)],1),t.activeDocument.has_taxes_detail?[a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.linesWithAmountsError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.exempt,t.activeCurrency.id)))]],2)],1),t.activeDocument.has_taxes?[a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.linesWithAmountsError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.amount,t.activeCurrency.id)))]],2)],1),a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",[a("v-list-item-title",[t._v("Impuestos ("+t._s(t.activeDocument.tax)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t.linesWithAmountsError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.taxes,t.activeCurrency.id)))]],2)],1)]:t._e()]:t._e(),a("v-divider",{staticClass:"ml-4 my-1"}),a("v-list-item",{staticClass:"py-0"},[a("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v("Total")]),a("v-list-item-subtitle",{staticClass:"text-right body-1 font-weight-medium"},[t.linesWithAmountsError.length?[t._v("-")]:[t._v(t._s(t._f("currency")(t.aggregations.total,t.activeCurrency.id))+" "+t._s(t.activeCurrency.id))]],2)],1)],2)],1)],1),a("v-row",{attrs:{align:"center",justify:"space-between"}},[a("v-col",{attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"20"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información adicional"),a("v-chip",{staticClass:"ml-3 mt-n1",attrs:{color:"secondary","x-small":""}},[t._v("Opcional")])],1)],1)],1)],1),a("v-divider"),a("v-row",{staticClass:"v-sm-text-fields",attrs:{align:"center",justify:"space-between"}},[a("v-col",{attrs:{cols:"12"}},[a("v-list",{staticClass:"v-list-form-extended transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"pt-2 text--secondary font-weight-medium"},[t._v("Referencias")])],1)],1)],1),a("v-col",{staticClass:"px-6 py-0",attrs:{cols:"12"}},[t.order.references.length?a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{staticClass:"py-0 ml-1",attrs:{cols:"2"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v("Fecha")])]),a("v-col",{staticClass:"py-0",attrs:{cols:"3"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v("Documento")])]),a("v-col",{staticClass:"py-0",attrs:{cols:"2"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v("Identificador")])]),a("v-col",{staticClass:"py-0",attrs:{cols:"4"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v("Descripción")])])],1):t._e(),t._l(t.order.references,(function(e,i){return a("v-row",{key:i,attrs:{"no-gutters":""}},[a("v-col",{staticClass:"py-0",attrs:{cols:"2"}},[a("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on,r=e.attrs;return[a("v-text-field",t._g(t._b({attrs:{error:t.$v.order.references.$each[i].date.$error,readonly:"","background-color":"white",height:"36",solo:"",outlined:"",flat:"",dense:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[a("v-icon",{staticClass:"mr-3",attrs:{small:"",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.order.references.$each[i].date.$model,callback:function(e){t.$set(t.$v.order.references.$each[i].date,"$model",e)},expression:"$v.order.references.$each[i].date.$model"}},"v-text-field",r,!1),s))]}}],null,!0),model:{value:t.datePickerMenuOrderReferences[i],callback:function(e){t.$set(t.datePickerMenuOrderReferences,i,e)},expression:"datePickerMenuOrderReferences[i]"}},[a("v-date-picker",{attrs:{"no-title":"","first-day-of-week":1,type:"date",locale:"es",width:"270",color:"primary"},on:{input:function(e){t.datePickerMenuOrderReferences[i]=!1}},model:{value:t.$v.order.references.$each[i].date.$model,callback:function(e){t.$set(t.$v.order.references.$each[i].date,"$model",e)},expression:"$v.order.references.$each[i].date.$model"}},[a("v-row",{staticClass:"py-2 px-6",attrs:{align:"center",justify:"space-between"}},[a("v-btn",{attrs:{outlined:""},on:{click:function(){t.$v.order.references.$each[i].date.$model=null,t.datePickerMenuOrderReferences[i]=!1}}},[t._v("Limpiar")]),a("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.order.references.$each[i].date.$model=t.today,t.datePickerMenuOrderReferences[i]=!1}}},[t._v("Hoy")])],1)],1)],1)],1),a("v-col",{staticClass:"py-0",attrs:{cols:"3"}},[a("v-select",{attrs:{error:t.$v.order.references.$each[i].document.$error,items:t.referencesList,"item-value":"id","item-text":"name","menu-props":{overflowY:!0,transition:"slide-y-transition"},"background-color":"white",height:"36",solo:"",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.references.$each[i].document.$model,callback:function(e){t.$set(t.$v.order.references.$each[i].document,"$model",e)},expression:"$v.order.references.$each[i].document.$model"}})],1),a("v-col",{staticClass:"py-0",attrs:{cols:"2"}},[a("v-text-field",{attrs:{error:t.$v.order.references.$each[i].serial.$error,maxlength:"18","background-color":"white",height:"36",solo:"",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.references.$each[i].serial.$model,callback:function(e){t.$set(t.$v.order.references.$each[i].serial,"$model","string"===typeof e?e.trim():e)},expression:"$v.order.references.$each[i].serial.$model"}})],1),a("v-col",{staticClass:"py-0",attrs:{cols:"4"}},[a("v-text-field",{attrs:{error:t.$v.order.references.$each[i].description.$error,maxlength:"36","background-color":"white",height:"36",solo:"",outlined:"",flat:"",dense:"","hide-details":""},model:{value:t.$v.order.references.$each[i].description.$model,callback:function(e){t.$set(t.$v.order.references.$each[i].description,"$model","string"===typeof e?e.trim():e)},expression:"$v.order.references.$each[i].description.$model"}})],1),a("v-col",{staticClass:"py-0",attrs:{cols:"1"}},[a("v-btn",{staticClass:"mt-1",attrs:{"min-width":"20","max-width":"20","min-height":"28","max-height":"28",text:"",color:"red",ripple:!1},on:{click:function(e){return t.order.references.splice(i,1)}}},[a("v-icon",{attrs:{size:"20"}},[t._v("mdi-delete")])],1)],1)],1)})),a("v-row",{staticClass:"px-1",attrs:{"no-gutters":""}},[a("v-col",{staticClass:"py-0",attrs:{cols:"12"}},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:t.addOrderReference}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar referencia")],1)],1)],1)],2)],1)],2),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[t.instance.id?[a("span",{staticClass:"body-2"},[t._v("Borrador guardado "+t._s(t._f("dateFromNow")(t.order.updated)))]),a("v-btn",{staticClass:"ml-3",attrs:{disabled:t.loadingSave||t.loadingFinalize,text:"",color:"primary",ripple:!1},on:{click:t.deleteOrder}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-delete")]),t._v("Eliminar borrador")],1)]:t._e(),a("v-spacer"),a("v-btn",{attrs:{disabled:!t.instance.id,loading:t.loadingSave||t.loadingFinalize,outlined:""},on:{click:function(e){return t.updateOrder("order",!0)}}},[t._v("Guardar y salir")]),a("v-btn",{attrs:{disabled:!t.order.id,loading:t.loadingSave||t.loadingFinalize,color:"primary"},on:{click:function(e){t.updateOrder("order"),t.finalizeOrder()}}},[t._v("Crear orden")])],2)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":""},model:{value:t.dialogCustomer,callback:function(e){t.dialogCustomer=e},expression:"dialogCustomer"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Seleccionar un cliente")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.dialogCustomer=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticClass:"text-left",attrs:{cols:"12"}},[a("v-col",{staticClass:"py-2"},[a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe para buscar un cliente...","hide-details":""},model:{value:t.customerQuery,callback:function(e){t.customerQuery=e},expression:"customerQuery"}})],1),a("v-divider"),t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item"}}):[t.customersList.length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("tbody",t._l(t.customersList,(function(e){return a("tr",{key:e.id,staticStyle:{cursor:"pointer"},on:{click:function(a){return t.setCustomer(e)}}},[a("td",[a("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))])])])})),0)]},proxy:!0}],null,!1,160405733)})]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-close-circle")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen clientes")])],1)]],2)],1)],1)],1)],1)],1)},Tl=[],El={page_size:100},Dl=null,Al={mixins:[$],inject:["theme"],components:{VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{activeCustomer:{},active:!1,aggregations:{lines:[{subtotal:0}],amount:0,exempt:0,subtotal:0,taxes:0,total:0},customerQuery:"",datePickerMenuOrderDate:!1,datePickerMenuOrderReferences:[!1],dialogCustomer:!1,isAutoSaving:!1,loadingInitial:!1,loadingSave:!1,loadingFinalize:!1,menu:!1,menuFiscal:[!1],menuInvoicing:!1,menuInvoicingUntil:!1,order:{customer:null,document:null,date:"",amount:null,exempt:null,tax:null,tax_percent:null,total:null,shipping_type:1,address:"",country:"",state:"",carrier_name:"",carrier_id:"",licence_plate:"",lines:[{name:"",exempt:!1,unit_label:"",amount:null,quantity:1,tax:null,tax_percent:null}],references:[]},orderClone:{},selectDocuments:[],shippingTypes:[{value:"1",label:"Operación constituye venta"},{value:"2",label:"Ventas por efectuar"},{value:"3",label:"Consignaciones"},{value:"4",label:"Entrega gratuita"},{value:"5",label:"Traslados internos"},{value:"6",label:"Otros traslados no venta"},{value:"7",label:"Guía de devolución"},{value:"8",label:"Traslado para exportación. (no venta)"},{value:"9",label:"Venta para exportación"}],statesList:[],upgradeable:!1}},computed:Object(i["a"])({activeDocument:function(){var t=this;return this.documents.find((function(e){return e.id===t.order.document}))||{}},activeCurrency:function(){var t=this;return this.currencies.find((function(e){return e.id===t.activeCustomer.currency}))||{}},aggregationsSource:function(){return{lines:this.order.lines.map((function(t){return{exempt:t.exempt,amount:t.amount,quantity:t.quantity}})),discount_scheme:this.order.discount_scheme,discount:this.order.discount}},linesWithAmountsError:function(){var t=this.$v.order.lines;return this.order.lines.filter((function(e,a){return t.$each[a].amount.$error||t.$each[a].quantity.$error}))},updated:function(){return this.order.updated?h()(this.order.updated).fromNow():null}},Object(u["c"])({customersList:function(t){return t.customers.customersList},countriesList:function(t){return t.generals.countriesList},documents:function(t){return t.generals.documentsList},instance:function(t){return t.orders.ordersDetail},referencesList:function(t){return t.generals.referencesList}})),beforeRouteEnter:function(t,e,a){Dl=e.name,a()},created:function(){var t=this;this.$store.dispatch("generals/LIST",{resource:"generals/references",query:{page_size:500}}),this.$store.dispatch("generals/LIST",{resource:"generals/documents",query:{country__in:[this.account.country.id,"US"],is_order:"True"}}).then((function(){var e=t.documents.filter((function(e){return e.country!==t.account.country.id}));t.selectDocuments.push({header:"Genéricos"}),t.selectDocuments=[].concat(Object(Y["a"])(t.selectDocuments),Object(Y["a"])(e));var a=t.documents.filter((function(e){return e.country===t.account.country.id}));a.length&&(t.selectDocuments.push({divider:!0}),t.selectDocuments.push({header:t.account.country.name}),t.selectDocuments=[].concat(Object(Y["a"])(t.selectDocuments),Object(Y["a"])(a)))})),this.$store.dispatch("generals/LIST",{resource:"generals/countries",query:El}).then((function(){t.order.country=t.account.country.id})),"OrderCreate"===this.$route.name?(this.$store.commit("orders/SET_DETAIL",{response:{data:{},config:{}},resource:"orders",loader:!1}),this.order.date=this.today):("OrderCreate"!==Dl&&(this.loadingInitial=!0),this.$store.dispatch("orders/RETRIEVE",{resource:"orders",id:this.$route.params.id}).then((function(e){if("draft"===t.instance.status){var a=Q()(e.data);t.activeCustomer=a.customer,a.customer=a.customer.id,a.document=a.document.id,t.order=a}else t.$router.push({name:"OrderRetrieve",params:{id:t.instance.id}})})).finally((function(){t.loadingInitial=!1})))},watch:{activeDocument:function(t,e){var a=this,i=function(t){a.order.lines.forEach((function(e,i){a.order.lines[i].exempt=t}))};this.activeDocument.has_taxes&&!e.has_taxes?i(!1):!this.activeDocument.has_taxes&&e.has_taxes&&i(!0),this.setAggregations()},aggregationsSource:{handler:function(){this.setAggregations()},deep:!0},customerQuery:function(){this.debounceMethod(this.getCustomers)},dialogCustomer:function(){this.dialogCustomer&&this.getCustomers()},order:{handler:L()((function(){this.orderClone=Q()(this.order),"OrderUpdate"===this.$route.name?this.updateOrder("orderClone"):this.createOrder()}),700),deep:!0},"order.country":{handler:function(){var t=this,e=this.countriesList.find((function(e){return e.id===t.order.country}));this.statesList=e?e.states:[],this.order.state=""},inmediate:!0}},methods:{createOrder:function(){var t=this;if(this.$v.orderClone.$touch(),this.$v.orderClone.$invalid)return!1;var e=Q()(this.order);this.loadingSave=!0,this.$store.dispatch("orders/CREATE",{resource:"orders",payload:e}).then((function(e){t.order=Q()(e.data),t.order.document=t.order.document.id,t.$router.replace("/orders/".concat(t.order.id,"/edit"))})).finally((function(){t.loadingSave=!1}))},updateOrder:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"order",a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.$v[e].$touch(),this.$v[e].$invalid)return!1;var i=Q()(this.order);delete i.amount,delete i.exempt,delete i.status,delete i.tax,delete i.tax_percent,delete i.total,this.loadingSave=!0,this.$store.dispatch("orders/UPDATE",{resource:"orders",id:this.order.id,payload:i}).then((function(){a&&t.$router.push({name:"OrderList"})})).finally((function(){t.loadingSave=!1}))},finalizeOrder:function(){var t=this;if(this.$v.order.$touch(),this.$v.order.$invalid)return!1;this.$dialog.warning({title:"Confirmar orden",text:'\n Al confirmar esta orden:\n 1. Validará con la agencia fiscal de '.concat(this.account.country.name,'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n '),actions:[{text:"Continuar",color:"primary",handle:function(){t.isAutoSaving=!1,t.loadingFinalize=!0,t.$store.dispatch("orders/RETRIEVE",{resource:"orders",detail:"finalize",id:t.order.id}).then((function(){t.$router.push({name:"OrderRetrieve",params:{id:t.instance.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loadingFinalize=!1}))}}]})},deleteOrder:function(){var t=this;if("draft"===!this.order.status)return!1;this.$dialog.warning({title:"Eliminar orden",text:'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("orders/DESTROY",{resource:"orders",id:t.order.id}).then((function(){t.$dialog.message.info("La order ha sido eliminada"),t.$router.push({name:"OrderList"})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})},getCustomers:function(){if([1,2].includes(this.customerQuery.length))return!1;var t={page_size:10};this.customerQuery.length>=3&&(t.name__icontains=this.customerQuery.toLowerCase()),this.$store.dispatch("customers/LIST",{resource:"customers",query:t})},setCustomer:function(t){this.activeCustomer=t,this.order.customer=t.id,this.customerQuery="",this.dialogCustomer=!1},addOrderLine:function(){this.order.lines.push({name:"",exempt:!1,unit_label:"",amount:null,quantity:1,tax:null,tax_percent:null})},setAggregations:function(){var t=this,e=this.activeCurrency.format&&0===this.activeCurrency.format.precision,a=0,i=0;if(this.order.lines.forEach((function(s,r){t.aggregations.lines[r]={subtotal:t.formatNumber((s.amount||0)*(s.quantity||0),e)},s.discount&&("%"===s.discount_scheme?t.aggregations.lines[r].subtotal-=t.aggregations.lines[r].subtotal*s.discount/100:(t.aggregations.lines[r].discount=t.formatNumber(s.discount,e),t.aggregations.lines[r].subtotal-=t.aggregations.lines[r].discount)),s.exempt||!t.activeDocument.has_taxes?a+=t.formatNumber(t.aggregations.lines[r].subtotal,e):i+=t.formatNumber(t.aggregations.lines[r].subtotal,e)})),this.aggregations.exempt=this.formatNumber(a,e),this.aggregations.amount=this.formatNumber(i,e),this.aggregations.subtotal=a+i,this.activeDocument.has_taxes)if(this.activeDocument.has_lines_total){var s=this.aggregations.amount;this.aggregations.amount=this.formatNumber(s/(this.activeDocument.tax/100+1),e),this.aggregations.taxes=this.formatNumber(s-this.aggregations.amount,e)}else this.aggregations.taxes=this.formatNumber(this.aggregations.amount*(this.activeDocument.tax/100),e);else this.aggregations.taxes=0;this.aggregations.total=this.formatNumber(this.aggregations.exempt+this.aggregations.amount+this.aggregations.taxes,e)},addOrderReference:function(){this.order.references.push({date:null,description:"",document:"",serial:""})}},validations:function(){var t={customer:{required:ie["required"]},document:{required:ie["required"],currencyIsValid:function(){if(!this.order.customer)return!0;var t=this.activeDocument.currencies||[];return!!t.length&&t.includes(this.activeCustomer.currency)}},date:{required:ie["required"]},shipping_type:{required:ie["required"]},address:{maxLength:Object(ie["maxLength"])(70)},carrier_name:{maxLength:Object(ie["maxLength"])(30)},carrier_id:{maxLength:Object(ie["maxLength"])(10)},licence_plate:{maxLength:Object(ie["maxLength"])(7)},note:{maxLength:Object(ie["maxLength"])(100)},lines:{$each:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(128)},description:{maxLength:Object(ie["maxLength"])(512)},unit_label:{maxLength:Object(ie["maxLength"])(4)},quantity:{required:ie["required"],numeric:ie["numeric"]},amount:{required:ie["required"],numeric:ie["numeric"]}}},references:{$each:{date:{required:ie["required"]},description:{maxLength:Object(ie["maxLength"])(64)},document:{required:ie["required"]},serial:{required:ie["required"],maxLength:Object(ie["maxLength"])(36)}}}};return{order:t,orderClone:Q()(t)}}},jl=Al,ql=Object(E["a"])(jl,Sl,Tl,!1,null,null,null),Il=ql.exports;A()(ql,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var Ol=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.orders.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"OrderList"}}},[t._v("Órdenes")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 200px;":"max-width: 300px;"},[t._v(t._s(t.instance.document.name)+" para "+t._s(t.instance.customer.name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalReminder=!0}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-email")]),t._v("Enviar orden")],1),a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("orders")}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document")]),t._v("PDF")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Total")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(t.instance.amount,t.instance.currency)))]),a("span",[t._v(t._s(t.instance.currency))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"3"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Cliente")]),t.instance.customer?a("v-btn",{attrs:{to:{name:"CustomerRetrieveUpdate",params:{id:t.instance.customer.id}},height:"20",text:"",color:"primary","retain-focus-on-click":"",ripple:!1}},[a("span",{staticClass:"d-inline-block text-truncate",staticStyle:{"max-width":"200px"}},[t._v(t._s(t.instance.customer.name))]),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1):a("span",{staticClass:"font-italic text--disabled"},[t._v("Cliente no especificado")])],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Fecha")]),a("div",{staticClass:"font-weight-medium mt-1"},[t._v(t._s(t._f("date")(t.instance.date)))])])],1),a("v-divider"),t.messagesList.length?[t._l(t.messagesList,(function(e,i){return a("v-col",{key:i},[a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary",small:""}},[t._v("mdi-email-send ")]),a("span",[t._v(" La orden fue enviada a "+t._s(e.recipient[0])+" "),e.recipient.length>1?[t._v("y otros "+t._s(e.recipient.length-1)+" contactos")]:t._e()],2),a("span",[t._v(t._s(t._f("dateTime")(e.created))+" por "+t._s(e.user))])],1)})),a("v-divider")]:t._e(),a("v-toolbar",{staticClass:"transparent",attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1),a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Tipo de documento")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.document.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Número")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.number))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Tipo de despacho")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.shipping_type))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Dirección del envío")]),t.instance.address?a("v-list-item-subtitle",[t._v(t._s(t.instance.address))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1),t.instance.note?a("v-list-item",[a("v-list-item-title",[t._v("Nota")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.note))])],1):t._e()],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nombre del conductor")]),t.instance.carrier_name?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_name))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID del conductor")]),t.instance.carrier_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_id))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Patente del transporte")]),t.instance.licence_plate?a("v-list-item-subtitle",[t._v(t._s(t.instance.licence_plate))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1)],1)],1)],1)],2)],1),"CL"==t.account.country.id&&t.instance.document.has_local_format?a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Gestión SII")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-menu",{attrs:{"offset-y":"",left:"",transition:"scale-transition","min-width":"160px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("Acciones")])]}}],null,!1,3335323182)},[t.instance.local_file?[a("v-btn",{staticClass:"mr-1",attrs:{href:t.instance.local_file,target:"_blank",block:"",outlined:"","retain-focus-on-click":"",color:"secondary"}},[t._v("Descargar XML")])]:t._e()],2)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"8"}},[a("v-list",{staticClass:"v-list-form transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t.instance.tax_agency.cl_status?t.instance.tax_agency.cl_status.includes("Rechazado")?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("orders","orders","tax_agency_status")}}},[t._v("Actualizar estado")])],1)],1),t.instance.tax_agency.cl_status_detail?a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_agency.cl_status_detail))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v(" Track ID "),t.instance.tax_agency.cl_id?t._e():a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"red"}},i),[t._v("mdi-alert")])]}}],null,!1,2543809772)},[a("span",[t._v("Es requerido enviar a la agencia fiscal")])])],1),a("v-list-item-subtitle",{staticClass:"text-left"},[t.instance.tax_agency.cl_id?a("span",[t._v(t._s(t.instance.tax_agency.cl_id))]):a("span",[a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("orders","orders","tax_agency_send")}}},[t._v("Enviar a la agencia fiscal")])],1)])],1),a("v-list-item",[a("v-list-item-title",[t._v("Referencias")]),a("v-list-item-subtitle",[t.instance.references&&t.instance.references.length?t._l(t.instance.references,(function(e){return a("span",{key:e.document,staticClass:"d-block"},[t._v("• Documento tipo "+t._s(e.document)+" del "+t._s(t._f("date")(e.date))+" ID "+t._s(e.serial)+". "+t._s(e.description))])})):a("span",{staticClass:"font-italic text--disabled"},[t._v("No se especificaron referencias a documentos.")])],2)],1)],1)],1)],1)],1)],1):t._e(),a("v-card",{staticClass:"pa-0 my-5"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Detalle")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-simple-table",{attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Producto")]),a("th",{staticClass:"text-center"},[t._v("Unidad de medida")]),a("th",{staticClass:"text-right"},[t._v("Cantidad")]),a("th",{staticClass:"text-right"},[t._v("P. unitario")]),a("th",{staticClass:"text-right"},[t._v("Total")])])]),a("tbody",[t._l(t.instance.lines,(function(e){return[a("tr",{key:e.id},[a("td",[a("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))]),a("span",{staticClass:"d-block"},[t._v(t._s(e.description))])]),a("td",{staticClass:"text-center"},[t._v(t._s(e.unit))]),a("td",{staticClass:"text-right"},[t._v(t._s(e.quantity))]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.amount,t.instance.currency)))])]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.total,t.instance.currency))+" "+t._s(t.instance.currency))])])])]}))],2)]},proxy:!0}])}),a("v-divider"),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"4"}},[a("v-list",{staticClass:"v-list-form pa-0 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("currency")(t.instance.exempt,t.instance.currency)))])],1),t.instance.document.has_taxes&&t.instance.document.has_taxes_detail?[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("currency")(t.instance.amount,t.instance.currency)))])],1),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Impuestos ("+t._s(t.instance.tax_percent)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("currency")(t.instance.tax,t.instance.currency)))])],1)]:t._e(),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left body-1 text--secondary font-weight-medium"},[t._v("Total")]),a("v-list-item-subtitle",{staticClass:"text-right body-1 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],2)],1)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalReminder,callback:function(e){t.modalReminder=e},expression:"modalReminder"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Enviar orden")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalReminder=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-subtitle",{staticClass:"py-2 px-3 background"},[a("v-row",{attrs:{align:"center","no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[a("v-autocomplete",{staticClass:"mx-0",attrs:{items:t.contactsList.concat({name:"Email de facturación",email:t.instance.customer.email}),error:t.$v.reminder.recipient.$error,prefix:"Para","small-chips":"","deletable-chips":"","hide-details":!t.$v.reminder.recipient.$error,required:"",multiple:"",chips:"","item-text":"name","item-value":"email",hint:"Selecciona al menos un destinatario","no-data-text":"No existen contactos asociados al cliente","persistent-hint":"",autofocus:"",dense:"",outlined:"",color:"blue-grey lighten-2","background-color":"white"},scopedSlots:t._u([{key:"item",fn:function(e){return[t._v(t._s(e.item.name)+" ("+t._s(e.item.email)+")")]}}]),model:{value:t.$v.reminder.recipient.$model,callback:function(e){t.$set(t.$v.reminder.recipient,"$model",e)},expression:"$v.reminder.recipient.$model"}})],1)],1),a("v-row",{attrs:{align:"center","no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{staticClass:"mx-0",attrs:{error:t.$v.reminder.subject.$error,prefix:"Asunto","background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"60",hint:"Escribe un asunto para el mensaje","persistent-hint":"","hide-details":!t.$v.reminder.subject.$error},model:{value:t.$v.reminder.subject.$model,callback:function(e){t.$set(t.$v.reminder.subject,"$model",e)},expression:"$v.reminder.subject.$model"}})],1)],1)],1),a("v-divider"),a("v-card-text",[a("v-row",{staticClass:"mx-0 py-5",attrs:{align:"center",justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("reminder-order-email",{attrs:{instance:t.instance,template:t.account.email_template,"color-background":t.account.color_background,message:t.reminder.message},on:{"update:message":[function(e){t.reminder.message=e},function(e){return t.$set(t.reminder,"message",e)}]}})],1)],1),a("v-row",{staticClass:"mx-0 pb-2",attrs:{justify:"center"}},[a("v-col",{attrs:{cols:"10"}},[a("span",{staticClass:"mr-2 body-2 text--secondary"},[t._v("Archivos adjuntos")]),a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".pdf")],1),t.instance.local_file?a("v-chip",{staticClass:"ma-1",attrs:{color:"secondary",small:"",outlined:""}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-paperclip")]),t._v(t._s(t.instance.number)+".xml")],1):t._e()],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalReminder=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.reminders.createLoader,color:"primary"},on:{click:t.createReminder}},[t._v("Enviar")])],1)],1)],1),t.instance.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalRender,callback:function(e){t.modalRender=e},expression:"modalRender"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v(t._s("PDF "+t.instance.document.name+" Nº "+t.instance.number))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalRender=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.loaderRender?a("v-row",[a("v-col",{staticClass:"py-0 ma-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"rounded-0",attrs:{transition:"fade-transition",type:"table"}})],1)],1):t.loaderRender||t.renderUrl?t._e():a("v-row",[a("v-col",{staticClass:"py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-image-broken-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("PDF no disponible")])],1)],1),a("div",{attrs:{id:"render"}})],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{href:t.renderUrl,download:t.instance.document.id+"_N"+t.instance.number,color:"primary",dark:""}},[t._v("Descargar PDF")])],1)],1)],1):t._e()],1)},Rl=[],Nl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",["admiral"===t.template?a("header-admiral",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"classic"===t.template?a("header-classic",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):"modern"===t.template?a("header-modern",{attrs:{instance:t.instance,message:t.message,"color-background":t.colorBackground},on:{"update:message":function(e){return t.updateMessage(e)}}}):t._e(),a("email-footer")],1)],1)},Pl=[],Bl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{staticClass:"background"},[a("v-row",{staticClass:"px-3",attrs:{justify:"start"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{staticClass:"background"},[a("v-row",[a("v-col",{staticClass:"pb-0",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-3"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-2 py-0"},[a("v-list",{staticClass:"transparent"},[a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Dirección del envío")]),t.instance.address?a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.address))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Tipo de despacho")]),a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.shipping_type))])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Nombre del conductor")]),t.instance.carrier_name?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_name))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("ID del conductor")]),t.instance.carrier_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_id))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Patente del transporte")]),t.instance.licence_plate?a("v-list-item-subtitle",[t._v(t._s(t.instance.licence_plate))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0"},[a("v-row",[a("v-col",{staticClass:"pa-0 pb-2",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},zl=[],Fl={mixins:[fa]},Ml=Fl,Ul=Object(E["a"])(Ml,Bl,zl,!1,null,null,null),Gl=Ul.exports;A()(Ul,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var Hl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"border-top: 3px solid "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",rounded:"lg",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 text--primary font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))]),a("span",{staticClass:"d-block body-1 font-weight-medium mt-5"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-2 background"},[a("v-list",{staticClass:"transparent"},[a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Dirección del envío")]),t.instance.address?a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.address))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Tipo de despacho")]),a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.shipping_type))])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Nombre del conductor")]),t.instance.carrier_name?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_name))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("ID del conductor")]),t.instance.carrier_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_id))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Patente del transporte")]),t.instance.licence_plate?a("v-list-item-subtitle",[t._v(t._s(t.instance.licence_plate))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0 background"},[a("v-row",[a("v-col",{staticClass:"pa-0 pb-2",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"","background-color":"background",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},Yl=[],Wl={mixins:[fa]},Ql=Wl,Kl=Object(E["a"])(Ql,Hl,Yl,!1,null,null,null),Xl=Kl.exports;A()(Kl,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var Jl=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",{staticClass:"pa-0 text-center",attrs:{rounded:"md",outlined:""}},[t.account.logo?a("v-card-title",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",{attrs:{justify:"center"}},[a("v-sheet",{staticClass:"overflow-hidden",attrs:{width:"90",color:"white",rounded:"circle",outlined:""}},[a("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1}},[a("v-sheet",{staticClass:"px-1",attrs:{color:"white",width:"90"}},[a("v-img",{attrs:{src:t.account.logo.split(/[?#]/)[0],width:"100%"}})],1)],1)],1)],1)],1):t._e(),a("v-card-subtitle",{style:"background: "+(t.colorBackground?t.colorBackground:t.account.color_background)},[a("v-row",[a("v-col",{staticClass:"pb-0 text-center",attrs:{cols:"12"}},[a("span",{staticClass:"d-block subtitle-1 white--text font-weight-medium mt-1"},[t._v(t._s(t.instance.document.name)+" Nº "+t._s(t.instance.number)+" de "+t._s(t.account.name))]),a("span",{staticClass:"d-block body-2 white--text font-weight-regular"},[t._v("para "+t._s(t.instance.customer.name))])])],1)],1),a("v-card-text",{staticClass:"py-0 background"},[a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("span",{staticClass:"d-block body-1 font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency)+" del "+t._s(t._f("date")(t.instance.date)))])])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-2 background"},[a("v-list",{staticClass:"my-0 transparent"},[a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Dirección del envío")]),t.instance.address?a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.address))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Tipo de despacho")]),a("v-list-item-subtitle",{staticClass:"text-left"},[t._v(t._s(t.instance.shipping_type))])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Nombre del conductor")]),t.instance.carrier_name?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_name))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("ID del conductor")]),t.instance.carrier_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.carrier_id))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1),a("v-list-item",{staticClass:"px-1 my-1"},[a("v-list-item-title",{staticClass:"text--secondary font-weight-medium text-left"},[t._v("Patente del transporte")]),t.instance.licence_plate?a("v-list-item-subtitle",[t._v(t._s(t.instance.licence_plate))]):a("v-list-item-subtitle",{staticClass:"text-left"},[t._v("No especificado")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-0"},[a("v-row",[a("v-col",{staticClass:"pa-0 pb-2",attrs:{cols:"12"}},[a("v-textarea",{staticClass:"elevation-0",attrs:{placeholder:t.placeholder,"auto-grow":"",solo:"",flat:"","hide-details":""},on:{input:function(e){return t.updateMessage(e)}},model:{value:t.messageBody,callback:function(e){t.messageBody=e},expression:"messageBody"}})],1)],1)],1)],1)},Zl=[],tc={mixins:[fa]},ec=tc,ac=Object(E["a"])(ec,Jl,Zl,!1,null,null,null),ic=ac.exports;A()(ac,{VCard:oe["a"],VCardSubtitle:le["b"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDivider:tt["a"],VImg:Ht["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VTextarea:_a["a"]});var sc={props:{template:{type:String,required:!1,default:function(){return"modern"}}},components:{EmailFooter:va,HeaderAdmiral:Gl,HeaderClassic:Xl,HeaderModern:ic},mixins:[fa]},rc=sc,nc=Object(E["a"])(rc,Nl,Pl,!1,null,null,null),oc=nc.exports;A()(nc,{VCol:q["a"],VRow:z["a"]});var lc={mixins:[$,xo,no],inject:["theme"],components:{ReminderOrderEmail:oc,VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{reminder:{template:"",recipient:"",subject:"",message:"Enviar la order"},shippingTypes:[{value:"1",label:"Operación constituye venta"},{value:"2",label:"Ventas por efectuar"},{value:"3",label:"Consignaciones"},{value:"4",label:"Entrega gratuita"},{value:"5",label:"Traslados internos"},{value:"6",label:"Otros traslados no venta"},{value:"7",label:"Guía de devolución"},{value:"8",label:"Traslado para exportación. (no venta)"},{value:"9",label:"Venta para exportación"}],modalReminder:!1}},computed:Object(u["c"])({instance:function(t){return Q()(t.orders.ordersDetail)},messagesList:function(t){return t.reminders.messagesList},contactsList:function(t){return t.customers.contactsList}}),created:function(){this.retrieve()},methods:{retrieve:function(){var t=this;this.$store.dispatch("orders/RETRIEVE",{resource:"orders",id:this.$route.params.id}).then((function(){t.instance.shipping_type=t.shippingTypes.find((function(e){return e.value===t.instance.shipping_type})).label,t.$store.dispatch("reminders/LIST",{resource:"reminders/messages",query:{order:t.instance.id}}),t.$store.dispatch("customers/LIST",{resource:"contacts",query:{customer:t.instance.customer.id}})}))},createReminder:function(){var t=this;if(this.reminder.order=this.instance.id,this.$v.reminder.$touch(),this.$v.reminder.$invalid)return!1;this.$store.dispatch("reminders/CREATE",{resource:"reminders/messages",payload:this.reminder}).then((function(){t.modalReminder=!1})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},remove:function(t){var e=this.$v.reminder.recipient.$model.indexOf(t.name);e>=0&&this.$v.reminder.recipient.$model.splice(e,1)}},validations:{reminder:{recipient:{required:ie["required"],maxLength:Object(ie["maxLength"])(8)},subject:{required:ie["required"],minLength:Object(ie["minLength"])(6),maxLength:Object(ie["maxLength"])(60)},message:{required:ie["required"]}}}},cc=lc,dc=Object(E["a"])(cc,Ol,Rl,!1,null,null,null),uc=dc.exports;A()(dc,{VAutocomplete:ko["a"],VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardSubtitle:le["b"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var vc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-tabs",{attrs:{"background-color":"background",color:"primary",grow:"",height:"55","slider-size":"4"}},[a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/orders",exact:""}},[t._v("Todas las órdenes")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/orders?status=draft",exact:""}},[t._v("Borrador")]),a("v-divider",{attrs:{vertical:""}}),a("v-tab",{staticClass:"text-none font-weight-medium",attrs:{to:"/orders?status=finalized",exact:""}},[t._v("Finalizado")])],1)],1),a("v-card",{staticClass:"px-0 mt-5"},[t.$store.state.orders.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Órdenes")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"order"}}),a("v-btn",{attrs:{to:{name:"OrderCreate"},outlined:"",color:"secondary"}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v(" Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("order-list",{attrs:{"show-create":!0}})],1)],1)],1)],1)},mc=[],pc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[t.$store.state.orders.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.ordersList.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.ordersList,"items-per-page":t.pagination,"hide-default-header":"","disable-sort":"","mobile-breakpoint":"","hide-default-footer":""},on:{"click:row":function(e){t.$router.push({name:"draft"===e.status?"OrderUpdate":"OrderRetrieve",params:{id:e.id}})}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.customer",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.customer.name))])]}},{key:"item.status",fn:function(e){var i=e.item;return[t.showStatus?a("div",{staticClass:"text-right py-4"},["draft"===i.status?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Borrador")]):t._e(),"finalized"===i.status?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Finalizado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):t._e()],1):t._e()]}},{key:"item.number",fn:function(e){var i=e.item;return[a("v-menu",{attrs:{"open-on-hover":"",right:"","offset-x":"",transition:"slide-x-transition","nudge-width":140},scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[a("div",t._g({},s),[a("span",{staticClass:"d-block"},[t._v(t._s(i.document.name))]),"draft"!==i.status?a("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v("Nº "+t._s(i.number))]):t._e()])]}}],null,!0)},[a("v-card",{staticClass:"pa-0"},[a("v-subheader",{staticClass:"font-weight-medium background"},[t._v(t._s(i.document.name))]),a("v-card-text",{staticClass:"pa-0"},[i.lines.length?t._l(i.lines.slice(0,3),(function(e){return a("v-row",{key:e.id,staticClass:"mx-0 px-2"},[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(e.name))])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("span",{staticClass:"d-block"},[t._v("$ "+t._s(t._f("number")(e.amount)))]),i.lines.length>3?a("span",{staticClass:"d-block"},[t._v("y otros "+t._s(i.lines.length-3)+" productos")]):t._e()])],1)})):t._e(),a("v-divider")],2),a("v-card-actions",{staticClass:"text-center"},[a("v-spacer"),a("v-btn",{attrs:{to:{name:"draft"===i.status?"OrderUpdate":"OrderRetrieve",params:{id:i.id}},text:"",color:"primary"}},[t._v("Ver detalle "),a("v-icon",{attrs:{small:""}},[t._v("mdi-arrow-right")])],1),a("v-spacer")],1)],1)],1)]}},{key:"item.created",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(t._f("date")(i.date)))])]}},{key:"item.total",fn:function(e){var i=e.item;return[a("div",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(i.total,i.currency)))]),a("span",{staticClass:"ml-1"},[t._v(t._s(i.currency))])])]}},{key:"item.currency",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(i.currency))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showAll?a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-btn",{attrs:{to:{name:"OrderList",query:t.showCriteria},outlined:"",color:"secondary"}},[t._v("Ver todas las órdenes")])],1):t._e(),t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-file")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen órdenes")]),t.showCreate?a("v-btn",{staticClass:"my-5",attrs:{to:{name:"OrderCreate"},outlined:""}},[t._v("Crear una orden")]):t._e()],1)]],2)],1)},hc=[],fc={components:{VTableHeaders:Mi},mixins:[k],data:function(){return{headers:[{text:"Cliente",value:"customer",class:"font-weight-bold",sortable:!0},{text:"",value:"status"},{text:"Número",value:"number",sortable:!0},{text:"Fecha",value:"created",align:"end",sortable:!0},{text:"Total",value:"total",align:"end",sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.orders.ordersCount},ordersList:function(t){return t.orders.ordersList}})},bc=fc,gc=Object(E["a"])(bc,pc,hc,!1,null,null,null),_c=gc.exports;A()(gc,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VMenu:P["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSubheader:rt["a"]});var yc={components:{OrderList:_c,VQueryBuilder:dn},mixins:[k],data:function(){return{filters:[{type:"text",id:"customer__name",label:"Cliente",operators:["contiene"]},{type:"text",id:"date",label:"Fecha",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"amount",label:"Total",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"number",label:"Número",operators:["es igual","es menor a","es mayor a"]}]}},methods:{getList:function(){this.$store.dispatch("orders/LIST",{resource:"orders",query:this.$route.query})}}},Cc=yc,xc=Object(E["a"])(Cc,vc,mc,!1,null,null,null),wc=xc.exports;A()(xc,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTab:Ua["a"],VTabs:Ha["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var $c=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.loaderMain?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, divider, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"CustomerListCreate"}}},[t._v("Clientes")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 300px;":"max-width: 500px;"},[t._v(t._s(t.instance.name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{outlined:"","retain-focus-on-click":""},on:{click:function(e){t.dialogCustomer=!0}}},[t._v("Editar")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Ventas totales")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v("$ "+t._s(t._f("number")(t.instance.aggregations.sales)))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Ventas en "+t._s(t.currentMonth))]),a("div",{staticClass:"body-1 font-weight-medium mt-1"},[t._v("$ "+t._s(t._f("number")(t.instance.aggregations.sales_current_period)))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v(" Balance "),a("v-tooltip",{attrs:{right:"","max-width":"200px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Representa el total adeudado por el cliente.")])])],1),a("div",{staticClass:"body-1 font-weight-medium mt-1"},[t._v("$ "+t._s(t._f("number")(t.instance.aggregations.balance)))])])],1),a("v-divider"),a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.address))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.state.name)+", "+t._s(t.instance.country.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),t.instance.phone?a("v-list-item-subtitle",[t._v(t._s(t.instance.phone))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin número de teléfono")])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID")]),a("v-list-item-subtitle",[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.instance.id)}}},i),[t._v(t._s(t.instance.id))])]}}])},[a("span",[t._v("Copiar")])])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Actualizado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.updated)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información de facturación")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.email))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Moneda")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCurrency.id)+" - "+t._s(t.activeCurrency.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID Fiscal")]),t.instance.tax_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_id))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1)],1)],1)],1)],1)],1),a("v-card",{staticClass:"px-0"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Facturas")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("invoice-list",{attrs:{"show-pagination":!1,"show-sort":!1,"show-criteria":{customer:t.instance.id}}})],1)],1),a("v-card",{staticClass:"px-0 my-5 overflow-hidden"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Unidades organizativas")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"end"}},[a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogOrgunitCreate=!0}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v("Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("orgunit-list",{attrs:{"show-pagination":!1,"show-sort":!1,"show-criteria":{customer:t.instance.id},"display-create":t.dialogOrgunitCreate,customer:t.instance},on:{"dialog-create":t.updateDialogOrgunitCreate}})],1)],1),a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Metadatos")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogMetadata=!0}}},[t._v("Editar")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",[Object.keys(t.instance.metadata).length?a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},t._l(t.instance.metadata,(function(e,i){return a("v-list-item",{key:i},[a("v-list-item-title",[t._v(t._s(i))]),a("v-list-item-subtitle",[t._v(t._s(e))])],1)})),1)],1):a("v-col",{staticClass:"text-center py-5",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-code-tags")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No hay metadatos")])],1)],1)],1)],1)],1),t.editable.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogCustomer,callback:function(e){t.dialogCustomer=e},expression:"dialogCustomer"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Actualizar cliente")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogCustomer=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.editable.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Acme LLC",maxlength:"100","hide-details":""},model:{value:t.$v.editable.name.$model,callback:function(e){t.$set(t.$v.editable.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{disabled:"","single-line":"",items:[t.editable.country.name],"item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.editable.country.name,callback:function(e){t.$set(t.editable.country,"name",e)},expression:"editable.country.name"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.editable.state.$error,items:t.statesList,"item-text":"name","item-value":"id","single-line":"","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white","no-data-text":"No existen estados para el país."},model:{value:t.$v.editable.state.$model,callback:function(e){t.$set(t.$v.editable.state,"$model",e)},expression:"$v.editable.state.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.editable.address.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.address.$model,callback:function(e){t.$set(t.$v.editable.address,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información fiscal")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v(" Moneda "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}],null,!1,3956645415)},[a("span",[t._v("No podrás cambiar la moneda una vez que se guarde la información del cliente o se cree una factura del cliente.")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{value:t.activeCurrency.name,disabled:"","background-color":"white",outlined:"","single-line":"",dense:"","hide-details":""}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v(" ID Fiscal "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}],null,!1,3956645415)},[a("span",[t._v("RUT, VAT, NIF o TAX ID")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{directives:[{name:"dni",rawName:"v-dni",value:t.instance.country.id,expression:"instance.country.id"}],attrs:{error:t.$v.editable.tax_id.$error,disabled:t.instance.country.has_regulation,"background-color":"white",outlined:"","single-line":"",dense:"",maxlength:"32","hide-details":""},model:{value:t.$v.editable.tax_id.$model,callback:function(e){t.$set(t.$v.editable.tax_id,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.tax_id.$model"}})],1)],1)],1),"CL"===t.editable.country.id?a("v-list-item",[a("v-list-item-title",[t._v("Actividad comercial")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{attrs:{error:t.$v.editable.tax_settings.cl_activity_description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.tax_settings.cl_activity_description.$model,callback:function(e){t.$set(t.$v.editable.tax_settings.cl_activity_description,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.tax_settings.cl_activity_description.$model"}})],1)],1):t._e(),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de contacto")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.editable.email.$error,outlined:"",required:"","single-line":"","background-color":"white",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.email.$model,callback:function(e){t.$set(t.$v.editable.email,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.email.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[t.editable.country?a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.editable.country.phone_code+" # #### ####",expression:"`${editable.country.phone_code} # #### ####`"}],attrs:{error:t.$v.editable.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"16","hide-details":""},model:{value:t.$v.editable.phone.$model,callback:function(e){t.$set(t.$v.editable.phone,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.phone.$model"}}):t._e()],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Sitio web")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.editable.website.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":!0},model:{value:t.$v.editable.website.$model,callback:function(e){t.$set(t.$v.editable.website,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.website.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogCustomer=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.customers.createLoader,color:"primary"},on:{click:t.patchCustomer}},[t._v("Guardar")])],1)],1)],1):t._e(),t.editable.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogMetadata,callback:function(e){t.dialogMetadata=e},expression:"dialogMetadata"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Editar metadatos")])],1)],1),a("v-divider"),a("v-card-text",{staticClass:"py-4 background"},[t.editableMetadata.length?a("v-row",{attrs:{"no-gutters":"",align:"center"}},[a("v-col",{attrs:{cols:"4"}},[a("span",{staticClass:"body-2 text--secondary font-weight-medium ml-1"},[t._v("Clave")])]),a("v-col",{attrs:{cols:"8"}},[a("span",{staticClass:"body-2 text--secondary font-weight-medium ml-1"},[t._v("Valor")])])],1):t._e(),t._l(t.editableMetadata,(function(e,i){return a("v-row",{key:i,attrs:{"no-gutters":"",align:"center"}},[a("v-col",{staticClass:"py-1",attrs:{cols:"4"}},[a("v-text-field",{attrs:{error:t.$v.editableMetadata.$each[i].key.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"32","hide-details":""},model:{value:t.$v.editableMetadata.$each[i].key.$model,callback:function(e){t.$set(t.$v.editableMetadata.$each[i].key,"$model","string"===typeof e?e.trim():e)},expression:"$v.editableMetadata.$each[i].key.$model"}})],1),a("v-col",{staticClass:"py-1",attrs:{cols:"7"}},[a("v-text-field",{attrs:{error:t.$v.editableMetadata.$each[i].value.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"256","hide-details":""},model:{value:t.$v.editableMetadata.$each[i].value.$model,callback:function(e){t.$set(t.$v.editableMetadata.$each[i].value,"$model","string"===typeof e?e.trim():e)},expression:"$v.editableMetadata.$each[i].value.$model"}})],1),a("v-col",{staticClass:"py-1 text-right",attrs:{cols:"1"}},[i>=1||t.editableMetadata.length>1?a("v-btn",{attrs:{icon:"",color:"secondary"},on:{click:function(e){return t.editableMetadata.splice(i,1)}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-delete")])],1):t._e()],1),t.$v.editableMetadata.$each[i].key.itsRepeated?t._e():a("v-col",{attrs:{cols:"12"}},[a("span",{staticClass:"d-block red--text caption ml-1 mt-n1 mb-1"},[a("v-icon",{attrs:{color:"red",small:"",left:""}},[t._v("mdi-alert-circle")]),t._v("La clave debe ser única.")],1)])],1)})),a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"3"}},[a("v-btn",{attrs:{disabled:t.editableMetadata.length>=10,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.editableMetadata.push({key:"",value:""})}}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar elemento")],1)],1)],1)],2),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogMetadata=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.loaderMetadata,disabled:!t.editableMetadata.length,color:"primary"},on:{click:t.updateMetadata}},[t._v("Guardar")])],1)],1)],1):t._e()],1)},kc=[],Vc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.orgunits.length?a("v-data-table",{attrs:{headers:t.headers,items:t.orgunits,"items-per-page":t.pagination,"mobile-breakpoint":"","hide-default-header":"","disable-sort":"","hide-default-footer":""},on:{"update:items":function(e){t.orgunits=e}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.actions",fn:function(e){var i=e.item;return[a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"ml-2",attrs:{"min-width":"34","max-width":"34",outlined:"",color:"secondary",ripple:!1,"retain-focus-on-click":""}},"v-btn",s,!1),i),[a("v-icon",{attrs:{color:"secondary"}},[t._v("mdi-dots-horizontal")])],1)]}}],null,!0)},[a("v-list",{staticClass:"pa-0"},[a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){return t.setEditable(i)}}},[a("v-list-item-title",{staticClass:"subtitle-2 font-weight-medium"},[t._v("Editar")])],1),a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){return t.destroyOrgunit(i)}}},[a("v-list-item-title",{staticClass:"subtitle-2 red--text font-weight-medium"},[t._v("Eliminar")])],1)],1)],1)]}}],null,!0)}):a("v-row",[a("v-col",{staticClass:"pb-6 pt-4 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-sitemap")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("No existen unidades organizativas")]),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogOrgunitCreate=!0}}},[t._v("Crear una unidad organizativa")])],1)],1)]],2),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogOrgunitCreate,callback:function(e){t.dialogOrgunitCreate=e},expression:"dialogOrgunitCreate"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear unidad organizativa")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogOrgunitCreate=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-12 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre de la unidad organizativa")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.newOrgunit.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newOrgunit.name.$model,callback:function(e){t.$set(t.$v.newOrgunit.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.newOrgunit.name.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-3"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogOrgunitCreate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"primary",loading:t.$store.state.customers.createLoader},on:{click:t.createOrgunit}},[t._v("Crear")])],1)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogOrgunitUpdate,callback:function(e){t.dialogOrgunitUpdate=e},expression:"dialogOrgunitUpdate"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Editar unidad organizativa")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogOrgunitUpdate=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-12 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre de la unidad organizativa")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.editableOrgunit.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editableOrgunit.name.$model,callback:function(e){t.$set(t.$v.editableOrgunit.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.editableOrgunit.name.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-3"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogOrgunitUpdate=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"primary",loading:t.$store.state.customers.createLoader},on:{click:t.updateOrgunit}},[t._v("Guardar")])],1)],1)],1)],1)},Lc=[],Sc={components:{VTableHeaders:Mi},mixins:[k],props:{customer:{type:Object,required:!0},displayCreate:{type:Boolean,required:!1,default:function(){return!1}}},data:function(){return{dialogOrgunitCreate:!1,dialogOrgunitUpdate:!1,editableOrgunit:{id:"",name:""},headers:[{text:"Nombre",value:"name",class:"font-weight-bold",sortable:!0},{text:"",value:"actions",class:"font-weight-bold",align:"end",sortable:!1}],newOrgunit:{name:""}}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({count:function(t){return t.customers.customersCount},orgunitsList:function(t){return t.customers.orgunitsList}})),Object(u["b"])({orgunits:"customers/orgunits"})),watch:{displayCreate:function(){this.displayCreate&&(this.dialogOrgunitCreate=!0)},dialogOrgunitCreate:function(){this.$emit("dialog-create",this.dialogOrgunitCreate)}},methods:{createOrgunit:function(){var t=this;if(this.$v.newOrgunit.$touch(),this.$v.newOrgunit.$invalid)return!1;var e=Object.assign({},this.newOrgunit,{customer:this.customer.id});this.$store.dispatch("customers/CREATE",{resource:"orgunits",payload:e}).then((function(){t.dialogOrgunitCreate=!1,t.newOrgunit.name="",t.$v.newOrgunit.$reset()})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))},destroyOrgunit:function(t){var e=this;this.$dialog.warning({title:"Eliminar unidad organizativa",text:'\n Estás a punto de eliminar la unidad organizativa '.concat(t.name,'.\n Esta acción no se podrá realizar si la organización está asignada a al menos una suscripción\n o persona / contacto.\n Esta acción no se puede deshacer.\n '),actions:[{color:"red",text:"Continuar",handle:function(){e.$store.dispatch("customers/DESTROY",{resource:"orgunits",id:t.id}).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))}}]})},setEditable:function(t){this.dialogOrgunitUpdate=!0,this.editableOrgunit=Q()(t)},updateOrgunit:function(){var t=this;if(this.$v.editableOrgunit.$touch(),this.$v.editableOrgunit.$invalid)return!1;var e=Object.assign({},this.editableOrgunit,{customer:this.customer.id});this.$store.dispatch("customers/UPDATE",{resource:"orgunits",id:this.editableOrgunit.id,payload:e}).then((function(){t.dialogOrgunitUpdate=!1})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{newOrgunit:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)}},editableOrgunit:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)}}}},Tc=Sc,Ec=Object(E["a"])(Tc,Vc,Lc,!1,null,null,null),Dc=Ec.exports;A()(Ec,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDataTable:Ai["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var Ac={mixins:[$],inject:["theme"],components:{InvoiceList:Tn,OrgunitList:Dc,VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{activeCurrency:{},dialogCustomer:!1,dialogMetadata:!1,dialogOrgunitCreate:!1,dialogSource:!1,editable:{},editableMetadata:[{key:"",value:""}],loaderMain:!1,loaderMetadata:!1,loaderSource:!1,source:{description:"",recipient:""},taxSettings:[{country:"CL",fields:["cl_activity_description"]}]}},computed:Object(u["c"])({contactsList:function(t){return t.customers.contactsList},instance:function(t){return t.customers.customersDetail},statesList:function(t){return t.generals.statesList}}),created:function(){var t=this;this.loaderMain=!0,this.$store.dispatch("customers/RETRIEVE",{resource:"customers",id:this.$route.params.id}).then((function(){var e=Q()(t.instance),a=t.taxSettings.find((function(t){return t.country===e.country.id}));a&&a.fields.forEach((function(t){e.tax_settings[t]||(e.tax_settings[t]=null)})),t.editable=e,t.editableMetadata=Object.keys(t.editable.metadata).map((function(e){return{key:e,value:t.editable.metadata[e]}}))})).then((function(){t.$store.dispatch("generals/LIST",{resource:"generals/states",query:{country:t.instance.country.id,page_size:500}})})).then((function(){t.$store.dispatch("customers/LIST",{resource:"contacts",query:{customer:t.$route.params.id}})})).then((function(){t.$store.dispatch("invoices/LIST",{resource:"invoices",query:{customer:t.$route.params.id,page_size:5}})})).then((function(){t.$store.dispatch("customers/LIST",{resource:"orgunits",query:{customer:t.$route.params.id,page_size:5}})})).then((function(){t.activeCurrency=t.currencies.find((function(e){return e.id===t.instance.currency}))})).finally((function(){t.loaderMain=!1}))},methods:{patchCustomer:function(){var t=this;if(this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;var e={name:this.editable.name,state:this.editable.state.id||this.editable.state,address:this.editable.address,tax_settings:this.editable.tax_settings,email:this.editable.email,phone:this.editable.phone,website:this.editable.website};this.instance.country.has_regulation||(e.tax_id=this.editable.tax_id),this.$store.dispatch("customers/UPDATE",{resource:"customers",id:this.$route.params.id,payload:e}).then((function(){t.dialogCustomer=!1,t.$dialog.message.info("El cliente ha sido actualizado")})).catch((function(){t.$dialog.message.error("Error al actualizar el cliente.")}))},updateDialogOrgunitCreate:function(t){this.dialogOrgunitCreate=t},updateMetadata:function(){var t=this;if(this.$v.editableMetadata.$touch(),this.$v.editableMetadata.$invalid)return!1;this.loaderMetadata=!0;var e=Object.fromEntries(this.editableMetadata.map((function(t){var e=t.key,a=t.value;return[e,a]})));this.$store.dispatch("customers/UPDATE",{resource:"customers",id:this.instance.id,payload:{metadata:e}}).then((function(){t.dialogMetadata=!1,t.$dialog.message.info("El cliente ha sido actualizado")})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loaderMetadata=!1}))}},validations:{editable:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(100)},state:{required:ie["required"]},address:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},tax_settings:{cl_activity_description:{required:Object(ie["requiredIf"])((function(){return"CL"===this.editable.country.id})),maxLength:Object(ie["maxLength"])(64)}},tax_id:{maxLength:Object(ie["maxLength"])(32)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(16)},website:{url:ie["url"]}},editableMetadata:{$each:{key:{required:ie["required"],maxLength:Object(ie["maxLength"])(32),itsRepeated:function(t){return!t||1===this.editableMetadata.filter((function(e){return e.key===t})).length}},value:{required:ie["required"],maxLength:Object(ie["maxLength"])(256)}},minLength:Object(ie["minLength"])(1),maxLength:Object(ie["maxLength"])(10)},source:{recipient:{required:ie["required"],email:ie["email"]},description:{required:ie["required"],maxLength:Object(ie["maxLength"])(256)}}}},jc=Ac,qc=Object(E["a"])(jc,$c,kc,!1,null,null,null),Ic=qc.exports;A()(qc,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Oc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Clientes")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"end"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"customer"}}),a("v-btn",{attrs:{color:"secondary",outlined:""},on:{click:function(e){t.dialogCustomer=!0}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v("Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("customer-list",{attrs:{"show-create":!0},on:{"update:create":function(e){t.dialogCustomer=!0}}})],1)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogCustomer,callback:function(e){t.dialogCustomer=e},expression:"dialogCustomer"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear cliente")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogCustomer=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"12"}},[a("v-text-field",{attrs:{error:t.$v.customer.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Acme LLC",maxlength:"100","hide-details":""},model:{value:t.$v.customer.name.$model,callback:function(e){t.$set(t.$v.customer.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v(" País "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("No podrás cambiar el país una vez que se guarde la información del cliente.")])])],1),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.customer.country.$error,label:"Elige un país","single-line":"",items:t.countriesList,"item-value":"id","item-text":"name","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},scopedSlots:t._u([{key:"item",fn:function(e){return[a("v-list-item-title",{staticClass:"font-weight-regular"},[t._v(t._s(e.item.name))])]}}]),model:{value:t.$v.customer.country.$model,callback:function(e){t.$set(t.$v.customer.country,"$model",e)},expression:"$v.customer.country.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.customer.state.$error,label:"Elige un estado",items:t.statesList,"item-value":"id","item-text":"name","single-line":"","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white","no-data-text":"No existen estados para el país."},scopedSlots:t._u([{key:"item",fn:function(e){return[a("v-list-item-title",{staticClass:"font-weight-regular"},[t._v(t._s(e.item.name))])]}}]),model:{value:t.$v.customer.state.$model,callback:function(e){t.$set(t.$v.customer.state,"$model",e)},expression:"$v.customer.state.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.customer.address.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.customer.address.$model,callback:function(e){t.$set(t.$v.customer.address,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de facturación")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v(" Moneda "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("No podrás cambiar la moneda una vez que se guarde la información del cliente o se cree una factura del cliente.")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.customer.currency.$error,label:"Elige una moneda",items:t.currencies.filter((function(t){return!t.conversion})),"item-value":"id","item-text":"name","menu-props":{overflowY:!0,transition:"slide-y-transition"},height:"30","background-color":"white",outlined:"",dense:"","single-line":"","hide-details":""},scopedSlots:t._u([{key:"item",fn:function(e){return[a("v-list-item-title",{staticClass:"font-weight-regular"},[t._v(t._s(e.item.id)+" - "+t._s(e.item.name))])]}}]),model:{value:t.$v.customer.currency.$model,callback:function(e){t.$set(t.$v.customer.currency,"$model",e)},expression:"$v.customer.currency.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v(" ID Fiscal "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("RUT, VAT, NIF o TAX ID")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{directives:[{name:"dni",rawName:"v-dni",value:t.customer.country,expression:"customer.country"}],attrs:{error:t.$v.customer.tax_id.$error,"background-color":"white",outlined:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.customer.tax_id.$model,callback:function(e){t.$set(t.$v.customer.tax_id,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.tax_id.$model"}})],1)],1)],1),t.country&&"CL"===t.country.id?a("v-list-item",[a("v-list-item-title",[t._v("Actividad comercial")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{attrs:{error:t.$v.customer.tax_settings.cl_activity_description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.customer.tax_settings.cl_activity_description.$model,callback:function(e){t.$set(t.$v.customer.tax_settings.cl_activity_description,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.tax_settings.cl_activity_description.$model"}})],1)],1):t._e(),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de contacto")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.customer.email.$error,outlined:"",required:"","single-line":"","background-color":"white",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.customer.email.$model,callback:function(e){t.$set(t.$v.customer.email,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.email.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[t.country?a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.country.phone_code+" # #### ####",expression:"`${country.phone_code} # #### ####`"}],attrs:{error:t.$v.customer.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"16","hide-details":""},model:{value:t.$v.customer.phone.$model,callback:function(e){t.$set(t.$v.customer.phone,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.phone.$model"}}):t._e()],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Sitio web")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.customer.website.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":!0},model:{value:t.$v.customer.website.$model,callback:function(e){t.$set(t.$v.customer.website,"$model","string"===typeof e?e.trim():e)},expression:"$v.customer.website.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-3"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogCustomer=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"primary",loading:t.$store.state.customers.createLoader},on:{click:t.postCustomer}},[t._v("Crear cliente")])],1)],1)],1)],1)},Rc=[],Nc={components:{CustomerList:fn,VQueryBuilder:dn},mixins:[k],data:function(){return{customer:{name:"",tax_id:"",tax_settings:{cl_activity_description:""},country:null,currency:"",state:"",address:"",email:"",phone:"",website:""},dialogCustomer:!1,filters:[{type:"text",id:"name",label:"Nombre",operators:["contiene"]},{type:"text",id:"tax_id",label:"Número fiscal",operators:["contiene"]},{type:"text",id:"created",label:"Fecha de creación",operators:["es igual","es menor a","es mayor a"]},{type:"radio",id:"sources",label:"Método de pago",choices:[{label:"Si",value:"True"},{label:"No",value:"False"}]},{type:"text",id:"email",label:"Email",operators:["contiene"]},{type:"text",id:"country__name",label:"País",operators:["contiene"]}],headers:[{text:"Cliente",value:"name",class:"font-weight-bold",sortable:!0},{text:"Email",value:"email",sortable:!0},{text:"Creado el",value:"created",align:"end",sortable:!0}],statesList:{}}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({countriesList:function(t){return t.generals.countriesList}})),{},{country:function(){var t=this;return this.customer.country?this.countriesList.find((function(e){return e.id===t.customer.country})):null}}),created:function(){var t=this,e={page_size:100};this.$store.dispatch("generals/LIST",{resource:"generals/countries",query:e}).then((function(){var e=t.countriesList.filter((function(e){return e.id===t.$store.state.auth.account.country.id}))[0];t.customer.country=e.id}))},watch:{"customer.country":function(){var t=this;this.statesList=this.countriesList.find((function(e){return e.id===t.customer.country})).states,this.customer.state="",this.customer.tax_id=""}},methods:{getList:function(){this.$store.dispatch("customers/LIST",{resource:"customers",query:this.$route.query})},postCustomer:function(){var t=this;if(this.$v.customer.$touch(),this.$v.customer.$invalid)return!1;this.$store.dispatch("customers/CREATE",{resource:"customers",payload:this.customer}).then((function(e){t.$router.push({name:"CustomerRetrieveUpdate",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{customer:{address:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},country:{required:ie["required"]},currency:{required:ie["required"]},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},name:{required:ie["required"],maxLength:Object(ie["maxLength"])(100)},phone:{maxLength:Object(ie["maxLength"])(16)},state:{required:ie["required"]},tax_id:{required:Object(ie["requiredIf"])((function(){var t=this;return this.countriesList.find((function(e){return e.id===t.customer.country})).has_regulation})),taxId:function(t){return"CL"!==this.customer.country||Object(_r["rutValidator"])(t)},maxLength:Object(ie["maxLength"])(32)},tax_settings:{cl_activity_description:{required:Object(ie["requiredIf"])((function(){return"CL"===this.customer.country})),maxLength:Object(ie["maxLength"])(64)}},website:{url:ie["url"]}}}},Pc=Nc,Bc=Object(E["a"])(Pc,Oc,Rc,!1,null,null,null),zc=Bc.exports;A()(Bc,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Fc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.loaderMain?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, divider, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"ContactListCreate"}}},[t._v("Personas")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 300px;":"max-width: 500px;"},[t._v(t._s(t.instance.name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-2",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){t.dialogContact=!0}}},[t._v("Editar")]),a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"ml-2",attrs:{"min-width":"34","max-width":"34",outlined:"",color:"secondary",ripple:!1,"retain-focus-on-click":""}},"v-btn",s,!1),i),[a("v-icon",{attrs:{color:"secondary"}},[t._v("mdi-dots-horizontal")])],1)]}}])},[a("v-list",{staticClass:"pa-0"},[a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:t.destroyContact}},[a("v-list-item-title",{staticClass:"subtitle-2 red--text font-weight-medium"},[t._v("Eliminar persona")])],1)],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.instance.email)}}},i),[t._v(t._s(t.instance.email))])]}}])},[a("span",[t._v("Copiar")])])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),t.instance.phone?a("v-list-item-subtitle",[t._v(t._s(t.instance.phone))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin número de teléfono")])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID")]),a("v-list-item-subtitle",[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.instance.id)}}},i),[t._v(t._s(t.instance.id))])]}}])},[a("span",[t._v("Copiar")])])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Actualizado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.updated)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Notificaciones activas")]),t.instance.invoicing||t.instance.collections?a("v-list-item-subtitle",[t.instance.invoicing?a("v-chip",{staticClass:"mr-1",attrs:{color:"primary","text-color":"white",small:""}},[t._v("Facturación")]):t._e(),t.instance.collections?a("v-chip",{staticClass:"mr-1",attrs:{color:"primary","text-color":"white",small:""}},[t._v("Cobranza")]):t._e()],1):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin notificaciones activas")])],1)],1)],1)],1)],1)],1),a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Cliente")])],1),a("v-divider"),a("v-card-text",{staticClass:"background"},[t.instance.customer&&t.customersDetail.id?a("v-row",{attrs:{align:"center",justify:"space-between"}},[a("v-col",{attrs:{cols:"5"}},[a("v-btn",{attrs:{to:{name:"CustomerRetrieveUpdate",params:{id:t.customersDetail.id}},text:"",color:"primary"}},[t._v(t._s(t.customersDetail.name)),a("v-icon",{attrs:{right:""}},[t._v("mdi-arrow-right")])],1),a("span",{staticClass:"d-block"},[t._v(t._s(t.customersDetail.address)+", "+t._s(t.customersDetail.country.name))])],1),t.orgunitsList.length?a("v-col",[a("span",{staticClass:"ml-1 body-2 text--secondary font-weight-medium"},[t._v("Unidad organizativa "),a("v-chip",{staticClass:"ml-1 mt-n1",attrs:{color:"secondary","x-small":""}},[t._v("Opcional")])],1),a("v-select",{attrs:{clearable:"",label:"Seleccionar unidad organizativa","single-line":"",items:t.orgunitsList,"item-value":"id","item-text":"name","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},on:{change:t.updateContact},scopedSlots:t._u([{key:"item",fn:function(e){return[a("v-list-item-title",{staticClass:"font-weight-regular"},[t._v(t._s(e.item.name))])]}}],null,!1,245714575),model:{value:t.editable.orgunit,callback:function(e){t.$set(t.editable,"orgunit",e)},expression:"editable.orgunit"}})],1):t._e(),a("v-col",{staticClass:"text-right"},[a("v-btn",{attrs:{outlined:"",color:"red darken-2",dark:"","retain-focus-on-click":""},on:{click:t.destroyCustomer}},[t._v("Desvincular cliente")])],1)],1):a("v-row",[a("v-col",{staticClass:"pb-6 pt-4 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-domain")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Esta persona aún no está vinculada a un cliente")]),a("v-btn",{attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){t.dialogCustomer=!0}}},[t._v("Vincular cliente")])],1)],1)],1)],1)],1),t.$store.state.customers.retrieveLoader?t._e():a("v-dialog",{attrs:{width:"700",scrollable:"",persistent:"","no-click-animation":""},model:{value:t.dialogContact,callback:function(e){t.dialogContact=e},expression:"dialogContact"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Editar persona")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogContact=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.editable.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un nombre",maxlength:"64","hide-details":""},model:{value:t.$v.editable.name.$model,callback:function(e){t.$set(t.$v.editable.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"10"}},[a("v-text-field",{attrs:{error:t.$v.editable.email.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un email",maxlength:"60","hide-details":""},model:{value:t.$v.editable.email.$model,callback:function(e){t.$set(t.$v.editable.email,"$model",e)},expression:"$v.editable.email.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"6"}},[a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.editable.phone+" # #### ####",expression:"`${editable.phone} # #### ####`"}],attrs:{error:t.$v.editable.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un teléfono",maxlength:"12","hide-details":""},model:{value:t.$v.editable.phone.$model,callback:function(e){t.$set(t.$v.editable.phone,"$model",e)},expression:"$v.editable.phone.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("¿Qué notificaciones debe recibir esta persona?")])])],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Facturación")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.editable.invoicing,callback:function(e){t.$set(t.editable,"invoicing",e)},expression:"editable.invoicing"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Cobranza")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.editable.collections,callback:function(e){t.$set(t.editable,"collections",e)},expression:"editable.collections"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.dialogContact=!1,t.$v.editable.$reset()}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.customers.createLoader,color:"primary"},on:{click:t.updateContact}},[t._v("Guardar")])],1)],1)],1),a("v-dialog",{attrs:{width:"600",persistent:"","no-click-animation":""},model:{value:t.dialogCustomer,callback:function(e){t.dialogCustomer=e},expression:"dialogCustomer"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Seleccionar un cliente")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.dialogCustomer=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticClass:"text-left",attrs:{cols:"12"}},[a("v-col",{staticClass:"py-2"},[a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe para buscar un cliente...","hide-details":""},model:{value:t.customerQuery,callback:function(e){t.customerQuery=e},expression:"customerQuery"}})],1),a("v-divider"),t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item"}}):[t.customersList.length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("tbody",t._l(t.customersList,(function(e){return a("tr",{key:e.id,staticStyle:{cursor:"pointer"},on:{click:function(a){return t.setCustomer(e)}}},[a("td",[a("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))])])])})),0)]},proxy:!0}],null,!1,160405733)})]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-close-circle")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen clientes")])],1)]],2)],1)],1)],1)],1)],1)},Mc=[],Uc={mixins:[$],inject:["theme"],components:{VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{customerQuery:"",editable:{collections:!1,email:"",invoicing:!1,name:"",phone:"",orgunit:null},dialogCustomer:!1,dialogDestroyCustomer:!1,dialogContact:!1,loaderMain:!1}},computed:Object(u["c"])({instance:function(t){return t.customers.contactsDetail},customersList:function(t){return t.customers.customersList},customersDetail:function(t){return t.customers.customersDetail},orgunitsList:function(t){return t.customers.orgunitsList}}),watch:{customerQuery:function(){this.debounceMethod(this.getCustomers)}},created:function(){var t=this;this.loaderMain=!0,this.$store.dispatch("customers/RETRIEVE",{resource:"contacts",id:this.$route.params.id}).then((function(){t.instance.customer&&t.getCustomer(),Object.keys(t.editable).forEach((function(e){t.editable[e]=t.instance[e]}))})).finally((function(){t.loaderMain=!1}))},methods:{updateContact:function(){var t=this;if(this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;void 0===this.editable.orgunit&&(this.editable.orgunit=null),this.$store.dispatch("customers/UPDATE",{resource:"contacts",payload:this.editable,id:this.$route.params.id}).then((function(){t.dialogContact=!1,t.$dialog.message.info("La persona ha sido actualizado")})).catch((function(e){t.$dialog.message.error(e.response.data.detail)}))},getCustomer:function(){var t=this;this.$store.dispatch("customers/RETRIEVE",{resource:"customers",id:this.instance.customer}).then((function(){t.getOrgunits()}))},getCustomers:function(){if([1,2].includes(this.customerQuery.length))return!1;var t={page_size:10};this.customerQuery.length>=3&&(t.name__icontains=this.customerQuery.toLowerCase()),this.$store.dispatch("customers/LIST",{resource:"customers",query:t})},getOrgunits:function(){this.$store.dispatch("customers/LIST",{resource:"orgunits",query:{customer:this.instance.customer}})},destroyContact:function(){var t=this;this.$dialog.warning({title:"Eliminar persona",text:'\n ¿Estás seguro de eliminar esta persona?\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("customers/DESTROY",{resource:"contacts",id:t.$route.params.id}).then((function(){t.$router.push({name:"ContactListCreate"})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})},setCustomer:function(t){var e=this;this.$dialog.warning({title:"Vincular cliente",text:'\n ¿Estás seguro de asociar cliente a esta persona?\n ',actions:[{color:"red",text:"Continuar",handle:function(){e.$store.dispatch("customers/UPDATE",{resource:"contacts",payload:{customer:t.id},id:e.$route.params.id}).then((function(){e.getCustomer(),e.dialogCustomer=!1,e.$dialog.message.info("El cliente ha sido asociado a la persona")})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))}}]})},destroyCustomer:function(){var t=this;this.$dialog.warning({title:"Eliminar asociación",text:'\n ¿Estás seguro de eliminar la asociación de esta persona con el cliente?\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("customers/UPDATE",{resource:"contacts",payload:{customer:null},id:t.$route.params.id}).then((function(){t.$dialog.message.info("El cliente ha sido eliminado")})).catch((function(){t.$dialog.message.error("El cliente no se ha podido eliminar")}))}}]})}},validations:{editable:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(12)}}}},Gc=Uc,Hc=Object(E["a"])(Gc,Fc,Mc,!1,null,null,null),Yc=Hc.exports;A()(Hc,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Wc=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",{staticClass:"px-0"},[t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Personas")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"customer"}}),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalContact=!0}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v("Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[t.$store.state.customers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.contactsList.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.contactsList,"items-per-page":t.pagination,"mobile-breakpoint":"","hide-default-footer":"","hide-default-header":"","disable-sort":""},on:{"click:row":function(e){t.$router.push({name:"ContactRetrieveUpdate",params:{id:e.id}})}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.name",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.name))])]}},{key:"item.email",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(i.email))])]}},{key:"item.phone",fn:function(e){var i=e.item;return[i.phone?a("span",[t._v(t._s(i.phone))]):a("span",{staticClass:"font-italic text--disabled"},[t._v("Sin teléfono")])]}},{key:"item.invoicing",fn:function(e){var i=e.item;return[i.invoicing||i.collections?[i.invoicing?a("v-chip",{staticClass:"mr-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Facturación")]):t._e(),i.collections?a("v-chip",{attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Cobranza")]):t._e()]:a("span",{staticClass:"font-italic text--disabled"},[t._v("Sin notificaciones activas")])]}},{key:"item.created",fn:function(e){var i=e.item;return[a("span",{staticClass:"text-right"},[t._v(t._s(t._f("date")(i.created)))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-row",[a("v-col",{staticClass:"pb-6 pt-4 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-account-multiple")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Sin personas registradas")]),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.modalContact=!0}}},[t._v("Crear una persona")])],1)],1)]],2)],1)],1),a("v-dialog",{attrs:{width:"700",scrollable:"",persistent:"","no-click-animation":""},model:{value:t.modalContact,callback:function(e){t.modalContact=e},expression:"modalContact"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear persona")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.modalContact=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.newContact.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un nombre",maxlength:"30","hide-details":""},model:{value:t.$v.newContact.name.$model,callback:function(e){t.$set(t.$v.newContact.name,"$model",e)},expression:"$v.newContact.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"10"}},[a("v-text-field",{attrs:{error:t.$v.newContact.email.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un email",maxlength:"60","hide-details":""},model:{value:t.$v.newContact.email.$model,callback:function(e){t.$set(t.$v.newContact.email,"$model",e)},expression:"$v.newContact.email.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"6"}},[a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.newContact.phone+" # #### ####",expression:"`${newContact.phone} # #### ####`"}],attrs:{error:t.$v.newContact.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe un teléfono",maxlength:"16","hide-details":""},model:{value:t.$v.newContact.phone.$model,callback:function(e){t.$set(t.$v.newContact.phone,"$model",e)},expression:"$v.newContact.phone.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("¿Qué notificaciones debe recibir esta persona?")])])],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Facturación")]),a("v-list-item-subtitle",[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.newContact.invoicing,callback:function(e){t.$set(t.newContact,"invoicing",e)},expression:"newContact.invoicing"}})],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Cobranza")]),a("v-list-item-subtitle",[a("v-switch",{staticClass:"mt-n4",staticStyle:{position:"absolute"},model:{value:t.newContact.collections,callback:function(e){t.$set(t.newContact,"collections",e)},expression:"newContact.collections"}})],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalContact=!1,t.$v.newContact.$reset()}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.loading,color:"primary"},on:{click:t.createContact}},[t._v("Crear persona")])],1)],1)],1)],1)},Qc=[],Kc={components:{VQueryBuilder:dn,VTableHeaders:Mi},mixins:[k],data:function(){return{newContact:{name:"",email:"",phone:"",invoicing:!1,collections:!1},filters:[{type:"text",id:"email",label:"Email",operators:["contiene"]},{type:"text",id:"name",label:"Nombre",operators:["contiene"]},{type:"text",id:"customer__name",label:"Cliente",operators:["contiene"]},{type:"radio",id:"invoicing",label:"Recibe facturación",choices:[{label:"Si",value:"True"},{label:"No",value:"False"}]},{type:"radio",id:"collections",label:"Recibe cobranza",choices:[{label:"Si",value:"True"},{label:"No",value:"False"}]}],headers:[{text:"Nombre",value:"name",class:"font-weight-bold",sortable:!0},{text:"Email",value:"email",sortable:!0},{text:"Teléfono",value:"phone"},{text:"Notificaciones activas",value:"invoicing"},{text:"Creado el",value:"created",align:"end",sortable:!0}],modalContact:!1}},computed:Object(u["c"])({count:function(t){return t.customers.contactsCount},contactsList:function(t){return t.customers.contactsList}}),methods:{getList:function(){this.$store.dispatch("customers/LIST",{resource:"contacts",query:this.$route.query})},createContact:function(){var t=this;if(this.$v.newContact.$touch(),this.$v.newContact.$invalid)return!1;this.$store.dispatch("customers/CREATE",{resource:"contacts",payload:this.newContact}).then((function(e){t.$router.push({name:"ContactRetrieveUpdate",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{newContact:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(30)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(12)}}}},Xc=Kc,Jc=Object(E["a"])(Xc,Wc,Qc,!1,null,null,null),Zc=Jc.exports;A()(Jc,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDataTable:Ai["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var td=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{staticClass:"px-0 pb-0",attrs:{cols:"12"}},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"48"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Integraciones")])],1)],1),i("v-col",{staticClass:"px-0",attrs:{cols:"12"}},[i("v-row",{staticClass:"mx-0",attrs:{aling:"center",justify:"start"}},[t._l(t.integrations,(function(e){return i("v-col",{key:e.id,attrs:{cols:"2"}},[i("v-card",{staticClass:"py-0 card-apps",attrs:{ripple:!1},on:{click:function(a){a.stopPropagation(),t.dialog=!0,t.selectedIntegration=e}}},[i("v-card-text",{staticClass:"px-2 text-center"},[i("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1.2}},[i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+e.img+".svg"),width:"60px"}}),i("span",{staticClass:"d-block text--secondary"},[t._v(t._s(e.title))])])],1)],1)],1)})),i("v-col",{attrs:{cols:"2"}},[i("v-card",{staticClass:"py-0 card-apps",attrs:{href:t.zapier.main,target:"_blank",hover:"",ripple:!1}},[i("v-card-text",{staticClass:"px-2 text-center"},[i("v-responsive",{staticClass:"align-center",attrs:{"aspect-ratio":1.2}},[i("v-icon",{attrs:{color:"secondary",size:"52px"}},[t._v("mdi-dots-horizontal")]),i("span",{staticClass:"d-block mt-2 text--secondary"},[t._v("Ver más")])],1)],1)],1)],1)],2),i("v-row",{staticClass:"mx-0",attrs:{aling:"center",justify:"start"}},[i("v-col",[i("v-card",{staticClass:"py-0 card-apps",attrs:{hover:"",href:t.zapier.link,target:"_blank",ripple:!1}},[i("v-list",{attrs:{subheader:"","two-line":""}},[i("v-list-item",{attrs:{"three-line":""}},[i("v-list-item-avatar",{attrs:{tile:"",size:"52"}},[i("img",{attrs:{src:a("133d"),width:"60px"}})]),i("v-list-item-content",[i("v-list-item-title",{staticClass:"pt-1 text--secondary subtitle-1 font-weight-medium"},[t._v("Zapier")]),i("v-list-item-subtitle",{staticClass:"pb-2"},[t._v("Automatización para tus aplicaciones favoritas")])],1),i("v-list-item-action",{staticClass:"px-4 py-2"},[i("v-btn",{attrs:{href:t.zapier.link,target:"_blank",text:"",color:"primary"}},[t._v("Unirse a la beta"),i("v-icon",{attrs:{color:"primary",right:""}},[t._v("mdi-arrow-right")])],1)],1)],1)],1)],1)],1)],1)],1),i("v-dialog",{attrs:{width:"600",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialog,callback:function(e){t.dialog=e},expression:"dialog"}},[i("v-card",{staticClass:"pa-0"},[i("v-card-title",{staticClass:"pa-0"},[i("v-toolbar",{attrs:{flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Integra Axteroid con "+t._s(t.selectedIntegration.title))]),i("v-spacer"),i("v-toolbar-items",[i("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[i("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialog=!1}}},[i("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),i("v-divider"),i("v-card-text",{staticClass:"background"},[i("v-row",[i("v-col",{attrs:{cols:"12"}},[i("span",{staticClass:"text--secondary subtitle-1"},[t._v(t._s(t.selectedIntegration.description))])]),i("v-col",{attrs:{cols:"12"}},[i("span",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Ejemplo")])])],1),i("v-row",[i("v-col",[i("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Connecta...")]),i("v-sheet",{attrs:{color:"#D8E0EA",rounded:""}},[i("v-row",{staticClass:"mx-0 pa-2"},[i("v-avatar",{attrs:{color:"white",size:"28",rounded:""}},[t.selectedIntegration.img?i("img",{attrs:{src:a("049a"),width:"24px"}}):t._e()]),i("span",{staticClass:"ml-2 subtitle-1 text--secondary font-weight-medium"},[t._v("Axteroid")])],1)],1)],1),i("v-col",{staticClass:"text-center",attrs:{cols:"1"}},[i("v-icon",{staticClass:"mt-8",attrs:{dense:"",size:"28px",color:"secondary"}},[t._v("mdi-plus")])],1),i("v-col",[i("span",{staticClass:"text--secondary font-weight-medium"},[t._v("con...")]),i("v-sheet",{attrs:{color:"#D8E0EA",rounded:""}},[i("v-row",{staticClass:"mx-0 pa-2"},[i("v-avatar",{attrs:{color:"white",size:"28",rounded:""}},[t.selectedIntegration.img?i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+t.selectedIntegration.img+".svg")}}):t._e()]),i("span",{staticClass:"ml-2 subtitle-1 text--secondary font-weight-medium"},[t._v(t._s(t.selectedIntegration.title))])],1)],1)],1)],1),i("v-row",[i("v-col",[i("span",{staticClass:"text--secondary font-weight-medium"},[t._v("cuando...")]),i("v-sheet",{attrs:{color:"#D8E0EA",rounded:""}},[i("v-row",{staticClass:"mx-0 pa-2"},[i("v-avatar",{attrs:{color:"white",size:"28",rounded:""}},[t.selectedIntegration.img?i("img",{attrs:{src:a("049a"),width:"24px"}}):t._e()]),i("span",{staticClass:"ml-2 subtitle-1 text--secondary font-weight-medium"},[t._v(t._s(t.selectedIntegration.example.when))])],1)],1)],1),i("v-col",{staticClass:"text-center",attrs:{cols:"1"}},[i("v-icon",{staticClass:"mt-8",attrs:{dense:"",size:"28px",color:"secondary"}},[t._v("mdi-arrow-right")])],1),i("v-col",[i("span",{staticClass:"text--secondary font-weight-medium"},[t._v("entonces haz esto!")]),i("v-sheet",{attrs:{color:"#D8E0EA",rounded:""}},[i("v-row",{staticClass:"mx-0 pa-2"},[i("v-avatar",{attrs:{color:"white",size:"28",rounded:""}},[t.selectedIntegration.img?i("img",{attrs:{src:a("e4d1")("./appAsset-brand--"+t.selectedIntegration.img+".svg"),width:"24px"}}):t._e()]),i("span",{staticClass:"ml-2 subtitle-1 text--secondary font-weight-medium"},[t._v(t._s(t.selectedIntegration.example.then))])],1)],1)],1)],1),i("v-row",{staticClass:"px-3 mt-8",attrs:{align:"center"}},[i("v-btn",{attrs:{href:t.zapier.link,target:"_blank",color:"primary"}},[t._v("Unirse a la beta "),i("v-icon",{attrs:{small:"",right:""}},[t._v("mdi-arrow-right")])],1),i("span",{staticClass:"mx-4"},[t._v("o")]),i("v-btn",{attrs:{href:t.zapier.main,target:"_blank",text:"",color:"primary"}},[t._v("Ir al constructor")])],1)],1)],1)],1)],1)},ed=[],ad={data:function(){return{integrations:[{id:"gsheets",title:"Google Sheets",description:"Crea, edita y comparte hojas de cálculo donde quieras que estés con Google Sheets y obtén información automatizada de tus datos.",img:"GoogleSheets",example:{when:"Cupón Creado",then:"Crear una Fila"}},{id:"hubspot",title:"HubSpot",description:"HubSpot es una solución de CRM todo en uno para todas las necesidades digitales de marketing y ventas.",img:"HubSpot",example:{when:"Cliente Creado",then:"Crear Contacto"}},{id:"slack",title:"Slack",description:"Slack es una plataforma de mensajería instantánea en equipo. Intercambio de documentos y búsqueda de conocimiento para equipos modernos.",img:"Slack",example:{when:"Factura Pagada",then:"Enviar Mensaje"}},{id:"twilio",title:"Twilio",description:"Una herramienta sencilla para que los desarrolladores envíen y reciban SMS y llamadas de voz.",img:"Twilio",example:{when:"Pago Creado",then:"Enviar SMS"}},{id:"airtable",title:"Airtable",description:"Organiza cualquier cosa con Airtable, una base de datos moderna creada para todos. Airtable es una forma rápida y flexible de crear tablas para organizar desde los clientes potenciales hasta realizar la gestión de inventario.",img:"Airtable",example:{when:"Plan Creado",then:"Crear Registro"}}],selectedIntegration:{id:"",title:"",img:"",example:{when:"",then:""}},zapier:{link:"https://zapier.com/developer/public-invite/127840/e9276ebafdd31047720b76ae27f6de96/",main:"https://zapier.com/webintent/create-zap"},dialog:!1}}},id=ad,sd=a("8212"),rd=a("8270"),nd=Object(E["a"])(id,td,ed,!1,null,null,null),od=nd.exports;A()(nd,{VAvatar:sd["a"],VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemAction:we["a"],VListItemAvatar:rd["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VResponsive:it["a"],VRow:z["a"],VSheet:da["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var ld=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",{staticClass:"px-0"},[t.$store.state.purchases.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"Applications"}}},[t._v("Aplicaciones")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(" Purchases "),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(" Compras ")],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"purchase"}}),a("v-btn",{attrs:{id:"it-purchase-new",to:{name:"PurchaseCreate"},outlined:"",color:"secondary"}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v("Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("purchase-list")],1)],1)],1)],1)},cd=[],dd=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{"no-gutters":""}},[a("v-col",{attrs:{cols:"12"}},[t.$store.state.purchases.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.list.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.list,"items-per-page":t.pagination,"hide-default-header":"","disable-sort":"","mobile-breakpoint":"","hide-default-footer":""},on:{"click:row":function(e){t.goToUpdateorRetrieve(e)}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.supplier",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.supplier.name))])]}},{key:"item.status",fn:function(e){var i=e.item;return[a("v-row",{attrs:{align:"center",justify:"end"}},[t.showStatus?a("div",{staticClass:"text-right"},["draft"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Borrador")]):"processing"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Procesando")]):"finalized"===i.status?a("v-chip",{staticClass:"mx-1",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Finalizado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):t._e()],1):t._e()])]}},{key:"item.document",fn:function(e){var i=e.item;return[a("span",{staticClass:"d-block"},[t._v(t._s(i.document.name))]),0!==i.number?a("span",{staticClass:"d-block body-2 text--secondary font-weight-medium"},[t._v(t._s(i.number))]):t._e()]}},{key:"item.date",fn:function(e){var i=e.item;return[a("span",[t._v(t._s(t._f("date")(i.date)))])]}},{key:"item.total",fn:function(e){var i=e.item;return[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(i.total,i.currency)))]),a("span",{staticClass:"ml-1"},[t._v(t._s(i.currency))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-row",[a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-file")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen compras")])],1)],1)]],2)],1)},ud=[],vd={components:{VTableHeaders:Mi},mixins:[k],data:function(){return{headers:[{text:"Proveedor",value:"supplier",class:"font-weight-bold",sortable:!0},{text:"",value:"status"},{text:"Documento",value:"document"},{text:"Fecha",value:"date",sortable:!0},{text:"Total",value:"total",width:300,align:"end",sortable:!0}]}},computed:Object(u["c"])({count:function(t){return t.purchases.purchasesCount},list:function(t){return t.purchases.purchasesList}}),methods:{goToUpdateorRetrieve:function(t){"draft"===t.status&&t.document.is_purshase&&!t.document.is_sale?this.$router.replace("/purchases/".concat(t.id,"/edit")):this.$router.push({name:"PurchaseRetrieve",params:{id:t.id}})}}},md=vd,pd=Object(E["a"])(md,dd,ud,!1,null,null,null),hd=pd.exports;A()(pd,{VChip:j["a"],VCol:q["a"],VDataTable:Ai["a"],VDivider:tt["a"],VIcon:I["a"],VPagination:ji["a"],VRow:z["a"],VSkeletonLoader:st["a"]});var fd={components:{PurchaseList:hd,VQueryBuilder:dn},mixins:[k],data:function(){return{filters:[{type:"text",id:"supplier__name",label:"Proveedor",operators:["contiene"]},{type:"text",id:"date",label:"Fecha",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"total",label:"Total",operators:["es igual","es menor a","es mayor a"]},{type:"numeric",id:"number",label:"Número",operators:["es igual","es menor a","es mayor a"]}]}},methods:{getList:function(){this.$store.dispatch("purchases/LIST",{resource:"purchases",query:this.$route.query})}}},bd=fd,gd=Object(E["a"])(bd,ld,cd,!1,null,null,null),_d=gd.exports;A()(gd,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var yd=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.purchases.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"PurchaseList"}}},[t._v("Compras")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 350px;":"max-width: 500px;"},[t._v(t._s(((t.instance||{}).document||{}).name)+" de "+t._s(((t.instance||{}).supplier||{}).name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[t.instance.document.is_purshase&&!t.instance.document.is_sale?a("v-btn",{staticClass:"ml-1",attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("purchases")}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document")]),t._v("PDF")],1):[t.swap?a("v-btn",{attrs:{outlined:"",color:"secondary","retain-focus-on-click":""},on:{click:function(e){return t.renderDocument("purchases","billers/built_in/swaps","pdf",t.swap.id)}}},[a("v-icon",{attrs:{small:"",left:""}},[t._v("mdi-file-document ")]),t._v(" PDF")],1):t._e()]],2)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("v-row",{staticClass:"mx-0 background"},[a("v-col",{attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Total")]),a("span",{staticClass:"body-1 font-weight-medium mr-1"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency)))]),a("span",[t._v(t._s(t.instance.currency))])]),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"3"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Proveedor")]),a("v-btn",{attrs:{to:{name:"SupplierRetrieveUpdate",params:{id:t.instance.supplier.id}},height:"20",text:"",color:"primary","retain-focus-on-click":"",ripple:!1}},[a("span",{staticClass:"d-inline-block text-truncate",staticStyle:{"max-width":"200px"}},[t._v(t._s(((t.instance||{}).supplier||{}).name))]),a("v-icon",{attrs:{right:"",small:""}},[t._v("mdi-arrow-right")])],1)],1),a("v-divider",{staticClass:"my-2",attrs:{vertical:""}}),a("v-col",{staticClass:"ml-2",attrs:{cols:"2"}},[a("span",{staticClass:"d-block mb-1"},[t._v("Fecha")]),a("div",{staticClass:"font-weight-medium mt-1"},[t._v(t._s(t._f("date")(t.instance.date)))])])],1),a("v-divider"),a("v-toolbar",{staticClass:"transparent",attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1),a("v-row",[a("v-col",{attrs:{cols:"5"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Tipo de documento")]),a("v-list-item-subtitle",[t._v(t._s(((t.instance||{}).document||{}).name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Número")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.number))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.created)))])],1)],1)],1)],1)],1)],1),"CL"==t.account.country.id&&t.instance.document.has_local_format?a("v-card",{staticClass:"px-0 my-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Gestión SII")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[t.swap&&!t.swap.status?a("v-btn",{staticClass:"mr-1",attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalSwap=!0}}},[t._v("Aceptar o rechazar")]):t._e(),a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({attrs:{"retain-focus-on-click":"",outlined:"",color:"secondary"}},"v-btn",s,!1),i),[t._v("Opciones")])]}}],null,!1,2157976467)},[a("v-list",{staticClass:"pa-0"},[t.swap&&t.swap.local_file?a("v-list-item",{staticClass:"px-5 py-1",attrs:{href:t.swap.local_file,target:"_blank",ripple:!1}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Ver XML")])],1):t.instance.local_file?a("v-list-item",{staticClass:"px-5 py-1",attrs:{href:t.instance.local_file,target:"_blank",ripple:!1}},[a("v-list-item-title",{staticClass:"subtitle-2 text--secondary font-weight-medium"},[t._v("Ver XML")])],1):t._e()],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.swap?[a("v-row",[a("v-col",[a("v-list",{staticClass:"v-list-form-extended transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t.swap.status?"ERM"===t.swap.status||"ACD"===t.swap.status?a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v("Aceptado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):"RCD"===t.swap.status||"RFP"===t.swap.status||"RFT"===t.swap.status?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Rechazado"),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):t._e():a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v("Pendiente")])],1)],1),t.swap.status?[a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",["ERM"===t.swap.status?a("span",[t._v("Otorga recibo de mercaderías o servicios")]):"ACD"===t.swap.status?a("span",[t._v("Acepta contenido del documento")]):"RCD"===t.swap.status?a("span",[t._v("Reclamo al contenido del documento")]):"RFP"===t.swap.status?a("span",[t._v("Reclamo por falta parcial de mercaderías")]):"RFT"===t.swap.status?a("span",[t._v("Reclamo por falta total de mercaderías")]):t._e()])],1),a("v-list-item",[a("v-list-item-title",[t._v("Archivos de respuesta")]),a("v-list-item-subtitle",{staticClass:"text-left"},[t.swap.reception?a("v-btn",{staticClass:"mr-1",attrs:{href:t.swap.reception,target:"_blank",outlined:"",color:"secondary",small:""}},[t._v("Recepción")]):t._e(),t.swap.receipt?a("v-btn",{staticClass:"mr-1",attrs:{href:t.swap.receipt,target:"_blank",outlined:"",color:"secondary",small:""}},[t._v("Recepción")]):t._e(),t.swap.result?a("v-btn",{staticClass:"mr-1",attrs:{href:t.swap.result,target:"_blank",outlined:"",color:"secondary",small:""}},[t._v("Resultado")]):t._e()],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Respondido el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.swap.reply_date)))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Respondido por")]),a("v-list-item-subtitle",[t._v(t._s(t.swap.reply_by))])],1)]:t._e(),a("v-list-item",[t.swap.status?a("v-list-item-title",[t._v("Respondido a")]):a("v-list-item-title",[t._v("Responder a")]),a("v-list-item-subtitle",[t._v(t._s(t.swap.reply_to))])],1)],2)],1)],1)]:[a("v-list",{staticClass:"v-list-form-extended transparent py-5"},[a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t.instance.tax_agency.cl_status?t.instance.tax_agency.cl_status.includes("Rechazado")?a("v-chip",{staticClass:"caption",attrs:{color:"defaultGrey","text-color":"secondary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-close")])],1):a("v-chip",{attrs:{color:"lightBlue","text-color":"primary",small:""}},[t._v(t._s(t.instance.tax_agency.cl_status)),a("v-icon",{staticClass:"ml-1",attrs:{"x-small":""}},[t._v("mdi-check")])],1):a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("purchases","purchases","tax_agency_status")}}},[t._v("Actualizar estado")])],1)],1),t.instance.tax_agency.cl_status_detail?a("v-list-item",[a("v-list-item-title",[t._v("Detalle del estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_agency.cl_status_detail))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v(" Track ID "),t.instance.tax_agency.cl_id?t._e():a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"red"}},i),[t._v("mdi-alert")])]}}],null,!1,2543809772)},[a("span",[t._v("Es requerido enviar a la agencia fiscal")])])],1),a("v-list-item-subtitle",{staticClass:"text-left"},[t.instance.tax_agency.cl_id?a("span",[t._v(t._s(t.instance.tax_agency.cl_id))]):a("span",[a("v-btn",{attrs:{loading:t.taxAgencyLoader,text:"",color:"primary",ripple:!1},on:{click:function(e){return t.taxAgencyService("purchases","purchases","tax_agency_send")}}},[t._v("Enviar a la agencia fiscal")])],1)])],1)],1)]],2)],1):t._e(),a("v-card",{staticClass:"pa-0 my-5"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Productos")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-simple-table",{attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Producto")]),a("th",{staticClass:"text-center"},[t._v("Unidad de medida")]),a("th",{staticClass:"text-right"},[t._v("Cantidad")]),a("th",{staticClass:"text-right"},[t._v("P. unitario")]),a("th",{staticClass:"text-right"},[t._v("Total")])])]),a("tbody",[t._l(t.instance.lines,(function(e){return[a("tr",{key:e.id},[a("td",[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(e.name))]),a("span",{staticClass:"d-block"},[t._v(t._s(e.description))])]),a("td",{staticClass:"text-center"},[t._v(t._s(e.unit))]),a("td",{staticClass:"text-right"},[t._v(t._s(t._f("currency")(e.quantity,t.instance.currency)))]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.amount,t.instance.currency)))])]),a("td",{staticClass:"text-right"},[a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(e.total,t.instance.currency)))])])])]}))],2)]},proxy:!0}])}),a("v-divider"),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"4"}},[a("v-list",{staticClass:"v-list-form pa-0 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("number")(t.instance.exempt)))])],1),t.instance.document.has_taxes&&t.instance.document.has_taxes_detail?[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("number")(t.instance.amount)))])],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Descuento")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("number")(t.instance.discount))+" "+t._s(t.instance.discount_scheme))])],1),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Impuestos ("+t._s(t.instance.tax_percent)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right"},[t._v(t._s(t._f("number")(t.instance.tax)))])],1)]:t._e(),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left body-1 text--secondary font-weight-medium"},[t._v("Total")]),a("v-list-item-subtitle",{staticClass:"text-right body-1 text--secondary font-weight-medium"},[t._v(t._s(t._f("currency")(t.instance.total,t.instance.currency))+" "+t._s(t.instance.currency))])],1)],2)],1)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"700"},model:{value:t.modalSwap,callback:function(e){t.modalSwap=e},expression:"modalSwap"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Aceptar o rechazar "+t._s(((t.instance||{}).document||{}).name))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:"","retain-focus-on-click":""},on:{click:function(e){t.modalSwap=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",[a("v-list-item-title",[t._v("Respuesta")]),a("v-list-item-subtitle",[a("v-select",{attrs:{items:t.swapStatuses,"item-text":"label","item-value":"value","single-line":"","hide-details":"",dense:"",outlined:"","background-color":"white"},model:{value:t.swapResponse.status,callback:function(e){t.$set(t.swapResponse,"status",e)},expression:"swapResponse.status"}})],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalSwap=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.billers.createLoader,color:"primary"},on:{click:t.updateSwap}},[t._v("Continuar")])],1)],1)],1),t.instance.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.modalRender,callback:function(e){t.modalRender=e},expression:"modalRender"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v(t._s("PDF "+t.instance.document.name+" Nº "+t.instance.number))]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.modalRender=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[t.loaderRender?a("v-row",[a("v-col",{staticClass:"py-0 ma-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{staticClass:"rounded-0",attrs:{transition:"fade-transition",type:"table"}})],1)],1):t.loaderRender||t.renderUrl?t._e():a("v-row",[a("v-col",{staticClass:"py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-image-broken-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("PDF no disponible")])],1)],1),a("div",{attrs:{id:"render"}})],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{href:t.renderUrl,download:t.instance.document.id+"_N"+t.instance.number,color:"primary",dark:""}},[t._v("Descargar PDF")])],1)],1)],1):t._e()],1)},Cd=[],xd={mixins:[$,no,xo],inject:["theme"],components:{VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{swap:null,swapResponse:{status:"ERM"},swapStatuses:[{value:"ERM",label:"Otorga recibo de mercaderías o servicios"},{value:"ACD",label:"Acepta contenido del documento"},{value:"RCD",label:"Reclamo al contenido del documento"},{value:"RFP",label:"Reclamo por falta parcial de mercaderías"},{value:"RFT",label:"Reclamo por falta total de mercaderías"}],modalSwap:!1}},computed:Object(u["c"])({instance:function(t){return t.purchases.purchasesDetail}}),created:function(){this.retrieve()},methods:{retrieve:function(){var t=this;this.$store.dispatch("purchases/RETRIEVE",{resource:"purchases",id:this.$route.params.id}).then((function(){"CL"===t.instance.document.country&&t.$store.dispatch("billers/LIST",{resource:"billers/built_in/swaps",query:{purchases__in:t.$route.params.id}}).then((function(e){e.data.results&&(t.swap=e.data.results[0])}))}))},updateSwap:function(){var t=this,e=["ERM","ACD"].includes(this.swapResponse.status);this.$dialog.warning({title:"Confirmar ".concat(e?"aceptar":"rechazar"," documento"),text:'\n Se enviará un email al proveedor y se registrará la respuesta en tu cuenta de sii.cl\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n ',actions:[{color:e?"primary":"red",text:"Continuar",handle:function(){t.$store.dispatch("billers/UPDATE",{resource:"billers/built_in/swaps",id:t.swap.id,payload:{status:t.swapResponse.status,purchase:t.instance.id}}).then((function(e){t.swap=e.data,t.modalSwap=!1})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}}]})}}},wd=xd,$d=Object(E["a"])(wd,yd,Cd,!1,null,null,null),kd=$d.exports;A()($d,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Vd=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.purchases.retrieveLoader||t.$store.state.generals.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"card-heading, image, actions"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-card-text",{staticClass:"px-0 py-0 background"},[a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text-right mr-2 text--secondary font-weight-medium"},[t._v("Documento")]),a("v-list-item-subtitle",[a("v-select",{attrs:{error:t.$v.purchase.document.$error,items:t.documentsList,readonly:"","single-line":"","v-ripple":!1,"item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.$v.purchase.document.$model,callback:function(e){t.$set(t.$v.purchase.document,"$model",e)},expression:"$v.purchase.document.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-3"},[a("v-list-item-title",{staticClass:"text-right mr-2 text--secondary font-weight-medium"},[t._v("Fecha")]),a("v-list-item-subtitle",[a("v-menu",{attrs:{"close-on-content-click":!1,"offset-y":"",transition:"scale-transition","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-text-field",t._g(t._b({attrs:{error:t.$v.purchase.date.$error,outlined:"","single-line":"",dense:"",readonly:"","hide-details":""},scopedSlots:t._u([{key:"append",fn:function(){return[a("v-icon",{staticClass:"mr-3",attrs:{small:"",color:"secondary"}},[t._v("mdi-calendar")])]},proxy:!0}],null,!0),model:{value:t.$v.purchase.date.$model,callback:function(e){t.$set(t.$v.purchase.date,"$model",e)},expression:"$v.purchase.date.$model"}},"v-text-field",s,!1),i))]}}]),model:{value:t.menu,callback:function(e){t.menu=e},expression:"menu"}},[a("v-date-picker",{attrs:{"no-title":"",type:"date",locale:"es-cl",width:"280",color:"blue"},on:{input:function(e){t.menu=!1}},model:{value:t.$v.purchase.date.$model,callback:function(e){t.$set(t.$v.purchase.date,"$model",e)},expression:"$v.purchase.date.$model"}},[a("div",{staticClass:"mx-auto"},[a("v-btn",{attrs:{color:"primary"},on:{click:function(){t.$v.purchase.date.$model=t.today}}},[t._v("Hoy")]),a("v-btn",{staticClass:"ml-2",attrs:{outlined:""},on:{click:function(){t.$v.purchase.date.$model=""}}},[t._v("Limpiar")])],1)])],1)],1)],1)],1)],1)],1),t.purchase.supplier.id?a("v-row",[a("v-col",{attrs:{md:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",[a("span",{staticClass:"text--secondary pb-3 subtitle-1 font-weight-medium",staticStyle:{width:"200px"}},[t._v(t._s(t.purchase.supplier.name))])]),a("v-list-item-subtitle",[a("v-btn",{attrs:{color:"primary",text:"",ripple:!1},on:{click:function(e){t.modalSupplier=!0}}},[t._v("Seleccionar otro...")])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Número fiscal")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.tax_id))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.address))])],1),t.purchase.supplier.state.name?a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.state.name))])],1):t._e(),t.purchase.supplier.country.name?a("v-list-item",[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.country.name))])],1):t._e(),a("v-list-item",[a("v-list-item-title",[t._v("Email")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.email))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",[t._v(t._s(t.purchase.supplier.phone))])],1)],1)],1)],1):a("v-row",[a("v-col",{staticClass:"text-center py-5",attrs:{cols:"12"}},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-account")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Selecciona un proveedor para crear el documento")]),a("v-btn",{staticClass:"my-5",attrs:{id:"it-purchase-supplier",outlined:"",color:"secondary"},on:{click:function(e){t.modalSupplier=!0}}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Seleccionar un proveedor")],1)],1)],1),a("v-col",{staticClass:"px-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Productos y servicios")])],1),a("v-divider"),a("v-simple-table",{attrs:{dense:""},scopedSlots:t._u([{key:"default",fn:function(){return[a("thead",[a("tr",[a("th",[t._v("Nombre")]),a("th",{staticClass:"text-left",staticStyle:{width:"80px"}},[t._v("Exento")]),a("th",{staticStyle:{width:"80px"}},[t._v("Cant.")]),a("th",{staticStyle:{width:"80px"}},[t._v("Unidad")]),a("th",{staticClass:"text-right",staticStyle:{width:"100px"}},[t._v("Precio")]),a("th",{staticClass:"text-right",staticStyle:{width:"156px"}},[t._v("Subtotal")]),a("th",{staticStyle:{width:"56px"}})])]),a("tbody",{attrs:{id:"it-purchase-set_product"}},[t._l(t.purchase.lines,(function(e,i){return[a("tr",{key:e.id},[a("td",[a("v-text-field",{attrs:{error:t.$v.purchase.lines.$each[i].name.$error,"background-color":"transparent",solo:"",required:"","single-line":"",flat:"",dense:"",placeholder:"Escribe un nombre para el producto",maxlength:"80","hide-details":""},model:{value:e.name,callback:function(a){t.$set(e,"name","string"===typeof a?a.trim():a)},expression:"d.name"}}),a("v-text-field",{staticClass:"mt-n4",attrs:{error:t.$v.purchase.lines.$each[i].description.$error,"background-color":"transparent",required:"","single-line":"",solo:"",flat:"",dense:"",placeholder:"Descripción del producto",maxlength:"1000","hide-details":""},model:{value:e.description,callback:function(a){t.$set(e,"description","string"===typeof a?a.trim():a)},expression:"d.description"}})],1),a("td",[a("v-switch",{attrs:{disabled:!t.selectedDocument.has_taxes},model:{value:e.exempt,callback:function(a){t.$set(e,"exempt",a)},expression:"d.exempt"}})],1),a("td",[a("v-text-field",{attrs:{error:t.$v.purchase.lines.$each[i].quantity.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');","background-color":"transparent",reverse:"","full-width":"",solo:"",required:"","single-line":"",flat:"",dense:"",placeholder:"0",maxlength:"12","hide-details":""},model:{value:e.quantity,callback:function(a){t.$set(e,"quantity",t._n(a))},expression:"d.quantity"}})],1),a("td",[a("v-text-field",{attrs:{error:t.$v.purchase.lines.$each[i].unit_label.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');","background-color":"transparent",solo:"",required:"","single-line":"",flat:"",dense:"",placeholder:"C/U",maxlength:"4","hide-details":""},model:{value:e.unit_label,callback:function(a){t.$set(e,"unit_label","string"===typeof a?a.trim():a)},expression:"d.unit_label"}})],1),a("td",[a("v-text-field",{attrs:{error:t.$v.purchase.lines.$each[i].amount.$error,oninput:"this.value=this.value.replace(/[^0-9.]/g,'');",required:"","single-line":"","background-color":"transparent",reverse:"",solo:"",flat:"",dense:"",placeholder:"0",maxlength:"12","hide-details":""},model:{value:e.amount,callback:function(a){t.$set(e,"amount",t._n(a))},expression:"d.amount"}})],1),a("td",{staticClass:"text-right"},[a("span",{staticClass:"text--secondary body-2 font-weight-medium"},[t._v(t._s(t._f("number")(t.aggregations.lines[i].subtotal,((t.selectedDocument||{}).currency||{}).rounded))+" "+t._s(((t.selectedDocument||{}).currency||{}).id))])]),a("td",{staticClass:"text-right"},[i>=1||t.purchase.lines.length>1?a("v-btn",{attrs:{icon:"",color:"red"},on:{click:function(e){return t.purchase.lines.splice(i,1)}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1):t._e()],1)])]}))],2)]},proxy:!0}])}),a("v-divider"),a("v-row",{staticClass:"px-4",attrs:{"no-gutters":""}},[a("v-col",{staticClass:"text-left"},[a("v-btn",{attrs:{text:"",color:"primary",ripple:!1},on:{click:t.addRowLines}},[a("v-icon",{attrs:{left:""}},[t._v("mdi-plus")]),t._v("Agregar un producto")],1)],1)],1),a("v-row",{attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"4"}},[a("v-list",{staticClass:"v-list-form pa-0 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Subtotal")]),a("v-list-item-subtitle",{staticClass:"text-right font-weight-medium"},[t._v(t._s(t._f("number")(t.aggregations.subtotal,((t.selectedDocument||{}).currency||{}).rounded)))])],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Descuento")]),a("v-list-item-subtitle",{staticClass:"text-right"},[a("v-row",{staticClass:"px-3",attrs:{align:"center",justify:"end"}},[a("v-col",{attrs:{cols:"3"}},[a("v-select",{staticClass:"mr-1",attrs:{items:t.dropdown,"item-text":"name","item-value":"value","hide-details":"true",solo:"",outlined:"",flat:"",dense:""},scopedSlots:t._u([{key:"selection",fn:function(e){var i=e.item;return[a("span",{staticClass:"px-1 ml-1"},[t._v(t._s(i.value))])]}}]),model:{value:t.purchase.discount_scheme,callback:function(e){t.$set(t.purchase,"discount_scheme",e)},expression:"purchase.discount_scheme"}})],1),a("v-col",{attrs:{cols:"6"}},[a("v-text-field",{attrs:{error:t.$v.purchase.discount.$error,oninput:"this.value=this.value.replace(/[^0-9]/g,'');","background-color":"white",reverse:"",outlined:"",required:"","single-line":"",dense:"",maxlength:"20",placeholder:"0","hide-details":""},model:{value:t.$v.purchase.discount.$model,callback:function(e){t.$set(t.$v.purchase.discount,"$model",t._n(e))},expression:"$v.purchase.discount.$model"}})],1)],1),t.aggregations.discount&&"%"===t.purchase.discount_scheme?a("span",[t._v(t._s(t._f("number")(t.aggregations.discount)))]):t._e()],1)],1),t.$v.purchase.discount.maxAmount&&t.$v.purchase.discount.maxPercent?t._e():a("div",{staticClass:"mr-4 mt-3"},[a("div",{staticClass:"text-right"},[t.$v.purchase.discount.maxAmount?t._e():a("span",{staticClass:"red--text"},[t._v("El descuento no puede superar el subtotal")]),t.$v.purchase.discount.maxPercent?t._e():a("span",{staticClass:"red--text"},[t._v("El descuento no puede superar el 100%")])])]),t.selectedDocument.has_taxes_detail?[a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Exento")]),a("v-list-item-subtitle",{staticClass:"text-right",class:{"red--text":t.aggregations.exempt<0}},[t._v(t._s(t._f("number")(t.aggregations.exempt,((t.selectedDocument||{}).currency||{}).rounded)))])],1),t.selectedDocument.has_taxes?[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Neto")]),a("v-list-item-subtitle",{staticClass:"text-right",class:{"red--text":t.aggregations.amount<0}},[t._v(t._s(t._f("number")(t.aggregations.amount,((t.selectedDocument||{}).currency||{}).rounded)))])],1),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",[a("v-list-item-title",{staticClass:"text-left mr-2 text--secondary font-weight-medium"},[t._v("Impuestos ("+t._s(t.selectedDocument.tax)+"%)")]),a("v-list-item-subtitle",{staticClass:"text-right",class:{"red--text":t.aggregations.total<0}},[t._v(t._s(t._f("number")(t.aggregations.taxes,((t.selectedDocument||{}).currency||{}).rounded)))])],1)]:t._e()]:t._e(),a("v-divider",{staticClass:"ml-4 my-3"}),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",{staticClass:"text-left body-1 text--secondary font-weight-medium"},[t._v("Total")]),a("v-list-item-subtitle",{staticClass:"text-right body-1 text--secondary font-weight-medium",class:{"red--text":t.aggregations.total<0}},[t._v(t._s(t._f("number")(t.aggregations.total,((t.selectedDocument||{}).currency||{}).rounded))+" "+t._s(((t.selectedDocument||{}).currency||{}).id))])],1)],2)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[t.purchase.id?[a("span",{staticClass:"body-2 mr-1"},[t._v("Borrador guardado")]),a("span",{staticClass:"body-2 text--secondary font-weight-medium"},[t._v(t._s(t._f("dateFromNow")(t.purchase.updated)))]),a("v-btn",{attrs:{disabled:!t.purchase.id,text:"",color:"primary"},on:{click:t.removePurchase}},[a("v-icon",{staticClass:"mx-1",attrs:{small:""}},[t._v("mdi-delete")]),t._v("Eliminar borrador")],1)]:t._e(),a("v-spacer"),a("v-btn",{attrs:{loading:t.loadingSavePurchase,disabled:!t.purchase.id,outlined:""},on:{click:function(e){t.active=!0,t.patchPurchase()}}},[t._v("Guardar y salir")]),a("v-btn",{attrs:{id:"it-purchase-create",disabled:!t.purchase.id,loading:!t.isAutoSaving&&(t.loadingFinalizePurchase||t.$store.state.purchases.retrieveLoader),color:"primary"},on:{click:t.finalizePurchase}},[t._v("Crear documento")])],2)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":""},model:{value:t.modalSupplier,callback:function(e){t.modalSupplier=e},expression:"modalSupplier"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Seleccionar un proveedor")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.modalSupplier=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticClass:"text-left",attrs:{cols:"12"}},[a("v-col",{staticClass:"py-2"},[a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe para buscar un provedor...","hide-details":""},model:{value:t.supplierQuery,callback:function(e){t.supplierQuery=e},expression:"supplierQuery"}})],1),a("v-divider"),t.$store.state.suppliers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item"}}):[t.suppliersList.length?[a("v-simple-table",{attrs:{id:"it-purchase-set_supplier"},scopedSlots:t._u([{key:"default",fn:function(){return[a("tbody",t._l(t.suppliersList,(function(e){return a("tr",{key:e.id,staticStyle:{cursor:"pointer"},on:{click:function(a){return t.setSupplier(e)}}},[a("td",[a("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))])])])})),0)]},proxy:!0}],null,!1,338671333)})]:a("v-col",{staticClass:"text-center py-5"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-close-circle")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen proveedores")])],1)]],2)],1)],1)],1)],1)],1)},Ld=[],Sd={mixins:[$],inject:["theme"],components:{VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{date:h()().format("YYYY-MM-DD"),modalDelete:!1,menu:!1,loadingSavePurchase:!1,loadingFinalizePurchase:!1,dropdown:[{name:"% - Porcentaje",value:"%"},{name:"- Monto",value:"$"}],isAutoSaving:!1,active:!1,purchase:{supplier:{},document:"CL46",number:0,date:"",discount:null,discount_scheme:"%",lines:[{name:"",exempt:!1,unit_label:"",amount:null,quantity:1,discount:null,discount_scheme:"%",tax:null,tax_percent:null}]},aggregations:{lines:[{subtotal:0}],amount:0,exempt:0,subtotal:0,discount:0,taxes:0,total:0},supplierQuery:"",sourcesDetail:{},purchaseClone:{},upgradeable:!1,modalSupplier:!1,documentsListSelect:[]}},computed:Object(i["a"])({aggregationsSource:function(){return{lines:this.purchase.lines.map((function(t){return{exempt:t.exempt,amount:t.amount,quantity:t.quantity}})),discount_scheme:this.purchase.discount_scheme,discount:this.purchase.discount}},selectedDocument:function(){var t=this;return this.documentsList.find((function(e){return e.id===t.purchase.document}))||{}}},Object(u["c"])({accountsDetail:function(t){return t.auth.account},documentsList:function(t){return t.generals.documentsList},purchasesDetail:function(t){return t.purchases.purchasesDetail},suppliersList:function(t){return t.suppliers.suppliersList}})),created:function(){var t=this;this.$store.dispatch("generals/LIST",{resource:"generals/documents",query:{country__id__in:"".concat(this.account.country.id,", US"),is_purchase:"True",is_sale:"False"}}),"PurchaseCreate"===this.$route.name&&(this.purchase.date=this.today),"PurchaseUpdate"===this.$route.name&&this.$store.dispatch("purchases/RETRIEVE",{resource:"purchases",id:this.$route.params.id}).then((function(e){if("draft"===t.purchasesDetail.status){var a=Q()(e.data);a.document=a.document.id,t.purchase=a}else t.$router.push({name:"PurchaseRetrieve",params:{id:t.purchasesDetail.id}})}))},watch:{supplierQuery:function(){this.debounceMethod(this.getSuppliers)},modalSupplier:function(){this.modalSupplier&&this.getSuppliers()},purchase:{handler:L()((function(){this.purchaseClone=Q()(this.purchase),"PurchaseUpdate"===this.$route.name?(this.isAutoSaving=!0,this.patchPurchase("purchaseClone")):this.postPurchase(),this.upgradeable=!0}),700),deep:!0},aggregationsSource:{handler:function(){this.setAggregations()},deep:!0},selectedDocument:function(t,e){var a=this,i=function(t){a.purchase.lines.forEach((function(e,i){a.purchase.lines[i].exempt=t}))};this.selectedDocument.has_taxes&&!e.has_taxes?i(!1):!this.selectedDocument.has_taxes&&e.has_taxes&&i(!0),this.setAggregations()}},methods:{postPurchase:function(){var t=this,e=Q()(this.purchase);if(e.supplier=this.purchase.supplier.id,this.$v.purchaseClone.$touch(),this.$v.purchaseClone.$invalid)return!1;this.loadingFinalizePurchase=!0,this.$store.dispatch("purchases/CREATE",{resource:"purchases",payload:e}).then((function(e){t.purchase=Q()(e.data),t.purchase.document=t.purchase.document.id,t.$router.replace("/purchases/".concat(t.purchase.id,"/edit"))})).finally((function(){t.loadingFinalizePurchase=!1}))},patchPurchase:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"purchase";if(!this.upgradeable)return!1;var a=Q()(this.purchase);if(delete a.subtotal,delete a.amount,delete a.exempt,delete a.tax,delete a.tax_percent,delete a.total,a.supplier=this.purchase.supplier.id,this.loadingSavePurchase=!0,this.$v[e].$touch(),this.$v[e].$invalid)return!1;this.$store.dispatch("purchases/UPDATE",{resource:"purchases",id:this.purchase.id,payload:a}).then((function(e){t.active&&(t.$dialog.message.info("La factura se ha guardado con éxito"),t.$router.push({name:"PurchaseList"}))})).finally((function(){t.isAutoSaving=!1,t.loadingSavePurchase=!1}))},finalizePurchase:function(){var t=this;if(this.$v.purchase.$touch(),this.$v.purchase.$invalid)return!1;this.$dialog.warning({title:"Confirmar documento",text:'\n Al confirmar este documento, se:\n 1. Validará con la agencia fiscal de '.concat(this.account.country.name,'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n '),actions:[{color:"primary",text:"Continuar",handle:function(){t.isAutoSaving=!1,t.loadingFinalizePurchase=!0,t.$store.dispatch("purchases/RETRIEVE",{resource:"purchases",detail:"finalize",id:t.purchase.id,loader:!1}).then((function(){t.$router.push({name:"PurchaseRetrieve",params:{id:t.purchasesDetail.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.loadingFinalizePurchase=!1}))}}]})},removePurchase:function(){var t=this;if("draft"===!this.purchase.status)return!1;this.$dialog.warning({title:"Eliminar documento",text:'\n ¿Estás seguro de continuar?\n Esta acción no se puede deshacer\n ',actions:[{color:"red",text:"Continuar",handle:function(){t.$store.dispatch("purchases/DESTROY",{resource:"purchases",id:t.purchase.id}).then((function(){t.$router.push({name:"PurchaseList"})})).catch((function(){t.$dialog.message.error()}))}}]})},getSuppliers:function(){if([1,2].includes(this.supplierQuery.length))return!1;var t={page_size:10};this.supplierQuery.length>=3&&(t.name__icontains=this.supplierQuery.toLowerCase()),this.$store.dispatch("suppliers/LIST",{resource:"suppliers",query:t})},setSupplier:function(t){this.purchase.supplier=t,this.supplierQuery="",this.modalSupplier=!1},addRowLines:function(){this.purchase.lines.push({name:"",exempt:!this.selectedDocument.has_taxes,unit_label:"",amount:null,quantity:1,discount:null,discount_scheme:"%",tax:null,tax_percent:null})},setAggregations:function(){var t=this,e=((this.selectedDocument||{}).currency||{}).rounded,a=0,i=0;if(this.purchase.lines.forEach((function(s,r){t.aggregations.lines[r]={subtotal:t.formatNumber((s.amount||0)*(s.quantity||0),e)},s.exempt||!t.selectedDocument.has_taxes?a+=t.formatNumber(t.aggregations.lines[r].subtotal,e):i+=t.formatNumber(t.aggregations.lines[r].subtotal,e)})),this.aggregations.exempt=this.formatNumber(a,e),this.aggregations.amount=this.formatNumber(i,e),this.aggregations.subtotal=a+i,this.purchase.discount)if("%"===this.purchase.discount_scheme){var s=this.purchase.discount/100;this.aggregations.amount-=this.formatNumber(this.aggregations.amount*s,e),this.aggregations.exempt-=this.formatNumber(this.aggregations.exempt*s,e)}else if("$"===this.purchase.discount_scheme){var r=100*this.aggregations.amount/this.aggregations.subtotal,n=100*this.aggregations.exempt/this.aggregations.subtotal;this.aggregations.amount-=this.formatNumber(this.purchase.discount*r/100,e),this.aggregations.exempt-=this.formatNumber(this.purchase.discount*n/100,e)}this.aggregations.taxes=this.formatNumber(this.selectedDocument.has_taxes_detail?this.aggregations.amount*(this.selectedDocument.tax/100):0,e),this.aggregations.total=this.selectedDocument.hold_taxes?this.formatNumber(this.aggregations.exempt+this.aggregations.amount,e):this.formatNumber(this.aggregations.exempt+this.aggregations.amount+this.aggregations.taxes,e)}},validations:function(){var t={document:{required:ie["required"]},date:{required:ie["required"]},discount:{numeric:ie["numeric"],maxAmount:function(){return"$"!==this.purchase.discount_scheme||this.purchase.discount<=this.aggregations.subtotal},maxPercent:function(){return"%"!==this.purchase.discount_scheme||this.purchase.discount<=100}},lines:{$each:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(128)},description:{maxLength:Object(ie["maxLength"])(512)},unit_label:{maxLength:Object(ie["maxLength"])(4)},quantity:{required:ie["required"],decimal:ie["decimal"]},amount:{required:ie["required"],decimal:ie["decimal"]},discount:{numeric:ie["numeric"]}}}};return{purchase:t,purchaseClone:Q()(t)}}},Td=Sd,Ed=Object(E["a"])(Td,Vd,Ld,!1,null,null,null),Dd=Ed.exports;A()(Ed,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDatePicker:yi["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSelect:Ge["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VSwitch:He["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"]});var Ad=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[t.$store.state.suppliers.retrieveLoader?a("v-col",{attrs:{cols:"12"}},[a("v-boilerplate",{attrs:{type:"table-heading, divider, list-item-two-line"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"table"}})],1):a("v-col",{attrs:{cols:"12"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("v-row",{attrs:{align:"center",justify:"start","no-gutters":""}},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"SupplierListCreate"}}},[t._v("Proveedores")]),a("v-icon",{staticClass:"mx-1 pt-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("span",{staticClass:"subtitle-1 font-weight-medium d-inline-block text-truncate",style:t.$vuetify.breakpoint.width<1200?"max-width: 300px;":"max-width: 500px;"},[t._v(t._s(t.instance.name))])],1)],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{outlined:"","retain-focus-on-click":""},on:{click:function(e){t.dialogSupplier=!0}}},[t._v("Editar")])],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-0 py-0"},[a("v-row",[a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información general")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.address))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.state.name)+", "+t._s(t.instance.country.name))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),t.instance.phone?a("v-list-item-subtitle",[t._v(t._s(t.instance.address))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("Sin número de teléfono")])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID")]),a("v-list-item-subtitle",[a("v-tooltip",{attrs:{right:"",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"font-weight-regular",attrs:{text:"",color:"secondary",ripple:!1},on:{click:function(e){return t.toClipboard(t.instance.id)}}},i),[t._v(t._s(t.instance.id))])]}}])},[a("span",[t._v("Copiar")])])],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Creado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("date")(t.instance.created)))])],1),a("v-list-item",[a("v-list-item-title",[t._v("Actualizado el")]),a("v-list-item-subtitle",[t._v(t._s(t._f("dateTime")(t.instance.updated)))])],1)],1)],1),a("v-col",{attrs:{cols:"6"}},[a("v-list",{staticClass:"transparent"},[a("v-list-item",[a("v-list-item-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Información de facturación")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",[t._v(t._s(t.instance.email))])],1),a("v-list-item",[a("v-list-item-title",[t._v("ID Fiscal")]),t.instance.tax_id?a("v-list-item-subtitle",[t._v(t._s(t.instance.tax_id))]):a("v-list-item-subtitle",{staticClass:"font-italic text--disabled"},[t._v("No especificado")])],1),a("v-list-item",[a("v-list-item-title",[t._v("Moneda")]),a("v-list-item-subtitle",[t._v(t._s(t.activeCurrency.id)+" - "+t._s(t.activeCurrency.name))])],1)],1)],1)],1)],1)],1),a("v-card",{staticClass:"px-0 mt-5"},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Purchases")])],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[a("purchase-list",{attrs:{"show-pagination":!1,"show-sort":!1,"show-criteria":{supplier:t.instance.id}}})],1)],1)],1),t.editable.id?a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogSupplier,callback:function(e){t.dialogSupplier=e},expression:"dialogSupplier"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Editar proveedor")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogSupplier=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.editable.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Acme LLC",maxlength:"100","hide-details":""},model:{value:t.$v.editable.name.$model,callback:function(e){t.$set(t.$v.editable.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{disabled:"","single-line":"",items:[t.editable.country.name],"item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.editable.country.name,callback:function(e){t.$set(t.editable.country,"name",e)},expression:"editable.country.name"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.editable.state.$error,items:t.statesList,"item-text":"name","item-value":"id","single-line":"","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white","no-data-text":"No existen estados para el país."},model:{value:t.$v.editable.state.$model,callback:function(e){t.$set(t.$v.editable.state,"$model",e)},expression:"$v.editable.state.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.editable.address.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.address.$model,callback:function(e){t.$set(t.$v.editable.address,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información fiscal")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v(" ID Fiscal "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}],null,!1,3956645415)},[a("span",[t._v("También llamado RUT, VAT o Tax ID")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{disabled:t.instance.country.has_regulation,"background-color":"white",outlined:"","single-line":"",dense:"","hide-details":""},model:{value:t.editable.tax_id,callback:function(e){t.$set(t.editable,"tax_id","string"===typeof e?e.trim():e)},expression:"editable.tax_id"}})],1)],1)],1),"CL"===t.editable.country.id?a("v-list-item",[a("v-list-item-title",[t._v("Actividad")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{attrs:{error:t.$v.editable.tax_settings.cl_activity_description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.tax_settings.cl_activity_description.$model,callback:function(e){t.$set(t.$v.editable.tax_settings.cl_activity_description,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.tax_settings.cl_activity_description.$model"}})],1)],1):t._e(),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de contacto")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.editable.email.$error,outlined:"",required:"","single-line":"","background-color":"white",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.editable.email.$model,callback:function(e){t.$set(t.$v.editable.email,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.email.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[t.editable.country?a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.editable.country.phone_code+" # #### ####",expression:"`${editable.country.phone_code} # #### ####`"}],attrs:{error:t.$v.editable.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"16","hide-details":""},model:{value:t.$v.editable.phone.$model,callback:function(e){t.$set(t.$v.editable.phone,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.phone.$model"}}):t._e()],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Sitio web")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.editable.website.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":!0},model:{value:t.$v.editable.website.$model,callback:function(e){t.$set(t.$v.editable.website,"$model","string"===typeof e?e.trim():e)},expression:"$v.editable.website.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogSupplier=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{loading:t.$store.state.suppliers.createLoader,color:"primary"},on:{click:t.updateSupplier}},[t._v("Guardar")])],1)],1)],1):t._e()],1)},jd=[],qd={mixins:[$],inject:["theme"],components:{PurchaseList:hd,VBoilerplate:{functional:!0,render:function(t,e){var a=e.data,s=e.props,r=e.children;return t("v-skeleton-loader",Object(i["a"])(Object(i["a"])({},a),{},{props:Object(i["a"])({boilerplate:!0,elevation:2},s)}),r)}}},data:function(){return{activeCurrency:{},editable:{},dialogSupplier:!1,taxSettings:[{country:"CL",fields:["cl_activity_description"]}]}},computed:Object(u["c"])({statesList:function(t){return t.generals.statesList},instance:function(t){return t.suppliers.suppliersDetail}}),created:function(){var t=this;this.$store.dispatch("suppliers/RETRIEVE",{resource:"suppliers",id:this.$route.params.id}).then((function(){var e=Q()(t.instance),a=t.taxSettings.find((function(t){return t.country===e.country.id}));a&&a.fields.forEach((function(t){e.tax_settings[t]||(e.tax_settings[t]=null)})),t.editable=e,t.$store.dispatch("generals/LIST",{resource:"generals/states",query:{country:t.instance.country.id,page_size:500}})})).then((function(){t.activeCurrency=t.currencies.find((function(e){return e.id===t.instance.currency}))})),this.$store.dispatch("purchases/LIST",{resource:"purchases",query:{supplier:this.$route.params.id,page_size:5}})},methods:{updateSupplier:function(){var t=this;if(this.$v.editable.$touch(),this.$v.editable.$invalid)return!1;var e={name:this.editable.name,state:this.editable.state.id||this.editable.state,address:this.editable.address,tax_settings:this.editable.tax_settings,email:this.editable.email,phone:this.editable.phone,website:this.editable.website};this.instance.country.has_regulation||(e.tax_id=this.editable.tax_id),this.$store.dispatch("suppliers/UPDATE",{resource:"suppliers",id:this.$route.params.id,payload:e}).then((function(){t.dialogSupplier=!1,t.$dialog.message.info("El proveedor ha sido actualizado")})).catch((function(){t.$dialog.message.error("Error al actualizar el proveedor.")}))}},validations:{editable:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(100)},state:{required:ie["required"]},address:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},tax_settings:{cl_activity_description:{required:Object(ie["requiredIf"])((function(){return"CL"===this.editable.country.id})),maxLength:Object(ie["maxLength"])(64)}},tax_id:{maxLength:Object(ie["maxLength"])(32)},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(16)},website:{url:ie["url"]}}}},Id=qd,Od=Object(E["a"])(Id,Ad,jd,!1,null,null,null),Rd=Od.exports;A()(Od,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Nd=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{attrs:{cols:"12"}},[a("v-card",[t.$store.state.suppliers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"toolbar"}}):a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[a("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"Applications"}}},[t._v("Aplicaciones")]),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(" Purchases "),a("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(" Proveedores ")],1),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"end"}},[a("v-query-builder",{staticClass:"mr-1",attrs:{"query-map":t.filters,model:"customer"}}),a("v-btn",{attrs:{color:"secondary",outlined:""},on:{click:function(e){t.dialogSupplier=!0}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v("Nuevo")],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0"},[t.$store.state.suppliers.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"table"}}):[t.suppliersList.length?[a("v-data-table",{staticStyle:{cursor:"pointer"},attrs:{headers:t.headers,items:t.suppliersList,"items-per-page":t.pagination,"mobile-breakpoint":"","hide-default-header":"","disable-sort":"","hide-default-footer":""},on:{"click:row":function(e){t.$router.push({name:"SupplierRetrieveUpdate",params:{id:e.id}})}},scopedSlots:t._u([{key:"header",fn:function(e){var i=e.props.headers;return[a("VTableHeaders",{attrs:{headers:i},on:{sort:t.setSort}})]}},{key:"item.name",fn:function(e){var i=e.item;return[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v(t._s(i.name))])]}},{key:"item.email",fn:function(e){var a=e.item;return[t._v(" "+t._s(a.email)+" ")]}},{key:"item.created",fn:function(e){var i=e.item;return[a("span",{staticClass:"text-right"},[t._v(t._s(t._f("date")(i.created)))])]}}],null,!0)}),t.showPagination||t.showAll?[a("v-divider"),a("v-row",{staticClass:"mx-0",attrs:{align:"center"}},[t.showAll?a("v-col",{staticClass:"text-center",attrs:{cols:"12"}},[a("v-btn",{attrs:{to:{name:"SupplierListCreate",query:t.showCriteria},outlined:"",color:"secondary"}},[t._v("Ver todos los proveedores")])],1):t._e(),t.showPagination?[a("v-col",{attrs:{cols:"6"}},[a("span",{staticClass:"body-2 text--secondary"},[t._v(t._s(t.count)+" registros")])]),a("v-col",{staticClass:"text-right",attrs:{cols:"6"}},[a("v-pagination",{attrs:{length:t.totalPages,"total-visible":"6"},model:{value:t.page,callback:function(e){t.page=e},expression:"page"}})],1)]:t._e()],2)]:t._e()]:a("v-row",[a("v-col",{staticClass:"pb-6 pt-4 text-center"},[a("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-badge-account-horizontal")]),a("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes proveedores registrados")]),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogSupplier=!0}}},[t._v("Crear un proveedor")])],1)],1)]],2)],1)],1),a("v-dialog",{attrs:{width:"700",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogSupplier,callback:function(e){t.dialogSupplier=e},expression:"dialogSupplier"}},[a("v-card",[a("v-card-title",{staticClass:"pa-0"},[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Crear proveedor")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{staticClass:"ml-3",attrs:{icon:"",small:""},on:{click:function(e){t.dialogSupplier=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-list",{staticClass:"v-list-form py-6 transparent"},[a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Nombre")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.newSupplier.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Acme LLC",maxlength:"100","hide-details":""},model:{value:t.$v.newSupplier.name.$model,callback:function(e){t.$set(t.$v.newSupplier.name,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.name.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("País")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.newSupplier.country.$error,"single-line":"",items:t.countriesList,"item-text":"name","item-value":"id","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white"},model:{value:t.$v.newSupplier.country.$model,callback:function(e){t.$set(t.$v.newSupplier.country,"$model",e)},expression:"$v.newSupplier.country.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Estado")]),a("v-list-item-subtitle",[a("v-col",{attrs:{cols:"8"}},[a("v-select",{attrs:{error:t.$v.newSupplier.state.$error,items:t.statesList,"item-text":"name","item-value":"id","single-line":"","hide-details":"",dense:"",height:"30",outlined:"","background-color":"white","no-data-text":"No existen estados para el país."},model:{value:t.$v.newSupplier.state.$model,callback:function(e){t.$set(t.$v.newSupplier.state,"$model",e)},expression:"$v.newSupplier.state.$model"}})],1)],1)],1),a("v-list-item",{staticClass:"py-1"},[a("v-list-item-title",[t._v("Dirección")]),a("v-list-item-subtitle",[a("v-text-field",{attrs:{error:t.$v.newSupplier.address.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newSupplier.address.$model,callback:function(e){t.$set(t.$v.newSupplier.address,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.address.$model"}})],1)],1),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información fiscal")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v(" ID Fiscal "),a("v-tooltip",{attrs:{right:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("También llamado RUT, VAT o Tax ID")])])],1),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{directives:[{name:"dni",rawName:"v-dni",value:t.newSupplier.country,expression:"newSupplier.country"}],attrs:{error:t.$v.newSupplier.tax_id.$error,"background-color":"white",outlined:"","single-line":"",dense:"","hide-details":""},model:{value:t.$v.newSupplier.tax_id.$model,callback:function(e){t.$set(t.$v.newSupplier.tax_id,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.tax_id.$model"}})],1)],1)],1),t.country&&"CL"===t.country.id?a("v-list-item",[a("v-list-item-title",[t._v("Actividad")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-text-field",{attrs:{error:t.$v.newSupplier.tax_settings.cl_activity_description.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newSupplier.tax_settings.cl_activity_description.$model,callback:function(e){t.$set(t.$v.newSupplier.tax_settings.cl_activity_description,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.tax_settings.cl_activity_description.$model"}})],1)],1):t._e(),a("v-list-item",{staticClass:"mt-4"},[a("v-list-item-title",[a("span",{staticClass:"text--secondary font-weight-medium"},[t._v("Información de contacto")])])],1),a("v-list-item",{staticClass:"mt-2"},[a("v-list-item-title",[t._v("Email de facturación")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{attrs:{error:t.$v.newSupplier.email.$error,outlined:"",required:"","single-line":"","background-color":"white",dense:"",maxlength:"64","hide-details":""},model:{value:t.$v.newSupplier.email.$model,callback:function(e){t.$set(t.$v.newSupplier.email,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.email.$model"}})],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Teléfono")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[t.country?a("v-text-field",{directives:[{name:"mask",rawName:"v-mask",value:t.country.phone_code+" # #### ####",expression:"`${country.phone_code} # #### ####`"}],attrs:{error:t.$v.newSupplier.phone.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"16","hide-details":""},model:{value:t.$v.newSupplier.phone.$model,callback:function(e){t.$set(t.$v.newSupplier.phone,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.phone.$model"}}):t._e()],1)],1)],1),a("v-list-item",[a("v-list-item-title",[t._v("Sitio web")]),a("v-list-item-subtitle",{staticClass:"py-1"},[a("v-col",{attrs:{cols:"8"}},[a("v-text-field",{staticClass:"pa-0",attrs:{error:t.$v.newSupplier.website.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"64","hide-details":!0},model:{value:t.$v.newSupplier.website.$model,callback:function(e){t.$set(t.$v.newSupplier.website,"$model","string"===typeof e?e.trim():e)},expression:"$v.newSupplier.website.$model"}})],1)],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-3"},[a("v-spacer"),a("v-btn",{attrs:{outlined:""},on:{click:function(e){t.dialogSupplier=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"primary",loading:t.$store.state.suppliers.createLoader},on:{click:t.postSupplier}},[t._v("Crear proveedor")])],1)],1)],1)],1)},Pd=[],Bd={components:{VQueryBuilder:dn,VTableHeaders:Mi,GenericViewMixin:$},mixins:[k],data:function(){return{newSupplier:{name:"",tax_id:"",tax_settings:{cl_activity_description:""},country:null,state:"",address:"",email:"",phone:"",website:""},filters:[{type:"text",id:"name",label:"Nombre",operators:["contiene"]},{type:"text",id:"tax_id",label:"Número fiscal",operators:["contiene"]},{type:"text",id:"created",label:"Fecha de creación",operators:["es igual","es menor a","es mayor a"]},{type:"radio",id:"sources",label:"Método de pago",choices:[{label:"Si",value:"True"},{label:"No",value:"False"}]},{type:"text",id:"email",label:"Email",operators:["contiene"]},{type:"text",id:"country__name",label:"País",operators:["contiene"]}],headers:[{text:"Proveedor",value:"name",class:"font-weight-bold",sortable:!0},{text:"Email",value:"email",sortable:!0},{text:"Creado el",value:"created",align:"end",sortable:!0}],statesList:{},dialogSupplier:!1}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({count:function(t){return t.suppliers.suppliersCount},suppliersList:function(t){return t.suppliers.suppliersList},countriesList:function(t){return t.generals.countriesList}})),{},{country:function(){var t=this;return this.newSupplier.country?this.countriesList.find((function(e){return e.id===t.newSupplier.country})):null}}),created:function(){var t=this,e={page_size:100};this.$store.dispatch("generals/LIST",{resource:"generals/countries",query:e}).then((function(){var e=t.countriesList.filter((function(e){return e.id===t.$store.state.auth.account.country.id}))[0];t.newSupplier.country=e.id}))},watch:{"newSupplier.country":function(){var t=this;this.statesList=this.countriesList.find((function(e){return e.id===t.newSupplier.country})).states,this.newSupplier.state="",this.newSupplier.tax_id=""}},methods:{getList:function(){this.$store.dispatch("suppliers/LIST",{resource:"suppliers",query:this.$route.query})},postSupplier:function(){var t=this;if(this.$v.newSupplier.$touch(),this.$v.newSupplier.$invalid)return!1;this.$store.dispatch("suppliers/CREATE",{resource:"suppliers",payload:this.newSupplier}).then((function(e){t.$router.push({name:"SupplierRetrieveUpdate",params:{id:e.data.id}})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))}))}},validations:{newSupplier:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(100)},country:{required:ie["required"]},state:{required:ie["required"]},address:{required:ie["required"],maxLength:Object(ie["maxLength"])(64)},tax_id:{required:Object(ie["requiredIf"])((function(){var t=this;return this.countriesList.find((function(e){return e.id===t.newSupplier.country})).has_regulation})),taxId:function(t){return"CL"!==this.newSupplier.country||Object(_r["rutValidator"])(t)},maxLength:Object(ie["maxLength"])(32)},tax_settings:{cl_activity_description:{required:Object(ie["requiredIf"])((function(){return"CL"===this.newSupplier.country})),maxLength:Object(ie["maxLength"])(64)}},email:{required:ie["required"],email:ie["email"],maxLength:Object(ie["maxLength"])(254)},phone:{maxLength:Object(ie["maxLength"])(16)},website:{url:ie["url"]}}}},zd=Bd,Fd=Object(E["a"])(zd,Nd,Pd,!1,null,null,null),Md=Fd.exports;A()(Fd,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VCol:q["a"],VDataTable:Ai["a"],VDialog:xe["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VPagination:ji["a"],VRow:z["a"],VSelect:Ge["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Ud=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{staticClass:"px-0 pb-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55",dense:""}},[a("v-toolbar-title",{staticClass:"pa-0 ml-n1 text--secondary subtitle-1 font-weight-medium"},[t._v("Colección de métricas")])],1)],1),t.dashboardSelected&&0!==Object.keys(t.dashboardSelected).length?[a("v-col",{staticClass:"py-0",attrs:{cols:"12"}},[a("v-btn",{attrs:{color:"primary",text:"",ripple:!1},on:{click:function(e){t.dialogDashboard=!0}}},[t._v(t._s(t.dashboardSelected.name))])],1),a("v-col",{staticClass:"pt-0",attrs:{cols:"12"}},[t.metricsAdded.length?t._l(t.metricsAdded,(function(e,i){return a("v-chip",{key:i,staticClass:"mr-2 my-1",attrs:{color:"secondary",small:"",close:""},on:{"click:close":function(a){return t.deleteChip(e.id)}}},[a("span",{staticClass:"d-inline-block"},["kpi"===e.type.name?a("v-icon",{attrs:{small:""}},[t._v("mdi-counter")]):t._e(),"graph"===e.type.name?a("v-icon",{attrs:{small:""}},[t._v("mdi-chart-line-variant")]):t._e(),"table"===e.type.name?a("v-icon",{attrs:{small:""}},[t._v("mdi-table-of-contents")]):t._e(),t._v(" "+t._s(t.$t("metrics."+e.name))+" ")],1)])})):[a("span",{staticClass:"d-block py-1 body-2 font-italic"},[t._v("Navega por la colección y selecciona métricas para agregarlas al dashboard...")])]],2),a("v-col",{staticClass:"pt-0",attrs:{cols:"12"}},[a("v-btn",{attrs:{disabled:!t.metricsAdded.length,color:"primary"},on:{click:function(e){return t.goToDashboard(t.dashboardSelected.id)}}},[t._v("Terminar")])],1)]:a("v-col",{attrs:{cols:"12"}},[a("v-btn",{attrs:{color:"primary"},on:{click:function(e){t.dialogDashboard=!0}}},[t._v("Seleccionar un dashboard")])],1),a("v-col",{staticClass:"pt-4",attrs:{cols:"5",md:"4",lg:"3"}},[a("v-text-field",{staticClass:"ma-0",attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Buscar métrica...",autocomplete:"off","hide-details":""},scopedSlots:t._u([{key:"prepend-inner",fn:function(){return[a("v-row",{staticClass:"text-center ml-2 mr-1",attrs:{justify:"center",align:"center"}},[a("v-icon",{staticClass:"icon-autocomplete",attrs:{color:"secondary",size:"20"}},[t._v("mdi-magnify")])],1)]},proxy:!0}]),model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),a("v-col",{attrs:{cols:"12"}},[a("v-row",{attrs:{aling:"center",justify:"start"}},[t.getCollections.length?t._l(t.getCollections,(function(e){return a("v-col",{key:e.id,attrs:{cols:"4"}},[a("v-hover",{attrs:{"open-delay":"200"},scopedSlots:t._u([{key:"default",fn:function(i){var s=i.hover;return[a("v-card",{staticClass:"card-apps",attrs:{hover:"",height:"155",border:"",ripple:!1},on:{click:function(a){return t.setActiveMetric(e)}}},[a("v-card-text",{staticClass:"py-1"},[a("v-list",{attrs:{"three-line":""}},[a("v-list-item",{staticClass:"px-1",attrs:{ripple:!1,color:"primary"}},[a("v-list-item-content",{staticStyle:{"min-height":"100px"}},[a("v-list-item-title",{staticClass:"pb-1 body-2 text--secondary font-weight-medium"},[t._v(t._s(t.$t("metrics."+e.name)))]),a("v-list-item-subtitle",{staticClass:"text--primary",domProps:{innerHTML:t._s(e.description)}})],1)],1)],1)],1),a("v-card-actions",{staticClass:"py-1"},[a("v-spacer"),s?a("v-fade-transition",[a("v-btn",{attrs:{icon:"",color:"primary"}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-chart-box-plus-outline")])],1)],1):t._e()],1)],1)]}}],null,!0)})],1)})):a("v-col",{staticClass:"text-center py-10"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-chart-line-variant")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("No existen métricas para tu búsqueda")])],1)],2)],1),a("v-dialog",{attrs:{width:"600",persistent:"","no-click-animation":""},model:{value:t.dialogDashboard,callback:function(e){t.dialogDashboard=e},expression:"dialogDashboard"}},[a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Seleccionar un dashboard")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"","retain-focus-on-click":"",ripple:!1,small:""},on:{click:function(e){t.dialogDashboard=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-0 background"},[a("v-row",{attrs:{align:"center",justify:"center","no-gutters":""}},[a("v-col",{staticClass:"text-left",attrs:{cols:"12"}},[a("v-col",{staticClass:"py-2"},[a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",placeholder:"Escribe para buscar un dashboard...","hide-details":""},model:{value:t.dashboardQuery,callback:function(e){t.dashboardQuery=e},expression:"dashboardQuery"}})],1),a("v-divider"),t.$store.state.dashboards.retrieveLoader?a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"list-item-three-line"}}):[(t.getDashboards||[]).length?[a("v-simple-table",{scopedSlots:t._u([{key:"default",fn:function(){return[a("tbody",t._l(t.getDashboards,(function(e){return a("tr",{key:e.id,staticStyle:{cursor:"pointer"},on:{click:function(a){return t.setDashboard(e.id)}}},[a("td",[a("span",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))])])])})),0)]},proxy:!0}],null,!1,2155499378)})]:a("v-col",{staticClass:"text-center py-10"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-close-circle")]),a("span",{staticClass:"d-block subtitle-1"},[t._v(t._s(t.dashboardQuery?"No se han encontrado resultados":"Aún no ha creado dashboards"))])],1)]],2)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"800",persistent:"","no-click-animation":"",scrollable:""},model:{value:t.dialogMetric,callback:function(e){t.dialogMetric=e},expression:"dialogMetric"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v("Agregar métrica")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){t.dialogMetric=!1,t.isActive=!1}}},[a("v-icon",{attrs:{size:"24"}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-title",{staticClass:"pa-0"},[a("v-list-item",{staticClass:"py-0"},[0!==Object.keys(t.activeMetric).length?a("v-list-item-content",[a("v-list-item-title",{staticClass:"body-1 text--secondary font-weight-medium"},[t._v(t._s(t.$t("metrics."+(t.activeMetric||{}).name)))]),a("v-list-item-subtitle",{staticClass:"text--primary font-weight-regular"},[t._v(t._s(t.activeMetric.description))])],1):t._e()],1)],1),a("v-divider"),a("v-card-text",{staticClass:"pa-4"},[((t.activeMetric||{}).type||{}).kpi?a("v-card",{attrs:{outlined:"",flat:""}},[a("v-card-text",{staticClass:"pa-3"},[a("span",{staticClass:"d-block mb-3 body-2 text--secondary font-weight-medium"},[t._v("KPI")]),a("v-sheet",{attrs:{outlined:"",rounded:"",width:"250",height:"140"}},[a("metric-kpi",{attrs:{metric:t.activeMetric.name,interval:t.activeKpiInterval,comparative:t.activeKpiComparative}})],1)],1),a("v-card-actions",{staticClass:"pa-3 pt-0"},[t.activeMetric.type.kpi.displayComparative?[a("v-menu",{attrs:{right:""},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({staticClass:"mr-2",attrs:{outlined:"",color:"secondary",disabled:1===t.getPeriods.length}},i),[t._v(t._s(t.$t("api."+t.activeKpiInterval))),a("v-icon",{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}],null,!1,1540947060)},[a("v-list",t._l(t.getPeriods,(function(e){return a("v-list-item",{key:e.value,on:{click:function(a){t.activeKpiInterval=e}}},[a("v-list-item-title",[t._v(t._s(t.$t("api."+e)))])],1)})),1)],1),a("v-menu",{attrs:{right:""},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({attrs:{outlined:"",color:"secondary"}},i),[t._v(t._s(t.$t("api."+t.activeKpiComparative))),a("v-icon",{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}],null,!1,3892321598)},[a("v-list",t._l(t.getComparatives,(function(e){return a("v-list-item",{key:e,on:{click:function(a){t.activeKpiComparative=e,t.isActive=!0}}},[a("v-list-item-title",[t._v(t._s(t.$t("api."+e)))])],1)})),1)],1)]:t._e(),a("v-spacer"),t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length?a("v-tooltip",{attrs:{left:"","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("div",t._g({staticClass:"box-hidden"},i))]}}],null,!1,379130969)},[a("span",[t._v("Selecciona un dashboard para añadir esta métrica.")])]):t._e(),a("v-btn",{attrs:{color:"primary",disabled:t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length},nativeOn:{click:function(e){return t.addMetrics(t.activeMetric.type.kpi,t.type="kpi")}}},[t._v("Agregar")])],2)],1):t._e(),((t.activeMetric||{}).type||{}).graph?a("v-card",{staticClass:"mt-5",attrs:{outlined:""}},[a("v-card-text",{staticClass:"pa-3"},[a("span",{staticClass:"d-block mb-3 body-2 text--secondary font-weight-medium"},[t._v("Gráfico")]),a("v-sheet",{attrs:{outlined:"",rounded:""}},[a("metric-graph",{attrs:{metric:t.activeMetric.name,interval:t.activeGraphInterval}})],1)],1),a("v-card-actions",{staticClass:"pa-3 pt-0"},[a("v-menu",{attrs:{right:""},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-btn",t._g({attrs:{outlined:"",color:"secondary",disabled:1===t.getPeriods.length}},i),[t._v(t._s(t.$t("api."+t.activeGraphInterval))),a("v-icon",{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}],null,!1,2653619530)},[a("v-list",t._l(t.getPeriods,(function(e){return a("v-list-item",{key:e.value,on:{click:function(a){t.activeGraphInterval=e}}},[a("v-list-item-title",[t._v(t._s(t.$t("api."+e)))])],1)})),1)],1),a("v-spacer"),t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length?a("v-tooltip",{attrs:{left:"","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("div",t._g({staticClass:"box-hidden"},i))]}}],null,!1,379130969)},[a("span",[t._v("Selecciona un dashboard para añadir esta métrica.")])]):t._e(),a("v-btn",{attrs:{color:"primary",disabled:t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length},nativeOn:{click:function(e){return t.addMetrics(t.activeMetric.type.graph,t.type="graph")}}},[t._v("Agregar")])],1)],1):t._e(),((t.activeMetric||{}).type||{}).table?a("v-card",{class:((t.activeMetric||{}).type||{}).kpi||((t.activeMetric||{}).type||{}).graph?"mt-5":"",attrs:{outlined:"",flat:""}},[a("v-card-text",{staticClass:"pa-3"},[a("span",{staticClass:"d-block mb-3 body-2 text--secondary font-weight-medium"},[t._v("Tabla")]),a("v-sheet",{attrs:{outlined:"",rounded:""}},[a("metric-table",{attrs:{metric:t.activeMetric.name}})],1)],1),a("v-card-actions",{staticClass:"pa-3 pt-0"},[a("v-spacer"),t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length?a("v-tooltip",{attrs:{left:"","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("div",t._g({staticClass:"box-hidden"},i))]}}],null,!1,379130969)},[a("span",[t._v("Selecciona un dashboard para añadir esta métrica.")])]):t._e(),a("v-btn",{attrs:{color:"primary",disabled:t.dashboardSelected&&0===Object.keys(t.dashboardSelected).length},nativeOn:{click:function(e){return t.addMetrics(t.activeMetric.type.table,t.type="table")}}},[t._v("Agregar")])],1)],1):t._e()],1)],1)],1)],2)},Gd=[],Hd={mixins:[$],components:{MetricGraph:tr,MetricKpi:nr,MetricTable:vr},data:function(){return{activeGraphInterval:"monthly",activeKpiComparative:"this_v_last",activeKpiInterval:"monthly",activeMetric:{},dashboardSelected:{},dialogDashboard:!1,dialogMetric:!1,draftDashboards:{},isActive:!1,metrics:gt,metricsAdded:[],search:"",dashboardQuery:"",type:"",table:[]}},computed:Object(i["a"])({collections:function(){var t=this;return this.$route.query.ref?this.metrics.filter((function(e){return e.category===t.$route.query.ref&&!0===e.active})):this.metrics.filter((function(t){return!0===t.active}))},getCollections:function(){return""===this.search?this.collections:this.getSearch()},getDashboards:function(){return""===this.dashboardQuery?this.dashboardsList:this.getSearchDashboard()},getPeriods:function(){var t="MRR"===this.activeMetric.category?["monthly"]:["monthly","daily","yearly"];return t},getComparatives:function(){var t="MRR"===this.activeMetric.category?["this_v_last","last_v_one_before"]:["this_v_last","this_v_last_mtd","last_v_one_before"];return t}},Object(u["c"])({dashboardsList:function(t){return t.dashboards.dashboardsList},dashboardsDetail:function(t){return t.dashboards.dashboardsDetail}})),watch:{search:Object(g["debounce"])((function(){if(this.search.length<3)return!1;this.getSearch()}),600)},created:function(){void 0===this.$route.query.dash||this.dialogDashboard?this.$store.dispatch("dashboards/LIST",{resource:"metrics/dashboards"}):this.getDashboardDetails(this.$route.query.dash)},methods:{getDashboardDetails:function(t){var e=this;this.$store.dispatch("dashboards/RETRIEVE",{resource:"metrics/dashboards",id:t}).then((function(t){e.draftDashboards=Object(g["cloneDeep"])(t.data),e.dashboardSelected=e.draftDashboards})).catch((function(t){e.$dialog.message.error(e.parseErrors(t.response.data))}))},getSearch:function(){var t=this;if(""!==this.search)return this.$route.query.ref?this.metrics.filter((function(e){return e.category===t.$route.query.ref&&t.$t("metrics.".concat(e.name)).toUpperCase().includes(t.search.toUpperCase())&&!0===e.active})):this.metrics.filter((function(e){return t.$t("metrics.".concat(e.name)).toUpperCase().includes(t.search.toUpperCase())&&!0===e.active}))},getSearchDashboard:function(){var t=this;if(""!==this.dashboardQuery)return this.dashboardsList.filter((function(e){return e.name.toUpperCase().includes(t.dashboardQuery.toUpperCase())}))},setActiveMetric:function(t){this.activeMetric=t,this.dialogMetric=!0,this.activeGraphInterval="monthly",this.activeKpiComparative="this_v_last",this.activeKpiInterval="monthly"},setDashboard:function(t){this.$route.query.dash=void 0,this.getDashboardDetails(t),this.dashboardQuery="",this.dialogDashboard=!1},addMetrics:function(t){"kpi"===this.type&&this.metricsAdded.push({id:this.metricsAdded.length+1,name:this.activeMetric.name,type:{name:this.type,config:t},interval:this.activeKpiInterval,comparative:this.activeKpiComparative}),"graph"===this.type&&this.metricsAdded.push({id:this.metricsAdded.length+1,name:this.activeMetric.name,type:{name:this.type,config:t},interval:this.activeGraphInterval}),"table"===this.type&&this.metricsAdded.push({id:this.metricsAdded.length+1,name:this.activeMetric.name,type:{name:this.type,config:t}}),this.dialogMetric=!1},goToDashboard:function(t){this.draftDashboards.layout=this.metricsAdded,this.$store.dispatch("dashboards/DASHBOARD_LIST",this.draftDashboards),this.$router.push({name:"DashboardUpdate",params:{id:t}})},deleteChip:function(t){var e=this.metricsAdded.findIndex((function(e){return e.id===t}));this.metricsAdded.splice(e,1)}},beforeRouteLeave:function(t,e,a){var i=this;return Object(Br["a"])(regeneratorRuntime.mark((function e(){var s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!i.metricsAdded.length){e.next=11;break}if("DashboardUpdate"===t.name){e.next=8;break}return e.next=4,i.$dialog.warning({title:"Cambios sin guardar",text:'\n Hay cambios que no han sido guardados\n ¿Estás seguro de continuar?\n ',actions:[{color:"red",text:"Continuar",class:"mx-12"},{color:"",text:"Cancel"}]});case 4:s=e.sent,a("Continuar"===s),e.next=9;break;case 8:a(!0);case 9:e.next=12;break;case 11:a(!0);case 12:case"end":return e.stop()}}),e)})))()}},Yd=Hd,Wd=(a("65d1"),Object(E["a"])(Yd,Ud,Gd,!1,null,"62873162",null)),Qd=Wd.exports;A()(Wd,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCardTitle:le["d"],VChip:j["a"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VFadeTransition:za["d"],VHover:et["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSheet:da["a"],VSimpleTable:Ze["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var Kd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-row",[i("v-col",{staticClass:"px-0",attrs:{cols:"12"}},[i("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[i("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[i("router-link",{staticClass:"subtitle-1 routerLink font-weight-medium",attrs:{to:{name:"Applications"}}},[t._v("Dashboard")]),i("v-icon",{staticClass:"mx-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),t._v(" "+t._s("Favorites"===t.$route.name?"Favoritos":"Predefinidos")+" "),i("v-chip",{staticClass:"ml-1",attrs:{color:"primary","text-color":"white",small:""}},[t._v("Beta")])],1)],1)],1),i("v-col",{attrs:{cols:"11"}},[t.dashboard.length?[0!==Object.keys(t.dashboardFix).length?[i("v-card",{staticClass:"card-apps",on:{click:function(e){return e.preventDefault(),t.goTo(e)}}},[i("v-card-text",{staticClass:"py-6 px-0"},[i("v-list",{staticClass:"transparent",attrs:{"three-line":""}},[i("v-list-item",[i("v-list-item-icon",[i("img",{attrs:{src:a("117d"),width:"24px"}})]),i("v-list-item-content",[i("v-list-item-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v(t._s(t.dashboardFix.name))]),i("v-list-item-subtitle",[i("v-row",[i("v-col",{attrs:{cols:"11"}},[t._v(t._s(t.dashboardFix.description))]),i("v-col",{staticClass:"mt-0 text-left",attrs:{cols:"1"}},[i("div",{staticClass:"fix-icon"},[i("v-icon",{attrs:{color:"primary"}},[t._v("mdi-pin")])],1),i("v-menu",{attrs:{"offset-y":"",transition:"scale-transition",width:"360px"},on:{click:function(e){t.changeRoute=!0}},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on,s=e.attrs;return[i("v-btn",t._g(t._b({attrs:{outlined:"",color:"secondary"}},"v-btn",s,!1),a),[t._v("•••")])]}}],null,!1,2666579854)},[i("v-list",{staticClass:"transparent py-2"},[i("v-list-item",{staticClass:"py-1",on:{click:function(e){t.dashboardFix={}}}},[i("v-list-item-title",[i("v-icon",{attrs:{color:"secondary"}},[t._v("mdi-pin ")]),t._v("Desfijar de la parte superior de la página ")],1)],1),i("v-list-item",{staticClass:"py-1",on:{click:function(e){return t.addToFavoriteDashboard(t.dashboardFix)}}},[i("v-list-item-title",[i("v-icon",{attrs:{color:"secondary"}},[t._v(t._s(t.isFavorite(t.dashboardFix.id)?"mdi-star":"mdi-star-outline")+" ")]),i("span",{staticClass:"ml-1"},[t._v(t._s(t.isFavorite(t.dashboardFix.id)?"Eliminar de tus favoritos":"Añadir a favoritos"))])],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)],1),i("v-divider",{staticClass:"my-5"})]:t._e(),t._l(t.dashboard,(function(e){return i("v-card",{key:e.id,class:(t.dashboardFix.length?"my-5":"mb-5")+" card-apps",on:{click:t.goTo}},[i("v-card-text",{staticClass:"py-6 px-0"},[i("v-list",{staticClass:"transparent",attrs:{"three-line":""}},[i("v-list-item",[i("v-list-item-icon",[i("img",{attrs:{src:a("117d"),width:"24px"}})]),i("v-list-item-content",[i("v-list-item-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v(t._s(e.name))]),i("v-list-item-subtitle",[i("v-row",[i("v-col",{attrs:{cols:"11"}},[t._v(t._s(e.description))]),i("v-col",{staticClass:"my-0 text-left",attrs:{cols:"1"}},[i("v-menu",{attrs:{"offset-y":"",transition:"scale-transition",width:"360px"},on:{click:function(e){t.changeRoute=!0}},scopedSlots:t._u([{key:"activator",fn:function(e){var a=e.on,s=e.attrs;return[i("v-btn",t._g(t._b({attrs:{outlined:"",color:"secondary"}},"v-btn",s,!1),a),[t._v("•••")])]}}],null,!0)},[i("v-list",{staticClass:"transparent py-2"},[i("v-list-item",{staticClass:"py-1",on:{click:function(a){t.dashboardFix=e}}},[i("v-list-item-title",[i("v-icon",{attrs:{color:"secondary"}},[t._v("mdi-pin-outline ")]),t._v("Fijar en la parte superior de la página ")],1)],1),i("v-list-item",{staticClass:"py-1",on:{click:function(a){return t.addToFavoriteDashboard(e)}}},[i("v-list-item-title",[i("v-icon",{attrs:{color:"secondary"}},[t._v(t._s(t.isFavorite(e.id)?"mdi-star":"mdi-star-outline")+" ")]),i("span",{staticClass:"ml-1"},[t._v(t._s(t.isFavorite(e.id)?"Eliminar de tus favoritos":"Añadir a favoritos"))])],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)],1)}))]:"Favorites"===t.$route.name?[i("v-col",{staticClass:"pb-6 pt-4 text-center"},[i("v-icon",{staticClass:"d-block",attrs:{color:"secondary",size:"70"}},[t._v("mdi-star")]),i("span",{staticClass:"d-block subtitle-1 my-2"},[t._v("Aún no tienes favoritos agregados")]),i("span",{staticClass:"d-block body-2"},[t._v("Agrega dashboard a tus favoritos para priorizar tu listado")])],1)]:t._e()],2)],1)},Xd=[],Jd=[{id:0,name:"Métricas críticas del negocio",description:"Un panel de control en tiempo real para comprender las métricas críticas relacionadas con el crecimiento, la retención y las fugas y para mantenerse al tanto del crecimiento del negocio en los tiempos inciertos de COVID-19",type:[],category:"executive",url:"CollectiontitleList",active:!0},{id:1,name:"Vigilancia de finanzas",description:"Este panel le ayuda a comprender cuántos ingresos está generando su empresa en comparación con MRR, que es un valor teórico. Con las métricas de este panel también puede obtener visibilidad de su flujo de caja, pagos y reembolsos, y el vencimiento de su tarjeta de crédito",type:[],category:"marketing",url:"CollectiontitleList",active:!0},{id:2,name:"Aspectos destacados de los negocios",description:"Proporciona una vista de pájaro de todas las métricas clave que giran en torno a MRR, Crecimiento, Suscripciones y Churn, mensual y trimestralmente. Este panel le ayuda a comprender el estado de su negocio y ver si está en el buen camino. Es útil para los miembros en funciones ejecutivas u operativas, para comparar el desempeño de su mes y trimestre anterior con el mes y trimestre anterior, y levantar banderas rojas temprano.",type:[],category:"marketing",url:"CollectiontitleList",active:!0},{id:3,name:"Vigilancia ejecutiva",description:"Ofrece tendencias históricas con métricas en torno a MRR, MRR Growth, Retention y Churn desglosadas en el transcurso de varios meses. Este panel proporciona información sobre su rendimiento actual, en comparación con las mismas métricas del mes anterior. Utilícelo para obtener una visión detallada de su crecimiento para las partes interesadas y los inversores",type:[],category:"marketing",url:"CollectiontitleList",active:!0},{id:4,name:"Vigilancia de marketing",description:"Muestra métricas que afectan a la parte superior del embudo de conversión, como registros, activaciones y nuevos ingresos. Este panel también incluye información sobre más actividades a largo plazo, como la retención de suscripciones y las cohortes de crecimiento de MRR, y la expansión neta del dólar que permiten a los equipos de marketing ver el impacto de sus estrategias de adquisición durante un período de tiempo más largo e identificar los mercados emergentes",type:[],category:"finance",url:"CollectiontitleList",active:!0},{id:5,name:"Vigilancia de ventas",description:"Consta de las principales métricas de ingresos como New MRR, Expansion MRR, Upgrade MRR y ARR, segmentadas por planes, territorios geográficos y verticales. Este panel permite al equipo de ventas identificar qué industrias, geografías, planes e incluso representantes de ventas contribuyen a la mayor cantidad de ingresos",type:[],category:"sales",url:"CollectiontitleList",active:!0},{id:6,name:"Reloj de éxito del cliente",description:"Realiza un seguimiento de las métricas de interacción, retención y crecimiento de su negocio de suscripción entre clientes e ingresos. Este panel muestra la suscripción y la renovación de ingresos, la actualización y la degradación de MRR, la tasa de abandono neto y una vista cohortizada de cómo los clientes se están revolciendo, además de un desglose basado en el tiempo de cuándo los clientes se reparten. Utilícelo para supervisar y realizar un seguimiento de sus iniciativas de éxito de clientes.",type:[],category:"customerSuccess",url:"CollectiontitleList",active:!0},{id:7,name:"Reloj mensual",description:"Mira todos los componentes que afectan a tu MRR mes a mes, como New MRR, MRR de conversiones gratuitas a pagadas, expansiones y la pérdida debida a cancelaciones, degradaciones y cancelaciones programadas. Este panel también le ofrece una idea de sus cargos medidos, LTV y CAC, y la rotación mensual tanto en términos de número de clientes como de valor en dólares perdidos",type:[],category:"sales",url:"CollectiontitleList",active:!0},{id:8,name:"Vigilancia de suscripciones",description:"Muestra una colección de todos los KPI principales para proporcionar una perspectiva holística del ciclo de vida de su suscripción, como inscripciones, activaciones, abandono, etc. Utilice este panel para comprender cómo han evolucionado las métricas de su empresa semanalmente o mensualmente. Este panel es especialmente útil para comparar las tendencias dinámicas y a largo plazo de sus suscripciones simultáneamente.",type:[],category:"customerSuccess",url:"CollectiontitleList",active:!0}],Zd=Jd,tu=[],eu=tu,au={data:function(){return{defaulfDashboardList:Zd,favorites:eu,dashboard:[],dashboardFix:{},changeRoute:!1}},created:function(){"Favorites"===this.$route.name?this.dashboard=this.favorites:this.dashboard=this.defaulfDashboardList},methods:{isFavorite:function(t){return-1!==this.favorites.findIndex((function(e){return e.id===t}))},goTo:function(){this.changeRoute||this.$router.push({name:"ReportList"})},addToFavoriteDashboard:function(t){if(this.isFavorite(t.id)){var e=this.favorites.findIndex((function(e){return e.id===t.id}));this.favorites.splice(e,1)}else this.favorites.push(t),this.$dialog.message.info("El Dashboard se ha añadido a favoritos")}}},iu=au,su=(a("f03b"),Object(E["a"])(iu,Kd,Xd,!1,null,"38a1ca8c",null)),ru=su.exports;A()(su,{VBtn:Z["a"],VCard:oe["a"],VCardText:le["c"],VChip:j["a"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemContent:N["a"],VListItemIcon:At["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});var nu=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",{attrs:{align:"center",justify:"center"}},[t.loading?a("v-col",{staticClass:"px-0 pb-0",attrs:{cols:"12"}},[a("v-skeleton-loader",{attrs:{type:"card-heading"}})],1):[a("v-col",{staticClass:"pb-0 px-0",attrs:{cols:"12"}},[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("span",{staticClass:"subtitle-1 font-weight-medium"},[t._v("Mis Dashboards")]),a("v-icon",{staticClass:"ml-1",attrs:{color:"secondary"}},[t._v("mdi-chevron-right")]),a("v-hover",{scopedSlots:t._u([{key:"default",fn:function(e){var i=e.hover;return[a("div",{staticClass:"ml-2 routerLink subtitle-1 font-weight-medium d-inline-block text-truncate",style:(t.$vuetify.breakpoint.width<1400?"max-width: 200px;":"max-width: 500px;")+" cursor: pointer;",attrs:{absolute:"",outlined:"",text:""},on:{click:function(e){t.modalDashboard=!0}}},[t._v(t._s(t.instance.name)+" "),i?a("v-icon",{staticClass:"pl-1",attrs:{small:"",color:"primary"}},[t._v("mdi-pencil")]):t._e()],1)]}}])}),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-tooltip",{attrs:{bottom:"","max-width":"280px",transition:"scale-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-icon",t._g(t._b({attrs:{bottom:"",color:"secondary",small:""}},"v-icon",s,!1),i),[t._v("mdi-information")])]}}])},[a("span",[t._v(t._s(t.instance.description||"Sin descripción"))])]),a("v-btn",{staticClass:"ml-4",attrs:{color:"primary",height:"30",disabled:!t.unSaved&&!((t.draft||{}).layout||[]).length,loading:t.loadingSave},on:{click:function(e){return t.saveDashboard()}}},[t._v("Guardar")]),a("v-btn",{staticClass:"ml-2",attrs:{outlined:"",color:"secondary",height:"34"},on:{click:function(e){t.$router.push({name:"MetricList",query:{dash:t.$route.params.id}}).catch((function(t){return t}))}}},[a("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-plus")]),t._v(" Agregar métricas")],1),a("v-menu",{attrs:{"close-on-click":"","close-on-content-click":"","offset-y":"",left:"","nudge-bottom":10,transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on,s=e.attrs;return[a("v-btn",t._g(t._b({staticClass:"ml-2",attrs:{"min-width":"34","max-width":"34",outlined:"",color:"secondary",ripple:!1,"retain-focus-on-click":""}},"v-btn",s,!1),i),[a("v-icon",{attrs:{color:"secondary"}},[t._v("mdi-dots-horizontal")])],1)]}}])},[a("v-list",{staticClass:"pa-0"},[a("v-list-item",{staticClass:"px-5 py-1",attrs:{ripple:!1},on:{click:function(e){t.modalDestroy=!0}}},[a("v-list-item-title",{staticClass:"subtitle-2 red--text font-weight-medium"},[t._v("Eliminar dashboard")])],1)],1)],1)],1)],1)],1)],1),t.layout.length?a("v-col",{staticClass:"pt-0 px-0",attrs:{cols:"12"}},[a("grid-layout",{class:t.activeGrid?"grid-layout--active-mask":"",attrs:{layout:t.layout,"col-num":t.colNum,"row-height":30,"is-draggable":t.draggable,"is-resizable":!1,"vertical-compact":!0,margin:[15,20],"use-css-transforms":!0},on:{"layout-updated":t.layoutUpdatedEvent,"update:layout":function(e){t.layout=e}}},t._l(t.layout,(function(e){return a("grid-item",{key:e.i,attrs:{x:e.x,y:e.y,w:e.w,h:e.h,i:e.i,"drag-allow-from":".vue-draggable-handle"},on:{move:t.moveEvent,moved:t.movedEvent}},["kpi"===e.metrics.type.name?[a("metric-kpi",{attrs:{metric:e.metrics.name,draggable:!0,interval:e.metrics.interval,comparative:e.metrics.comparative,removable:!0},on:{destroy:function(a){return t.removeItemLayout(e.i)}}})]:"graph"===e.metrics.type.name?[a("metric-graph",{attrs:{draggable:!0,metric:e.metrics.name,removable:!0,resizable:!0,settings:{i:e.i,w:e.w}},on:{destroy:function(a){return t.removeItemLayout(e.i)},resize:function(a){return t.expandItemLayout(e)}}})]:t._e(),"table"===e.metrics.type.name?[a("metric-table",{attrs:{draggable:!0,metric:e.metrics.name,removable:!0,resizable:!0,settings:{i:e.i,w:e.w}},on:{destroy:function(a){return t.removeItemLayout(e.i)},resize:function(a){return t.expandItemLayout(e)}}})]:t._e()],2)})),1)],1):a("v-col",{staticClass:"px-0 py-16 text-center",attrs:{cols:"12"}},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-view-dashboard-outline")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Aún no has añadido métricas al dashboards")]),a("v-btn",{staticClass:"ml-2 mt-5",attrs:{outlined:"",color:"secondary",height:"34"},on:{click:function(e){return t.$router.push({name:"MetricList",query:{dash:t.$route.params.id}})}}},[t._v("Añadir métricas")])],1)],a("v-dialog",{attrs:{width:"600",persistent:"","no-click-animation":""},model:{value:t.modalDashboard,callback:function(e){t.modalDashboard=e},expression:"modalDashboard"}},[a("dialog-add-info-dashboard",{attrs:{isCurrentDashboard:t.instance.id},on:{close:function(e){t.modalDashboard=!1}}})],1),a("v-dialog",{attrs:{width:"500",persistent:"","no-click-animation":""},model:{value:t.modalDestroy,callback:function(e){t.modalDestroy=e},expression:"modalDestroy"}},[a("v-card",[a("v-toolbar",{attrs:{flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"subtitle-1 text--secondary font-weight-medium"},[t._v("Eliminar dashboard")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"mr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",small:"","retain-focus-on-click":""},on:{click:function(e){t.modalDestroy=!1}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{staticClass:"px-2 py-6 background"},[a("v-col",{attrs:{cols:"12"}},[a("span",[t._v("Estás a punto de eliminar "),a("span",{staticClass:"font-weight-medium"},[t._v(" "+t._s(t.instance.name))]),t._v(". Utiliza el siguiente campo de texto para confirmar el nombre del dashboard que quieres eliminar. ")]),a("span",{staticClass:"d-block mt-3"},[t._v(" Escribe "),a("span",{staticClass:"font-weight-medium"},[t._v(t._s(t.instance.name))]),t._v(" para eliminar el dashboard "),a("v-text-field",{attrs:{"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"80","hide-details":"",autocomplete:"off"},model:{value:t.deleteDashboard,callback:function(e){t.deleteDashboard=e},expression:"deleteDashboard"}})],1)])],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},on:{click:function(e){t.modalDestroy=!1}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"red darken-2",dark:!t.isDashboardDelete,disabled:t.isDashboardDelete},on:{click:t.destroy}},[t._v("Eliminar dashboard")])],1)],1)],1)],2)},ou=[],lu=a("7be8"),cu=a.n(lu),du=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",[a("v-toolbar",{attrs:{color:"transparent",flat:"",height:"55"}},[a("v-toolbar-title",{staticClass:"text--secondary subtitle-1 font-weight-medium"},[t._v(t._s(t.isCurrentDashboard?"Editar información del":"Crear nuevo")+" Dashboard")]),a("v-spacer"),a("v-toolbar-items",[a("v-row",{staticClass:"pr-1",attrs:{align:"center",justify:"center"}},[a("v-btn",{attrs:{icon:"",ripple:!1,small:""},nativeOn:{click:function(e){return t.$emit("close")}}},[a("v-icon",{attrs:{small:""}},[t._v("mdi-close")])],1)],1)],1)],1),a("v-divider"),a("v-card-text",{class:(t.loading?"white":"background")+" pa-0"},[t.loading?a("v-row",{staticClass:"pa-0",attrs:{"no-gutters":""}},[a("v-col",{staticClass:"px-0 py-4",attrs:{cols:"3"}},[a("v-skeleton-loader",{attrs:{transition:"fade-transition",type:"card-heading"}}),a("v-skeleton-loader",{staticClass:"mt-5",attrs:{transition:"fade-transition",type:"card-heading"}})],1),a("v-col",{staticClass:"px-0 py-4",attrs:{cols:"9"}},[a("v-skeleton-loader",{staticClass:"ml-n3 mb-4",attrs:{transition:"fade-transition",type:"card-heading"}}),a("v-skeleton-loader",{staticClass:"mt-2 mb-4",staticStyle:{width:"420px",height:"180px"},attrs:{transition:"fade-transition",type:"image"}})],1)],1):a("v-list",{staticClass:"v-list-form-extended py-6 transparent"},[a("v-list-item",{staticClass:"py-1",attrs:{inactive:"",ripple:!1}},[a("v-list-item-title",[t._v(" Nombre "),a("v-tooltip",{attrs:{right:"","max-width":"280px"},scopedSlots:t._u([{key:"activator",fn:function(e){var i=e.on;return[a("v-icon",t._g({attrs:{small:"",color:"secondary"}},i),[t._v("mdi-information")])]}}])},[a("span",[t._v("Escribe un nombre para que puedas identificar fácilmente tu dashboard.")])])],1),a("v-list-item-subtitle",{staticClass:"pl-5"},[a("v-text-field",{attrs:{error:t.$v.dashboard.name.$error,"background-color":"white",outlined:"",required:"","single-line":"",dense:"",maxlength:"56",placeholder:"Escribe un nombre","hide-details":"",autocomplete:"off"},model:{value:t.$v.dashboard.name.$model,callback:function(e){t.$set(t.$v.dashboard.name,"$model",e)},expression:"$v.dashboard.name.$model"}})],1)],1),a("v-list-item",{staticClass:"pt-2",attrs:{inactive:"",ripple:!1}},[a("v-list-item-title",[t._v("Descripción")]),a("v-list-item-subtitle",{staticClass:"pl-5"},[a("v-textarea",{staticClass:"pb-0",attrs:{error:t.$v.dashboard.description.$error,"auto-grow":"",solo:"",flat:"",outlined:"","hide-details":"",placeholder:"Escribe una descripción corta para tu dashboard"},model:{value:t.$v.dashboard.description.$model,callback:function(e){t.$set(t.$v.dashboard.description,"$model",e)},expression:"$v.dashboard.description.$model"}})],1)],1)],1)],1),a("v-divider"),a("v-card-actions",{staticClass:"pa-4"},[a("v-spacer"),a("v-btn",{attrs:{outlined:"",color:"secondary"},nativeOn:{click:function(e){return t.$emit("close")}}},[t._v("Cancelar")]),a("v-btn",{attrs:{color:"primary"},on:{click:function(e){return t.addInfoDashboard()}}},[t._v("Guardar")])],1)],1)},uu=[],vu={props:{isCurrentDashboard:{type:String,default:function(){return null}}},data:function(){return{dashboard:{name:"",description:"",layout:[]},loading:!1}},created:function(){var t=this;null!==this.isCurrentDashboard&&(this.loading=!0,this.$store.dispatch("dashboards/RETRIEVE",{resource:"metrics/dashboards",id:this.isCurrentDashboard}).then((function(e){t.loading=!1;var a=Q()(e.data);t.dashboard=a})))},methods:{addInfoDashboard:function(){var t=this;if(this.$v.dashboard.$touch(),this.$v.dashboard.$invalid)return!1;null!==this.isCurrentDashboard?this.$store.dispatch("dashboards/UPDATE",{resource:"metrics/dashboards",id:this.isCurrentDashboard,payload:this.dashboard}).then((function(e){t.$dialog.message.info("Dashboard guardado correctamente"),t.$store.dispatch("dashboards/LIST",{resource:"metrics/dashboards"})})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})):(this.dashboard.layout=[],this.$store.dispatch("dashboards/CREATE",{resource:"metrics/dashboards",payload:this.dashboard}).then((function(e){t.$dialog.message.info("Has creado un nuevo dashboard"),t.$router.push({name:"DashboardUpdate",params:{id:e.data.id}})})).catch((function(){t.$dialog.message.error("No se pudo crear el dashboard")}))),this.$emit("close")}},validations:{dashboard:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(56)},description:{maxLength:Object(ie["maxLength"])(256)}}}},mu=vu,pu=(a("887c"),Object(E["a"])(mu,du,uu,!1,null,"738864fe",null)),hu=pu.exports;A()(pu,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDivider:tt["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemSubtitle:N["b"],VListItemTitle:N["c"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VTextarea:_a["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var fu={mixins:[$],components:{GridLayout:lu["GridLayout"],GridItem:lu["GridItem"],MetricGraph:tr,MetricKpi:nr,MetricTable:vr,DialogAddInfoDashboard:hu},data:function(){return{dashboard:{name:"",description:"",isMain:!1},selectedIndex:0,layout:[],table:[],deleteDashboard:"",goToDashboard:{},draggable:!0,colNum:12,index:0,activeGrid:!1,modalDashboard:!1,modalDestroy:!1,unSaved:!1,loadingSave:!1,loading:!1,metric:[]}},computed:Object(i["a"])(Object(i["a"])({},Object(u["c"])({instance:function(t){return Q()(t.dashboards.dashboardsDetail)},draft:function(t){return t.dashboards.draft}})),{},{isDashboardDelete:function(){return this.instance.name!==this.deleteDashboard}}),created:function(){var t=this;this.unSaved=!1,this.loading=!0,this.$store.dispatch("dashboards/RETRIEVE",{resource:"metrics/dashboards",id:this.$route.params.id}).then((function(){t.setLayout()})).catch((function(t){console.error(t)})).finally((function(){t.loading=!1}))},methods:{setLayout:function(){var t,e,a,i,s=this;this.layout=Q()(this.instance.layout),(null===(t=this.instance)||void 0===t||null===(e=t.layout)||void 0===e?void 0:e.length)&&this.layout.forEach((function(t,e){s.layout[e].metrics=t.metrics})),(null===(a=this.draft)||void 0===a||null===(i=a.layout)||void 0===i?void 0:i.length)&&(this.draft.layout.forEach((function(t){"kpi"===t.type.name?s.layout.push({x:3*s.layout.length%(s.colNum||12),y:s.layout.length+(s.colNum||12),w:3,h:3,i:t.name+"_"+(s.layout.length+1),metrics:t}):s.layout.push({x:12*s.layout.length%(s.colNum||12),y:s.layout.length+(s.colNum||12),w:12,h:6,i:t.name+"_"+(s.layout.length+1),metrics:t})})),this.unSaved=!0)},movedEvent:function(){this.activeGrid=!1,this.unSaved=!0},moveEvent:function(){this.activeGrid=!0},layoutUpdatedEvent:function(){this.activeGrid=!1},removeItemLayout:function(t){var e=this.layout.map((function(t){return t.i})).indexOf(t);this.layout.splice(e,1),this.unSaved=!0},expandItemLayout:function(t){var e=this.layout.map((function(t){return t.i})).indexOf(t.i);if(12===t.w)this.layout[e].w=6;else{var a=[],i="";for(var s in this.layout[e].w=12,this.layout)for(var r in this.layout[s].y===t.y?(this.layout[e].x=0,this.layout[s].i!==t.i&&(this.layout[e].x=0,a.push(this.layout[s]))):this.layout[s].y!==t.y-3&&this.layout[s].y!==t.y+3||("kpi"!==this.layout[s].metrics.type.name?(this.metric.forEach((function(t){return console.log()})),i=this.layout[s]):this.metric.push(this.layout[s])),a)this.layout[s].y===a[r].y&&(this.layout[s].y=this.layout.length*this.layout[this.layout.length-1].h+(this.colNum||12),this.layout[s].x=this.layout.length*this.layout[s].w%(this.colNum||12));for(var n in this.metric)i.y===this.metric[n].y&&(this.layout[n].y=this.layout.length*this.layout[this.layout.length-1].h+(this.colNum||12),this.layout[n].x=this.layout.length*this.layout[n].w%(this.colNum||12))}this.unSaved=!0},saveDashboard:function(){var t=this;this.loadingSave=!0,this.$store.dispatch("dashboards/CLEAR_DASHBOARD");var e=Object.assign({},this.instance);e.layout=Q()(this.layout),e.layout.forEach((function(t){Object.keys(t.metrics).forEach((function(e){["id","values","description"].includes(e)&&delete t.metrics[e]}))})),this.$store.dispatch("dashboards/UPDATE",{resource:"metrics/dashboards",id:this.instance.id,payload:e}).then((function(){t.$dialog.message.info("Dashboard guardado correctamente"),t.loadingSave=!1,t.unSaved=!1})).catch((function(t){console.error(t)}))},destroy:function(){var t=this;this.instance.name===this.deleteDashboard&&this.$store.dispatch("dashboards/LIST",{resource:"metrics/dashboards"}).then((function(e){var a=Q()(e.data.results);a.length&&(t.goToDashboard=a.filter((function(e){return e.id!==t.instance.id}))),t.$store.dispatch("dashboards/DESTROY",{resource:"metrics/dashboards",id:t.instance.id}).then((function(){t.goToDashboard.length?t.$router.push({name:"DashboardUpdate",params:{id:t.goToDashboard[0].id}}):t.$router.push("/dashboards").catch((function(t){return t}))})).catch((function(e){t.$dialog.message.error(t.parseErrors(e.response.data))})).finally((function(){t.modalDestroy=!1}))}))},dialogRouteLeave:function(){return this.$dialog.warning({title:"Cambios sin guardar",text:'\n Hay cambios que no han sido guardados\n ¿Estás seguro de continuar?\n ',actions:[{color:"red",text:"Continuar",class:"mx-12"},{color:"",text:"Cancel"}]})}},beforeRouteUpdate:function(t,e,a){var i=this;return Object(Br["a"])(regeneratorRuntime.mark((function s(){var r,n,o;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:if(!i.unSaved||"DashboardUpdate"!==t.name||(null===(r=t.params)||void 0===r?void 0:r.id)===(null===(n=e.params)||void 0===n?void 0:n.id)){s.next=7;break}return s.next=3,i.dialogRouteLeave();case 3:o=s.sent,"Continuar"===o?(i.$store.dispatch("dashboards/CLEAR_DASHBOARD"),a(),i.unSaved=!1):a(!1),s.next=8;break;case 7:a();case 8:case"end":return s.stop()}}),s)})))()},beforeRouteLeave:function(t,e,a){var i=this;return Object(Br["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i.unSaved){t.next=4;break}a(!0),t.next=8;break;case 4:return t.next=6,i.dialogRouteLeave();case 6:e=t.sent,"Continuar"===e?(i.$store.dispatch("dashboards/CLEAR_DASHBOARD"),a(!0),i.unSaved=!1):a(!1);case 8:case"end":return t.stop()}}),t)})))()},validations:{dashboard:{name:{required:ie["required"],maxLength:Object(ie["maxLength"])(56)},description:{maxLength:Object(ie["maxLength"])(200)}}}},bu=fu,gu=(a("8189"),Object(E["a"])(bu,nu,ou,!1,null,"592562cb",null)),_u=gu.exports;A()(gu,{VBtn:Z["a"],VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VCol:q["a"],VDialog:xe["a"],VDivider:tt["a"],VHover:et["a"],VIcon:I["a"],VList:O["a"],VListItem:R["a"],VListItemTitle:N["c"],VMenu:P["a"],VRow:z["a"],VSkeletonLoader:st["a"],VSpacer:ut["a"],VTextField:F["a"],VToolbar:$e["a"],VToolbarItems:ke["a"],VToolbarTitle:ke["b"],VTooltip:Ve["a"]});var yu=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-row",[a("v-col",{staticClass:"px-0",attrs:{cols:"12"}},[a("v-row",{staticClass:"mx-0",attrs:{aling:"center",justify:"start"}},[a("v-col",{staticClass:"text-center py-10"},[a("v-row",{staticClass:"mt-12",attrs:{align:"center",justify:"center"}},[a("v-col",{staticClass:"text-center mt-12"},[a("v-icon",{attrs:{color:"secondary",size:"70"}},[t._v("mdi-chart-box-plus-outline")]),a("span",{staticClass:"d-block subtitle-1"},[t._v("Bienvenido a los dashboards")]),a("span",{staticClass:"d-block subtitle-2"},[t._v("Crea un panel para monitorear tus métricas, todo en un solo lugar")]),a("v-btn",{staticClass:"ml-2 mt-5",attrs:{outlined:"",color:"secondary",height:"34"},on:{click:function(e){t.modalDashboard=!0}}},[t._v("Crear Dashboard")])],1)],1)],1)],1)],1),a("v-dialog",{attrs:{width:"600",persistent:"","no-click-animation":""},model:{value:t.modalDashboard,callback:function(e){t.modalDashboard=e},expression:"modalDashboard"}},[a("dialog-add-info-dashboard",{on:{close:function(e){t.modalDashboard=!1}}})],1)],1)},Cu=[],xu={components:{DialogAddInfoDashboard:hu},data:function(){return{modalDashboard:!1}}},wu=xu,$u=Object(E["a"])(wu,yu,Cu,!1,null,null,null),ku=$u.exports;A()($u,{VBtn:Z["a"],VCol:q["a"],VDialog:xe["a"],VIcon:I["a"],VRow:z["a"]});var Vu=a("0e44"),Lu=a("bc3a"),Su=a.n(Lu),Tu=(a("8a79"),Su.a.create({baseURL:"https://api-devel.piriod.com/"}));Tu.interceptors.request.use((function(t){var e=Su.a.CancelToken.source();return t.cancelToken=e.token,wv.commit("global/ADD_CANCEL_TOKEN",e),wv.state.auth.token&&(t.headers.Authorization="JWT ".concat(wv.state.auth.token)),wv.state.auth.account.id&&(t.headers["x-simple-workspace"]=wv.state.auth.account.id),t}),(function(t){return Promise.reject(t)})),Tu.interceptors.response.use((function(t){return t}),(function(t){var e=t.response.status,a=t.config.url;return 403===e?Vv.push({name:"PermissionDenied"}):401===e&&a.endsWith("/token/refresh/")?wv.commit("auth/DELETE_AUTH",{router:Vv,redirect:Vv.currentRoute.fullPath}):401===e&&a.endsWith("/token/")||401!==e?new Promise((function(e,a){a(t)})):wv.dispatch("auth/REFRESH_TOKEN").then((function(e){return new Promise((function(e,a){Tu.request(t.config).then((function(t){e(t)})).catch((function(t){a(t)}))}))})).catch((function(t){Promise.reject(t)}))}));var Eu=Tu,Du={signUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(a,i){var s={};e&&(s.invitation=e),Eu.post("/auth/registration/",t,{params:s}).then((function(t){a(t)})).catch((function(t){i(t)}))}))},getAuth:function(t,e){return new Promise((function(a,i){Eu.post(t,e).then((function(t){a(t)})).catch((function(t){i(t)}))}))},getRefreshToken:function(t){return new Promise((function(e,a){Eu.post("/token/refresh/",{refresh:t}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},tokenVerify:function(t){return new Promise((function(e,a){Eu.post("/token/verify/",{token:t}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},bulkInvitation:function(t){return new Promise((function(e,a){Eu.post("/invitations/send_bulk/",{persons:t}).then((function(){e()})).catch((function(t){a(t)}))}))},acceptInvitation:function(t){return new Promise((function(e,a){Eu.get("".concat(t,"/accept-invite/")).then((function(t){e(t)})).catch((function(t){a(t)}))}))},passwordReset:function(t){return new Promise((function(e,a){Eu.post("/auth/password/reset/",{email:t}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},passwordResetConfirm:function(t){return new Promise((function(e,a){Eu.post("/auth/password/reset/confirm/",{uid:t.uid,token:t.token,new_password1:t.new_password1,new_password2:t.new_password2}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},getUser:function(){return new Promise((function(t,e){Eu.get("/auth/user/").then((function(e){t(e)})).catch((function(t){e(t)}))}))},patchUser:function(t){return new Promise((function(e,a){Eu.patch("/auth/user/",{first_name:t.first_name,last_name:t.last_name}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},postUserPassword:function(t){return new Promise((function(e,a){Eu.post("/auth/password/change/",{new_password1:t.new_password1,new_password2:t.new_password2,old_password:t.old_password}).then((function(t){e(t)})).catch((function(t){a(t)}))}))},retrieveTrace:function(){return new Promise((function(t,e){Su.a.get("https://www.cloudflare.com/cdn-cgi/trace").then((function(e){t(e)})).catch((function(t){e(t)}))}))}},Au={list:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"json";return new Promise((function(i,s){var r="/".concat(t,"/");Eu.get(r,{params:e,responseType:a}).then((function(t){i(t)})).catch((function(t){s(t)}))}))},retrieve:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,r){var n="/".concat(t,"/").concat(e,"/");a&&(n+="".concat(a,"/")),Eu.get(n,{params:i}).then((function(t){s(t)})).catch((function(t){r(t)}))}))},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(a,i){Eu.get("/".concat(t,"/"),{params:e}).then((function(t){a(t)})).catch((function(t){i(t)}))}))},create:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return new Promise((function(r,n){var o="/".concat(t,"/");a&&i&&(o+="".concat(i,"/").concat(a,"/")),Eu.post(o,e,s).then((function(t){r(t)})).catch((function(t){n(t)}))}))},update:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(s,r){var n="/".concat(t,"/").concat(e,"/");Eu.patch(n,a,i).then((function(t){s(t)})).catch((function(t){r(t)}))}))},destroy:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(i,s){Eu.delete("/".concat(t,"/").concat(e,"/"),{params:a}).then((function(t){i(t)})).catch((function(t){s(t)}))}))}},ju={retrieveLoader:!1,createLoader:!1,destroyLoader:!1},qu={LIST:function(t,e){var a=t.commit,i=e.resource,s=e.query,r=e.loader,n=void 0===r||r,o=e.responseType;return new Promise((function(t,e){n&&a("TOGGLE_RETRIEVE_LOADER"),Au.list(i,s,o).then((function(e){a("SET_LIST",{response:e,resource:i}),t(e)})).catch((function(t){e(t)})).finally((function(){n&&a("TOGGLE_RETRIEVE_LOADER")}))}))},RETRIEVE:function(t,e){var a=t.commit,i=e.resource,s=e.id,r=e.detail,n=e.query,o=e.setDetail,l=void 0===o||o,c=e.loader,d=void 0===c||c;return new Promise((function(t,e){d&&a("TOGGLE_RETRIEVE_LOADER"),Au.retrieve(i,s,r,n).then((function(e){l&&a("SET_DETAIL",{response:e,resource:i,loader:d}),t(e)})).catch((function(t){e(t)})).finally((function(){d&&a("TOGGLE_RETRIEVE_LOADER")}))}))},CREATE:function(t,e){var a=t.commit,i=e.resource,s=e.payload,r=e.detail,n=e.id,o=e.headers,l=e.commitInstance,c=void 0===l||l;return new Promise((function(t,e){a("TOGGLE_CREATE_LOADER"),Au.create(i,s,r,n,o).then((function(e){c&&a("SET_DETAIL",{response:e,resource:i}),t(e)})).catch((function(t){e(t)})).finally((function(){a("TOGGLE_CREATE_LOADER")}))}))},UPDATE:function(t,e){var a=t.commit,i=e.resource,s=e.id,r=e.payload,n=e.headers;return new Promise((function(t,e){a("TOGGLE_CREATE_LOADER"),Au.update(i,s,r,n).then((function(e){a("SET_DETAIL",{response:e,resource:i}),t(e)})).catch((function(t){e(t)})).finally((function(){a("TOGGLE_CREATE_LOADER")}))}))},DESTROY:function(t,e){var a=t.commit,i=e.resource,s=e.id,r=e.query,n=e.loader,o=void 0===n||n,l=e.commitInstance,c=void 0===l||l;return new Promise((function(t,e){o&&a("TOGGLE_DESTROY_LOADER"),Au.destroy(i,s,r).then((function(){c&&a("SET_DELETE",{resource:i,id:s}),t()})).catch((function(t){e(t)})).finally((function(){o&&a("TOGGLE_DESTROY_LOADER")}))}))}},Iu={SET_LIST:function(t,e){var a=e.response,i=e.resource;t["".concat(i.split("/").pop(),"List")]=a.data.results,t["".concat(i.split("/").pop(),"Count")]=a.data.count},SET_DETAIL:function(t,e){var a=e.response,i=e.resource,r=(e.loader,i.split("/").pop()),n=r+"List",o=r+"Detail";if(t[o]&&(t[o]=a.data),t[n]){var l=a.config.method;if("post"===l&&t[n].push(a.data),"patch"===l){var c=t[n].findIndex((function(t){return t.id===a.data.id}));s["default"].set(t[n],c,a.data)}}},SET_DELETE:function(t,e){var a=e.resource,i=e.id,s=a.split("/").pop(),r=t["".concat(s,"List")].findIndex((function(t){return t.id===i}));t["".concat(s,"List")].splice(r,1)},SET_LOADER:function(t,e){t["".concat(e,"Loader")]=!t["".concat(e,"Loader")]},TOGGLE_CREATE_LOADER:function(t){t.createLoader=!t.createLoader},TOGGLE_RETRIEVE_LOADER:function(t){t.retrieveLoader=!t.retrieveLoader},TOGGLE_DESTROY_LOADER:function(t){t.destroyLoader=!t.destroyLoader}},Ou=Object(i["a"])({invoice:{},invoice_due:{},payment:{},subscriptions:{},customer:{},metrics:{}},ju),Ru={GET:function(t,e){var a=t.commit,i=e.resource,s=e.query;return new Promise((function(t,e){a("SET_LOADER","retrieve"),Au.get(i,s).then((function(e){a("SET",{response:e,resource:i}),t(e)})).catch((function(t){e(t)}))}))}},Nu=Object(i["a"])({SET:function(t,e){var a=e.response,i=e.resource,s=i.split("/").pop();t[s]&&(t[s]=a.data),t.retrieveLoader=!1,t.createLoader=!1}},Iu),Pu={namespaced:!0,state:Ou,actions:Ru,mutations:Nu},Bu=Object(i["a"])({accountsDetail:{},accountsCount:null,accountsList:[],onboardingsList:[],emailsDetail:{},emailsCount:null,emailsList:[],invoicesDetail:{},resolutionsDetail:{},resolutionsList:[],membersCount:null,membersList:[],membersDetail:{},invitationsCount:null,invitationsList:[],invitationsDetail:{},filtersDetail:[],filtersCount:null,filtersList:[],searchCount:null,searchList:[],tokensList:[],notificationsList:[],notificationsCount:null,conversationsCount:null,conversationsList:[],eventsCount:null,eventsList:[],webhooksCount:null,webhooksDetail:{},webhooksList:[]},ju),zu=Object(i["a"])({BULK_INVITATION:function(t,e){var a=t.commit,i=e.persons;return new Promise((function(t,e){a("TOGGLE_CREATE_LOADER"),Du.bulkInvitation(i).then((function(){t()})).catch((function(t){e(t)})).finally((function(){a("TOGGLE_CREATE_LOADER")}))}))},SEARCH_LIST:function(t,e){var a=t.commit,i=e.resource,s=e.query,r=e.loader,n=void 0===r||r;return new Promise((function(t,e){n&&a("TOGGLE_RETRIEVE_LOADER"),Au.list(i,s).then((function(e){a("SET_SEARCH",e),t(e)})).catch((function(t){e(t)})).finally((function(){n&&a("TOGGLE_RETRIEVE_LOADER")}))}))},CLEAR_LIST:function(t){var e=t.commit;e("CLEAR_LIST")}},qu),Fu=Object(i["a"])({SET_SEARCH:function(t,e){s["default"].set(t,"searchList",e.data.hits.hits),s["default"].set(t,"searchCount",e.data.hits.total.value)},CLEAR_LIST:function(t){s["default"].set(t,"searchList",[]),s["default"].set(t,"searchCount",0)}},Iu),Mu={namespaced:!0,state:Bu,actions:zu,mutations:Fu},Uu=Object(i["a"])({dashboardsDetail:{},dashboardsList:[],draft:{}},ju),Gu=Object(i["a"])({DASHBOARD_LIST:function(t,e){var a=t.commit;a("SET_DASHBOARD",e)},CLEAR_DASHBOARD:function(t){var e=t.commit;e("CLEAR_DASHBOARD")}},qu),Hu=Object(i["a"])({SET_DASHBOARD:function(t,e){t.draft=e},CLEAR_DASHBOARD:function(t){t.draft={}}},Iu),Yu={namespaced:!0,state:Uu,actions:Gu,mutations:Hu},Wu=Object(i["a"])(Object(i["a"])({},ju),{},{certificatesCount:null,certificatesList:[],activitiesCount:null,activitiesList:[],billerconnectionsCount:0,billerconnectionsDetail:{},billerconnectionsList:[],cafsCount:null,cafsDetail:{},cafsList:[],foliosCount:null,foliosList:[],foliosDetail:{},rvdsCount:null,rvdsList:[],sequencesDetail:{},sequencesCount:null,sequencesList:[],supplierresponsesList:[],supplierresponsesCount:null,swapsDetail:{},swapsCount:null,swapsList:[]}),Qu={namespaced:!0,state:Wu,actions:qu,mutations:Iu},Ku=Object(i["a"])(Object(i["a"])({},ju),{},{countriesCount:null,countriesList:[],statesCount:null,statesList:[],documentsCount:null,documentsList:[],currenciesCount:null,currenciesList:[],activitiesCount:null,activitiesList:[],referencesCount:null,referencesList:[]}),Xu={namespaced:!0,state:Ku,actions:qu,mutations:Iu},Ju={loading:!1,cancelTokens:[]},Zu={SET_LOADING:function(t,e){var a=t.commit;a("SET_LOADING",e)},CANCEL_PENDING_REQUESTS:function(t){var e=t.commit,a=t.state;a.cancelTokens.forEach((function(t){t.cancel&&t.cancel()})),e("CLEAR_CANCEL_TOKENS")}},tv={SET_LOADING:function(t,e){t.loading=e},ADD_CANCEL_TOKEN:function(t,e){t.cancelTokens.push(e)},CLEAR_CANCEL_TOKENS:function(t){t.cancelTokens=[]}},ev={namespaced:!0,state:Ju,actions:Zu,mutations:tv},av=(a("498a"),{token:"",refresh:"",user:{},account:{},invitation:{},trace:{}}),iv={SIGN_UP:function(t,e){t.commit;var a=e.user,i=e.invitation;return new Promise((function(t,e){Du.signUp(a,i).then((function(e){t(e)})).catch((function(t){e(t)}))}))},GET_AUTH:function(t,e){var a=t.commit,i=e.resource,s=e.payload;return new Promise((function(t,e){Du.getAuth(i,s).then((function(e){a("SET_AUTH",e),Du.getUser().then((function(t){var e=t.data;window.analytics.identify(e.email,{email:e.email},{integrations:{Intercom:{user_hash:e.intercom.hash}}})})).catch({}),t()})).catch((function(t){e(t)}))}))},DELETE_AUTH:function(t){var e=t.commit;e("DELETE_AUTH")},SET_ACCOUNT:function(t,e){var a=t.commit;a("SET_ACCOUNT",{account:e,redirect:!0})},TOKEN_VERIFY:function(t){t.commit;var e=t.state;return new Promise((function(t,a){Du.tokenVerify(e.refresh).then((function(e){t(e)})).catch((function(t){a(t)}))}))},REFRESH_TOKEN:function(t){var e=t.commit,a=t.state;return new Promise((function(t,i){Du.getRefreshToken(a.refresh).then((function(a){e("REFRESH_TOKEN",a.data.access),t(a)})).catch((function(t){i(t)}))}))},ACCEPT_INVITATION:function(t,e){var a=t.commit;return new Promise((function(t,i){Du.acceptInvitation(e).then((function(e){a("SET_INVITATION",e.data),t(e)})).catch((function(t){i(t)}))}))},PASSWORD_RESET:function(t,e){t.commit;return new Promise((function(t,a){Du.passwordReset(e).then((function(e){t(e)})).catch((function(t){a(t)}))}))},PASSWORD_RESET_CONFIRM:function(t,e){t.commit;return new Promise((function(t,a){Du.passwordResetConfirm(e).then((function(e){t(e)})).catch((function(t){a(t)}))}))},GET_USER:function(t){t.commit;return new Promise((function(t,e){Du.getUser().then((function(e){t(e)})).catch((function(t){e(t)}))}))},PATCH_USER:function(t,e){t.commit;return new Promise((function(t,a){Du.patchUser(e).then((function(e){t(e)})).catch((function(t){a(t)}))}))},POST_USER_PASSWORD:function(t,e){t.commit;return new Promise((function(t,a){Du.postUserPassword(e).then((function(e){t(e)})).catch((function(t){a(t)}))}))},RETRIEVE_TRACE:function(t){var e=t.commit;return new Promise((function(t,a){Du.retrieveTrace().then((function(a){e("SET_TRACE",a.data),t(a)})).catch((function(t){a(t)}))}))}},sv={SET_AUTH:function(t,e){t.token=e.data.access||e.data.token,t.refresh=e.data.refresh,t.user=JSON.parse(atob(t.token.split(".")[1])),t.user.authenticated=!0,Vv.push("/account/choose")},DELETE_AUTH:function(t){t.token="",t.refresh="",t.user={},t.account={},delete Su.a.defaults.headers.common.Authorization,Vv.push("/auth/signin")},SET_ACCOUNT:function(t,e){var a=e.account,i=e.redirect;t.account=a,i&&Vv.push("/account/dashboard")},REFRESH_TOKEN:function(t,e){t.token=e},SET_INVITATION:function(t,e){t.invitation=e},SET_TRACE:function(t,e){var a={};e.split("\n").forEach((function(t){var e=t.trim().split("=");a[e[0]]=e[1]})),t.trace=a}},rv={namespaced:!0,state:av,actions:iv,mutations:sv},nv={customersDetail:{},customersCount:null,customersList:[],contactsDetail:{},contactsCount:null,contactsList:[],orgunitsCount:null,orgunitsDetail:{},orgunitsList:[],retrieveLoader:!1,createLoader:!1,deleteLoader:!1},ov={orgunits:function(t){return t.orgunitsList}},lv={actions:qu,getters:ov,mutations:Iu,namespaced:!0,state:nv},cv=Object(i["a"])(Object(i["a"])({},ju),{},{invoicesDetail:{},invoicesCount:null,invoicesList:[],debitnotesDetail:{},debitnotesCount:null,debitnotesList:[],creditnotesDetail:{},creditnotesCount:null,creditnotesList:[],cessionsCount:null,cessionsList:[],sequencesDetail:{},sequencesCount:null,sequencesList:[]}),dv={namespaced:!0,state:cv,actions:qu,mutations:Iu},uv=Object(i["a"])(Object(i["a"])({},ju),{},{ordersDetail:{},invoicesCount:null,ordersList:[]}),vv={namespaced:!0,state:uv,actions:qu,mutations:Iu},mv=Object(i["a"])(Object(i["a"])({},ju),{},{templatesCount:null,templatesList:[],templatesDetail:{},messagesCount:null,messagesList:[],messagesDetail:{},rulesCount:null,rulesList:[],rulesDetail:{}}),pv=Object(i["a"])(Object(i["a"])({},qu),{},{ADD_TEMPORAL_OBJECT:function(t,e){var a=t.commit;a("ADD_TEMPORAL_OBJECT",e)},DESTROY_TEMPORAL_OBJECT:function(t,e){var a=t.commit;a("DESTROY_TEMPORAL_OBJECT",e)}}),hv=Object(i["a"])(Object(i["a"])({},Iu),{},{ADD_TEMPORAL_OBJECT:function(t,e){t.rulesList.push(e)},DESTROY_TEMPORAL_OBJECT:function(t,e){t.rulesList.splice(e,1)}}),fv={namespaced:!0,state:mv,actions:pv,mutations:hv},bv=Object(i["a"])(Object(i["a"])({},ju),{},{purchasesDetail:{},purchasesCount:null,purchasesList:[]}),gv={namespaced:!0,state:bv,actions:qu,mutations:Iu},_v={suppliersDetail:{},suppliersCount:null,suppliersList:[],retrieveLoader:!1,createLoader:!1,deleteLoader:!1},yv={namespaced:!0,state:_v,actions:qu,mutations:Iu},Cv=Object(i["a"])(Object(i["a"])({},ju),{},{invoicesDetail:{},invoicesCount:null,invoicesList:[]}),xv={namespaced:!0,state:Cv,actions:qu,mutations:Iu};s["default"].use(u["a"]);var wv=new u["a"].Store({strict:!0,modules:{analytics:Pu,accounts:Mu,dashboards:Yu,billers:Qu,generals:Xu,global:ev,auth:rv,customers:lv,invoices:dv,orders:vv,reminders:fv,purchases:gv,suppliers:yv,bulks:xv},plugins:[Object(Vu["a"])({paths:["auth"]})]});s["default"].use(Mt["a"]);var $v=[{path:"/auth/signin",name:"AuthSignIn",component:ue,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,title:"Inicio de sesión"}},{path:"/auth/signup",name:"AuthSignUp",component:be,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,title:"Registro de usuario"}},{path:"/auth/settings",name:"AuthSettings",component:Se,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!1,displayOrganization:!0,requireAuth:!0,title:"Configuraciones de usuario"}},{path:"/auth/password/reset",name:"AuthPasswordReset",component:qe,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,title:"Restablecimiento de la contraseña"}},{path:"/auth/password/reset/confirm/:uid/:token",name:"AuthPasswordResetConfirm",component:Be,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,title:"Confirmación restablecimiento de la contraseña"}},{path:"/account/settings/basic",name:"AccountBasic",component:We,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,showDetails:!0,title:"Configuración de la organización"}},{path:"/account/settings/email",name:"AccountSettingsEmail",component:ea,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Email"}},{path:"/account/settings/branding",name:"AccountSettingsBranding",component:Qa,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Branding"}},{path:"/account/settings/invoicing/billers/:id",name:"BillersBiller",component:pi,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Facturador"}},{path:"/account/settings/billers/built_in",name:"BillersBuiltInSettings",component:Li,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Facturador"}},{path:"/reports/billers/built_in/rvds",name:"BillersBuiltInRvds",component:Ii,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Reporte RVD"}},{path:"/reports/billers/built_in/transactional",name:"BillersBuiltInReportTransactional",component:Yi,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Reporte transaccional"}},{path:"/account/settings/invoicing",name:"AccountSettingsInvoicing",component:li,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Facturación"}},{path:"/account/settings/collections",name:"AccountSettingsCollections",component:Zi,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Cobranzas"}},{path:"/account/settings/webhooks",name:"AccountSettingsWebhooksListCreate",component:rs,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Webhooks"}},{path:"/account/settings/webhooks/:id",name:"AccountSettingsWebhooksRetrieveUpdate",component:us,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,title:"Webhooks"}},{path:"/account/settings/billing",name:"AccountBilling",component:bs,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,title:"Facturación de Axteroid"}},{path:"/account/settings/members",name:"AccountMembers",component:Vs,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,requireAccount:!0,title:"Equipo"}},{path:"/account/choose",name:"AccountChoose",component:As,meta:{displayAppBar:!0,displayNavigationDrawer:!1,displayDrawer:!1,displayOrganization:!1,requireAuth:!0,requireAccount:!1,title:"Cambio de cuenta"}},{path:"/",name:"Index",component:As,meta:{displayAppBar:!0,displayNavigationDrawer:!1,displayDrawer:!1,displayOrganization:!1,requireAuth:!0,requireAccount:!0,title:"Cambio de cuenta"}},{path:"/account/dashboard",name:"AccountDashboard",component:fr,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!1,displayOrganization:!0,parent:"AccountDashboard",requireAuth:!0,requireAccount:!0,title:"Dashboard"}},{path:"/account/setup",name:"AccountSetup",component:wr,meta:{displayAppBar:!0,displayNavigationDrawer:!1,displayDrawer:!1,displayOrganization:!1,parent:"AccountBasic",requireAuth:!0,title:"Setup"}},{path:"/account/import/invoices",name:"AccountImportInvoices",component:Dr,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0,title:"Importación de facturas"}},{path:"/account/exports",name:"AccountExports",component:Rr,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/account/exports/customers",name:"AccountCustomerExport",component:yn,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/account/exports/invoices",name:"AccountExportInvoices",component:jn,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/account/exports/credit_notes",name:"AccountExportCreditNote",component:Gn,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/account/imports",name:"AccountImports",component:Xn,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/account/imports/customers",name:"AccountImportCustomers",component:io,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"AccountBasic",requireAuth:!0}},{path:"/invoices/create",name:"InvoiceCreate",component:vo,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Creación de Facturas"}},{path:"/invoices/:id",name:"InvoiceRetrieve",component:Lo,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Detalles de facturas"}},{path:"/invoices",name:"InvoiceList",component:jo,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Facturas"}},{path:"/invoices/:id/edit",name:"InvoiceUpdate",component:vo,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Actualización de facturas"}},{path:"/bulks/invoices",name:"InvoiceBulkListCreate",component:Go,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Facturación masiva"}},{path:"/bulks/invoices/:id",name:"InvoiceBulkRetrieve",component:Po,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Detalles de facturación masiva"}},{path:"/credit-note/:id",name:"CreditNoteRetrieve",component:Cl,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Nota de crédito"}},{path:"/debit-notes/:id",name:"DebitNoteRetrieve",component:Ll,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Nota de débito"}},{path:"/orders/create",name:"OrderCreate",component:Il,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Creación de órdenes"}},{path:"/orders/:id",name:"OrderRetrieve",component:uc,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Detalles de órdenes"}},{path:"/orders",name:"OrderList",component:wc,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Órdenes"}},{path:"/orders/:id/edit",name:"OrderUpdate",component:Il,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"InvoiceList",requireAuth:!0,requireAccount:!0,title:"Actualización de ordenes"}},{path:"/customers/:id",name:"CustomerRetrieveUpdate",component:Ic,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"CustomerListCreate",requireAuth:!0,requireAccount:!0,title:"Detalles y actualización de clientes"}},{path:"/customers",name:"CustomerListCreate",component:zc,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"CustomerListCreate",requireAuth:!0,requireAccount:!0,title:"Clientes"}},{path:"/contacts/:id",name:"ContactRetrieveUpdate",component:Yc,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"CustomerListCreate",requireAuth:!0,requireAccount:!0,title:"Detalles y actualización de la persona"}},{path:"/contacts",name:"ContactListCreate",component:Zc,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"CustomerListCreate",requireAuth:!0,requireAccount:!0,title:"Personas"}},{path:"/applications",name:"Applications",component:od,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!1,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Menú de aplicaciones"}},{path:"/purchases",name:"PurchaseList",component:_d,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Purchases"}},{path:"/purchases/:id",name:"PurchaseRetrieve",component:kd,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Detalles de purchases"}},{path:"/purchases/:id/edit",name:"PurchaseUpdate",component:Dd,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Actualización de purchases"}},{path:"/purchase/create",name:"PurchaseCreate",component:Dd,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Creación de purchases"}},{path:"/suppliers/:id",name:"SupplierRetrieveUpdate",component:Rd,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Detalles y actualización de proveedores"}},{path:"/suppliers",name:"SupplierListCreate",component:Md,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"Applications",requireAuth:!0,requireAccount:!0,title:"Proveedores"}},{path:"/metrics/collections",name:"MetricList",component:Qd,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Coleccción de Métricas"}},{path:"/dashboard/default",name:"DefaultDashboardList",component:ru,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Dashboard predefinidos"}},{path:"/dashboard/favorites",name:"Favorites",component:ru,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Dashboard favoritos"}},{path:"/dashboard/create",name:"DashboardCreate",component:_u,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Dashboard"}},{path:"/dashboard/:id/edit",name:"DashboardUpdate",component:_u,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Dashboard"}},{path:"/dashboard/:id/",name:"DashboardRetrieve",component:_u,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Detalles del Dashboard"}},{path:"/dashboards",name:"Dashboards",component:ku,meta:{displayAppBar:!0,displayNavigationDrawer:!0,displayDrawer:!0,displayOrganization:!0,parent:"DashboardUpdate",requireAuth:!0,requireAccount:!0,title:"Bienvenida dashboards"}},{path:"*",name:"PageNotFound",component:Qt,meta:{displayAppBar:!0,displayNavigationDrawer:!1,displayDrawer:!1,displayOrganization:!0,title:"Página no encontrada"}},{path:"*",name:"PermissionDenied",component:te,meta:{displayAppBar:!0,displayNavigationDrawer:!1,displayDrawer:!1,displayOrganization:!0,title:"Permiso denegado"}}],kv=new Mt["a"]({mode:"history",base:"/",routes:$v});kv.beforeEach((function(t,e,a){wv.dispatch("global/CANCEL_PENDING_REQUESTS"),t.meta.requireAuth?wv.state.auth.token?t.meta.requireAccount?wv.state.auth.account.id?a():a({path:"/account/choose"}):a():a({path:"/auth/signin",query:{redirect:t.fullPath}}):a()})),kv.afterEach((function(t,e){wv.state.auth.account.id&&window.analytics.page(t.name)})),kv.beforeEach((function(t,e,a){document.title=t.meta.title?t.meta.title+" - Axteroid":"Axteroid",a(!0)}));var Vv=kv,Lv=a("f309");s["default"].use(Lv["a"]);var Sv=new Lv["a"]({icons:{iconfont:"mdiSvg"},theme:{options:{customProperties:!0},themes:{light:{primary:"#3F51B5",secondary:"#63627C",lightBlue:"#E6F0FF",darkBlue:"#1868FB",defaultGrey:"#E3E8EE",background:"#F5F9FC",blueCard:"#F5F9FC",blueFont:"#6B7C93",radioLabel:"#525F7F",lightGrey:"#EDEEF6",mediumGrey:"#9B9FB1",darkenGrey:"#73819D",darkenBlue:"#0022B2",fontDraw:"#2B3F58"}}}}),Tv=(a("de31"),a("530b"),a("a925")),Ev=a("1dce"),Dv=a.n(Ev),Av=a("67b0"),jv=a("4eb5"),qv=a.n(jv),Iv=a("998c"),Ov=a.n(Iv),Rv=a("c9bf"),Nv={api:{non_field_errors:"errores",tax_id:"número fiscal",invoice:"factura {number}",lines:"líneas",name:"nombre",discount_scheme:"tipo de descuento",amount:"monto",customer:"cliente",document:"documento",next_number:"número siguiente",date:"fecha",due_date:"fecha de pago",payments:"pagos",file:"archivo",logo:"logo",month:"Mensual",year:"Anual",monthly:"Mensual",yearly:"Anual",daily:"Diario",this_v_last:"actual vs último",this_v_last_mtd:"actual vs último (MTD)",last_v_one_before:"último vs antepenúltimo",tax_agency_failed:"Facturación fallida",reference_expired:"Referencia expirada"},metrics:{total_mrr:"Total del MRR",expansion_mrr:"Expansión del MRR",new_mrr:"Nuevo MRR",contraction_mrr:"Contracción del MRR",churn_mrr:"Cancelación del MRR",total_billing:"Facturación total",total_tax:"Impuestos totales",net_growth_mrr:"Crecimiento neto del MRR",arpu:"Ingresos promedio por suscripción",churn_count_mrr:"Cancelación de suscripciones",total_billing_non_recurring:"Facturación total no recurrente",net_billing:"Facturación neta",total_cancelled_billing:"Total de la facturación anulada",total_receivables:"Cuentas por cobrar",total_receivables_overdue:"Cuentas por cobrar: vencidas",total_receivables_current_due:"Cuentas por cobrar: por vencer",overdue_billing_recovery_breakdown:"Antigüedad de cuentas por cobrar","1_to_14":"1 a 14 días","15_to_29":"15 a 29 días","30_to_59":"30 a 59 días",more_than_60:"más de 60 días"}},Pv={es:Nv},Bv=a("83df"),zv=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-card",[t.title?a("v-toolbar",{attrs:{color:t.color,dark:Boolean(t.color),dense:"",flat:""}},[t.icon?a("v-icon",{attrs:{left:""}},[t._v(t._s(t.icon))]):t._e(),a("v-toolbar-title",{staticClass:"body-1 font-weight-medium",class:{"text--secondary":!t.color}},[t._v(t._s(t.title))])],1):t._e(),t.color?t._e():a("v-divider"),a("v-card-text",{staticClass:"py-6 background",domProps:{innerHTML:t._s(t.text)}}),a("v-divider"),a("v-card-actions",{staticClass:"pa-3"},[a("v-spacer"),a("v-dialog-actions",{attrs:{actions:t.actions,flat:""}})],1)],1)},Fv=[],Mv=a("4450"),Uv=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t._l(t.actionlist,(function(e){return[a("v-dialog-action",t._b({key:e.key,staticClass:"ml-2",class:{loading:t.loadingAction===e.key},attrs:{"action-key":""+e.key,loading:!t.passive&&t.isActionInLoading(e),disabled:t.isActionDisabled(e)||!t.passive&&Boolean(t.loadingAction)},on:{click:function(a){return t.onActionClick(e)}}},"v-dialog-action",t.getActionProps(e),!1))]})),t._t("default")],2)},Gv=[],Hv=a("1ba2"),Yv=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-btn",t._g({attrs:{id:"it-dialog-"+t.actionText.toLowerCase(),disabled:t.disabled,outlined:!t.color,color:t.color||"secondary",dark:Boolean(t.color)},on:{click:function(e){return t.$emit("click",this)}}},t.on),[t.icon&&!t.icon.right?a("v-icon",t._b({domProps:{textContent:t._s(t.icon.text)}},"v-icon",t.icon,!1)):t._e(),t._v(" "+t._s(t.actionText)+" "),t.icon&&t.icon.right?a("v-icon",t._b({domProps:{textContent:t._s(t.icon.text)}},"v-icon",t.icon,!1)):t._e()],1)},Wv=[],Qv={props:{attrs:Object,text:[String,Function],disabled:Boolean,icon:Object,color:String,on:{type:Object,default:function(){}}},computed:{actionText:function(){return"function"===typeof this.text?this.text():this.text}}},Kv=Qv,Xv=Object(E["a"])(Kv,Yv,Wv,!1,null,null,null),Jv=Xv.exports;A()(Xv,{VBtn:Z["a"],VIcon:I["a"]});var Zv={components:{VDialogAction:Jv},mixins:[Hv["a"]],props:{component:[String,Object],color:String,flat:Boolean,rounded:Boolean,outlined:Boolean,passive:Boolean},computed:{nestedProps:function(){return["color","flat","icon","outlined","rounded","block","small","large","x-small","x-large"]}},methods:{getActionProps:function(t){var e=this,a={component:t.component||this.component,text:t.text};return this.nestedProps.forEach((function(i){(t[i]||e[i])&&(a[i]=void 0===t[i]?e[i]:t[i])})),a}}},tm=Zv,em=Object(E["a"])(tm,Uv,Gv,!1,null,null,null),am=em.exports,im={components:{VDialogActions:am,VCard:oe["a"],VCardText:le["c"],VCardActions:le["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"],VIcon:I["a"],VSpacer:ut["a"]},layout:["default",{width:450}],mixins:[Mv["a"]],props:{color:{type:String,default:""},icon:{type:String,default:""},text:{type:[String,Function],required:!0,default:""}},computed:{getText:function(){return"function"===typeof this.text?this.text():this.text}}},sm=im,rm=Object(E["a"])(sm,zv,Fv,!1,null,null,null),nm=rm.exports;A()(rm,{VCard:oe["a"],VCardActions:le["a"],VCardText:le["c"],VDivider:tt["a"],VIcon:I["a"],VSpacer:ut["a"],VToolbar:$e["a"],VToolbarTitle:ke["b"]});a("8128");var om=a("2c05"),lm=a.n(om),cm=a("1920");s["default"].use(lm.a,{api_key:"FOO",options:{cluster:"us2",encrypted:!0}}),s["default"].config.productionTip=!1,s["default"].use(cm["a"],{context:{vuetify:Sv}}),s["default"].use(cu.a,{context:{vuetify:Sv}}),s["default"].use(Bv["a"],{context:{vuetify:Sv}}),s["default"].prototype.$dialog.component("warning",nm,{waitForResult:!0,actions:{false:"Cancelar",true:{text:"Continuar",color:"primary"}}}),s["default"].prototype.$dialog.message={info:function(t,e){return s["default"].prototype.$dialog.toast(Object(i["a"])({text:t,color:"blue-grey darken-1",position:"top-center"},e))},error:function(t,e){return s["default"].prototype.$dialog.toast(Object(i["a"])({text:t,color:"red darken-1",position:"top-center"},e))},success:function(t,e){return s["default"].prototype.$dialog.toast(Object(i["a"])({text:t,color:"green darken-1",position:"top-center"},e))},warning:function(t,e){return s["default"].prototype.$dialog.toast(Object(i["a"])({text:t,color:"amber darken-1",position:"top-center"},e))}},s["default"].use(Tv["a"]),s["default"].use(Dv.a),s["default"].use(Av["a"]),s["default"].use(qv.a),s["default"].use(Ov.a),s["default"].use(Rv["a"],{clientId:"338574906830-gddkaner07o2kr73ao9p37ug4c6ubcer.apps.googleusercontent.com",prompt:"select_account",fetch_basic_profile:!0}),s["default"].prototype.$JS_BASE="http://localhost:8082",s["default"].prototype.$CLIENT_BASE="http://localhost:8080",s["default"].prototype.$API_BASE="https://api-devel.piriod.com/",s["default"].prototype.$PAY_BASE="http://localhost:8081",s["default"].prototype.$DOCS_BASE="https://docs.piriod.com",s["default"].prototype.$FINTOC_API_KEY="FOO";var dm=new Tv["a"]({locale:"es",messages:Pv,silentTranslationWarn:!0});new s["default"]({router:Vv,store:wv,i18n:dm,vuetify:Sv,render:function(t){return t(Ft)}}).$mount("#app")},5829:function(t,e,a){t.exports=a.p+"img/appAsset-brand--Slack.ef01c910.svg"},"5a48":function(t,e,a){t.exports=a.p+"img/appAsset-brand--GoogleSheets.d0481dc9.svg"},"5ac8":function(t,e,a){t.exports=a.p+"img/appAsset-brand--sat.1a3d7e64.svg"},"61ad":function(t,e,a){t.exports=a.p+"img/appAsset-brand--Airtable.8144bef6.svg"},6506:function(t,e,a){},"65d1":function(t,e,a){"use strict";var i=a("45d5"),s=a.n(i);s.a},8189:function(t,e,a){"use strict";var i=a("e6bb"),s=a.n(i);s.a},"887c":function(t,e,a){"use strict";var i=a("6506"),s=a.n(i);s.a},"8b22":function(t,e,a){var i={"./appAsset-flag--CL.svg":"196a","./appAsset-flag--MX.svg":"5633"};function s(t){var e=r(t);return a(e)}function r(t){if(!a.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=r,t.exports=s,s.id="8b22"},a2e5:function(t,e,a){},af5c:function(t,e,a){t.exports=a.p+"img/appAsset-brand--axteroid.245ffa8b.svg"},b010:function(t,e,a){t.exports=a.p+"img/appAsset-brand--HubSpot.92349da8.svg"},b244:function(t,e,a){"use strict";var i=a("a2e5"),s=a.n(i);s.a},bb9c:function(t,e,a){t.exports=a.p+"img/appAsset-Branding--TemplateEmail-admiral.a0a83177.svg"},d222:function(t,e,a){t.exports=a.p+"img/appAsset-brand--sri.674d1475.svg"},d713:function(t,e,a){t.exports=a.p+"img/appAsset-brand--khipu.8fef5910.svg"},de31:function(t,e,a){},df50:function(t,e,a){t.exports=a.p+"img/appAsset-brand--dian.0393b22b.svg"},e2e6:function(t,e,a){t.exports=a.p+"img/appAsset-brand--sii.d503a2a2.svg"},e4d1:function(t,e,a){var i={"./appAsset-brand--Airtable.svg":"61ad","./appAsset-brand--Discover.svg":"371d","./appAsset-brand--GoogleLogo.svg":"2980","./appAsset-brand--GoogleSheets.svg":"5a48","./appAsset-brand--HubSpot.svg":"b010","./appAsset-brand--Office365.svg":"3365","./appAsset-brand--Slack.svg":"5829","./appAsset-brand--Twilio.svg":"0ddb","./appAsset-brand--Zapier.svg":"133d","./appAsset-brand--axteroid-icon.svg":"049a","./appAsset-brand--axteroid.svg":"af5c","./appAsset-brand--bsale.svg":"42f3","./appAsset-brand--defontana.svg":"0551","./appAsset-brand--dian.svg":"df50","./appAsset-brand--facturapi.svg":"2c1f","./appAsset-brand--khipu.svg":"d713","./appAsset-brand--sat.svg":"5ac8","./appAsset-brand--sii.svg":"e2e6","./appAsset-brand--sri.svg":"d222","./appAsset-brand--sunat.svg":"2981"};function s(t){var e=r(t);return a(e)}function r(t){if(!a.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=r,t.exports=s,s.id="e4d1"},e5e5:function(t,e,a){},e6bb:function(t,e,a){},f03b:function(t,e,a){"use strict";var i=a("4ec4"),s=a.n(i);s.a},f8c8:function(t,e,a){},fd27:function(t,e,a){t.exports=a.p+"img/appAsset-ui-genericEmail.c276875c.svg"}}); //# sourceMappingURL=app.2bdc28a1.js.map