(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e912b8e6"],{d065:function(e,t,n){"use strict";var r=n("8336"),i=n("b0af"),a=n("99d9"),o=n("62ad"),s=n("a523"),l=n("23a7"),c=n("132d"),u=n("da13"),d=n("1800"),p=n("5d23"),f=n("34c3"),m=n("490a"),h=function(){var e=this,t=e._self._c;return t(s["a"],[t(o["a"],{staticClass:"pa-0",attrs:{cols:"12"}},[t("div",{staticClass:"primary",staticStyle:{"border-radius":"5px",padding:"7px","text-align":"start"}},[t("h3",{staticClass:"t-bw-primary--text",staticStyle:{"padding-left":"5px"}},[e._v(" "+e._s(e.$t("general.titles.evidences"))+" "),t(c["a"],{staticClass:"t-bw-primary--text",attrs:{small:""}},[e._v("mdi-pencil")])],1)]),e.evidences&&e.evidences.length>0&&!e.loading?t("div",{staticClass:"mt-2",staticStyle:{"background-color":"#f8f8f8","border-radius":"5px",padding:"7px","text-align":"start"}},e._l(e.evidences,(function(n,i){return t(u["a"],{key:i},[t(f["a"],[t(c["a"],{attrs:{color:"neuter"}},[e._v(" "+e._s(e.selectIconFile(n.name))+" ")])],1),t(p["g"],[t(p["k"],[e._v(e._s(n.name))]),t(p["j"],[e._v(e._s(e.size(n.size)))])],1),t(d["a"],{staticStyle:{display:"contents"}},[n.url?t(r["a"],{attrs:{color:"primary",icon:""}},[t("a",{attrs:{href:n.url,target:"_blank"}},[t(c["a"],{attrs:{color:"primary"}},[e._v("mdi-download-multiple")])],1)]):e._e(),t(r["a"],{attrs:{color:"danger",icon:""},on:{click:function(t){return e.removeEvidence(i)}}},[t(c["a"],{attrs:{color:"error"}},[e._v("mdi-close-circle-outline")])],1)],1)],1)})),1):e.loading?t("div",{staticClass:"mt-2",staticStyle:{"background-color":"#f8f8f8","border-radius":"5px",padding:"7px","text-align":"start"}},[t(i["a"],{attrs:{elevation:"0"}},[t(a["d"],{staticClass:"d-flex justify-center"},[t(m["a"],{attrs:{indeterminate:"",size:"20",width:"3"}})],1)],1)],1):e._e()]),t(o["a"],{staticClass:"pa-0 mt-5",attrs:{cols:"12"}},[t(l["a"],{attrs:{outlined:"",dense:"","error-messages":e.duplicatedFile,label:e.$t("general.buttons.upload_doc"),rules:e.fileTypeRulesAndSize(e.filesSelected),color:"primary",multiple:""},on:{change:e.addEvidences},model:{value:e.filesSelected,callback:function(t){e.filesSelected=t},expression:"filesSelected"}})],1)],1)},v=[],y=n("2f62"),g=n("a8e4");function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=O(e,"string");return"symbol"==b(t)?t:t+""}function O(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var E={name:"UploadEvidence",data:function(){return{filesSelected:[],duplicatedFile:""}},props:{nomenclator:{type:Object,required:!1},loading:{type:Boolean,required:!1,default:!1}},computed:w({evidences:function(){return this.$store.getters["documents/evidences"]}},Object(y["c"])({fileTypeRulesAndSize:"general/fileTypeRulesAndSize"})),methods:w(w({},Object(y["b"])({addEvidences:"documents/addEvidences",removeEvidence:"documents/removeEvidence"})),{},{size:function(e){return g["a"].formatterSizeUnit(e)},selectIconFile:function(e){var t=g["a"].getFileExtension(e);switch(t[0]){case"pdf":return"mdi-file-pdf-box";case"xlsx":return"mdi-file-excel";case"xls":return"mdi-file-excel";case"cvs":return"mdi-file-table";case"png":return"mdi-file-image";case"jpg":return"mdi-file-image";case"jpeg":return"mdi-file-image";case"bmp":return"mdi-file-image";case"msword":return"mdi-file-image";case"zip":return"mdi-folder-zip";case"rar":return"mdi-folder-zip"}}})},S=E,I=n("2877"),C=Object(I["a"])(S,h,v,!1,null,"28b971d3",null);t["a"]=C.exports},d586:function(e,t,n){"use strict";n.r(t);var r=n("8336"),i=n("b0af"),a=n("99d9"),o=n("62ad"),s=n("a523"),l=n("8fea"),c=n("169a"),u=n("ce7e"),d=n("4bd4"),p=n("132d"),f=n("24c9"),m=n("da13"),h=n("5d23"),v=n("490a"),y=n("0fd9"),g=n("2fa4"),b=n("b73d"),x=n("8654"),w=n("a844"),_=n("71d9"),k=n("3a2f");function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){var t=q(e,"string");return"symbol"==O(t)?t:t+""}function q(e,t){if("object"!=O(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var j=function(){var e=this,t=e._self._c;return t(s["a"],{attrs:{fluid:""}},[t(m["a"],{attrs:{"three-line":""}},[t(h["g"],[t("p",{staticClass:"display-1 text--primary"},[e._v(" "+e._s(e.$t("menu.equipment"))+" ")])])],1),t(l["a"],{staticClass:"agTable",attrs:{headers:e.headers,search:e.search,items:e.equipments,options:e.options,"server-items-length":e.totalFromServer,"show-select":e.showCheckBox,loading:e.loading,"checkbox-color":"primary","no-results-text":e.$t("general.ui.not_search_found"),"no-data-text":e.$t("general.ui.not_data_found"),"loading-text":e.$t("general.notification.loadData"),"footer-props":S(S({},e.rowsPerPageItemsOptions),{},{itemsPerPageText:e.$t("general.table.itemsPerPageText"),pageText:"{0}-{1} "+e.$t("general.table.pageText")+" {2}"})},on:{"update:options":function(t){e.options=t}},scopedSlots:e._u([{key:"top",fn:function(){return[t(_["a"],{attrs:{flat:"",color:"white"}},[t(y["a"],{staticClass:"d-flex justify-space-between align-baseline"},[t(o["a"],{staticClass:"pl-0",attrs:{lg:"4",md:"4",sm:"12",xl:"4"}},[t(x["a"],{attrs:{onkeypress:"return (event.charCode != 34)",dense:"",filled:"",rounded:"",color:"primary","append-icon":"mdi-magnify",label:e.$t("general.titles.filter"),clearable:!0,"single-line":"","hide-details":""},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replaceSearch.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replaceSearch.apply(null,arguments):null}],keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchForText.apply(null,arguments)},"click:clear":e.searchAll,"click:append":e.searchForText},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),t(o["a"],{attrs:{lg:"4",md:"4",sm:"12",xl:"4"}},[t(r["a"],{staticClass:"mr-1",staticStyle:{"border-radius":"1.5em"},attrs:{small:"",tile:"",elevation:0,color:"gray",disabled:!(e.equipments&&e.equipments.length>0)},on:{click:e.checkBoxShow}},[e.showCheckBox?t("span",[t(p["a"],{attrs:{small:"",color:"neuter",left:""}},[e._v("mdi-checkbox-multiple-marked")]),t("span",[e._v(e._s(e.$t("general.buttons.checksBoxDisable")))])],1):t("span",[t(p["a"],{attrs:{small:"",color:"neuter",left:""}},[e._v("mdi-checkbox-multiple-marked-outline")]),t("span",{staticClass:"neuter--text"},[e._v(e._s(e.$t("general.buttons.checksBoxEnable")))])],1)])],1),t(g["a"]),t(o["a"],{staticClass:"text-end d-flex justify-end",attrs:{lg:"4",md:"4",sm:"8",xl:"4"}},[e.check([{domain:"Equipments",permisions:["Write"]}])?t(r["a"],{staticClass:"mr-1",staticStyle:{"border-radius":"1.5em 0 0 1.5em"},attrs:{small:"",tile:"",elevation:0,color:"gray",loading:e.loadingExport},on:{click:e.exportCSVEquipments},scopedSlots:e._u([{key:"loader",fn:function(){return[t(v["a"],{staticStyle:{position:"absolute","margin-left":"-3px",height:"15px"},attrs:{color:"secondary accent-4",indeterminate:"",rounded:""}})]},proxy:!0}],null,!1,582310261)},[t(p["a"],{attrs:{small:"",color:"neuter",left:""}},[e._v("mdi-download-multiple")]),t("span",{staticClass:"neuter--text"},[e._v(e._s(e.$t("general.buttons.export")))])],1):e._e(),t(c["a"],{attrs:{persistent:"","max-width":"500px"},scopedSlots:e._u([{key:"activator",fn:function(n){var i=n.on;return[e.check([{domain:"Equipment",permisions:["Write"]}])?t(r["a"],e._g({staticStyle:{"border-radius":"0 1.5em 1.5em 0"},attrs:{small:"",tile:"",elevation:0,color:"gray"}},i),[t(p["a"],{attrs:{small:"",color:"neuter",left:""}},[e._v("mdi-plus")]),e._v(" "+e._s(e.$t("general.buttons.new"))+" ")],1):e._e()]}}]),model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[t(i["a"],{attrs:{light:!0,color:"white"}},[t(a["e"],{staticClass:"pa-6"},[t("span",{staticClass:"headline"},[e._v(e._s(e.formTitle))])]),t(u["a"]),t(a["d"],{staticClass:"px-6"},[t(s["a"],[t(d["a"],{ref:"form",model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t(y["a"],[t(o["a"],{staticClass:"d-flex justify-end",attrs:{cols:"12"}},[t(b["a"],{attrs:{color:"primary"},scopedSlots:e._u([{key:"prepend",fn:function(){return[t(f["a"],{ref:"label"},[e._v(e._s(e.$t("equipment.fields.active"))+" ")])]},proxy:!0}]),model:{value:e.editedItem.active,callback:function(t){e.$set(e.editedItem,"active",t)},expression:"editedItem.active"}})],1)],1),t(y["a"],[t(o["a"],{attrs:{cols:"12"}},[t(x["a"],{staticClass:"required",attrs:{outlined:"",dense:"",onkeypress:"return (event.charCode != 34)",color:"primary",required:"",rules:e.requireAndMaxRules(e.max),counter:e.max,maxlength:"max"},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replaceEquipmentName.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replaceEquipmentName.apply(null,arguments):null}]},scopedSlots:e._u([{key:"label",fn:function(){return[e._v(" "+e._s(e.$t("equipment.fields.name"))+" "),t("strong",{staticClass:"red--text"},[e._v("*")])]},proxy:!0}]),model:{value:e.editedItem.equipment_name,callback:function(t){e.$set(e.editedItem,"equipment_name",t)},expression:"editedItem.equipment_name"}})],1)],1),t(y["a"],[t(o["a"],{attrs:{cols:"12"}},[t(x["a"],{staticClass:"required",attrs:{outlined:"",dense:"",onkeypress:"return (event.charCode != 34)",color:"primary",required:"",rules:e.requireRules},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replaceCode.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replaceCode.apply(null,arguments):null}]},scopedSlots:e._u([{key:"label",fn:function(){return[e._v(" "+e._s(e.$t("equipment.fields.code"))+" "),t("strong",{staticClass:"red--text"},[e._v("*")])]},proxy:!0}]),model:{value:e.editedItem.code,callback:function(t){e.$set(e.editedItem,"code",t)},expression:"editedItem.code"}})],1)],1),t(y["a"],[t(o["a"],{attrs:{cols:"12"}},[t(w["a"],{attrs:{outlined:"",dense:"",onkeypress:"return (event.charCode != 34)",color:"primary",rules:e.lengthRules(250).concat(e.limitEnterKeyPress),"auto-grow":!0,clearable:!0,label:e.$t("equipment.fields.description"),"no-resize":!0,"row-height":40,rows:3,counter:250},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replaceDescriptionText.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replaceDescriptionText.apply(null,arguments):null}]},model:{value:e.editedItem.description_text,callback:function(t){e.$set(e.editedItem,"description_text",t)},expression:"editedItem.description_text"}})],1)],1),t(y["a"],[t("upload-evidence",{attrs:{nomenclator:e.editedItem,loading:e.loadingEvidences}})],1)],1)],1)],1),t(u["a"]),t(a["b"],{staticClass:"pa-6"},[t(g["a"]),t(r["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:e.close}},[e._v(" "+e._s(e.$t("general.buttons.cancel"))+" ")]),t(r["a"],{staticClass:"t-bw-primary--text",attrs:{small:"",elevation:"0",color:"primary",disabled:!e.valid},on:{click:e.save}},[e._v(" "+e._s(e.$t("general.buttons.save"))+" ")])],1)],1)],1)],1)],1)],1)]},proxy:!0},{key:"item.action",fn:function(n){var r=n.item;return[t(k["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(n){var i=n.on;return[e.check([{domain:"Equipment",permisions:["Update"]}])?t(p["a"],e._g({staticClass:"mr-2",attrs:{color:"neuter",small:""},on:{click:function(t){return e.showItem(r)}}},i),[e._v(" mdi-eye-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.show"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.equipment"))+" ")])])]),t(k["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(n){var i=n.on;return[e.check([{domain:"Equipment",permisions:["Update"]}])?t(p["a"],e._g({staticClass:"mr-2",attrs:{color:"neuter",small:""},on:{click:function(t){return e.editItem(r)}}},i),[e._v(" mdi-square-edit-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.edit"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.equipment"))+" ")])])]),t(k["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(n){var i=n.on;return[e.check([{domain:"Equipment",permisions:["Delete"]}])?t(p["a"],e._g({attrs:{color:"neuter",small:""},on:{click:function(t){return e.deleteItemDialog(r)}}},i),[e._v(" mdi-trash-can-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.delete"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.equipment"))+" ")])])])]}},{key:"item.active",fn:function(n){var r=n.item;return[r.active?t(p["a"],{staticClass:"mr-4",attrs:{small:"",color:"success"}},[e._v(" mdi-checkbox-marked-circle-outline ")]):t(p["a"],{staticClass:"mr-4",attrs:{small:"",color:"disabled"}},[e._v(" mdi-checkbox-marked-circle-outline ")])]}},{key:"item.description_text",fn:function(n){var r=n.item;return["NULL"===r.description_text.toUpperCase()?t("div",{staticClass:"mr-4"},[e._v(" - ")]):t("div",{staticClass:"mr-4",staticStyle:{width:"200px","overflow-wrap":"break-word"}},[t("ReadMore",{attrs:{classes:"mb-0","font-size":14,"max-chars":50,text:r.description_text}})],1)]}}]),model:{value:e.selectedItems,callback:function(t){e.selectedItems=t},expression:"selectedItems"}}),t(y["a"],{attrs:{justify:"center"}},[t(d["a"],{ref:"form",model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[e.editedItem?t(c["a"],{attrs:{persistent:"",scrollable:"",width:"600px"},model:{value:e.showItemDetailsDialog,callback:function(t){e.showItemDetailsDialog=t},expression:"showItemDetailsDialog"}},[t(i["a"],[t(a["e"],{staticClass:"px-6",staticStyle:{display:"flex","justify-content":"space-between","align-content":"center","align-items":"flex-start"}},[e._v(" "+e._s(e.editedItem.equipment_name)+" ")]),t(a["c"],{staticClass:"px-6"},[t("div",{staticStyle:{display:"flex"}},[t("p",{staticClass:"mr-2"},[e._v(e._s(e.$t("equipment.fields.code"))+":")]),e._v(" "+e._s(e.editedItem.code)+" ")])]),t(u["a"],{attrs:{light:""}}),t(a["d"],{staticClass:"pa-6"},[t("div",{staticClass:"row mt-2"},[t("div",{staticClass:"col-12"},[t("div",{staticClass:"primary",staticStyle:{"border-radius":"5px",padding:"7px","text-align":"start"}},[t("h3",{staticClass:"t-bw-primary--text",staticStyle:{"padding-left":"5px"}},[e._v(" "+e._s(e.$t("equipment.fields.description"))+" ")])]),t("div",{staticClass:"mt-2",staticStyle:{"background-color":"#f8f8f8","border-radius":"5px",padding:"7px","text-align":"start"}},[e._v(" "+e._s(e.editedItem.description_text||"-")+" ")])])])]),t(u["a"],{attrs:{light:""}}),t(a["b"],{staticClass:"pa-6"},[e.editedItem.evidences&&e.editedItem.evidences.length>0?t(r["a"],{attrs:{icon:"",fab:"",text:"",loading:e.loadingDownloadEvidences,disabled:e.loadingDownloadEvidences,small:""},on:{click:function(t){return e.downloadEvidence(e.editedItem)}}},[t(p["a"],{attrs:{color:"neuter"}},[e._v(" mdi-file-download-outline ")])],1):e._e(),t(g["a"]),t(r["a"],{staticClass:"t-bw-primary--text",attrs:{small:"",elevation:"0",color:"primary"},on:{click:e.close}},[e._v(" "+e._s(e.$t("general.buttons.close"))+" ")])],1)],1)],1):e._e(),t(c["a"],{attrs:{persistent:"",width:"600px",scrollable:""},model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[t(i["a"],[t(a["e"],{staticClass:"headline secondary t-bw-secondary--text"},[e._v(e._s(e.title))]),t(a["d"],{staticClass:"pa-6"},[e._v(e._s(e.dialogText))]),t(a["b"],{staticClass:"pa-6"},[t(g["a"]),t(r["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:e.dialogClose}},[e._v(" "+e._s(e.$t("general.buttons.cancel"))+" ")]),t(r["a"],{staticClass:"t-bw-error--text",attrs:{small:"",elevation:"0",color:"error"},on:{click:e.deleteItem}},[e._v(" "+e._s(e.$t("general.buttons.confirm"))+" ")])],1)],1)],1)],1)],1)],1)},P=[],T=n("fe0b"),D=n("2f62"),$=n("b6e6"),L=n("eb7f"),A=n("fffb"),z=n("bae2"),N=n("d065"),B=n("2ef0"),F=n.n(B),R=n("149e");function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function K(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */K=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new j(r||[]);return i(o,"_invoke",{value:S(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",f="suspendedYield",m="executing",h="completed",v={};function y(){}function g(){}function b(){}var x={};c(x,o,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(P([])));_&&_!==n&&r.call(_,o)&&(x=_);var k=b.prototype=y.prototype=Object.create(x);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,s){var l=d(e[i],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==G(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(u).then((function(e){c.value=e,o(c)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function S(t,n,r){var i=p;return function(a,o){if(i===m)throw Error("Generator is already running");if(i===h){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=I(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=d(t,n,r);if("normal"===c.type){if(i=r.done?h:f,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=h,r.method="throw",r.arg=c.arg)}}}function I(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=d(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(G(t)+" is not iterable")}return g.prototype=b,i(k,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},O(E.prototype),c(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(u(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},O(k),c(k,l,"Generator"),c(k,o,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(q),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;q(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function M(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function U(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){M(a,r,i,o,s,"next",e)}function s(e){M(a,r,i,o,s,"throw",e)}o(void 0)}))}}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return(t=W(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e){var t=Y(e,"string");return"symbol"==G(t)?t:t+""}function Y(e,t){if("object"!=G(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var H=JSON.parse(localStorage.getItem("profile")),Q={components:{ReadMore:R["a"],UploadEvidence:N["a"],MoreOptions:A["a"]},data:function(){return{profile:null,dialog:!1,editedIndex:-1,search:"",selectedItem:null,icon:null,rowsPerPageItemsOptions:{itemsPerPageOptions:[10,20,50,100,200]},editedItem:{equipment_name:"",code:"",active:!0,description_text:"",evidences:[]},defaultItem:{active:!0},showDialog:!1,title:"Información",dialogText:"Añada un texto a este dialogo",valid:!1,max:60,deletingItem:{},selectedItems:[],showCheckBox:!1,isEnabledCheckBox:!1,showItemDetailsDialog:!1,previousDocuments:[],documentSelected:null,loadingEvidences:!1,loadingDownloadEvidences:!1,loadingExport:!1,options:{},defaultFilters:{companyId:H.company_id,search:"",pageableDTO:{page:0,size:10,sortBy:"id",direction:"ASC"}}}},computed:J(J({optionsTable:{get:function(){return this.$store.getters["ui/GET_OPTIONS_TABLE"]},set:function(e){this.$store.dispatch("ui/SET_OPTIONS_TABLE",e)}},notification:{get:function(){return this.$store.getters["ui/GET_NOTIFICATION"]},set:function(e){this.$store.commit("ui/NOTIFICATION",e)}}},Object(D["c"])({equipments:"equipment/equipments",totalFromServer:"equipment/totalFromServer",evidences:"documents/evidences",loading:"equipment/loading",requireAndMaxRules:"general/requireAndMaxRules",requireRules:"general/requireRules",lengthRules:"general/lengthRules",limitEnterKeyPress:"general/limitEnterKeyPress",languageStructure:"general/languageStructure",equalObjectsCompareRule:"general/equalObjectsCompareRule"})),{},{headers:function(){return[{text:T["a"].t("equipment.fields.name"),value:"equipment_name"},{text:T["a"].t("equipment.fields.code"),value:"code"},{text:T["a"].t("equipment.fields.description"),value:"description_text"},{text:T["a"].t("equipment.fields.active"),value:"active",align:"center"},{text:T["a"].t("general.fields.action"),value:"action",width:120,sortable:!1,align:"center"}]},formTitle:function(){return(-1===this.editedIndex?T["a"].t("general.titles.new"):T["a"].t("general.titles.edit"))+" "+T["a"].t("equipment.titles.new_equipment")}}),watch:{options:{handler:function(){var e=this;return U(K().mark((function t(){return K().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.optionsTable=e.options,t.next=3,e.searchText();case 3:case"end":return t.stop()}}),t)})))()},deep:!0}},created:function(){this.initialize()},methods:J(J({},Object(D["b"])({fetchListEquipment:"equipment/fetchListEquipment",saveEquipment:"equipment/saveEquipment",deleteEquipment:"equipment/deleteEquipment",clearEvidences:"documents/clearEvidences",exportCSV:"equipment/exportCSV"})),{},{searchAll:function(){var e=this;return U(K().mark((function t(){var n;return K().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={companyId:null,search:null,pageableDTO:{page:0,size:10,sortBy:"id",direction:"DESC"}},n.companyId=e.profile.company_id,t.next=4,e.fetchListEquipment([n,e.$toast]);case 4:case"end":return t.stop()}}),t)})))()},searchForText:function(){var e=this;return U(K().mark((function t(){return K().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.options.page=1,t.next=3,e.searchText();case 3:case"end":return t.stop()}}),t)})))()},searchText:function(){var e=this;return U(K().mark((function t(){var n,r,i;return K().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={companyId:null,search:null,pageableDTO:{page:null,size:null,sortBy:"id",direction:"DESC"}},n.companyId=e.profile.company_id,r=0===e.options.sortDesc.length||e.options.sortDesc[0]?"asc":"desc",i=0===e.options.sortBy.length?"id":F.a.filter(e.headers,{value:e.options.sortBy[0]})[0].value,n.pageableDTO={page:e.options.page-1,size:e.options.itemsPerPage,sortBy:i,direction:r},e.search&&""!==e.search&&(n.search=e.search),t.next=8,e.fetchListEquipment([n,e.$toast]);case 8:case"end":return t.stop()}}),t)})))()},initialize:function(){this.profile=JSON.parse(localStorage.getItem("profile")),this.fetchListEquipment([this.defaultFilters,this.$toast])},save:function(){var e=this;if(this.equalObjectsCompareRule(this.selectedItem,this.editedItem)&&this.editedItem.evidences.length===this.evidences.length)this.$toast.info(T["a"].t("general.notification.nothingToModify"),{icon:"mdi-information-slab-circle",queueable:!0});else{this.editedItem.description_text||(this.editedItem.description_text="");var t=Object.assign({},this.editedItem);t.language_key=$["a"].setKey3(t.equipment_name,t.language_key,t.id?null:this.languageStructure),t.description=$["a"].setKey3(t.description_text,t.description,t.id?null:this.languageStructure),t.companyId=this.profile.company_id,this.saveEquipment([t,this.evidences,this.editedIndex,this.$toast]).finally((function(){e.fetchListEquipment([e.defaultFilters,e.$toast])})),this.close()}},checkBoxShow:function(){this.showCheckBox=!this.showCheckBox,this.showCheckBox||(this.selectedItems=[])},getByProperty:function(e,t){return F.a.map(e,t)},exportCSVEquipments:function(){var e=this;return U(K().mark((function t(){var n;return K().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loadingExport=!0,n={language:$["a"].getLenguajeName(),equipments_ids:e.getByProperty(e.selectedItems,"id")},t.next=4,e.exportCSV([n,e.$toast]).finally((function(){e.loadingExport=!1}));case 4:case"end":return t.stop()}}),t)})))()},showItem:function(e){this.selectedItem=e,this.editedIndex=this.equipments.indexOf(e),this.editedItem=Object.assign({},e),e.evidences&&e.evidences.length>0&&this.getEvidences(this.editedItem),this.showItemDetailsDialog=!0},editItem:function(e){this.selectedItem=e,this.editedIndex=this.equipments.indexOf(e),this.editedItem=Object.assign({},e),e.evidences&&e.evidences.length>0&&this.getEvidences(this.editedItem),this.dialog=!0},downloadEvidence:function(e){var t=this;this.loadingDownloadEvidences=!0,z["a"].getEvidences(e).then((function(r){var i=n("21a6"),a=new Blob([r.data],{type:"application/zip"});i.saveAs(a,"equipment_".concat(e.equipment_name,"_evidences.zip")),t.$toast.success(T["a"].t("general.notification.successDownloadEvidences"),{icon:"mdi-check-circle",queueable:!0})})).catch((function(e){t.$toast.error(T["a"].t("general.notification.errorDownloadEvidences"),{queueable:!0})})).finally((function(){t.loadingDownloadEvidences=!1}))},getEvidences:function(e){var t=this;t.loadingEvidences=!0;try{z["a"].getEvidences(e).then((function(e){var r=new Blob([e.data],{type:"application/zip"}),i=n("c4e3");i.loadAsync(r).then((function(e){Object.keys(e.files).forEach((function(n){e.files[n].async("blob").then((function(e){var r="",i=n.split(".");r="pdf"===i[1]||"PDF"===i[1]?"application/pdf":"xlsx"===i[1]||"XLSX"===i[1]?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xls"===i[1]||"XLS"===i[1]?"application/vnd.ms-excel":"image/"+i[1],t.$store.commit("documents/SET_EVIDENCES",new File([e],n,{type:r}))}))}))}))})).finally((function(){t.loadingEvidences=!1}))}catch(r){t.$toast.error(T["a"].t("general.notification.loadEvidencesError"),{queueable:!0})}},deleteItem:function(){var e=this;this.dialogClose(),this.deleteEquipment([this.deletingItem.id,this.$toast]).finally((function(){e.fetchListEquipment([e.defaultFilters,e.$toast])}))},close:function(){var e=this;!0===this.dialog&&(this.dialog=!1),!0===this.showItemDetailsDialog&&(this.showItemDetailsDialog=!1),this.$refs.form.reset(),this.clearEvidences(),setTimeout((function(){e.editedItem=Object.assign({},e.defaultItem),e.editedIndex=-1}),300)},dialogShow:function(e){this.title=e.title,this.dialogText=e.dialogText,this.showDialog=!0},dialogClose:function(){this.showDialog=!1},check:function(e){return L["a"].check(e)},deleteItemDialog:function(e){this.deletingItem=e,this.dialogShow({title:T["a"].t("general.titles.alert"),dialogText:T["a"].t("general.notification.deleteItems")})},replace:function(e){e.currentTarget.value=e.currentTarget.value.toString().replaceAll('"',"")},replaceSearch:function(e){this.search=e.currentTarget.value.toString().replaceAll('"',"")},replaceEquipmentName:function(e){this.editedItem.equipment_name=e.currentTarget.value.toString().replaceAll('"',"")},replaceCode:function(e){this.editedItem.code=e.currentTarget.value.toString().replaceAll('"',"")},replaceDescriptionText:function(e){this.editedItem.description_text=e.currentTarget.value.toString().replaceAll('"',"")}}),destroyed:function(){this.notification=!1}},Z=Q,ee=n("2877"),te=Object(ee["a"])(Z,j,P,!1,null,"f1d9de8a",null);t["default"]=te.exports}}]);
//# sourceMappingURL=chunk-e912b8e6.c7e5c205.js.map