⚙ Ferramenta Interna — AB Soluções
Gerador de Documentos Operacionais
Avaliações de segurança, orçamentos e contratos gerados com IA em segundos.
🏢 Identificação do Cliente
Indústria / Manufatura
Comércio / Varejo
Setor Financeiro
Saúde / Hospitalar
Logística / Transporte
Condomínio Comercial / Corporativo
Escritório Jurídico / Compliance
Evento / Entretenimento
Outro
🛡️ Serviço de Interesse
Vigilância Patrimonial
Segurança VIP / Executiva
Pronta Resposta
Pacote Integrado
Imediato (até 48h)
Esta semana
Este mês
Em fase de planejamento
Diurno (6h–18h)
Noturno (18h–6h)
24 horas / Plantão
Por evento
⚠️ Diagnóstico de Risco
MÉDIO
MÉDIA
🏢 Dados do Cliente
🛡️ Tipo de Serviço
Vigilância Patrimonial
Segurança VIP / Executiva
Pronta Resposta
Pacote Combinado
Evento Pontual (1 dia)
Curta Duração (até 7 dias)
Contrato Mensal
Contrato Trimestral
Contrato Anual
Diurno (6h–18h)
Noturno (18h–6h)
24 horas / Plantão
Personalizado
💰 Composição de Valores
🏢 Partes do Contrato
🛡️ Objeto e Vigência
Vigilância Patrimonial Estratégica
Proteção Executiva (VIP)
Serviço de Pronta Resposta
Pacote Integrado de Segurança
PIX
Boleto Bancário
Transferência Bancária
Cartão Corporativo
Dia 5 de cada mês
Dia 10 de cada mês
Dia 15 de cada mês
Adiantado (antes do serviço)
‘ + (i===0?’‘:”) +
‘
‘ +
‘‘ + (i===0?’‘:”) +
‘
‘ +
‘‘ + (i===0?’‘:”) +
‘
‘ +
‘‘;
c.appendChild(row);
});
c.querySelectorAll(‘input’).forEach(function(inp) {
inp.addEventListener(‘input’, function() {
var idx = parseInt(this.getAttribute(‘data-idx’));
var field = this.getAttribute(‘data-field’);
orcItems[idx][field] = field===’desc’ ? this.value : (parseFloat(this.value)||0);
calcTotal();
});
});
c.querySelectorAll(‘[data-remove]’).forEach(function(btn) {
btn.addEventListener(‘click’, function() {
orcItems.splice(parseInt(this.getAttribute(‘data-remove’)), 1);
renderItems();
});
});
calcTotal();
}
function calcTotal() {
var total = orcItems.reduce(function(s,it){ return s + it.qty * it.val; }, 0);
document.getElementById(‘orc-total’).textContent = ‘R$ ‘ + total.toLocaleString(‘pt-BR’, {minimumFractionDigits:2});
return total;
}
document.getElementById(‘orc-add-btn’).addEventListener(‘click’, function() {
orcItems.push({desc:”, qty:1, val:0});
renderItems();
});
renderItems();
// ── LIMPAR ──
document.querySelectorAll(‘[data-limpar]’).forEach(function(btn) {
btn.addEventListener(‘click’, function() {
var tipo = this.getAttribute(‘data-limpar’);
if (tipo === ‘avaliacao’) {
[‘av-cliente’,’av-contato’,’av-cidade’,’av-endereco’,’av-contexto’,’av-expectativas’].forEach(function(id){
var el = document.getElementById(id); if(el) el.value = (id===’av-cidade’?’São Paulo – SP’:”);
});
document.querySelectorAll(‘input[name=”vuln”]’).forEach(function(c){ c.checked=false; });
document.getElementById(‘av-risco’).value = 2;
document.getElementById(‘av-risco-label’).innerHTML = ‘MÉDIO‘;
document.getElementById(‘av-urgencia’).value = 2;
document.getElementById(‘av-urgencia-label’).innerHTML = ‘MÉDIA‘;
} else if (tipo === ‘orcamento’) {
[‘orc-cliente’,’orc-doc’,’orc-contato’,’orc-email’,’orc-endereco’,’orc-obs’].forEach(function(id){
var el = document.getElementById(id); if(el) el.value=”;
});
orcItems = [{desc:”,qty:1,val:0}];
renderItems();
} else {
[‘con-cliente’,’con-doc’,’con-rep’,’con-cargo’,’con-endereco’,’con-valor’,’con-inicio’,’con-fim’,’con-escopo’].forEach(function(id){
var el = document.getElementById(id); if(el) el.value=”;
});
}
document.getElementById(‘ab-output-box’).style.display = ‘none’;
});
});
// ── COPIAR ──
document.getElementById(‘ab-copy-btn’).addEventListener(‘click’, function() {
var txt = document.getElementById(‘ab-output-content’).innerText;
navigator.clipboard.writeText(txt).then(function() {
var btn = document.getElementById(‘ab-copy-btn’);
btn.textContent = ‘✓ Copiado!’;
setTimeout(function(){ btn.textContent = ‘📋 Copiar’; }, 2000);
});
});
// ── GERAR ──
var riscoNomes = [”,’Baixo’,’Médio’,’Alto’,’Crítico’];
var urgNomes = [”,’Baixa’,’Média’,’Alta’,’Imediata’];
document.querySelectorAll(‘[data-gerar]’).forEach(function(btn) {
btn.addEventListener(‘click’, function() {
var tipo = this.getAttribute(‘data-gerar’);
var self = this;
self.disabled = true;
self.innerHTML = ‘ Gerando…’;
if (!document.getElementById(‘ab-spin-style’)) {
var s = document.createElement(‘style’);
s.id = ‘ab-spin-style’;
s.textContent = ‘@keyframes ab-spin{to{transform:rotate(360deg)}}’;
document.head.appendChild(s);
}
var outBox = document.getElementById(‘ab-output-box’);
var outContent = document.getElementById(‘ab-output-content’);
var outTitle = document.getElementById(‘ab-output-title’);
var titles = { avaliacao:’🔍 AVALIAÇÃO DE SEGURANÇA’, orcamento:’📋 ORÇAMENTO’, contrato:’📄 CONTRATO’ };
outBox.style.display = ‘block’;
outContent.textContent = ”;
outTitle.innerHTML = titles[tipo] + ‘ GERADO ‘;
document.getElementById(‘ab-copy-btn’).addEventListener(‘click’, function() {
navigator.clipboard.writeText(outContent.innerText).then(function() {
var b = document.getElementById(‘ab-copy-btn’);
b.textContent = ‘✓ Copiado!’;
setTimeout(function(){ b.textContent = ‘📋 Copiar’; }, 2000);
});
});
var prompt = ”;
if (tipo === ‘avaliacao’) {
var vulns = Array.from(document.querySelectorAll(‘input[name=”vuln”]:checked’)).map(function(c){ return c.value; });
var rv = document.getElementById(‘av-risco’).value;
var uv = document.getElementById(‘av-urgencia’).value;
prompt = ‘Você é especialista sênior em segurança estratégica e inteligência corporativa, assessorando a AB Soluções Inteligentes — empresa brasileira dirigida por um oficial com 15 anos na Polícia Militar e formação em Relações Internacionais.nnGere um RELATÓRIO DE AVALIAÇÃO DE SEGURANÇA completo e profissional com:n1. Identificação e contexton2. Diagnóstico de vulnerabilidadesn3. Análise de risco e urgêncian4. Recomendações estratégicas e táticasn5. Proposta de solução da AB Soluções Inteligentesn6. Próximos passosnnDADOS:nCliente: ‘ + (document.getElementById(‘av-cliente’).value||’Não informado’) +
‘nSegmento: ‘ + document.getElementById(‘av-segmento’).value +
‘nResponsável: ‘ + (document.getElementById(‘av-contato’).value||’Não informado’) +
‘nLocal: ‘ + (document.getElementById(‘av-endereco’).value||’Não informado’) + ‘ — ‘ + document.getElementById(‘av-cidade’).value +
‘nServiço Solicitado: ‘ + document.getElementById(‘av-servico’).value +
‘nAgentes: ‘ + document.getElementById(‘av-agentes’).value +
‘nTurno: ‘ + document.getElementById(‘av-turno’).value +
‘nPrazo: ‘ + document.getElementById(‘av-prazo’).value +
‘nNível de Risco: ‘ + riscoNomes[rv] +
‘nUrgência: ‘ + urgNomes[uv] +
‘nVulnerabilidades: ‘ + (vulns.length ? vulns.join(‘, ‘) : ‘Nenhuma marcada’) +
‘nContexto: ‘ + (document.getElementById(‘av-contexto’).value||’Não descrito’) +
‘nExpectativas: ‘ + (document.getElementById(‘av-expectativas’).value||’Não informadas’) +
‘nnGere a avaliação completa agora:’;
} else if (tipo === ‘orcamento’) {
var total = calcTotal();
var itensText = orcItems.map(function(it){ return ‘ – ‘ + it.desc + ‘: ‘ + it.qty + ‘x R$ ‘ + it.val.toFixed(2) + ‘ = R$ ‘ + (it.qty*it.val).toFixed(2); }).join(‘n’);
prompt = ‘Você é especialista em segurança privada auxiliando a AB Soluções Inteligentes (São Paulo/SP).nnGere um ORÇAMENTO COMERCIAL PROFISSIONAL com cabeçalho, validade, condições, escopo, tabela de valores, pagamento e assinaturas.nnCLIENTE: ‘ + (document.getElementById(‘orc-cliente’).value||’N/I’) +
‘ | Doc: ‘ + (document.getElementById(‘orc-doc’).value||’N/I’) +
‘ | Resp: ‘ + (document.getElementById(‘orc-contato’).value||’N/I’) +
‘ | Email: ‘ + (document.getElementById(‘orc-email’).value||’N/I’) +
‘ | Local: ‘ + (document.getElementById(‘orc-endereco’).value||’N/I’) +
‘nSERVIÇO: ‘ + document.getElementById(‘orc-servico’).value +
‘ | Duração: ‘ + document.getElementById(‘orc-duracao’).value +
‘ | Agentes: ‘ + document.getElementById(‘orc-agentes’).value +
‘ | Turno: ‘ + document.getElementById(‘orc-turno’).value +
‘nOBS: ‘ + (document.getElementById(‘orc-obs’).value||’Nenhuma’) +
‘nITENS:n’ + itensText +
‘nTOTAL: R$ ‘ + total.toLocaleString(‘pt-BR’,{minimumFractionDigits:2}) +
‘nnGere o orçamento agora:’;
} else {
var val = parseFloat(document.getElementById(‘con-valor’).value||0);
prompt = ‘Você é especialista jurídico em contratos de segurança privada no Brasil, auxiliando a AB Soluções Inteligentes.nnGere um CONTRATO DE PRESTAÇÃO DE SERVIÇOS DE SEGURANÇA completo com qualificação das partes, objeto, obrigações, valor, vigência, rescisão, confidencialidade, responsabilidades, foro e assinaturas.nnCONTRATANTE: ‘ + (document.getElementById(‘con-cliente’).value||’N/I’) +
‘ | Doc: ‘ + (document.getElementById(‘con-doc’).value||’N/I’) +
‘ | Rep: ‘ + (document.getElementById(‘con-rep’).value||’N/I’) +
‘ | Cargo: ‘ + (document.getElementById(‘con-cargo’).value||’N/I’) +
‘ | End: ‘ + (document.getElementById(‘con-endereco’).value||’N/I’) +
‘nCONTRATADA: AB Soluções Inteligentes — São Paulo/SP’ +
‘nSERVIÇO: ‘ + document.getElementById(‘con-servico’).value +
‘ | Valor: R$ ‘ + val.toLocaleString(‘pt-BR’,{minimumFractionDigits:2}) +
‘ | Início: ‘ + (document.getElementById(‘con-inicio’).value||’A definir’) +
‘ | Fim: ‘ + (document.getElementById(‘con-fim’).value||’A definir’) +
‘ | Pagamento: ‘ + document.getElementById(‘con-pagamento’).value +
‘ | Vencimento: ‘ + document.getElementById(‘con-vencimento’).value +
‘nESCOPO: ‘ + (document.getElementById(‘con-escopo’).value||’A detalhar em anexo’) +
‘nnGere o contrato agora:’;
}
fetch(‘https://api.anthropic.com/v1/messages’, {
method: ‘POST’,
headers: { ‘Content-Type’: ‘application/json’ },
body: JSON.stringify({
model: ‘claude-sonnet-4-20250514’,
max_tokens: 1000,
messages: [{ role: ‘user’, content: prompt }]
})
})
.then(function(r){ return r.json(); })
.then(function(data) {
var text = ”;
if (data.content) {
data.content.forEach(function(b){ if(b.type===’text’) text += b.text; });
}
outContent.textContent = text || ‘Erro ao gerar documento.’;
})
.catch(function() {
outContent.textContent = ‘❌ Erro ao conectar com a IA. Verifique sua conexão e tente novamente.’;
})
.finally(function() {
self.disabled = false;
var labels = { avaliacao:’✦ Gerar Avaliação de Segurança com IA’, orcamento:’✦ Gerar Orçamento com IA’, contrato:’✦ Gerar Contrato com IA’ };
self.innerHTML = labels[tipo];
outBox.scrollIntoView({ behavior:’smooth’, block:’start’ });
});
});
});
});
