PageSourceSearch

https://www.genei.es/chunks/3249.9fdcc139.js

js genei.es collected 2026-10-04 10:43:22 UTC 12,727 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgenei_front=self.webpackChunkgenei_front||[]).push([[3249],{3249:(e,t,s)=>{s.r(t),s.d(t,{default:()=>N});var a=s(5893),i=s(7294),n=s(7189),l=s(1594),r=s(3904),o=s(9216),c=s(1834),d=s(8254),u=s(7368),p=s(152),m=s(4138),h=s(6544),g=s(9854),v=s(4950),x=s(6486),f=s(6264);const S=e=>{if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?"-":(0,u.WU)(t,"EEE, d MMM yyyy, HH:mm",{locale:p.es})},N=({user:e})=>{const[t,s]=(0,i.useState)(!0),[u,p]=(0,i.useState)([]),[N,Z]=(0,i.useState)(0),[j,_]=(0,i.useState)(1),[C,y]=(0,i.useState)(10);(0,i.useEffect)((()=>{var t,a,i,l;t=void 0,a=void 0,l=function*(){var t,a,i,l;if(!e)return;s(!0);const r=new URLSearchParams;r.append("page",String(j)),r.append("limit",String(C));const o=yield new n.Z("https://apiv2.genei.es").get(`/api/v1/users/${e.userId}/customer-support/sinisters?${r.toString()}`);(null==o?void 0:o.ok)?(p(null!==(a=null===(t=o.data)||void 0===t?void 0:t.rows)&&void 0!==a?a:[]),Z(null!==(l=null===(i=o.data)||void 0===i?void 0:i.count)&&void 0!==l?l:0)):(p([]),Z(0)),s(!1)},new((i=void 0)||(i=Promise))((function(e,s){function n(e){try{o(l.next(e))}catch(e){s(e)}}function r(e){try{o(l.throw(e))}catch(e){s(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof i?s:new i((function(e){e(s)}))).then(n,r)}o((l=l.apply(t,a||[])).next())}))}),[null==e?void 0:e.userId,j,C]);const I=[{key:"fecha",renderHeader:()=>(0,h.Z)("fields.date")},{key:"codigo",renderHeader:()=>(0,h.Z)("fields.shipmentCode"),class:"h-text-center"},{key:"detalles",renderHeader:()=>(0,h.Z)("pages.incidents.colClaim"),class:"h-text-center"},{key:"proteccion",renderHeader:()=>(0,h.Z)("pages.incidents.colProtection"),class:"h-text-center"},{key:"estado",renderHeader:()=>(0,h.Z)("fields.status"),class:"h-text-center"}],P=({fecha:e,codigo:t,detalles:s,proteccion:i,estado:n,onSelect:l})=>{var r;const o=Object.values(m.INCIDENT_STATUS).find((e=>e.value===n));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("td",{children:S(null!=e?e:null)}),(0,a.jsx)("td",{className:"t-bold h-text-center",children:(0,a.jsx)("b",{className:"h-is-clickable",onClick:l,children:null!=t?t:"-"})}),(0,a.jsx)("td",{className:"h-text-center",children:null!=s?s:"-"}),(0,a.jsx)("td",{className:"h-text-center",children:null!==(c=i,r=!c||c<=0?(0,a.jsxs)("span",{className:"smt-error",children:[(0,a.jsx)("i",{className:"ph ph-x h-inline-icon"}),(0,h.Z)("pages.incidents.labelNotHired")]}):`${(0,h.Z)("pages.incidents.labelHired")} ${(0,g.CZ)(c)}`)&&void 0!==r?r:null}),(0,a.jsx)("td",{className:"h-text-center",style:{minWidth:150},children:o?(0,a.jsx)("span",{className:`o-badge${(0,f.sO)(!!(null==o?void 0:o.semanticColor),`--${null==o?void 0:o.semanticColor}`)}`,children:o.text}):(0,h.Z)("pages.tracking.labelNoStatus")})]});var c},b=u.map((e=>(0,a.jsx)(P,{fecha:e.fecha_hora_creacion,codigo:e.codigo_envio,detalles:e.detalles,proteccion:e.importe_seguro,estado:e.estado,onSelect:()=>{return t=e,void(0,c.Z)({pageName:"incidentDetail",urlParams:{id_siniestro:String(t.id_siniestro)}});var t}},e.id_siniestro)));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.Z,{items:[{label:(0,x.capitalize)("genei.es"),onClick:()=>(0,c.Z)({pageName:"createShipment"})},{label:`${(0,h.Z)("pages.profile.titleSection")}: ${(0,h.Z)("pages.incidents.title")}`,onClick:()=>(0,c.Z)({pageName:"incidents"})},{label:(0,h.Z)("pages.incidents.labelClaimsHistory")}]}),(0,a.jsx)("div",{className:"o-buttons-wrapper--space-between",children:(0,a.jsxs)(d.Z,{className:"o-link",onClick:()=>(0,c.Z)({pageName:"incidents"}),children:[(0,a.jsx)("i",{className:"ph ph-caret-left"}),(0,h.Z)("actions.backTo",{link:(0,h.Z)("pages.incidents.title")})]})}),(0,a.jsxs)("div",{className:"c-card",children:[(0,a.jsx)("div",{className:"c-card__header",children:(0,h.Z)("pages.incidents.labelClaimsHistory")}),(0,a.jsx)("div",{className:"c-card__body",children:t?(0,a.jsx)(l.Z,{type:l.d.full}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{rows:b,columns:I,tableClass:"justified"}),(0,a.jsx)(o.Z,{totalItems:N,itemsPerPageOptions:m.ITEMS_PER_PAGE_OPTIONS,initialCurrentPage:j,initialItemsPerPage:C,onChange:({currentPage:e,itemsPerPage:t})=>{_(e),y(t)}},N)]})})]})]})}},4138:(e,t,s)=>{s.r(t),s.d(t,{INCIDENT_STATUS:()=>
1_,ITEMS_PER_PAGE_OPTIONS:()=>j,default:()=>y});var a=s(5893),i=s(7294),n=s(9506),l=s(7189),r=s(2364),o=s(3953),c=s(3904),d=s(9216),u=s(6264),p=s(7368),m=s(6544);const h=({incidents:e,totalItems:t,currentPage:s,itemsPerPage:i,onChangePage:n,onChangeItemsPerPage:l,onSelectIncident:r})=>{const o=({agencyImage:e,shipmentCode:t,clientReference:s,details:i,date:n,status:l,onSelect:r})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("td",{children:(0,a.jsx)("img",{style:{maxWidth:"16px"},src:"https://apiv2.genei.es/api/v1/files/"+e})}),(0,a.jsx)("td",{className:"t-bold",children:(0,a.jsx)("b",{className:"h-is-clickable",onClick:r,children:t})}),(0,a.jsx)("td",{children:s||"-"}),(0,a.jsx)("td",{children:i}),(0,a.jsx)("td",{className:"h-text-center",style:{minWidth:"150"},children:(()=>{const e=Object.values(_).find((({value:e})=>e===l))||null;return(0,a.jsx)("span",{className:`o-badge${(0,u.sO)(!!(null==e?void 0:e.semanticColor),`--${null==e?void 0:e.semanticColor}`)}`,children:null==e?void 0:e.text})})()}),(0,a.jsx)("td",{children:(0,p.WU)(n,"dd.MM.yyyy")})]}),h=[{key:"id",renderHeader:()=>""},{key:"shipmentCode",renderHeader:()=>(0,m.Z)("pages.incidents.colShipmentCode")},{key:"clientReference",renderHeader:()=>"Ref Cliente"},{key:"shipmentDescription",renderHeader:()=>(0,m.Z)("pages.incidents.colDescription")},{key:"status",renderHeader:()=>(0,m.Z)("pages.incidents.colStatus"),class:"h-text-center"},{key:"date",renderHeader:()=>(0,m.Z)("pages.incidents.colDate")}],g=e.map((e=>(0,a.jsx)(o,{agencyImage:e.logo,shipmentCode:e.codigo_envio,clientReference:e.codigo_envio_externo,details:e.detalles,date:e.fecha_hora_creacion,status:e.estado,idSiniestro:e.id_siniestro,onSelect:()=>r(e)},e.id_siniestro)));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"o-table-scroll-alert",children:(0,m.Z)("components.tables.alertScroll")}),(0,a.jsxs)("div",{className:"o-table-wrapper",children:[(0,a.jsx)(c.Z,{rows:g,columns:h,tableClass:"justified"}),(0,a.jsx)(d.Z,{totalItems:t,itemsPerPageOptions:j,initialCurrentPage:s,initialItemsPerPage:i,onChange:({currentPage:e,itemsPerPage:t})=>{n(e),l(t)}},t)]})]})};var g=s(8254),v=s(8898),x=s(1594),f=s(1834),S=s(4950),N=s(6486),Z=function(e,t,s,a){return new(s||(s=Promise))((function(i,n){function l(e){try{o(a.next(e))}catch(e){n(e)}}function r(e){try{o(a.throw(e))}catch(e){n(e)}}function o(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(l,r)}o((a=a.apply(e,t||[])).next())}))};const j=[5,10,20,50],_={SINIESTRO_SOLICITADA_APERTURA:{value:1,text:(0,m.Z)("status.claimOpen"),semanticColor:"primary"},SINIESTRO_SIENDO_GESTIONADO:{value:2,text:(0,m.Z)("status.claimProcessing"),semanticColor:"primary"},SINIESTRO_DOC_ENVIADA_A_LA_AGENCIA:{value:3,text:(0,m.Z)("status.claimDocSent"),semanticColor:"primary"},SINIESTRO_EN_ESPERA_DE_RESOLUCION:{value:4,text:(0,m.Z)("status.claimPendingSolution"),semanticColor:"warning"},SINIESTRO_APROBADO:{value:5,text:(0,m.Z)("status.claimApproved"),semanticColor:"success"},SINIESTRO_DENEGADO:{value:6,text:(0,m.Z)("status.claimDenied"),semanticColor:"error"},SINIESTRO_INCIDENCIA_FALTA_DOC:{value:7,text:(0,m.Z)("status.claimMissingDoc"),semanticColor:"error"},SINIESTRO_PAGADO:{value:8,text:(0,m.Z)("status.claimPaid"),semanticColor:"success"},SINIESTRO_PENDIENTE_CONFIRMAR_PAGO:{value:9,text:(0,m.Z)("status.claimPendingPaymentConfirmation"),semanticColor:"warning"},SINIESTRO_FACTURA_SUBIDA_PENDIENTE_DE_PAGO:{value:10,text:(0,m.Z)("status.claimInvoiceUploaded"),semanticColor:"warning"},SINIESTRO_CERRADO:{value:11,text:(0,m.Z)("status.claimClosed"),semanticColor:null}},C=[{type:"input",name:"mainFilter",label:(0,m.Z)("actions.searchBy",{prop:(0,m.Z)("fields.shipmentCode")}),value:"",defaultValue:"",mainFilter:!0,chipText:null},{type:"select",name:"incidentStatusFilter",label:(0,m.Z)("actions.searchBy",{prop:(0,m.Z)("fields.status")}),value:"",defaultValue:"",chipText:"Shipment status",options:Object.values(_).map((({value:e,text:t})=>({label:t,value:e})))},{type:"date",name:"dateFromFilter",label:(0,m.Z)("actions.searchBy",{prop:(0,m.Z)("fields.dateFrom").toLowerCase()}),value:"",defaultValue:"",chipText:"date from",dateRange:{id:"incident-date",boundary:"from"}},{type:"date",name:"dateToFilter",label:(0,m.Z)("actions.searchBy",{prop:(0,m.Z)("fields.dateTo").toLowerCase()}),value:"",defaultValue:"",chipText:"date to",dateRange:{id:"incident-date",boundary:"to"}}],y=({user:e})=>{const[t,s]=(0,i.useState)([]),[c,d]=(0,i.useState)(!0),[u,p]=(0,i.useState)(C),[j,_]=(0,i.useState)(!1),[y,I]=(0,i.useState)(""),[P,b]=(0,i.useState)(1),[E,T]=(0,i.useState)(0),{itemsPerPage:w,setItemsPerPage:O}=(0,v.X)({user:e}),[k,R]=(0,i.useState)(null),{showToast:A}=(0,n.p)();return(0,i.useEffect)((()=>{!function(){Z(this,void 0,void 0,(function*(){var t,a,i,n,r;try{if(!e)return;d(!0);const o=null===(t=u.find((e=>"dateFromFilter"===e.name)))||void 0===t?void 0:t.value,c=null===(a=u.find((e=>"dateToFilter"===e.name)))||void 0===a?void 0:a.value,p=null===(i=u.find((e=>"incidentStatusFilter"===e.name)))||void 0===i?void 0:i.value,h=new URLSearchParams;h.append("page",P.toString()),h.append("limit",w.toString()),y&&h.append("shipment_code",y.toString()),p&&h.append("incident_status",p.toString()),o&&h.append("shipment_date_from",o.toString()),c&&h.append("shipment_date_to",c.toString());const g=yield new l.Z("https://apiv2.genei.es").get(`/api/v1/users/${e.userId}/customer-support/sinisters?${h.toString()}`);(null==g?void 0:g.ok)?(s(null!==(n=g.data.rows)&&void 0!==n?n:[]),T(null!==(r=g.data.count)&&void 0!==r?r:0)):(s([]),T(0),A({text:(0,m.Z)("pages.incidents.alertGettingError"),type:"warning"}))}catch(e){console.error("fetchIncidents(): ",e)}finally{d(!1)}}))}(),function(){Z(this,void 0,void 0,(function*(){try{if(!e)return;const t=yield new l.Z("https://apiv2.genei.es").get(`/api/v1/users/${e.userId}/customer-support/atc-info`);(null==t?void 0:t.data)&&R(t.data)}catch(e){console.error("fetchATCInfo(): ",e)}}))}()}),[e,P,w,u,y]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z,{items:[{label:(0,N.capitalize)("genei.es"),onClick:()=>(0,f.Z)({pageName:"createShipment"})},{label:`${(0,m.Z)("pages.profile.titleSection")}: ${(0,m.Z)("pages.incidents.title")}`}]}),(0,a.jsx)("h1",{className:"t-h2",children:(0,m.Z)("pages.incidents.title")}),(0,a.jsxs)("div",{className:"c-card",children:[(0,a.jsxs)("div",{className:"c-card__header",children:[(0,m.Z)("pages.incidents.labelClaims")," ",(0,a.jsx)("i",{className:"ph ph-chat-text"})]}),(0,a.jsxs)("div",{className:"c-card__body",children:[(0,a.jsx)("div",{className:"o-half",children:(0,a.jsx)(r.Z,{filtersData:u,onSearch:I,onToggleFilters:()=>_((e=>!e)),onRemoveFilters:()=>p(C),inputLabel:(0,m.Z)("fields.searchByShipmentReference")})}),(0,a.jsx)(o.Z,{visible:j,onClose:()=>_(!1),onApply:e=>p(e),onReset:()=>p(C),filtersData:u}),c?(0,a.jsx)(x.Z,{type:x.d.full}):(0,a.jsx)(a.Fragment,{children:E>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{incidents:t,totalItems:E,currentPage:P,itemsPerPage:w,onChangePage:b,onChangeItemsPerPage:O,onSelectIncident:e=>{const t=e.id_siniestro;
1t&&(0,f.Z)({pageName:"incidentDetail",urlParams:{id_siniestro:String(t)}})}}),(0,a.jsx)("div",{className:"o-buttons-wrapper--center",children:(0,a.jsx)(g.Z,{className:"o-link",onClick:()=>(0,f.Z)({pageName:"incidentHistory"}),children:(0,m.Z)("actions.viewHistory")})})]}):(0,a.jsx)("div",{className:"o-sheet t-body",children:(0,m.Z)("pages.incidents.alertNoClaims")})}),(0,a.jsxs)("div",{className:k?"o-buttons-wrapper--space-between":"o-buttons-wrapper--right",children:[k&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("strong",{children:[(0,m.Z)("pages.incidents.atcPhone"),": "]}),(0,a.jsx)("a",{className:"o-link",href:`tel:${null==k?void 0:k.telefono}`,children:null==k?void 0:k.telefono})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("strong",{children:[(0,m.Z)("pages.incidents.atcPin"),": "]}),null==k?void 0:k.codigo]})]}),(0,a.jsxs)(g.Z,{onClick:()=>Z(void 0,void 0,void 0,(function*(){var t;if("undefined"!=typeof window&&e){const s=yield new l.Z("https://apiv2.genei.es").get(`/api/v1/zoho-jwt-authentication/${e.userId}`);if(s.ok){const e=null===(t=s.data)||void 0===t?void 0:t.redirection_url;if(e)return void(window.location.href=e)}A({text:(0,m.Z)("pages.incidents.alertCouldNotRedirect"),type:"error"})}})),className:"o-button-sm--primary",children:[(0,m.Z)("actions.openTicket")," ",(0,a.jsx)("i",{className:"ph ph-plus"})]})]})]})]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.