1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2854],{1268:(e,a,t)=>{"use strict";t.d(a,{o:()=>x});var s=t(95155),r=t(12115),i=t(62916);let l=(0,t(78340).A)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var n=t(6296),d=t(4474),c=t(39658),o=t(74350),u=t(23716);function x({onScan:e,placeholder:a="Passe o leitor ou digite o n\xba de tombo",disabled:t,autoFocus:n,clearOnScan:o=!1,value:x,onChange:p}){let[h,g]=(0,r.useState)(""),b=void 0!==x,v=b?x:h,[f,j]=(0,r.useState)(!1),y=(0,r.useRef)(null),k=(0,r.useCallback)(e=>{b?p?.(e):g(e)},[b,p]),N=(0,r.useCallback)(async a=>{let t=(0,u.Lp)(a);t&&(await e(t),o&&k(""),y.current?.focus())},[e,o,k]),_=(0,r.useCallback)(e=>{k(e),N(e)},[N,k]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(i.A,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,s.jsx)(c.p,{ref:y,className:"pl-8",value:v,autoFocus:n,disabled:t,placeholder:a,onChange:e=>k(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),N(v))}})]}),(0,s.jsx)(d.$,{type:"button",variant:"outline",disabled:t,onClick:()=>j(!0),title:"Ler com a c\xe2mera",children:(0,s.jsx)(l,{className:"w-4 h-4"})})]}),(0,s.jsx)(m,{open:f,onOpenChange:j,onDetected:_})]})}function m({open:e,onOpenChange:a,onDetected:t}){return(0,s.jsx)(o.lG,{open:e,onOpenChange:a,children:(0,s.jsxs)(o.Cf,{children:[(0,s.jsx)(o.c7,{children:(0,s.jsx)(o.L3,{children:"Ler c\xf3digo de barras"})}),e&&(0,s.jsx)(p,{onDetected:t,onClose:()=>a(!1)})]})})}function p({onDetected:e,onClose:a}){let i=(0,r.useRef)(null),[l,d]=(0,r.useState)(!0),[c,o]=(0,r.useState)(""),u=(0,r.useRef)(e),x=(0,r.useRef)(a);return(0,r.useEffect)(()=>{u.current=e,x.current=a}),(0,r.useEffect)(()=>{let e=!1,a=null;return(async()=>{try{if(!navigator.mediaDevices?.getUserMedia)throw Error("Este navegador n\xe3o permite acesso \xe0 c\xe2mera. Use o leitor USB.");let s=i.current;if(!s)throw Error("N\xe3o foi poss\xedvel iniciar a pr\xe9-visualiza\xe7\xe3o.");let{BrowserMultiFormatReader:r}=await t.e(8385).then(t.bind(t,88385)),l=new r;if(a=await l.decodeFromConstraints({video:{facingMode:"environment"}},s,e=>{let t=e?.getText();t&&(a?.stop(),u.current(t),x.current())}),e)return void a.stop();d(!1)}catch(a){if(e)return;d(!1),o(a instanceof Error&&a.message?a.message:"N\xe3o foi poss\xedvel abrir a c\xe2mera. Verifique a permiss\xe3o do navegador.")}})(),()=>{e=!0,a?.stop()}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative aspect-video w-full overflow-hidden rounded-lg bg-black",children:[(0,s.jsx)("video",{ref:i,className:"w-full h-full object-cover",muted:!0,playsInline:!0}),l&&!c&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-white",children:(0,s.jsx)(n.A,{className:"w-6 h-6 animate-spin"})})]}),c?(0,s.jsx)("p",{className:"text-sm text-red-600",children:c}):(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"Aponte para o c\xf3digo de barras da etiqueta. A leitura fecha esta janela automaticamente."})]})}},2455:(e,a,t)=>{"use strict";t.d(a,{E_:()=>h,QU:()=>m,Yq:()=>l,he:()=>c,y7:()=>i,ym:()=>u});var s=t(95155),r=t(52959);function i(e){return null==e?"â":e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}function l(e){return e?new Date(e.length<=10?e+"T00:00:00":e).toLocaleDateString("pt-BR"):"â"}function n({label:e,className:a}){return(0,s.jsx)("span",{className:`inline-flex px-2 py-0.5 rounded-full text-xs font-medium ${a}`,children:e})}let d={available:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400",loaned:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400",reserved:"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400",lost:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400",damaged:"bg-orange-100 dar
1k:bg-orange-900/30 text-orange-700 dark:text-orange-400",withdrawn:"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"};function c({status:e}){return(0,s.jsx)(n,{label:r.dH[e],className:d[e]})}let o={active:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400",returned:"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",overdue:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400",lost:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400"};function u({status:e,overdue:a}){return a&&"active"===e?(0,s.jsx)(n,{label:"Atrasado",className:o.overdue}):(0,s.jsx)(n,{label:r.us[e],className:o[e]})}let x={waiting:"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400",available:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400",fulfilled:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400",cancelled:"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",expired:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400"};function m({status:e}){return(0,s.jsx)(n,{label:r.SX[e],className:x[e]})}let p={open:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400",paid:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400",waived:"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"};function h({status:e}){return(0,s.jsx)(n,{label:r.oG[e],className:p[e]})}},9921:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},23716:(e,a,t)=>{"use strict";function s(e){let a=e.copy_code?.trim();return a||String(e.accession_number).padStart(8,"0")}function r(e){return e.trim().replace(/\s+/g,"")}t.d(a,{Lp:()=>r,xo:()=>s})},26518:(e,a,t)=>{"use strict";t.d(a,{bq:()=>u,eb:()=>m,gC:()=>x,l6:()=>c,yv:()=>o});var s=t(95155);t(12115);var r=t(29144),i=t(91337),l=t(66088),n=t(94514),d=t(9921);function c({...e}){return(0,s.jsx)(r.Root,{"data-slot":"select",...e})}function o({...e}){return(0,s.jsx)(r.Value,{"data-slot":"select-value",...e})}function u({className:e,size:a="default",children:t,...n}){return(0,s.jsxs)(r.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,(0,s.jsx)(r.Icon,{asChild:!0,children:(0,s.jsx)(l.A,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function x({className:e,children:a,position:t="item-aligned",align:l="center",...n}){return(0,s.jsx)(r.Portal,{children:(0,s.jsxs)(r.Content,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto","popper"===t&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:t,align:l,...n,children:[(0,s.jsx)(p,{}
1),(0,s.jsx)(r.Viewport,{"data-position":t,className:(0,i.cn)("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]","popper"===t&&""),children:a}),(0,s.jsx)(h,{})]})})}function m({className:e,children:a,...t}){return(0,s.jsxs)(r.Item,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...t,children:[(0,s.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:(0,s.jsx)(r.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"pointer-events-none"})})}),(0,s.jsx)(r.ItemText,{children:a})]})}function p({className:e,...a}){return(0,s.jsx)(r.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",e),...a,children:(0,s.jsx)(d.A,{})})}function h({className:e,...a}){return(0,s.jsx)(r.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",e),...a,children:(0,s.jsx)(l.A,{})})}},49387:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},54414:(e,a,t)=>{"use strict";t.d(a,{TitleDetailClient:()=>R});var s=t(95155),r=t(12115),i=t(73321),l=t(66609),n=t(80723),d=t(49387),c=t(67635),o=t(68459);let u=(0,t(78340).A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var x=t(51914),m=t(6296),p=t(98500),h=t.n(p),g=t(4474),b=t(39658),v=t(26518),f=t(74350),j=t(2455),y=t(1268),k=t(80674),N=t(9339);let _=(0,N.createServerReference)("40cb2a9d3f18f3347516c7efba438ddc53f08eb783",N.callServer,void 0,N.findSourceMapURL,"checkCopyCodeExists");var w=t(89972);let C=(0,N.createServerReference)("6080706173f3beadf46a4a6bd7a62afca576f31a49",N.callServer,void 0,N.findSourceMapURL,"updateLibraryTitle"),q=(0,N.createServerReference)("40dcb77c6ea760f206a43db49ff34995c81f4ecb9f",N.callServer,void 0,N.findSourceMapURL,"deleteLibraryTitle"),S=(0,N.createServerReference)("4094577c2b0aa7eb6a9eafe69c6187d085ab8f9ff6",N.callServer,void 0,N.findSourceMapURL,"addLibraryCopies"),A=(0,N.createServerReference)("6013f4daa858e6227277e89070382304c172ec3f98",N.callServer,void 0,N.findSourceMapURL,"moveLibraryCopyToShelf"),z=(0,N.createServerReference)("60278b1d2dd3d028f670fa08f6b00382c108fbb93d",N.callServer,void 0,N.findSourceMapURL,"setLibraryCopyStatus"),$=(0,N.createServerReference)("4000ffd4a52515865929f85c233054505bdd563d1d",N.callServer,void 0,N.findSourceMapURL,"deleteLibraryCopy");var E=t(52959);let L=["available","lost","damaged","withdrawn"];function R({title:e,copies:a,shelves:t,subjectOptions:p}){let N=(0,i.useRouter)(),[,R]=(0,r.useTransition)(),[V,U]=(0,r.useState)(!1),[I,O]=(0,r.useState)(null),[H,B]=(0,r.useState)(null),[F,P]=(0,r.useState)(!1),[Q,G]=(0,r.useState)(!1),[Y,K]=(0,r.useState)({quantity:"1",copy_code:"",acquisition_type:"",acquisition_value:"",acquisition_date:"",shelf_id:""}),[X,J]=(0,r.useState)({checking:!1,conflict:null}),W=()=>R(()=>N.refresh()),Z=`from=${encodeURIComponent(`/admin/biblioteca/acervo/${e.id}`)}`,ee=Number(Y.quantity)||0,ea=ee>1,et=(0,r.useCallback)(async e=>{let a=e.trim();
1if(!a)return void J({checking:!1,conflict:null});J({checking:!0,conflict:null});let t=await _(a);J({checking:!1,conflict:t.exists?{accession_number:t.accession_number,title_name:t.title_name??null}:null})},[]);async function es(e,a){let t=await e();return t&&"error"in t&&t.error?(l.o.error(t.error),!1):(l.o.success(a),W(),!0)}function er(){K({quantity:"1",copy_code:"",acquisition_type:"",acquisition_value:"",acquisition_date:"",shelf_id:""}),J({checking:!1,conflict:null})}function ei(a){B((0,E.lH)(e)),O(a)}async function el(a,t){let s=(0,k.R)(a);if("duplicate"===I){let a=await (0,w.a)({...s,cover_path:t??null,copy_cover_from:t?null:e.id});return"error"in a?(l.o.error(a.error),!1):(l.o.success("T\xedtulo duplicado."),N.push(`/admin/biblioteca/acervo/${a.data.id}`),!0)}let r=await C(e.id,{...s,cover_path:t});return"error"in r?(l.o.error(r.error),!1):(l.o.success("T\xedtulo atualizado."),W(),!0)}async function en(){G(!0);try{let a=await q(e.id);if("error"in a)return void l.o.error(a.error);l.o.success("T\xedtulo exclu\xeddo."),P(!1),N.push("/admin/biblioteca/acervo"),W()}finally{G(!1)}}async function ed(){if(X.conflict)return;let a=Number(Y.quantity)||0;if(a<1||a>E.mN)return void l.o.error(`Informe uma quantidade entre 1 e ${E.mN}.`);G(!0);try{let t=await S({title_id:e.id,quantity:a,copy_code:a>1?null:Y.copy_code||null,acquisition_type:Y.acquisition_type||null,acquisition_value:Y.acquisition_value?Number(Y.acquisition_value):null,acquisition_date:Y.acquisition_date||null,shelf_id:Y.shelf_id||null});if("error"in t)return void l.o.error(t.error);let s=t.data.accession_numbers;l.o.success(1===s.length?`Exemplar tombado (n\xba ${s[0]}).`:`${s.length} exemplares tombados (n\xba ${s[0]} a ${s[s.length-1]}).`,{action:{label:"Etiquetas",onClick:()=>N.push(`/admin/biblioteca/etiquetas?ids=${t.data.ids.join(",")}&${Z}`)}}),U(!1),er(),W()}finally{G(!1)}}return(0,r.useEffect)(()=>{let e=setTimeout(()=>{et(Y.copy_code)},400);return()=>clearTimeout(e)},[Y.copy_code,et]),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)(h(),{href:"/admin/biblioteca/acervo",className:"inline-flex items-center gap-1 text-sm text-gray-500 hover:text-primary",children:[(0,s.jsx)(n.A,{className:"w-4 h-4"})," Voltar ao acervo"]}),(0,s.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-200 dark:border-gray-700",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e.title}),e.subtitle&&(0,s.jsx)("p",{className:"text-gray-500 mt-1",children:e.subt
1itle})]}),(0,s.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,s.jsxs)(g.$,{variant:"outline",size:"sm",onClick:()=>ei("edit"),children:[(0,s.jsx)(d.A,{className:"w-4 h-4 mr-1"})," Editar"]}),(0,s.jsxs)(g.$,{variant:"outline",size:"sm",title:"Criar um novo t\xedtulo a partir deste",onClick:()=>ei("duplicate"),children:[(0,s.jsx)(c.A,{className:"w-4 h-4 mr-1"})," Duplicar"]}),(0,s.jsxs)(g.$,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700",onClick:()=>P(!0),children:[(0,s.jsx)(o.A,{className:"w-4 h-4 mr-1"})," Excluir"]})]})]}),(0,s.jsxs)("dl",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mt-4 text-sm",children:[(0,s.jsx)(M,{label:"Autor(es)",value:e.authors}),(0,s.jsx)(M,{label:"Editora",value:e.publisher}),(0,s.jsx)(M,{label:"Edi\xe7\xe3o",value:e.edition}),(0,s.jsx)(M,{label:"Ano",value:e.publication_year?.toString()}),(0,s.jsx)(M,{label:"ISBN",value:e.isbn}),(0,s.jsx)(M,{label:"N\xba de chamada",value:e.call_number}),(0,s.jsx)(M,{label:"Categoria",value:e.category})]}),e.subjects.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("dt",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Disciplinas atendidas"}),(0,s.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.subjects.map(e=>(0,s.jsxs)("span",{className:"rounded-sm bg-gray-100 dark:bg-gray-700 px-2 py-0.5 text-xs text-gray-700 dark:text-gray-200",title:e.course_codes.join(", "),children:[e.name,e.code&&(0,s.jsxs)("span",{className:"text-gray-400",children:[" (",e.code,")"]})]},e.id))})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:["Exemplares (",e.available_count,"/",e.copies_count," dispon\xedveis)"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[a.length>0&&(0,s.jsx)(g.$,{variant:"outline",asChild:!0,children:(0,s.jsxs)(h(),{href:`/admin/biblioteca/etiquetas?title=${e.id}&${Z}`,children:[(0,s.jsx)(u,{className:"w-4 h-4 mr-1"})," Etiquetas"]})}),(0,s.jsxs)(g.$,{onClick:()=>U(!0),children:[(0,s.jsx)(x.A,{className:"w-4 h-4 mr-1"})," Tombar exemplar"]})]})]}),(0,s.jsx)("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:0===a.length?(0,s.jsx)("div",{className:"p-8 text-center text-gray-500",children:"Nenhum exemplar cadastrado."}):(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 dark:bg-gray-900/40 text-left text-gray-500",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium",children:"Tombo"}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium",children:"Status"}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium hidden md:table-cell",children:"Prateleira"}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium hidden lg:table-cell",children:"Aquisi\xe7\xe3o"}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-right",children:"A\xe7\xf5es"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:a.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{className:"px-4 py-3 font-mono font-medium",children:["#",e.accession_number,e.copy_code&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-1",children:["(",e.copy_code,")"]})]}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)(j.he,{status:e.status})}),(0,s.jsx)("td",{className:"px-4 py-3 hidden md:table-cell",children:(0,s.jsx)(D,{copyId:e.id,shelfId:e.shelf_id,shelves:t,onMove:a=>es(()=>A(e.id,a),"Exemplar realocado.")})}),(0,s.jsxs)("td",{className:"px-4 py-3 hidden lg:table-cell text-gray-500",children:[e.acquisition_type?E.xQ[e.acquisition_type]:"â",null!=e.acquisition_value&&` \xb7 ${(0,j.y7)(e.acquisition_value)}`,e.acquisition_date&&` \xb7 ${(0,j.Yq)(e.acquisition_date)}`]}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)(g.$,{variant:"ghost",size:"sm",asChild:!0,title:"Imprimir etiqueta deste exemplar",children:(0,s.jsx)(h(),{href:`/admin/biblioteca/etiquetas?ids=${e.id}&${Z}`,children:(0,s.jsx)(u,{className:"w-4 h-4"})})}),"loaned"!==e.status&&(0,s.jsxs)(v.l6,{value:e.status,onValueChange:a=>es(()=>z(e.id,a),"Status atualizado."),children:[(0,s.jsx)(v.bq,{className:"h-8 w-32 text-xs",children:(0,s.jsx)(v.yv,{})}),(0,s.jsx)(v.gC,{children:L.map(e=>(0,s.jsx)(v.eb,{value:e,className:"text-xs",children:(0,s.jsx)(j.he,{status:e})},e))})]}),(0,s.jsx)(g.$,{variant:"ghost",size:"sm",onClick:()=>es(()=>$(e.id),"Exemplar exclu\xeddo."),disabled:"loaned"===e.status,children:(0,s.jsx)(o.A,{className:"w-4 h-4 text-red-500"})})]})})]},e.id))})]})}),(0,s.jsx)(f.lG,{open:V,onOpenChange:e=>!Q&&U(e),children:(0,s.jsxs)(f.Cf,{children:[(0,s.jsx)(f.c7,{children:(0,s.jsx)(f.L3,{children:"Tombar exemplares"})}),(0,s.jsx)("p",{className:"text-xs text-gray-500 -mt-2",children:"Os n\xfameros de tombo s\xe3o gerados automaticamente, um por exemplar."}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)(T,{label:"Quantidade de exemplares",children:[(0,s.jsx)(b.p,{type:"number",min:1,max:E.mN,value:Y.quantity,onChange:e=>K({...Y,quantity:e.target.value})}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:["Tomba de uma vez os exemplares iguais da mesma remessa (at\xe9 ",E.mN,")."]})]}),(0,s.jsx)(T,{label:"Forma de aquisi\xe7\xe3o",children:(0,s.jsxs)(v.l6,{value:Y.acquisition_type,onValueChange:e=>K({...Y,acquisition_type:e}),children:[(0,s.jsx)(v.bq,{children:(0,s.jsx)(v.yv,{placeholder:"Selecione"})}),(0,s.jsx)(v.gC,{children:Object.keys(E.xQ).map(e=>(0,s.jsx)(v.eb,{value:e,children:E.xQ[e]},e))})]})}),(0,s.jsx)(T,{label:"Valor (R$)",children:(0,s.jsx)(b.p,{type:"number",step:"0.01",value:Y.acquisition_value,onChange:e=>K({...Y,acquisition_value:e.target.value})})}),(0,s.jsx)(T,{label:"Data de aquisi\xe7\xe3o",children:(0,s.jsx)(b.p,{type:"date",value:Y.acquisition_date,onChange:e=>K({...Y,acquisition_date:e.target.value})})}),(0,s.jsx)(T,{label:"Prateleira",full:!0,children:(0,s.jsxs)(v.l6,{value:Y.shelf_id,onValueChange:e=>K({...Y,shelf_id:e}),children:[(0,s.jsx)(v.bq,{children:(0,s.jsx)(v.yv,{placeholder:"Selecione"})}),(0,s.jsx)(v.gC,{children:t.map(e=>(0,s.jsxs)(v.eb,{value:e.id,children:[e.bookcase_code," \xb7 ",e.label??e.code]},e.id))})]})}),(0,s.jsxs)(T,{label:"C\xf3digo de barras externo (opcional)",full:!0,children:[(0,s.jsx)(y.o,{value:Y.copy_code,onChange:e=>K({...Y,copy_code:e}),onScan:et,placeholder:"Leia com o leitor ou digite o c\xf3digo",disabled:ea}),ea?(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"O c\xf3digo externo \xe9 de um exemplar s\xf3 â tombe-o separadamente."}):X.conflict?(0,s.jsxs)("p",{className:"text-xs text-red-600 mt-1",children:["C\xf3digo j\xe1 usado no exemplar #",X.conflict.accession_number,X.c
1onflict.title_name?` (${X.conflict.title_name})`:"","."]}):(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"S\xf3 para livros que j\xe1 vieram etiquetados. Vazio = a etiqueta usa o n\xba de tombo."})]})]}),(0,s.jsxs)(f.Es,{children:[(0,s.jsx)(g.$,{variant:"outline",onClick:()=>{U(!1),er()},disabled:Q,children:"Cancelar"}),(0,s.jsxs)(g.$,{onClick:ed,disabled:Q||!ea&&(X.checking||!!X.conflict),children:[Q&&(0,s.jsx)(m.A,{className:"w-4 h-4 mr-1 animate-spin"}),ea?`Tombar ${ee} exemplares`:"Tombar"]})]})]})}),(0,s.jsx)(k.f,{open:null!==I,onOpenChange:e=>{e||O(null)},heading:"duplicate"===I?"Duplicar t\xedtulo":"Editar t\xedtulo",description:"duplicate"===I?"Os dados vieram desta obra. Ajuste o que muda (edi\xe7\xe3o, ano, volume...) e salve como um novo t\xedtulo.":void 0,submitLabel:"duplicate"===I?"Duplicar":"Salvar",coverHint:"duplicate"===I?e.cover_path?"A capa desta obra \xe9 copiada. Envie uma imagem para usar outra.":void 0:e.cover_path?"Deixe vazio para manter a capa atual.":"Este t\xedtulo ainda n\xe3o tem capa.",subjectOptions:p,initial:H,onSubmit:el}),(0,s.jsx)(f.lG,{open:F,onOpenChange:e=>!Q&&P(e),children:(0,s.jsxs)(f.Cf,{children:[(0,s.jsxs)(f.c7,{children:[(0,s.jsx)(f.L3,{children:"Excluir t\xedtulo"}),(0,s.jsx)(f.rr,{children:e.copies_count>0?`"${e.title}" ser\xe1 exclu\xeddo junto com ${e.copies_count} exemplar(es) tombado(s). Esta a\xe7\xe3o n\xe3o pode ser desfeita.`:`"${e.title}" ser\xe1 exclu\xeddo. Esta a\xe7\xe3o n\xe3o pode ser desfeita.`})]}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:'T\xedtulos que j\xe1 foram emprestados n\xe3o podem ser exclu\xeddos â o hist\xf3rico \xe9 preservado. Nesse caso, marque os exemplares como "Baixado".'}),(0,s.jsxs)(f.Es,{children:[(0,s.jsx)(g.$,{variant:"outline",onClick:()=>P(!1),disabled:Q,children:"Cancelar"}),(0,s.jsxs)(g.$,{variant:"destructive",onClick:en,disabled:Q,children:[Q&&(0,s.jsx)(m.A,{className:"w-4 h-4 mr-1 animate-spin"})," Excluir"]})]})]})})]})}function M({label:e,value:a}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-xs text-gray-400",children:e}),(0,s.jsx)("dd",{className:"text-gray-800 dark:text-gray-200",children:a||"â"})]})}function T({label:e,full:a,children:t}){return(0,s.jsxs)("div",{className:a?"col-span-2":"",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:e}),t]})}function D({shelfId:e,shelves:a,onMove:t}){return(0,s.jsxs)(v.l6,{value:e??"",onValueChange:t,children:[(0,s.jsx)(v.bq,{className:"h-8 w-40 text-xs",children:(0,s.jsx)(v.yv,{placeholder:"Sem prateleira"})}),(0,s.jsx)(v.gC,{children:a.map(e=>(0,s.jsxs)(v.eb,{value:e.id,className:"text-xs",children:[e.bookcase_code," \xb7 ",e.label??e.code]},e.id))})]})}},62916:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("scan-line",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]])},66088:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},68459:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},80723:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(78340).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},99460:(e,a,t)=>{Promise.resolve().then(t.bind(t,54414))}},e=>{e.O(0,[5730,9060,8500,1437,6609,2619,8384,9144,9682,5632,8441,5838,7358],()=>e(e.s=99460)),_N_E=e.O()}]);
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.