PageSourceSearch

https://bitacora.ai/assets/Ayuda-CgSSUwUL.js

js bitacora.ai collected 2026-10-05 15:28:14 UTC 18,366 bytes, 18 lines download raw bytes

1import{c as R,s as _,a1 as $,u as C,j as e,M as U,d as z,r as l,e as E,ar as F,ae as G,L as K,as as V}from"./index-BiVk33Bn.js";import{M as W}from"./mail-CFHv1ZSR.js";import{H as Y}from"./articles-D5rj_8US.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"daca8474617e38beb40596519f5b410a89e15552"};var s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="2260618a-4689-4f9a-8442-389d80371db4",t._sentryDebugIdIdentifier="sentry-dbid-2260618a-4689-4f9a-8442-389d80371db4")}catch{}})();/**
2 * @license lucide-react v0.508.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const J=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],Z=R("thumbs-down",J);/**
7 * @license lucide-react v0.508.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const X=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],ee=R("thumbs-up",X);class f extends ${constructor(s){super(s),this.name="HelpServiceError"}}const M="Bitácora es una herramienta de gestión, no asesora clínicamente. No puedo responder eso. Si necesitas ayuda con la app, reformula la pregunta.",te="No tengo información sobre eso en la documentación de Bitácora. Si es sobre el producto, escríbenos a [email protected]. Si es una consulta clínica, Bitácora no asesora sobre ese tipo de decisiones.",se={blacklist:M};async function*ae(t){var n;const{data:s}=await _.auth.getSession(),a=(n=s.session)==null?void 0:n.access_token;if(!a)throw new f("No hay sesión activa. Vuelve a ingresar.");const o=await fetch("https://api.bitacora.ai/help/ask",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:`Bearer ${a}`},body:JSON.stringify({question:t.question,route:t.route}),signal:t.signal});if(!o.ok||!o.body)throw new f(`No pudimos abrir el canal de respuesta (${o.status}). Intenta de nuevo.`);yield*ne(o.body)}async function T(t){var n;const{data:s}=await _.auth.getSession(),a=(n=s.session)==null?void 0:n.access_token;if(!a)throw new f("No hay sesión activa.");if(!(await fetch("https://api.bitacora.ai/help/feedback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(t)})).ok)throw new f("No pudimos registrar el feedback.")}function re(t){const s=encodeURIComponent("Consulta sobre Bitácora"),a=encodeURIComponent(t.trim()?`Pregunta original:
12${t}
13
14`:"");return`mailto:[email protected]?subject=${s}&body=${a}`}async function*ne(t){const s=t.getReader(),a=new TextDecoder("utf-8");let i="";for(;;){const{done:o,value:n}=await s.read();if(o){const u=i.trim();if(u){const c=L(u);c&&(yield c)}return}i+=a.decode(n,{stream:!0});let m;for(;(m=i.indexOf(`
15
16`))!==-1;){const u=i.slice(0,m);i=i.slice(m+2);const c=L(u);c&&(yield c)}}}function L(t){let s="message";const a=[];for(const o of t.split(`
17`)){const n=o.replace(/\r$/,"");n&&(n.startsWith("event: ")?s=n.slice(7).trim():n.startsWith("data: ")&&a.push(n.slice(6)))}if(a.length===0)return null;let i;try{i=JSON.parse(a.join(`
18`))}catch{return null}return ie(s,i)}function ie(t,s){if(s===null||typeof s!="object")return t==="done"?{type:"done",query_id:null}:null;const a=s;switch(t){case"phase":return a.phase==="retrieving"||a.phase==="streaming"?{type:"phase",phase:a.phase}:null;case"query":return typeof a.query_id=="string"?{type:"query",query_id:a.query_id}:null;case"token":return typeof a.text=="string"?{type:"token",text:a.text}:null;case"citations":return Array.isArray(a.citations)?{type:"citations",citations:a.citations}:null;
18case"blacklist":return{type:"blacklist",message:typeof a.message=="string"?a.message:M,query_id:typeof a.query_id=="string"?a.query_id:null};case"fallback":return{type:"fallback",message:typeof a.message=="string"?a.message:te,query_id:typeof a.query_id=="string"?a.query_id:null};case"error":return{type:"error",reason:oe(a.reason),message:typeof a.message=="string"?a.message:"Error desconocido.",query_id:typeof a.query_id=="string"?a.query_id:void 0};case"done":return{type:"done",query_id:typeof a.query_id=="string"?a.query_id:null};default:return null}}function oe(t){return typeof t=="string"&&["empty","too_long","rate_limited","retrieval","generation","network"].includes(t)?t:"network"}function le(t){const{t:s}=C("common"),{status:a,questionAsked:i,answer:o,citations:n,message:m,queryId:u,errorMessage:c}=t;return a==="idle"?null:a==="retrieving"||a==="streaming"?e.jsxs("section",{"aria-live":"polite","aria-busy":"true",className:"border border-bark/10 rounded-md px-6 py-5",children:[e.jsx("p",{className:"text-small uppercase tracking-[0.18em] text-bark-muted mb-3",children:s(a==="retrieving"?"help.phaseRetrieving":"help.phaseStreaming")}),o?e.jsx("p",{className:"text-body text-bark whitespace-pre-wrap leading-relaxed",children:o}):null]}):a==="blacklist"||a==="fallback"?e.jsxs("section",{"aria-live":"polite",className:"border border-bark/10 rounded-md px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-body text-bark leading-relaxed",children:m}),a==="fallback"?e.jsxs("a",{href:re(i),className:"inline-flex items-center gap-2 border border-bark text-bark hover:bg-bark hover:text-linen px-5 py-2.5 rounded-xs text-tiny uppercase tracking-[0.14em] transition-colors",children:[e.jsx(W,{size:14,strokeWidth:1.5}),s("help.contactSupport")]}):null]}):a==="error"?e.jsx("section",{className:"border border-brick-500/40 rounded-md px-6 py-5",children:e.jsx("p",{className:"text-body text-bark leading-relaxed",children:c??s("help.genericError")})}):e.jsxs("section",{className:"border border-bark/10 rounded-md px-6 py-5 space-y-6",children:[e.jsx(ce,{answer:o}),n.length>0?e.jsxs("div",{className:"border-t border-bark/10 pt-4",children:[e.jsx("p",{className:"text-tiny uppercase tracking-[0.18em] text-bark-muted mb-3",children:s("help.moreDetail")}),e.jsx("ul",{className:"space-y-1",children:n.map((p,h)=>e.jsxs("li",{className:"text-small text-bark",children:[e.jsx("span",{className:"text-bark-muted",children:p.doc_path}),p.doc_section?e.jsxs("span",{className:"text-bark-muted",children:[" · ",p.doc_section]}):null]},`${p.doc_path}-${h}`))})]}):null,e.jsx(de,{queryId:u})]})}function ce({answer:t}){return e.jsx("div",{className:"text-body text-bark leading-relaxed space-y-3",children:e.jsx(U,{remarkPlugins:[z],components:{p:({children:s})=>e.jsx("p",{className:"leading-relaxed",children:s}),ol:({children:s})=>e.jsx("ol",{className:"list-decimal pl-5 space-y-1.5 marker:text-bark-muted",children:s}),ul:({children:s})=>e.jsx("ul",{className:"list-disc pl-5 space-y-1.5 marker:text-bark-muted",children:s}),li:({children:s})=>e.jsx("li",{className:"leading-relaxed",children:s}),strong:({children:s})=>e.jsx("strong",{className:"font-medium text-bark",children:s}),a:({children:s,href:a})=>e.jsx("a",{href:a,className:"text-terracotta underline underline-offset-2",children:s}),code:({children:s})=>e.jsx("code",{className:"text-small bg-bark/5 rounded px-1 py-0.5",children:s})},children:t})})}function de({queryId:t}){const{t:s}=C("common"),[a,i]=l.useState(null),[o,n]=l.useState(!1),[m,u]=l.useState(""),[c,p]=l.useState(null);if(!t)return null;async function h(){if(t){p(null);try{await T({query_id:t,feedback:"up"}),i("up")}catch(x){p(E(x,s("help.feedbackError")))}}}function j(){n(!0)}async function g(){if(t){p(null);try{await T({query_id:t,feedback:"down",comment:m.trim()||void 0}),i("down"),n(!1)}catch(x){p(E(x,s("help.feedbackError")))}}}return a?e.jsx("p",{className:"text-small text-bark-muted border-t border-bark/10 pt-4",children:s("help.feedbackThanks")}):e.jsxs("div",{className:"border-t border-bark/10 pt-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("p",{className:"text-small text-bark-muted",children:s("help.feedbackQuestion")}),e.jsx("button",{type:"button",onClick:h,"aria-label":s("help.feedbackYes"),className:"text-bark-muted hover:text-bark transition-colors",children:e.jsx(ee,{size:16,strokeWidth:1.5})}),e.jsx("button",{type:"button",onClick:j,"aria-label":s("help.feedbackNo"),className:"text-bark-muted hover:text-bark transition-colors",children:e.jsx(Z,{size:16,strokeWidth:1.5})})]}),o?e.jsxs("form",{onSubmit:x=>{x.preventDefault(),g()},className:"mt-3 flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:x=>u(x.target.value),placeholder:s("help.feedbackCommentPlaceholder"),maxLength:500,className:"flex-1 border border-bark/15 hover:border-bark/30 focus:border-bark/40 rounded-xs px-3 py-2 bg-bone/60 focus:bg-bone text-bark text-small placeholder:text-bark/40 focu
18s:outline-none"}),e.jsx("button",{type:"submit",className:"border border-bark text-bark hover:bg-bark hover:text-linen px-4 py-2 rounded-xs text-tiny uppercase tracking-[0.14em] transition-colors",children:s("acciones.enviar")})]}):null,c?e.jsx("p",{className:"mt-2 text-small text-brick-500",children:c}):null]})}function ue({category:t,onSelect:s}){return e.jsxs("button",{type:"button",onClick:()=>s(t),className:"text-left border border-bark/10 hover:border-bark/30 rounded-md px-5 py-4 transition-colors",children:[e.jsx("p",{className:"text-body text-bark mb-1",children:t.label}),e.jsx("p",{className:"text-small text-bark-muted leading-relaxed",children:t.description})]})}const I=[{slug:"configuracion",label:"Configuración",description:"Tema, idioma, color de acento y preferencias generales.",starterQuestion:"¿Cómo configuro el tema y los colores de la app?"},{slug:"pacientes",label:"Pacientes",description:"Crear, editar, archivar y gestionar fichas de pacientes.",starterQuestion:"¿Cómo creo o edito un paciente?"},{slug:"sesiones",label:"Sesiones",description:"Registrar encuentros, notas y plantillas por sesión.",starterQuestion:"¿Cómo registro una sesión y agrego una nota?"},{slug:"notas-privacidad",label:"Notas y privacidad",description:"Niveles de privacidad, encriptación E2E, compartir notas.",starterQuestion:"¿Cómo funciona la encriptación de notas privadas?"},{slug:"importar-pacientes",label:"Importar pacientes",description:"Cargar pacientes desde Excel o CSV y resolver duplicados.",starterQuestion:"¿Cómo importo pacientes desde Excel?"},{slug:"agenda",label:"Agenda",description:"Bloques horarios, tipos de sesión y sincronización con calendarios.",starterQuestion:"¿Cómo sincronizo mi agenda con Google Calendar?"},{slug:"ia-analisis",label:"IA y análisis",description:"Análisis de archivo, informes asistidos por IA y biblioteca.",starterQuestion:"¿Cómo aplico un marco teórico al archivo de un paciente?"},{slug:"pagos",label:"Pagos",description:"Honorarios, recibos y seguimiento de pagos pendientes.",starterQuestion:"¿Cómo registro un pago y emito un recibo?"},{slug:"cuenta",label:"Cuenta y suscripción",description:"Plan, facturación, datos de perfil y cancelación.",starterQuestion:"¿Cómo cambio mi plan o cancelo la suscripción?"},{slug:"seguridad",label:"Seguridad",description:"Verificación en dos pasos, recuperación de cuenta y audit log.",starterQuestion:"¿Cómo configuro la verificación en dos pasos?"}],Q=500,pe=[/\b(diagnostic[oa]s?|diagn[oó]stic[oa]s?)\b/i,/\b(dosis)\s+(de|para|adecuada|recomendada)\b/i,/\b(antidepresiv[oa]s?|ansiol[ií]tic[oa]s?|antipsic[oó]tic[oa]s?)\b/i,/\bsuicid(io|a|arse|ad)\b/i,/\bautolesi[oó]n\b/i,/\bmi\s+paciente\s+(tiene|presenta|sufre|padece)\b/i,/\bqu[eé]\s+hago\s+(con|si)\s+mi\s+paciente\b/i,/\bqu[eé]\s+significa\s+(el|la|los|las)?\s*(resultad|punta|score)/i,/\binterpret[a-záéíóú]+\s+(el|la|los|las)?\s*(test|escala|prueba|resultad[oa]s?)\b/i],me=[/\bc[oó]mo\s+(la\s+)?(registr|carg|guard|anot|escrib|configur|busc|filtr|export|import|edit|elimin|borr|crea?r?|agreg|asign)/i,/\bd[oó]nde\s+(registr|carg|guard|anot|escrib|configur|busc|filtr|export|import|edit|elimin|borr|crea?r?|agreg|asign)/i,/\bes\s+un\s+campo\b/i];function be(t){return me.some(s=>s.test(t))?!1:pe.some(s=>s.test(t))}function ke(){const{t}=C("common"),s=F(),[a]=G(),[i,o]=l.useState(""),[n,m]=l.useState(""),[u,c]=l.useState("idle"),[p,h]=l.useState(""),[j,g]=l.useState([]),[x,q]=l.useState(null),[O,v]=l.useState(null),[B,y]=l.useState(null),w=l.useRef(null),S=l.useRef(null);l.useEffect(()=>()=>{var r;(r=S.current)==null||r.abort()},[]),l.useEffect(()=>{var b;const r=a.get("cat");if(!r)return;const d=I.find(k=>k.slug===r);d&&(o(d.starterQuestion),(b=w.current)==null||b.focus())},[a]);const A=l.useCallback(async r=>{var k;const d=r.trim();if(!d)return;if(d.length>Q){c("error"),y(t("help.questionTooLong"));return}if(m(d),h(""),g([]),q(null),v(null),y(null),be(d)){c("blacklist"),v(se.blacklist);return}(k=S.current)==null||k.abort();const b=new AbortController;S.current=b,c("retrieving");try{for await(const N of ae({question:d,route:s.pathname,signal:b.signal}))he(N,{setStatus:c,setAnswer:h,setCitations:g,setQueryId:q,setOverlayMessage:v,setErrorMessage:y})}catch(N){if(b.signal.aborted)return;
18const D=N instanceof f?N.message:t("help.connectError");c("error"),y(D)}},[s.pathname,t]);function P(r){r.preventDefault(),A(i)}function H(r){var d;o(r.starterQuestion),(d=w.current)==null||d.focus(),A(r.starterQuestion)}return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"px-5 py-8 lg:px-12 lg:py-16",children:[e.jsxs("div",{className:"max-w-5xl",children:[e.jsxs("p",{className:"text-tiny font-medium uppercase tracking-[0.18em] text-terracotta-700 mb-6",children:["§ · ",t("help.marker")]}),e.jsx("h1",{className:"text-h1 font-sans text-bark mb-6",children:t("help.title")}),e.jsx("p",{className:"text-body text-bark-muted mb-10 leading-relaxed",children:t("help.intro")}),e.jsx("form",{onSubmit:P,className:"mb-3",children:e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"sr-only",children:t("help.questionLabel")}),e.jsx("input",{ref:w,type:"text",value:i,onChange:r=>o(r.target.value),maxLength:Q,placeholder:t("help.questionPlaceholder"),"aria-label":t("help.questionLabel"),className:"w-full border border-bark/15 hover:border-bark/30 focus:border-bark/40 rounded-xs px-5 py-4 bg-bone/60 focus:bg-bone text-bark text-body placeholder:text-bark/40 focus:outline-none transition-colors"})]})}),e.jsx("p",{className:"text-small text-bark-muted mb-12",children:t("help.disclaimer")}),u!=="idle"?e.jsx("div",{className:"mb-12",children:e.jsx(le,{status:u,questionAsked:n,answer:p,citations:j,message:O,queryId:x,errorMessage:B})}):null]}),e.jsxs("section",{className:"max-w-5xl",children:[e.jsx("p",{className:"text-tiny font-medium uppercase tracking-[0.18em] text-terracotta-700 mb-6",children:t("help.exploreByTopic")}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:I.map(r=>e.jsx(ue,{category:r,onSelect:H},r.slug))})]}),e.jsxs("section",{className:"max-w-5xl mt-20",children:[e.jsx("p",{className:"text-tiny font-medium uppercase tracking-[0.18em] text-terracotta-700 mb-6",children:t("help.articles")}),e.jsx("div",{className:"grid gap-12 md:grid-cols-2",children:Y.map(({category:r,articles:d})=>e.jsxs("div",{children:[e.jsx("h2",{className:"text-h3 font-sans text-bark mb-4",children:r}),e.jsx("ul",{className:"space-y-2",children:d.map(b=>e.jsx("li",{children:e.jsx(K,{to:`/dashboard/ayuda/${b.slug}`,className:"text-body text-bark-muted hover:text-bark transition-colors underline decoration-1 underline-offset-4",children:b.title})},b.slug))})]},r))})]}),e.jsxs("section",{className:"max-w-5xl mt-20",children:[e.jsx("p",{className:"text-tiny font-medium uppercase tracking-[0.18em] text-terracotta-700 mb-6",children:t("help.faqTitle")}),e.jsx("div",{className:"space-y-8",children:xe.map(r=>e.jsxs("div",{className:"border-t border-bark/10 pt-6",children:[e.jsx("h3",{className:"text-h4 font-sans text-bark mb-2",children:t(`help.faqQ${r}`)}),e.jsx("p",{className:"text-body text-bark-muted leading-relaxed",children:t(`help.faqA${r}`)})]},r))})]}),e.jsxs("section",{className:"max-w-5xl mt-20",children:[e.jsx("p",{className:"text-tiny font-medium uppercase tracking-[0.18em] text-terracotta-700 mb-6",children:t("help.contact")}),e.jsx("p",{className:"text-body text-bark-muted leading-relaxed mb-6",children:t("help.contactIntro")}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 border border-bark text-bark uppercase tracking-widest text-tiny rounded-full px-6 py-2.5 hover:bg-bark hover:text-linen transition-colors",children:"[email protected]"}),e.jsx("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 border border-bark/40 text-bark uppercase tracking-widest text-tiny rounded-full px-6 py-2.5 hover:bg-bark hover:text-linen transition-colors",children:t("help.dpoContact")}),e.jsx("button",{type:"button",onClick:async()=>{var r;try{const{data:d}=await _.auth.getUser();(r=d.user)!=null&&r.id&&V(d.user.id),window.location.assign("/dashboard")}catch{}},className:"inline-flex items-center gap-2 border border-bark/40 text-bark uppercase tracking-widest text-tiny rounded-full px-6 py-2.5 hover:bg-bark hover:text-linen transition-colors",children:t("help.showHintsAgain")})]})]})]})})}const xe=[1,2,3,4,5,6,7,8,9,10];function he(t,s){switch(t.type){case"phase":s.setStatus(t.phase==="retrieving"?"retrieving":"streaming");return;case"query":s.setQueryId(t.query_id);return;case"token":s.setAnswer(a=>a+t.text);return;case"citations":s.setCitations(t.citations);return;case"blacklist":s.setStatus("blacklist"),s.setOverlayMessage(t.message),s.setQueryId(t.query_id);return;case"fallback":s.setStatus("fallback"),s.setOverlayMessage(t.message),s.setQueryId(t.query_id);return;case"error":s.setStatus("error"),s.setErrorMessage(t.message);return;case"done":s.setStatus(a=>a==="blacklist"||a==="fallback"||a==="error"?a:"done"),t.query_id&&s.setQueryId(t.query_id);return}}export{ke as default,be as questionTriggersBlacklist};

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.