PageSourceSearch

https://genesissa.com/_nuxt/B7QTtAUa.js

js genesissa.com collected 2026-10-02 01:30:55 UTC 8,701 bytes, 1 lines download raw bytes

1import{_ as L}from"./DD0bMvq5.js";/* empty css        *//* empty css        *//* empty css        *//* empty css        */import{M as U,cd as H,b7 as O,x as i,u as e,H as N,cr as q,bO as o,bE as s,B,w as m,cs as S,cj as V,ct as G,cu as J,b as Q,bo as R,bm as u,bc as c}from"./BqRK_f-2.js";import{l as W,u as X,c as Y,d as Z}from"./gY6mBzKq.js";import{u as ee}from"./CNxMQkOW.js";import{e as te}from"./DapnQ07H.js";import{a as p}from"./DOcBdUHk.js";import{r as ae}from"./2eavgsaj.js";import{E as oe}from"./nlMPApAa.js";import"./e5v6qK9R.js";import"./DXek99um.js";import"./BhFJ2G4y.js";const se={class:"mx-auto max-w-[1320px] w-full px-4 py-4 space-y-6"},re={class:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between"},le={class:"flex items-start gap-3"},ne={class:"text-3xl font-extrabold text-[var(--text)]"},ie={class:"text-sm text-[var(--muted)] mt-1 max-w-xl"},ce={class:"font-mono text-xs"},de={class:"rounded-2xl border border-[var(--border)] bg-[var(--surface)] shadow-[var(--shadow)] dark:backdrop-blur-xl p-4 md:p-5"},ue={class:"flex flex-col sm:flex-row gap-3 mb-4"},pe=["placeholder","onKeydown"],ve={key:0,class:"mb-6 rounded-xl border border-[var(--accent)]/25 bg-[var(--surface-2)]/60 p-4 space-y-3"},xe={class:"text-sm font-bold text-[var(--text)]"},me={class:"grid grid-cols-1 md:grid-cols-2 gap-3 max-w-[720px]"},be={class:"space-y-1"},ge={class:"text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)]"},fe=["value","placeholder"],_e={class:"space-y-1"},he={class:"text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)]"},ye=["placeholder"],we={class:"flex flex-wrap gap-2"},ke=["disabled"],Ce={key:1,class:"py-12 text-center text-sm text-[var(--muted)]"},Te={key:2,class:"overflow-x-auto"},Ee={class:"w-full text-sm"},Ne={class:"border-b border-[var(--border)] text-left"},Be={class:"pb-2 pr-4 text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)]"},Se={class:"pb-2 pr-4 text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)]"},Ve={class:"pb-2 text-[11px] font-bold uppercase tracking-[0.06em] text-[var(--muted)] w-[120px]"},je={class:"py-3 pr-4 font-medium text-[var(--text)]"},Me={class:"py-3 pr-4 font-mono text-xs text-[var(--muted)]"},Pe={class:"py-3"},$e={class:"flex flex-wrap gap-2"},ze=["onClick"],Ae=["onClick"],De={key:3,class:"mt-4 flex flex-wrap items-center justify-between gap-2 text-xs text-[var(--muted)]"},Fe={class:"flex gap-2"},Ie=["disabled"],Ke=["disabled"],ot=U({__name:"tags",setup(Le){const{tn:t}=H(),{canCreateTags:j,canEditTags:M,canDeleteTags:P}=ee(),f=u(!0),b=u(!1),_=u(""),k=u(""),h=u([]),l=u({total:0,pagina:1,limite:50,total_paginas:0}),g=u(!1),v=u(null),d=u({slug:"",nome:""});function y(r){return r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,"").replace(/_+/g,"_")}function $(r){return y(r).replace(/^_+|_+$/g,"")}function z(r){const a=r.target;d.value.slug=y(a.value)}async function x(){if(await te()){f.value=!0;try{const a=await W({busca:k.value||void 0,page:l.value.pagina,limit:l.value.limite});h.value=a.dados||[],a.paginacao&&(l.value={total:a.paginacao.total,pagina:a.paginacao.pagina,limite:a.paginacao.limite,total_paginas:a.paginacao.total_paginas})}catch{h.value=[],p.error(t("Não foi possível carregar as tags."))}finally{f.value=!1}}}function C(){k.value=_.value.trim(),l.value.pagina=1,x()}function T(r){l.value.pagina=r,x()}function A(){v.value=null,d.value={slug:"",nome:""},g.value=!0}function D(r){v.value=r.id,d.value={slug:y(r.slug),nome:r.nome},g.value=!0}function E(){g.value=!1,v.value=null}async function F(){const r=$(d.value.slug),a=d.value.nome.trim();if(d.value.slug=r,!r||!a){p.warning(t("Preencha slug e nome."));return}b.value=!0;try{v.value?(await X(v.value,{slug:r,nome:a}),p.success(t("Tag atualizada."))):(await Y({slug:r,nome:a}),p.success(t("Tag criada."))),E(),await x()}catch(w){p.error(w?.message||"Erro ao salvar tag.")}finally{b.value=!1}}async function I(r){try{await oe.confirm(`Excluir a tag «${r.nome}»? Vínculos com clientes, serviços e produtos serão removidos.`,"Confirmar exclusão",{type:"warning",confirmButtonText:t("Excluir"),cancelButtonText:t("Cancelar")}
1)}catch{return}try{await Z(r.id),p.success(t("Tag excluída.")),await x()}catch(a){p.error(a?.response?.data?.message||a?.message||"Não foi possível excluir a tag.")}}return O(()=>x()),(r,a)=>{const w=L;return c(),i("div",se,[e("header",re,[e("div",le,[N(w,{to:"/cadastros",class:"mt-1 p-2 rounded-xl border border-[var(--border)] text-[var(--text)] hover:bg-[var(--surface-2)] transition shrink-0",title:o(t)("Voltar aos cadastros")},{default:q(()=>[N(o(ae),{class:"h-5 w-5"})]),_:1},8,["title"]),e("div",null,[e("h1",ne,s(o(t)("Tags")),1),e("p",ie,[B(s(o(t)("Vocabulário do estabelecimento para perfil de clientes e alinhamento de serviços e produtos. Use slugs estáveis (ex.:"))+" ",1),e("span",ce,s(o(t)("cabelo_ressecado")),1),a[4]||(a[4]=B("). ",-1))])])]),o(j)?(c(),i("button",{key:0,type:"button",class:"inline-flex items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold text-white btn-primary-gradient shrink-0",onClick:A},s(o(t)("Nova tag")),1)):m("",!0)]),e("div",de,[e("div",ue,[S(e("input",{"onUpdate:modelValue":a[0]||(a[0]=n=>_.value=n),type:"search",placeholder:o(t)("Buscar por nome ou slug…"),class:"w-full max-w-md rounded-xl border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text)] placeholder:text-[var(--subtle)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)]",onKeydown:G(J(C,["prevent"]),["enter"])},null,40,pe),[[V,_.value]]),e("button",{type:"button",class:"inline-flex items-center justify-center rounded-xl border border-[var(--border)] px-4 py-2 text-sm font-semibold text-[var(--text)] hover:bg-[var(--surface-2)]",onClick:C},s(o(t)("Buscar")),1)]),g.value?(c(),i("div",ve,[e("h2",xe,s(v.value?"Editar tag":"Nova tag"),1),e("div",me,[e("div",be,[e("label",ge,s(o(t)("Slug *")),1),e("input",{value:d.value.slug,type:"text",autocomplete:"off",class:"w-full rounded-xl border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-mono text-[var(--text)]",placeholder:o(t)("ex.: cabelo_ressecado"),onInput:z},null,40,fe)]),e("div",_e,[e("label",he,s(o(t)("Nome exibido *")),1),S(e("input",{"onUpdate:modelValue":a[1]||(a[1]=n=>d.value.nome=n),type:"text",class:"w-full rounded-xl border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm text-[var(--text)]",placeholder:o(t)("Ex.: Cabelo ressecado")},null,8,ye),[[V,d.value.nome]])])]),e("div",we,[e("button",{type:"button",class:"inline-flex items-center justify-center rounded-xl px-4 py-2 text-sm font-semibold bg-[var(--brand-700)] text-white hover:brightness-110",disabled:b.value,onClick:F},s(b.value?"Salvando…":"Salvar"),9,ke),e("button",{type:"button",class:"inline-flex items-center justify-center rounded-xl border border-[var(--border)] px-4 py-2 text-sm font-semibold text-[var(--text)]",onClick:E},s(o(t)("Cancelar")),1)])])):m("",!0),f.value?(c(),i("div",Ce,s(o(t)("Carregando…")),1)):(c(),i("div",Te,[e("table",Ee,[e("thead",null,[e("tr",Ne,[e("th",Be,s(o(t)("Nome")),1),e("th",Se,s(o(t)("Slug")),1),e("th",Ve,s(o(t)("Ações")),1)])]),e("tbody",null,[(c(!0),i(Q,null,R(h.value,n=>(c(),i("tr",{key:n.id,class:"border-b border-[var(--border)] odd:bg-transparent even:bg-[rgba(255,255,255,0.03)] dark:even:bg-[rgba(255,255,255,0.04)]"},[e("td",je,s(n.nome),1),e("td",Me,s(n.slug),1),e("td",Pe,[e("div",$e,[o(M)?(c(),i("button",{key:0,type:"button",class:"text-xs font-semibold text-[var(--accent)] hover:underline",onClick:K=>D(n)},s(o(t)("Editar")),9,ze)):m("",!0),o(P)?(c(),i("button",{key:1,type:"button",class:"text-xs font-semibold text-red-600 dark:text-red-400 hover:underline",onClick:K=>I(n)},s(o(t)("Excluir")),9,Ae)):m("",!0)])])]))),128))])])])),l.value.total_paginas>1?(c(),i("div",De,[e("span",null,s(o(t)("Página"))+" "+s(l.value.pagina)+" de "+s(l.value.total_paginas)+" ("+s(l.value.total)+" tags)",1),e("div",Fe,[e("button",{type:"button",class:"rounded-lg border border-[var(--border)] bg-[var(--surface)] text-[var(--text)] px-3 py-1 disabled:opacity-40 hover:bg-[var(--surface-2)] transition duration-200",disabled:l.value.pagina<=1,onClick:a[2]||(a[2]=n=>T(l.value.pagina-1))},s(o(t)("Anterior")),9,Ie),e("button",{type:"button",class:"rounded-lg border border-[var(--border)] bg-[var(--surface)] text-[var(--text)] px-3 py-1 disabled:opacity-40 hover:bg-[var(--surface-2)] transition duration-200",disabled:l.value.pagina>=l.value.total_paginas,onClick:a[3]||(a[3]=n=>T(l.value.pagina+1))},s(o(t)("Próxima")),9,Ke)])])):m("",!0)])])}}});
1export{ot as default};

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.