(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-284a83a8"],{"0b68":function(t,e,r){"use strict";r("dc4a5")},"20bd":function(t,e,r){},"3a65":function(t,e,r){"use strict";r.r(e);var i=r("4ca6"),n=r("8336"),o=r("b0af"),a=r("99d9"),s=r("ac7c"),l=r("62ad"),c=r("132d"),u=r("a722"),f=r("8860"),d=r("da13"),p=r("1800"),h=r("5d23"),m=r("34c3"),y=r("a797"),v=r("891e"),g=r("490a"),b=r("0fd9"),w=r("2fa4"),x=function(){var t=this,e=t._self._c;return e(u["a"],{attrs:{"justify-center":"","align-center":"","d-flex":""}},[e(l["a"],{attrs:{cols:"12"}},[e(o["a"],{attrs:{elevation:"0","max-width":"100%"}},[e(a["e"],{staticClass:"display-1 text--primary"},[t._v(" "+t._s(t.$t("notifications.titles.notifications"))+" ")])],1),e(a["d"],[e(b["a"],[e(l["a"],{attrs:{cols:"8"}},[e(o["a"],{attrs:{elevation:"0","max-width":"100%",width:"100%"}},[e(a["d"],{staticClass:"pa-0"},[e(f["a"],{staticClass:"d-flex justify-start align-center align-content-center secondary",attrs:{dense:"",rounded:""}},[e(d["a"],{staticStyle:{"max-width":"fit-content"},attrs:{dense:""}},[e(m["a"],{staticClass:"mx-2 px-0"},[e(c["a"],{staticClass:"t-bw-secondary--text"},[t._v(" mdi-email-open-outline ")])],1),e(h["g"],[e("p",{staticClass:"ma-0 pa-0 t-bw-secondary--text"},[t._v(" "+t._s(t.$t("notifications.titles.read"))+": "),e("strong",[t._v(t._s(t.watched))])])])],1),e(d["a"],{staticStyle:{"max-width":"fit-content"},attrs:{dense:""}},[e(m["a"],{staticClass:"mx-2 px-0"},[e(c["a"],{staticClass:"t-bw-secondary--text"},[t._v(" mdi-email-outline ")])],1),e(h["g"],[e("p",{staticClass:"ma-0 pa-0 t-bw-secondary--text"},[t._v(" "+t._s(t.$t("notifications.titles.unread"))+": "),e("strong",[t._v(t._s(t.unwatched))])])])],1),e(d["a"],{staticStyle:{"max-width":"fit-content"},attrs:{dense:""}},[e(m["a"],{staticClass:"mx-2 px-0"},[e(c["a"],{staticClass:"t-bw-secondary--text"},[t._v(" mdi-inbox-full-outline ")])],1),e(h["g"],[e("p",{staticClass:"ma-0 pa-0 t-bw-secondary--text"},[t._v(" "+t._s(t.$t("notifications.titles.all"))+": "),e("strong",[t._v(t._s(t.totalFromServer))])])])],1),e(w["a"]),e(d["a"],{staticStyle:{"max-width":"fit-content"},attrs:{dense:""}},[e(p["a"],{staticClass:"mx-1 px-0"},[e("ConfirmDialog",{attrs:{loading:t.loadingArchiveAll,"is-btn":!0,"btn-title":t.alText,text:!1,"w-icon":!0,"i-left":!0,elevation:0,small:!0,"btn-color":"t-bw-primary--text","i-color":"t-bw-primary--text","btn-icon":"mdi-archive-arrow-down-outline",action:"archiveAll",valid:!(t.totalFromServer>0)}})],1),e(p["a"],{staticClass:"mx-1 px-0"},[e("ConfirmDialog",{attrs:{loading:t.loadingRead,"is-btn":!0,"btn-title":t.raText,text:!1,"w-icon":!0,"i-left":!0,elevation:0,small:!0,"btn-color":"t-bw-primary--text","i-color":"t-bw-primary--text","btn-icon":"mdi-check-all",action:"readAll",valid:!(t.totalFromServer>0&&t.enableRA)}})],1)],1)],1)],1)],1)],1),e(l["a"],{attrs:{cols:"4"}},[e(o["a"],{staticClass:"secondary",staticStyle:{position:"fixed"},attrs:{elevation:"0","max-width":"100%",width:"20%"}},[e(a["e"],{staticClass:"px-6 t-bw-secondary--text py-5"},[e("h4",[t._v(t._s(t.$t("notifications.titles.filters")))]),e(w["a"]),e(i["a"],{attrs:{color:"neuter",content:t.filterCount,value:t.filterCount>0,light:"","offset-x":"20",overlap:""}},[e(c["a"],{attrs:{left:"",color:"t-bw-secondary--text"}},[t._v(" mdi-filter-settings-outline ")])],1)],1)],1)],1),e(l["a"],{attrs:{cols:"8"}},[t.notifications&&t.notifications.length>0?e(o["a"],{attrs:{elevation:"0"}},[t.loadingArchiveAll||t.loadingRead?e(y["a"],{attrs:{opacity:".8",absolute:"",color:"white"}},[e(g["a"],{attrs:{indeterminate:"",color:"primary"}})],1):t._e(),e(f["a"],{staticClass:"pa-0",staticStyle:{"border-radius":".4em","overflow-y":"auto",height:"60vh"},style:[{"overflow-y: auto; height: auto !important":t.notifications.length<5}],attrs:{outlined:""}},t._l(t.notifications,(function(r,i){return e(d["a"],{staticClass:"mr-0 pr-0 notification-border__options",class:[{"notification-border__read":r.watched},{"notification-border__unread":!r.watched}],staticStyle:{"border-bottom":"1px solid rgba(0,0,0,0.07)",height:"12vh"},attrs:{ripple:"",selectable:""},on:{mouseleave:function(e){return t.$set(t.iconOptions,i,!1)},mouseenter:function(e){return t.$set(t.iconOptions,i,!0)}},scopedSlots:t._u([{key:"default",fn:function(o){o.active;return[e(p["a"],[e(s["a"],{attrs:{color:"primary","input-value":t.selected.some((function(t){return t.id===r.id}))},on:{change:function(e){return t.toggleSelection(r,e)}},scopedSlots:t._u([{key:"append",fn:function(){return[e(c["a"],{attrs:{color:t.setIconPriority(r.priority).color}},[t._v(" "+t._s(t.setIconPriority(r.priority).icon)+" ")])]},proxy:!0}],null,!0)})],1),e(h["g"],["BRAIN_AG"===r.module?e("BrainAgNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),"RECORDS"!==r.module||t.isExport(r)?t._e():e("RecordsNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}),"RECORD_VALIDATION"===r.module?e("RecordValidationNotification",{attrs:{index:i,loading:t.loading[r.id],loadingSee:t.loadingSee[r.id],notification:r,"with-action":!1},on:{"see:record":function(e){return t.seeRecord(r)},"mark:read":function(e){return t.markRead(r)}}}):t._e(),"TRACEABILITY"===r.module?e("TraceabilityNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),"TRACEABILITY_ERROR"===r.module?e("TraceabilityErrorNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),"EXCEL_IMPORT"===r.module?e("ImportRecordNotification",{ref:"recordImportFile",refInFor:!0,attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),t.isExport(r)?e("S3FileNotification",{ref:"s3File",refInFor:!0,attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),"STOCK"===r.module?e("StockNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e(),"USER_LOCATIONS"===r.module?e("UserLocationsNotification",{attrs:{index:i,loading:t.loading[r.id],notification:r,"with-action":!1},on:{"mark:read":function(e){return t.markRead(r)}}}):t._e()],1),e(p["a"],{staticClass:"mx-0 px-0"},[e(n["a"],{attrs:{tile:"",block:"","max-height":"100%",height:"12vh",elevation:"0",disabled:""}},[e(c["a"],[t._v(t._s(t.iconOptions[i]?"mdi-chevron-right":"mdi-chevron-left"))])],1)],1),e("span",{staticClass:"notification__animation d-flex justify-space-between"},["RECORD_VALIDATION"===r.module?e(p["a"],{staticClass:"mx-0 px-0"},[e(n["a"],{attrs:{tile:"",block:"",text:"","max-height":"100%",height:"12vh",elevation:"0",color:"primary"},on:{click:function(e){return t.$root.$emit("show:record",r)}}},[t._v(" "+t._s(t.$t("general.buttons.show"))+" ")])],1):t._e(),t.isExport(r)||t.isDownloadable(r)?e(p["a"],{staticClass:"mx-0 px-0"},[e(n["a"],{attrs:{tile:"",block:"",text:"","max-height":"100%",height:"12vh",elevation:"0",color:"primary",loading:t.loadingDownload},on:{click:function(e){return t.downloadFileFromS3(r,i)}}},[t._v(" "+t._s(t.$t("general.buttons.download"))+" ")])],1):t._e(),e(p["a"],{staticClass:"mx-0 px-0"},[e("ConfirmDialog",{attrs:{styles:"mx-0",item:r,tile:!0,block:!0,"max-height":"100%",height:"12vh",loading:t.loadingD[r.id],"btn-title":t.$t("notifications.titles.archive"),"is-tooltip":!1,"is-btn":!0,"is-icon":!1,action:"archiveN",frBtnProps:{small:!0,color:"error",textColor:"t-bw-error--text",elevation:0,text:!1}}})],1)],1)]}}],null,!0)})})),1)],1):e(f["a"],{staticClass:"pa-0",staticStyle:{"border-radius":".4em"},attrs:{outlined:""}},[e(d["a"],{staticClass:"d-flex justify-center"},[t._v(" "+t._s(t.$t("general.ui.not_data_found"))+" ")])],1),e(a["b"],{staticClass:"d-flex justify-center"},[e(v["a"],{attrs:{disabled:t.totalFromServer<=10,color:"primary",length:Math.ceil(t.totalFromServer/10),"total-visible":10},on:{input:function(e){return t.fetchNotifications([t.defaultFilters,t.$toast],e)}},model:{value:t.defaultFilters.pageableDTO.page,callback:function(e){t.$set(t.defaultFilters.pageableDTO,"page",e)},expression:"defaultFilters.pageableDTO.page"}})],1)],1),e(l["a"],{attrs:{cols:"4"}},[e("NotificationFilters",{on:{"set:filters":function(e){return t.setFilters(e)}}})],1)],1)],1)],1)],1)},_=[],S=r("2f62"),O=r("fe0b"),k=r("fc5c"),C=r("e0de"),R=r("e090"),$=r("220c"),A=r("e226"),E=r("2ef0"),T=r.n(E),j=r("afbc"),L=r("9e57"),I=r("c6a6"),N=r("cc20"),D=r("ce7e"),P=function(){var t=this,e=t._self._c;return e(o["a"],{staticStyle:{position:"fixed"},attrs:{outlined:"","max-width":"100%",width:"20%"}},[e(a["d"],{staticClass:"pa-2"},[e(f["a"],{attrs:{dense:""}},[e(d["a"],{attrs:{dense:""}},[e(h["g"],[e(I["a"],{ref:"modules",attrs:{outlined:"",chips:"","small-chips":"",dense:"",color:"primary",label:t.$t("notifications.titles.module"),"item-color":"primary","hide-details":"",items:t.modules,"item-text":"text","item-value":"value",multiple:"",clearable:""},on:{input:function(e){return t.$emit("set:filters",{modules:e})}},scopedSlots:t._u([{key:"prepend-item",fn:function(){return[e(s["a"],{staticClass:"pt-2 pb-2 mt-0 pl-4",attrs:{color:"primary","hide-details":!0},on:{change:function(e){return t.selectAll("modules","sModules")}},scopedSlots:t._u([{key:"label",fn:function(){return[e(n["a"],{attrs:{small:"",color:"primary","x-small":"",text:""}},[t._v(" "+t._s(t.$t("general.titles.selectAll"))+" ")])]},proxy:!0}]),model:{value:t.checkboxState.modules,callback:function(e){t.$set(t.checkboxState,"modules",e)},expression:"checkboxState.modules"}}),e(D["a"],{staticClass:"mb-2"})]},proxy:!0},{key:"prepend-inner",fn:function(){return[e(c["a"],{staticClass:"mt-1",attrs:{small:"",left:""}},[t._v(" mdi-view-module-outline ")])]},proxy:!0},{key:"item",fn:function(r){var i=r.item,n=r.attrs;return[e("div",{staticStyle:{display:"contents"}},[e(s["a"],{staticClass:"pt-2 pb-2 mt-0 priority__text",attrs:{dense:"","input-value":n.inputValue,color:"primary","hide-details":!0},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(i.text)+" ")]},proxy:!0}],null,!0)})],1)]}},{key:"selection",fn:function(r){var i=r.item,n=r.index;return[0===n?e(N["a"],{attrs:{small:""}},[e("span",[t._v(t._s(i.text))])]):t._e(),1===n?e("span",{staticClass:"grey--text caption"},[t._v("(+"+t._s(t.sModules.length-1)+" "+t._s(t.$t("general.titles.others"))+")")]):t._e()]}}]),model:{value:t.sModules,callback:function(e){t.sModules=e},expression:"sModules"}})],1)],1),e(d["a"],{attrs:{dense:""}},[e(h["g"],[e(I["a"],{attrs:{outlined:"",chips:"","small-chips":"",dense:"",color:"primary",label:t.$t("notifications.titles.visibility"),"item-color":"primary","hide-details":"",items:t.watched,"item-text":"text","item-value":"value",clearable:""},on:{input:function(e){return t.$emit("set:filters",{watched:e})}},scopedSlots:t._u([{key:"prepend-inner",fn:function(){return[e(c["a"],{staticClass:"mt-1",attrs:{small:"",left:""}},[t._v(" mdi-eye-outline ")])]},proxy:!0}])})],1)],1),e(d["a"],{attrs:{dense:""}},[e(h["g"],[e(I["a"],{attrs:{outlined:"",chips:"","small-chips":"",dense:"",color:"primary",label:t.$t("notifications.titles.priority"),"item-color":"primary","hide-details":"",items:t.priorities,"item-text":"text","item-value":"value",multiple:"",clearable:""},on:{input:function(e){return t.$emit("set:filters",{priorities:e})}},scopedSlots:t._u([{key:"prepend-inner",fn:function(){return[e(c["a"],{staticClass:"mt-1",attrs:{small:"",left:""}},[t._v(" mdi-priority-high ")])]},proxy:!0},{key:"selection",fn:function(r){var i=r.item,n=r.index;return[0===n?e(N["a"],{attrs:{small:""}},[e("span",[t._v(t._s(i.text))])]):t._e(),1===n?e("span",{staticClass:"grey--text caption"},[t._v("(+"+t._s(t.sPriorities.length-1)+" "+t._s(t.$t("general.titles.others"))+")")]):t._e()]}},{key:"item",fn:function(r){var i=r.item,n=r.attrs;return[e("div",{staticStyle:{display:"contents"}},[e(s["a"],{staticClass:"pt-2 pb-2 mt-0 priority__text",attrs:{dense:"","input-value":n.inputValue,color:"primary","hide-details":!0},scopedSlots:t._u([{key:"label",fn:function(){return[t._v(" "+t._s(i.text)+" ")]},proxy:!0}],null,!0)}),e(w["a"]),e(c["a"],{attrs:{color:i.color}},[t._v(" "+t._s(i.icon)+" ")])],1)]}}]),model:{value:t.sPriorities,callback:function(e){t.sPriorities=e},expression:"sPriorities"}})],1)],1)],1)],1)],1)},F=[],B=r("149e");function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function U(t,e,r){return(e=M(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function M(t){var e=G(t,"string");return"symbol"==q(e)?e:e+""}function G(t,e){if("object"!=q(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var X={name:"NotificationFilters",components:{ReadMore:B["a"]},data:function(){return{sModules:[],sPriorities:[],checkboxState:{modules:!1}}},computed:{modules:function(){return[{text:"BRAIN_AG",value:"BRAIN_AG"},{text:O["a"].t("modules.name.Record").toUpperCase(),value:["RECORDS","RECORD_VALIDATION"]},{text:O["a"].t("reports.titles.traceability").toUpperCase(),value:"TRACEABILITY"},{text:O["a"].t("menu.stock-report").toUpperCase(),value:"STOCK"},{text:O["a"].t("notifications.titles.orders").toUpperCase(),value:"USER_LOCATIONS"}]},watched:function(){return[{text:O["a"].t("notifications.titles.read").toUpperCase(),value:"true"},{text:O["a"].t("notifications.titles.unread").toUpperCase(),value:"false"}]},priorities:function(){return[{text:O["a"].t("notifications.titles.normal").toUpperCase(),value:"NORMAL",icon:"mdi-minus",color:"success"},{text:O["a"].t("notifications.titles.medium").toUpperCase(),value:"MEDIUM",icon:"mdi-equal",color:"warning"},{text:O["a"].t("notifications.titles.high").toUpperCase(),value:"HIGH",icon:"mdi-chevron-double-up",color:"error"}]}},methods:{selectAll:function(t,e){var r=this;if(!1===this.checkboxState[t])this[e]=[];else{var i=[];this[e]&&this[e].length>0?(T.a.forEach(this[e],(function(e){T.a.find(r.$refs[t].items,(function(t){return t.id===e.id}))||r.$refs[t].items.push(e)})),i=this.$refs[t].items):i=this.$refs[t].items,this[e]=i}this.$emit("set:filters",U({},t,T.a.map(this[e],(function(t){return t.value}))))}},destroyed:function(){this.sModules=[],this.sPriorities=[]}},V=X,H=(r("0b68"),r("2877")),Y=Object(H["a"])(V,P,F,!1,null,"64af9445",null),z=Y.exports,J=r("7dab"),K=r("96ec"),W=r("472f"),Q=r("cee4"),Z=r("4b56"),tt=r("f617");function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){return ot(t)||nt(t,e)||lt(t,e)||it()}function it(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nt(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,n,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}function ot(t){if(Array.isArray(t))return t}function at(t){return ut(t)||ct(t)||lt(t)||st()}function st(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lt(t,e){if(t){if("string"==typeof t)return ft(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ft(t,e):void 0}}function ct(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function ut(t){if(Array.isArray(t))return ft(t)}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(r),!0).forEach((function(e){ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ht(t,e,r){return(e=mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mt(t){var e=yt(t,"string");return"symbol"==et(e)?e:e+""}function yt(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function vt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */vt=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new E(i||[]);return n(a,"_invoke",{value:C(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(T([])));_&&_!==r&&i.call(_,a)&&(w=_);var S=b.prototype=v.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(n,o,a,s){var l=f(t[n],t,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==et(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(t,i){function n(){return new e((function(e,n){r(t,i,e,n)}))}return o=o?o.then(n,n):n()}})}function C(e,r,i){var n=d;return function(o,a){if(n===h)throw Error("Generator is already running");if(n===m){if("throw"===o)throw a;return{value:t,done:!0}}for(i.method=o,i.arg=a;;){var s=i.delegate;if(s){var l=R(s,i);if(l){if(l===y)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===d)throw n=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=h;var c=f(e,r,i);if("normal"===c.type){if(n=i.done?m:p,c.arg===y)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n=m,i.method="throw",i.arg=c.arg)}}}function R(e,r){var i=r.method,n=e.iterator[i];if(n===t)return r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(et(e)+" is not iterable")}return g.prototype=b,n(S,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,i,n,o){void 0===o&&(o=Promise);var a=new k(u(t,r,i,n),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),c(S,l,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var i in e)r.push(i);return r.reverse(),function t(){for(;r.length;){var i=r.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=T,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(i,n){return s.type="throw",s.arg=e,r.next=i,n&&(r.method="next",r.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;A(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:T(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function gt(t,e,r,i,n,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(i,n)}function bt(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function a(t){gt(o,i,n,a,s,"next",t)}function s(t){gt(o,i,n,a,s,"throw",t)}a(void 0)}))}}var wt={name:"IndexView",components:{ImportRecordNotification:tt["a"],TraceabilityErrorNotification:Z["a"],ConfirmDialog:K["a"],NotificationFilters:z,RecordValidationNotification:L["a"],RecordsNotification:A["a"],UserLocationsNotification:$["a"],TraceabilityNotification:R["a"],BrainAgNotification:C["a"],StockNotification:k["a"],S3FileNotification:W["a"]},data:function(){return{loading:{},loadingSee:{},loadingD:{},loadingAll:!1,loadingRead:!1,loadingDownload:!1,loadingArchiveAll:!1,loadingFetchAll:!1,userInitiatedPageChange:!1,iconOptions:{},enableRA:!1,defaultFilters:{modules:null,priorities:null,watched:null,pageableDTO:{page:1,size:10,sortBy:"dateTime",direction:"DESC"}},isRead:!0,selected:[],actionDialog:null}},created:function(){var t=this;return bt(vt().mark((function e(){return vt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.fetchNotifications([t.defaultFilters,t.$toast],1);case 2:case"end":return e.stop()}}),e)})))()},watch:{selected:function(){this.selected.length>0?this.enableRA=T.a.filter(this.selected,{watched:!1}).length>0:this.enableRA=T.a.filter(this.notifications,{watched:!1}).length>0},notifications:function(){this.enableRA=T.a.filter(this.notifications,{watched:!1}).length>0}},mounted:function(){var t=this;this.$root.$on("archiveN",(function(e){t.archiveN(e)})),this.$root.$on("archiveAll",(function(){t.archiveAll()})),this.$root.$on("readAll",(function(){t.readAll()}))},computed:pt(pt({},Object(S["c"])({notifications:"notifications/notifications",watched:"notifications/watched",unwatched:"notifications/unwatched",totalFromServer:"notifications/totalFromServer"})),{},{isExport:function(){return function(t){return t.data&&t.data.type&&["PDF_EXPORT","EXCEL_EXPORT"].includes(t.data.type)}},isDownloadable:function(){return function(t){return["EXCEL_IMPORT"].includes(t.module)&&!t.success}},alText:function(){return this.selected.length>0?O["a"].t("notifications.titles.archiveSelected"):O["a"].t("notifications.titles.archiveAll")},raText:function(){return this.selected.length>0?O["a"].t("notifications.titles.readSelected"):O["a"].t("notifications.titles.readAll")},filterCount:function(){var t=0;for(var e in this.defaultFilters)"pageableDTO"!==e&&(Array.isArray(this.defaultFilters[e])?this.defaultFilters[e].length>0&&t++:null!==this.defaultFilters[e]&&t++);return t}}),methods:pt(pt({},Object(S["b"])({setReadStatus:"notifications/setReadStatus",findLogRecordById:"records/findLogByRecordId",findRecordById:"records/findRecordById"})),{},{downloadFileFromS3:function(t,e){var r=this;return bt(vt().mark((function i(){var n,o;return vt().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n="download",o=null,console.log(t),!t.data){i.next=13;break}i.t0=t.data.type,i.next="PDF_EXPORT"===i.t0?7:"EXCEL_EXPORT"===i.t0?10:13;break;case 7:return o=t.data.s3Url,n="".concat(r.$refs.s3File[e].getTranslationModule(t.module).toLowerCase(),".pdf"),i.abrupt("break",13);case 10:return o=t.data.s3Url,n="".concat(r.$refs.s3File[e].getTranslationModule(t.module).toLowerCase(),".xlsx"),i.abrupt("break",13);case 13:i.t1=t.module,i.next="EXCEL_IMPORT"===i.t1?16:19;break;case 16:return o=t.s3Url,n="".concat(r.$t("modules.name.Record").toLowerCase(),".xlsx"),i.abrupt("break",19);case 19:if(!o){i.next=22;break}return i.next=22,Object(Q["a"])({url:o,method:"GET",responseType:"blob"}).then((function(t){var e=window.URL.createObjectURL(new Blob([t.data])),r=document.createElement("a");r.href=e,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(e)})).catch((function(t){console.error("Error al descargar el archivo: ",t)}));case 22:case"end":return i.stop()}}),i)})))()},showRecord:function(t){this.$root.$emit("see:record",t)},setIconPriority:function(t){switch(t){case"LOW":case"NORMAL":return{icon:"mdi-minus",color:"success"};case"MEDIUM":return{icon:"mdi-equal",color:"warning"};case"HIGH":return{icon:"mdi-chevron-double-up",color:"error"}}},toggleSelection:function(t,e){var r=this.selected.findIndex((function(e){return e.id===t.id}));e&&-1===r?this.selected.push(t):!e&&r>-1&&this.selected.splice(r,1)},archiveN:function(t){var e=this;return bt(vt().mark((function r(){return vt().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.$set(e.loadingD,t.id,!0),r.next=3,J["a"].deleteNotifications([t.id]).then((function(){e.fetchNotifications([e.defaultFilters,e.$toast],1),e.$store.dispatch("notifications/fetchNotificationsMenuByUser",[e.$toast])})).catch((function(){e.$toast.error(O["a"].t("notifications.titles.archiveError"),{queueable:!0})})).finally((function(){e.$set(e.loadingD,t.id,!1)}));case 3:case"end":return r.stop()}}),r)})))()},archiveAll:function(){var t=this;return bt(vt().mark((function e(){var r;return vt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingArchiveAll=!0,r=[],t.selected.length>0&&(r=T.a.map(t.selected,(function(t){return t.id}))),e.next=5,J["a"].deleteNotifications(r).then((function(){t.fetchNotifications([t.defaultFilters,t.$toast],1),t.$store.dispatch("notifications/fetchNotificationsMenuByUser",[t.$toast])})).catch((function(){t.$toast.error(O["a"].t("notifications.titles.archiveError"),{queueable:!0})})).finally((function(){t.loadingArchiveAll=!1,t.$set(t,"selected",[]),t.$set(t.defaultFilters.pageableDTO,"page",1)}));case 5:case"end":return e.stop()}}),e)})))()},readAll:function(){var t=this;return bt(vt().mark((function e(){var r;return vt().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadingRead=!0,r=[],t.selected.length>0&&(r=T.a.map(t.selected,(function(t){return t.id}))),e.next=5,t.setReadStatus([r,t.$toast]).finally((function(){t.loadingRead=!1}));case 5:return e.next=7,t.fetchNotifications([t.defaultFilters,t.$toast],1).finally((function(){t.$set(t,"selected",[]),t.$set(t.defaultFilters.pageableDTO,"page",1)}));case 7:case"end":return e.stop()}}),e)})))()},setFilters:function(t){var e=this;return bt(vt().mark((function r(){var i;return vt().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.watched?e.defaultFilters.watched=t.watched:e.defaultFilters.watched=null,t.modules&&(i=[],T.a.forEach(t.modules,(function(t){t instanceof Array?i=[].concat(at(i),at(t)):i.push(t)})),e.defaultFilters.modules=i.includes("ALL")?null:i),t.priorities&&(e.defaultFilters.priorities=t.priorities&&t.priorities!==[]?t.priorities:null),r.next=5,e.fetchNotifications([e.defaultFilters,e.$toast],1);case 5:case"end":return r.stop()}}),r)})))()},fetchNotifications:function(t,e){var r=this;return bt(vt().mark((function i(){var n,o,a;return vt().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=rt(t,2),o=n[0],a=n[1],e&&(o=pt(pt({},o),{},{pageableDTO:{page:e-1,size:10,sortBy:"dateTime",direction:"DESC"}})),r.loadingAll=!0,i.next=5,r.$store.dispatch("notifications/fetchNotificationsByUser",[o,a]).then((function(){r.loadingAll=!1})).catch((function(){r.loadingAll=!1}));case 5:case"end":return i.stop()}}),i)})))()},markRead:function(t){var e=this;return bt(vt().mark((function r(){var i;return vt().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return i=T.a.cloneDeep(t.id),e.$set(e.loading,i,!0),r.next=4,e.setReadStatus([[i],e.$toast]).finally((function(){e.$set(e.loading,i,!1)}));case 4:case"end":return r.stop()}}),r)})))()},seeRecord:function(t){var e=this;return bt(vt().mark((function r(){var i;return vt().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if("records"===j["a"].currentRoute.name){r.next=3;break}return r.next=3,j["a"].push({name:"records"});case 3:e.$set(e.loadingSee,t.id,!0),i=[],i.push(e.findRecordById([t.recordId,e.$toast])),i.push(e.findLogRecordById([t.recordId,e.$toast])),Promise.all(i).finally((function(){e.$set(e.loadingSee,t.id,!1),e.$store.commit("records/SET_DIALOG_DETAILS",!0)}));case 8:case"end":return r.stop()}}),r)})))()}}),destroyed:function(){this.$root.$off("archiveN"),this.$root.$off("archiveAll"),this.$root.$off("readAll")}},xt=wt,_t=(r("e171"),Object(H["a"])(xt,x,_,!1,null,"2bd73908",null));e["default"]=_t.exports},"96ec":function(t,e,r){"use strict";var i=r("8336"),n=r("b0af"),o=r("99d9"),a=r("169a"),s=r("132d"),l=r("2fa4"),c=r("3a2f");function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=h(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=m(t,"string");return"symbol"==u(e)?e:e+""}function m(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var y=function(){var t=this,e=t._self._c;return e(a["a"],{attrs:{persistent:"",width:"540px"},scopedSlots:t._u([{key:"activator",fn:function(r){var n=r.on;return[t.isBtn?e(i["a"],t._g(t._b({class:"".concat(t.styles),attrs:{disabled:t.valid,loading:t.loading,icon:t.isIcon,tile:t.tile,block:t.block,"max-height":t.maxHeight,height:t.height,"x-small":t.xSmall,fab:t.fab}},"v-btn",t.frBtnProps,!1),n),[t.wIcon?e(s["a"],{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],attrs:{small:t.iSmall,left:t.iLeft,right:t.iRight,color:t.iColor}},[t._v(" "+t._s(t.btnIcon)+" ")]):t._e(),t._v(" "+t._s(t.btnTitle)+" ")],1):t.isTooltip&&t.isIcon?e(c["a"],{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(r){var i=r.on;return[t.loading?t._e():e(s["a"],t._g({directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],class:"".concat(t.styles),attrs:{small:"",left:t.iLeft,right:t.iRight,color:t.iColor,disabled:t.valid}},d(d({},n),i)),[t._v(" "+t._s(t.btnIcon)+" ")]),t._t("loading")]}}],null,!0)},[e("span",[t._v(" "+t._s(t.tpText)+" "),e("span",{staticStyle:{"font-size":"12px",color:"#aaaaaa"}},[t._v(" "+t._s(t.tsText)+" ")])])]):t.isIcon?e(s["a"],t._g({attrs:{small:"",left:t.iLeft,right:t.iRight,color:t.iColor}},n),[t._v(" "+t._s(t.btnIcon)+" ")]):t._e()]}}]),model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[e(n["a"],[e(o["e"],{staticClass:"headline secondary t-bw-secondary--text"},[t._v(t._s(t.title))]),e(o["d"],{staticClass:"pa-6"},[t._v(t._s(t.dialogText))]),e(o["b"],{staticClass:"pa-6"},[e(l["a"]),e(i["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:function(e){return t.closeDialog()}}},[t._v(" "+t._s(t.$t("general.buttons.cancel"))+" ")]),e(i["a"],t._b({attrs:{small:""},on:{click:function(e){return t.confirmDialog()}}},"v-btn",t.frBtnProps,!1),[t._v(" "+t._s(t.$t("general.buttons.confirm"))+" ")])],1)],1)],1)},v=[],g=r("fe0b"),b={name:"ConfirmDialog",props:{item:{type:Object,required:!1},items:{type:Array,required:!1},show:{type:Boolean,required:!1,default:!0},btnIcon:{type:String,required:!1},iLeft:{type:Boolean,default:!1},iRight:{type:Boolean,default:!1},iColor:{type:String,default:"neuter"},isIcon:{type:Boolean,required:!1},wIcon:{type:Boolean,required:!1},text:{type:Boolean,required:!1,default:!0},isBtn:{type:Boolean,required:!0},tpText:{type:String,required:!1},tsText:{type:String,required:!1},isTooltip:{type:Boolean,required:!1},btnTitle:{type:String,require:!1},frBtnProps:{type:Object,required:!1,default:function(){return{small:!0,color:"primary",textColor:"t-bw-primary--text",elevation:0,text:!1}}},styles:{type:String,required:!1},title:{type:String,required:!1,default:g["a"].t("general.titles.titleGenericDialog")},dialogText:{type:String,required:!1,default:g["a"].t("general.titles.descriptionGenericDialog")},action:{type:String,required:!0},loading:{type:Boolean,required:!1},valid:{type:Boolean,required:!1},tile:{type:Boolean,required:!1},xSmall:{type:Boolean,required:!1},iSmall:{type:Boolean,required:!1},small:{type:Boolean,required:!1},elevation:{type:Number,required:!1},block:{type:Boolean,required:!1},fab:{type:Boolean,required:!1},maxHeight:{type:String,required:!1},height:{type:String,required:!1}},data:function(){return{showDialog:!1}},methods:{openDialog:function(){this.showDialog=!0},closeDialog:function(){this.showDialog=!1},confirmDialog:function(){console.log(this.action),this.$root.$emit(this.action,this.item||this.items),this.closeDialog()}}},w=b,x=r("2877"),_=Object(x["a"])(w,y,v,!1,null,null,null);e["a"]=_.exports},dc4a5:function(t,e,r){},e171:function(t,e,r){"use strict";r("20bd")}}]);
//# sourceMappingURL=chunk-284a83a8.8a95d0d0.js.map