1"use strict";(self.webpackChunkcatalogo_frontend=self.webpackChunkcatalogo_frontend||[]).push([[6184],{39042:(e,a,l)=>{l.r(a),l.d(a,{default:()=>S});var i=l(37055),t=l(88094),o=l(51561),n=l(89405),s=l(62334),d=l(21616),c=l(9761),r=l(44856),u=l(15678);const m=()=>{const{t:e}=(0,o.Bd)(),[a,l]=(0,t.useState)("X"),[m,v]=(0,t.useState)(!1),[f,h]=(0,t.useState)(!1),[p,x]=(0,t.useState)(!1),[g,b]=(0,t.useState)([]);(0,t.useEffect)(()=>{j()},[]);const j=()=>{h(!0),v(!0),r.lJ.buscarSolicitacoesUsuarioPorTipo("ficha-catalografica",a).then(e=>b(e.data)).catch(()=>x(!0)).finally(()=>v(!1))},N=e=>{b(a=>a.map(a=>a.id===e?(0,i.A)((0,i.A)({},a),{},{status:"U"}):a))};return(0,u.jsxs)("div",{className:"tabela anima-1",children:[(0,u.jsxs)(d.Row,{children:[(0,u.jsxs)(d.Col,{xs:"12",md:"4",className:"align-self-center my-1",children:[(0,u.jsx)("div",{className:"rotulo",children:e("FiltrarPorStatus")}),(0,u.jsx)(d.Input,{type:"select",name:"status",id:"status",value:a,onChange:e=>l(e.target.value),children:[{label:e("Todos"),value:"X"},{label:e("Aguardando"),value:"A"},{label:e("Finalizado"),value:"S"},{label:e("NaoFinalizado"),value:"N"},{label:e("Disponivel"),value:"D"},{label:e("EntrarEmContato"),value:"E"},{label:e("EmTransito"),value:"T"},{label:e("CanceladoPeloUsuario"),value:"U"}].map(e=>(0,u.jsx)("option",{value:e.value,children:e.label},"opt-".concat(e.value)))})]}),(0,u.jsxs)(d.Col,{xs:"12",md:"3",className:"pt-4",children:[(0,u.jsxs)(d.Button,{className:"primeiro ml-0 btn-w100",onClick:()=>j(),children:[(0,u.jsx)(s.g,{icon:"search",className:"mr-1 fa-fw"}),e("Mostrar")]}),(0,u.jsxs)(d.Button,{className:"btn-generic--segundo btn-w100 ml-0 ml-md-3 mt-3 mt-md-0",onClick:()=>(l("X"),h(!1),void b([])),children:[(0,u.jsx)(s.g,{icon:"eraser",className:"mr-1 fa-fw"}),e("Limpar")]})]})]}),f&&(0,u.jsxs)("div",{className:"tabela anima-1",children:[(0,u.jsxs)(d.Row,{children:[(0,u.jsx)(d.Col,{md:"2",className:"align-self-center d-md-block d-none",children:e("DataSolicitacao")}),(0,u.jsx)(d.Col,{md:"8",className:"align-self-center d-md-block d-none",children:e("DescricaoSolicitacao")}),(0,u.jsx)(d.Col,{md:"2",className:"align-self-center d-md-block d-none text-center",children:e("Situacao")})]}),m&&(0,u.jsx)("div",{className:"p-5 text-center",children:(0,u.jsx)(c.Ew,{height:70,width:70,className:"text-tema-70 mb-2",visible:!0})}),p&&(0,u.jsx)(d.Row,{children:(0,u.jsx)(d.Col,{xs:"12",md:"12",className:"p-3 text-center",children:(0,u.jsx)(d.Alert,{className:"p-3",color:"danger",children:(0,u.jsx)("h4",{className:"alert-heading",children:e("OcorreuErroBuscarHistoricoSolicitacoes")})})})}),!m&&!p&&0===g.length&&(0,u.jsx)(d.Row,{children:(0,u.jsx)(d.Col,{xs:"12",md:"12",className:"p-5 text-center preto40",children:(0,u.jsx)("h2",{children:e("NenhumRegistroEncontrado")})})}),!m&&!p&&g.map((e,a)=>(0,u.jsx)(n.cw,{solicitacao:(0,i.A)((0,i.A)({},e),{},{codServico:-4,codPessoa:e.codPessoa||null,id:e.id||a}),onItemCanceled:N},"ficha-historico-item-".concat(a)))]})]})};var v=l(16822),f=l(3339),h=l.n(f),p=l(63856),x=l.n(p),g=l(1108);const b=e=>{let{config:a,formRef:l,onChange:i,disabled:n}=e;const{id:c,label:r,type:m,size:v,required:f,dataSource:h,placeholder:p}=a,{t:b}=(0,o.Bd)(),[j,N]=(0,t.useState)(!(null!==a&&void 0!==a&&a.required)),y=(0,t.useRef)(null),[w,C]=(0,t.useState)("");a.setIsValid=N,a.isValid=j,a.fieldName="field_".concat(c,"_").concat(r.toLowerCase());const k=()=>{switch(m){case"check":return[];case"sn":return b("Sim");default:return""}};(0,t.useEffect)(()=>()=>{a.setIsValid=null,a.value=k(),a.fieldName=null},[]);const[S,_]=(0,t.useState)(k());a.value=S,(0,t.useEffect)(()=>{if(l.current){var e;const a=e=>{_(k())};return null===(e=l.current)||void 0===e||e.addEventListener("reset",a),()=>{var e;null===(e=l.current)||void 0===e||e.removeEventListener("reset",a)}}},[l]),(0,t.useEffect)(()=>{let e=!0;if(a.required){switch(a.type){case"arq":e=!["",null,void 0].includes(S);break;case"check":e=(null===S||void 0===S?void 0:S.length)>0;break;default:e=!["",null,void 0].includes(null===S||void 0===S?void 0:S.trim())}a.isValid=e,N(e)}"function"===typeof i&&i(S)},[S]);const I=e=>{_(e.target.value)},E=e=>{e.preventDefault(),y.current.click()},R=e=>{const a=e.target.files[0];a?(_(a),C(a.name)):(_(null),C(""))},P=()=>{switch(v){case"p":return 1;case"m":return 4;case"g":case"l":return 12;default:return 3}};return(0,u.jsx)(u.Fragment,{children:(()=>{var e;switch(m){case"txt":return(0,u.jsxs)(d.Col,{className:"d-flex flex-column",md:P(),children:[(0,u.jsx)(d.Label,{className:x()("rotulo",{obrigatorio:f}),title:r,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",display:"inline-block"},children:r}),"l"===v?(0,u.jsx)("textarea",{"data-type-field":m,"data-label":r,name:a.fieldName,rows:4,placeholder:p,onChange:e=>{_(e.target.value)},value:S,disabled:n}):(0,u.jsx)(d.Input,{onInput:e=>{_(e.target.value)},"data-type-field":m,"data-label":r,name:a.fieldName,type:"text",placeholder:p,disabled:n}),(0,u.jsx)("div",{className:"invalid-feedback",children:"Campo obrigat\xf3rio"})]});case"combo":return(0,u.jsxs)(d.Col,{className:"d-flex flex-column",md:P(),children:[(0,u.jsx)(d.Label,{className:x()("rotulo",{obrigatorio:f}),title:r,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",display:"inline-block"},children:r}),(0,u.jsxs)(d.Input,{onChange:e=>{_(e.target.value)},value:S,"data-type-field":m,"data-label":r,name:a.fieldName,type:"select",placeholder:p,disabled:n,children:[p?(0,u.jsx)("option",{value:"",children:p}):"",(null===h||void 0===h?void 0:h.length)>0?h.map(e=>{let{codigo:a,descricao:l}=e;return(0,u.jsx)("option",{value:a,children:l},"combo_".concat(r,"_option_").concat(a,"_").concat(l))}):""]}),(0,u.jsx)("div",{className:"invalid-feedback",children:"Campo obrigat\xf3rio"})]});case"check":return(0,u.jsxs)(d.Col,{className:"d-flex flex-column",md:P(),children:[(0,u.jsx)(d.Label,{className:x()("rotulo",{obrigatorio:f}),title:r,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",display:"inline-block"},children:r}),(null===h||void 0===h?void 0:h.length)>0?h.map(e=>(0,u.jsx)("div",{className:"position-relative",children:(0,u.jsxs)("label",{children:[(0,u.jsx)(d.Input,{onChange:a=>{null!==S&&void 0!==S&&S.find(a=>a===e)?_(S.filter(l=>l!==e||l===e&&a.target.checked)):_(a=>[...a,e])},"data-type-field":m,"data-label":r,type:"checkbox",value:e,disabled:n}),(0,u.jsx)("span",{style:{marginLeft:"32px"},children:e})]})},"checkbox_".concat(r,"_").concat(e))):""]});case"sn":return(0,u.jsxs)(d.Col,{className:"d-flex flex-column flex-wrap",md:P(),children:[(0,u.jsx)(d.Label,{className:x()("rotulo",{obrigatorio:f}),title:r,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",display:"inline-block"},children:r}),(0,u.jsxs)("div",{className:"custom-radio d-flex flex-wrap",style:{gap:"8px"},children:[(0,u.jsx)(d.Input,{onChange:I,"data-type-field":m,checked:S===b("Sim"),type:"radio",name:a.fieldName,id:"".concat(a.fieldName,"_YES"),className:"option",value:b("Sim"),disabled:n}),(0,u.jsx)("label",{htmlFor:"".concat(a.fieldName,"_YES"),children:b("Sim")}),(0,u.jsxs)("div",{className:"ml-0 d-block d-md-inline",children:[(0,u.jsx)(d.Input,{checked:S===b("Nao"),onChange:I,"data-type-field":m,type:"radio",name:a.fieldName,id:"".concat(a.fieldName,"_NO"),value:b("Nao"),disabled:n}),(0,u.jsx)("label",{htmlFor:"".concat(a.fieldName,"_NO"),children:b("Nao")})]})]})]});case"arq":return(0,u.jsxs)(d.Col,{className:"d-flex flex-column",md:P(),children:[(0,u.jsx)(d.Label,{className:x()("rotulo",{obrigatorio:f}),title:r,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%",display:"inline-block"},children:r}),(0,u.jsxs)("div",{className:"select-file",children:[(0,u.jsx)(d.Input,{onChange:R,innerRef:y,name:a.fieldName,type:"file",placeholder:p}),(0,u.jsxs)("button",{className:"dynamic-form-btn-upload",type:"button",onClick:E,disabled:n,children:[(0,u.jsx)(s.g,{icon:g.JmV}),null!==(e=null===a||void 0===a?void 0:a.placeholder)&&void 0!==e?e:b("SelecionarArquivo")]}),""!==w?(0,u.jsx)("span",{className:"ml-2 select-file-subtitle",children:w}):""]}),(0,u.jsx)("div",{className:"invalid-feedback",children:"Campo obrigat\xf3rio"})]});default:return(0,u.jsx)("div",{})}})()})};var j=l(11756);const N=l.p+"static/media/times-roman.2f15e43fd84207b8de4a.ttf";var y=l(8035);const w=e=>{let{isOpen:a,setIsOpen:l,onClosed:i,data:n,user:c}=e;const r=(0,t.useRef)(),{t:m}=(0,o.Bd)();j.KQ.register({family:"Times-Roman",fonts:[{src:N}]});const v="\xa0\xa0\xa0",f="\n",h=j.vv.create({page:{padding:40,fontFamily:"Times-Roman",fontSize:10,lineHeight:1.6,alignItems:"center"},header:{textAlign:"center",marginBottom:10},headerBold:{textAlign:"center",fontWeight:"bold",fontFamily:"Times-Bold"},box:{border:"1pt solid black",fontFamily:"Times-Roman",width:354.375,height:212.625,paddingLeft:28,paddingTop:28,paddingBottom:28,paddingRight:12},line:{fontSize:9,fontFamily:"Times-Roman",lineHeight:1.4}});function p(e){if(!e)return"";const a=e.trim().split(" ");if(1===a.length)return e;const l=a.pop(),i=a.join(" ");return"".concat(l,", ").concat(i)}function x(e){if(!e||"string"!==typeof e)return"";const a=(e.match(/\d+/g)||[]).map(Number);return a&&null!==a&&void 0!==a&&a.length?a[0]:""}const b=()=>{var e;return(0,u.jsx)(j.yo,{creator:"Pergamum",author:"Pergamum",title:"Ficha Catalogr\xe1fica",subject:"Subject",keywords:"ficha, catalografica",children:(0,u.jsx)(j.YW,{size:"A4",style:h.page,children:(0,u.jsx)(j.Ss,{style:h.box,children:(0,u.jsxs)(j.EY,{style:h.line,children:[p(null===c||void 0===c?void 0:c.nome_pessoa),f,v,null!==n&&void 0!==n&&n.title?null===n||void 0===n?void 0:n.title:"",null!==c&&void 0!==c&&c.nome_pessoa?" / ".concat(c.nome_pessoa):"",null!==n&&void 0!==n&&n.city?" - ".concat(n.city).concat(null!==n&&void 0!==n&&n.year?", ".concat(n.year):""):null!==n&&void 0!==n&&n.year?" - ".concat(n.year):"",f,null!==n&&void 0!==n&&n.pageNumber?"".concat(v).concat(x(n.pageNumber)," p.").concat(null!==n&&void 0!==n&&n.il?" : .il":""):"",f,f,null!==n&&void 0!==n&&n.coverPage?"".concat(v).concat(null===n||void 0===n?void 0:n.coverPage):"",f,v,null!==n&&void 0!==n&&n.advisor?"".concat(n.advisor):"",f,f,null!==n&&void 0!==n&&n.keyWords&&(null===n||void 0===n||null===(e=n.keyWords)||void 0===e?void 0:e.length)>0?n.keyWords.map((e,a)=>"".concat(a+1,". ").concat(e,"\xa0\xa0")):"",null!==n&&void 0!==n&&n.descInst?"I. ".concat(null===n||void 0===n?void 0:n.descInst):""]})})})})};return(0,u.jsxs)(d.Modal,{onClosed:()=>{i&&"function"===typeof i&&i()},innerRef:r,modalClassName:"tema-pergamum",isOpen:a,toggle:()=>l(!a),scrollable:!0,size:"lg",children:[(0,u.jsx)(d.ModalHeader,{style:{padding:"1rem 1rem 10px 1rem"},className:"b-solid-bottom b-branco cortxt negrito",toggle:()=>l(!a),close:(0,u.jsx)("button",{className:"close s20 branco float-right mr-1 rad5",style:{fontWeight:"normal"},onClick:()=>l(!1),children:(0,u.jsx)(s.g,{icon:"times",className:"fa-fw"})}),children:(0,u.jsx)("div",{className:"f700 branco s20 ",children:m("FichaCatalografica")})}),(0,u.jsx)(d.ModalBody,{children:(0,u.jsx)(j.TO,{showToolbar:!1,width:"100%",height:"600",children:b()})}),(0,u.jsx)(d.ModalFooter,{className:"d-flex justify-content-center align-items-center p-3",children:(0,u.jsxs)(d.Button,{onClick:()=>{(0,j.x8)(b()).toBlob().then(e=>(0,y.saveAs)(e,m("VisualizarFichaCatalografica")))},className:"segundo btn-w100 ml-md-3 ml-0 mt-3 mt-md-0",type:"button",children:[(0,u.jsx)(s.g,{icon:g.cbP,className:" fa-fw"}),m("BaixarPdf")]})})]})};
1var C=l(42426);const k=()=>{const[e,a]=(0,t.useState)(null),[l,i]=(0,t.useState)(!0),[n,m]=(0,t.useState)(!1),{t:f}=(0,o.Bd)(),p=(0,t.useRef)(null),[x,j]=(0,t.useState)(!1),[N,y]=(0,t.useState)(!1),k=((0,C.d4)(e=>e),(0,C.d4)(e=>e.authPersist.user||e.auth.user)),[S,_]=(0,t.useState)(),I=(0,C.d4)(e=>e.instituicao.data),[E,R]=(0,t.useState)(!1);(0,t.useEffect)(()=>{r.Ju.getPdfViewPermission().then(e=>{const{data:a}=e;R(a.permission)})},[]),(0,t.useEffect)(()=>{const l=h().CancelToken.source(),{token:t}=l;return i(!0),r.Ju.getFormConfig(t).then(l=>{if(l){const{data:i}=l;var t;if(i&&(null===i||void 0===i?void 0:i.length)>0)j(0===(null===e||void 0===e||null===(t=e.filter(e=>null===e||void 0===e?void 0:e.required))||void 0===t?void 0:t.length)),a(i)}i(!1)}).catch(e=>{h().isCancel(e)||i(!1),v.n6.tratarErro(e)}),()=>{l.cancel()}},[]);const P=()=>{j(null===e||void 0===e?void 0:e.every(e=>null===e||void 0===e?void 0:e.isValid));const a=e.filter(e=>!(null===e||void 0===e||!e.pdf_prefix));if(a&&a.length>0){var l,i,t,o,n,s,d,c,r,u,m,v,f,h,p;const e=null!==(l=null===(i=a.find(e=>"TI"===e.pdf_prefix))||void 0===i?void 0:i.value)&&void 0!==l?l:void 0,x=null!==(t=null===(o=a.find(e=>"FR"===e.pdf_prefix))||void 0===o?void 0:o.value)&&void 0!==t?t:void 0,g=null!==(n=a.filter(e=>"PC"===e.pdf_prefix&&!!e.value).map(e=>e.value))&&void 0!==n?n:[],b=null!==(s=null===(d=a.find(e=>"OR"===e.pdf_prefix))||void 0===d?void 0:d.value)&&void 0!==s?s:void 0,j=null!==(c=null===(r=a.find(e=>"CI"===e.pdf_prefix))||void 0===r?void 0:r.value)&&void 0!==c?c:void 0,N=null!==(u=null===(m=a.find(e=>"AN"===e.pdf_prefix))||void 0===m?void 0:m.value)&&void 0!==u?u:void 0,y=null!==(v=null===(f=a.find(e=>"TP"===e.pdf_prefix))||void 0===f?void 0:f.value)&&void 0!==v?v:void 0,w=!(null===(h=a.find(e=>"IL"===e.pdf_prefix))||void 0===h||!h.value),C=null===I||void 0===I||null===(p=I.nome)||void 0===p?void 0:p.trim();_({title:e,coverPage:x,keyWords:g,advisor:b,city:j,year:N,pageNumber:y,il:w,descInst:C})}};return(0,u.jsxs)(d.Container,{children:[l?(0,u.jsx)("div",{className:"p-5 text-center",children:(0,u.jsx)(c.Ew,{height:70,width:70,className:"text-tema-70 mb-2",visible:!0})}):(0,u.jsxs)("form",{className:"position-relative",ref:p,onSubmit:a=>{a.preventDefault(),a.stopPropagation();const l=null===e||void 0===e?void 0:e.filter(e=>{let a=!1;var l;if("check"===e.type)a=e.required&&0===(null===(l=e.value)||void 0===l?void 0:l.length);else if("arq"===e.type)a=e.required&&""===e.value;else{var i;a=e.required&&""===(null===(i=e.value)||void 0===i?void 0:i.trim())}return a?e.setIsValid(!0):e.setIsValid(!1),a});if((null===l||void 0===l?void 0:l.length)>0)return void l.forEach(e=>{v.qp.error(f("OCampoEObrigatorio",{field:e.label}))});m(!0);const i=new FormData;e.filter(e=>"arq"===e.type).forEach(e=>{i.append("file_".concat(e.id),e.value)}),i.append("data",JSON.stringify(e.map(e=>{let{id:a,required:l,label:i,value:t,type:o,dataSourceId:n}=e;return{id:a,required:l,label:i,value:t,type:o,dataSourceId:n}}))),r.Ju.save(i).then(e=>{const{data:a}=e;if(a){var l;const{message:e}=a;v.qp.success(e),null===(l=p.current)||void 0===l||l.reset()}}).catch(e=>{h().isCancel(e)||v.n6.tratarErro(e)}).finally(()=>{m(!1)})},children:[(null===e||void 0===e?void 0:e.length)>0?e.map((e,a)=>(0,u.jsx)(d.Row,{className:"mb-2",children:(0,u.jsx)(b,{onChange:P,formRef:p,config:e,disabled:n},"dynamic_field_".concat(e.codigo,"_").concat(a))},a)):(0,u.jsx)("div",{children:"Nenhum dado encontrado"}),(0,u.jsxs)("div",{className:"text-center my-4 pt-4 my-md-2 pt-md-2 b-w1 b-solid-top b-tema",children:[(0,u.jsxs)(d.Button,{disabled:!x,type:"submit",className:"primeiro btn-w100 ml-0",children:[(0,u.jsx)(s.g,{icon:n?"spinner":"save",className:"fa-fw mr-1 ".concat(n?"loading":"")}),f("Gravar")]}),(0,u.jsxs)(d.Button,{onClick:()=>{var e;null===(e=p.current)||void 0===e||e.reset()},className:"segundo btn-w100 ml-md-3 ml-0 mt-3 mt-md-0",type:"button",children:[(0,u.jsx)(s.g,{icon:"eraser",className:" fa-fw"}),f("Limpar")]}),E?(0,u.jsxs)(d.Button,{onClick:()=>{y(!0)},className:"segundo btn-w100 ml-md-3 ml-0 mt-3 mt-md-0",type:"button",children:[(0,u.jsx)(s.g,{icon:g.O_q,className:" fa-fw"}),f("VisualizarFichaCatalografica")]}):null]})]}),E?(0,u.jsx)(w,{user:k,data:S,isOpen:N,setIsOpen:y}):""]})},S=()=>{const{t:e}=(0,o.Bd)(),[a,l]=(0,t.useState)("gravar"),s=()=>{const i=v.Ud.descricaoReduzida(81,e("FichaCatalografica"));return{modoAtual:a,modoPrimario:{value:"gravar",titulo:i,icone:"chevron-right"},modoSecundario:{value:"historico",titulo:"".concat(i," >> ").concat(e("Historico")),icone:"history"},onToggleModoClick:e=>l(e)}};return(0,u.jsxs)("div",{className:"bkbranco rad5",children:[(0,u.jsxs)("div",{className:"container-fluid bkneo sombraPadrao pt-3 pb-1 rad5",children:[(0,u.jsx)(n.zY,(0,i.A)({},s())),"gravar"===a&&(0,u.jsx)(k,{}),"historico"===a&&(0,u.jsx)(m,{})]}),(0,u.jsx)(n.AG,(0,i.A)({},s()))]})}}}]);
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.