Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.3 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.4 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.4 (pull_request) Has been skipped
CI / Browser-Tests (pull_request) Failing after 19m38s
CI / PHP 8.3 / mysql:8.4-1 (pull_request) Successful in 24m17s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 9m13s
CI / Build-Artefakte aktuell (pull_request) Successful in 6m4s
Antworten mit Quellen aus Seiten, QM-Dokumenten, Glossar und Neuigkeiten – nur aus Sichtbarem, über den KI-Assistenten (Anthropic, OpenAI, Ollama). Wissensquellen als Registry für Plugins, Auswertung ohne Personenbezug. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 lines
No EOL
7.5 KiB
JavaScript
2 lines
No EOL
7.5 KiB
JavaScript
import{Nt as e,Ot as t,P as n}from"./ui-DY0WbyhT.js";import{At as r,C as i,O as a,S as o,T as s,Tt as c,V as ee,W as l,Y as u,_t as d,g as f,h as te,k as p,ot as m,p as ne,q as h,st as g,v as _,w as v,x as y}from"./framework-Cy4cevSy.js";import{t as re}from"./search-x-0wR3oofw.js";import{A as ie,H as ae,Pt as b,d as x,f as oe,p as se}from"./app-D39ss9YM.js";var S=e({name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]}),C={class:`grid min-w-0 grid-cols-1 gap-5`},w={class:`flex flex-col gap-2 rounded-xl border bg-card p-2 shadow-xs focus-within:border-brand-400 focus-within:ring-3 focus-within:ring-ring/30 sm:flex-row sm:items-end`},T={key:0,class:`flex flex-wrap gap-2`},E=[`onClick`],D={"aria-live":`polite`,class:`grid min-w-0 grid-cols-1 gap-5`},O={class:`flex items-center gap-3 text-muted-foreground`},k={key:1,class:`rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive`},A={class:`mb-3 text-sm font-medium text-muted-foreground`},j={class:`grid grid-cols-1 gap-3 text-base leading-relaxed`},M={key:0},N=[`href`,`aria-label`],P={key:1,class:`grid list-disc gap-1.5 pl-5`},F=[`href`,`aria-label`],I={class:`grid grid-cols-1 gap-2`},L=[`id`],R=[`href`],z={class:`grid size-6 shrink-0 place-items-center rounded-full bg-brand-soft text-xs font-semibold text-brand-text`},B={class:`min-w-0 flex-1`},ce={class:`block font-medium group-hover:underline`},V={class:`block truncate text-xs text-muted-foreground`},H={class:`flex items-start gap-3`},U={class:`grid gap-1`},W={class:`font-medium`},G={key:0,class:`mt-4 grid grid-cols-1 gap-2`},le=[`href`],ue={class:`min-w-0 truncate`},de={class:`text-muted-foreground`},fe={class:`flex items-start gap-2 text-xs text-muted-foreground`},K={__name:`Index`,props:{question:{type:String,default:``},sources:{type:Array,default:()=>[]},provider:{type:String,default:null}},setup(e){let K=e,q=d(K.question),J=d(``),Y=d(!1),X=d(``),Z=d(null),Q=d(null),pe=[`Wie beantrage ich Urlaub?`,`Was mache ich bei einem Arbeitsunfall?`,`Wer ist in der Mitarbeitervertretung?`];async function $(e=q.value){let t=e.trim();if(!(t.length<3||Y.value)){q.value=t,J.value=t,Y.value=!0,X.value=``,Z.value=null,window.history.replaceState(window.history.state,``,`/frag-das-portal?frage=${encodeURIComponent(t)}`);try{Z.value=await ie.post(`/frag-das-portal`,{question:t})}catch(e){X.value=e.status===429?`Sie haben gerade viele Fragen gestellt. Bitte einen Moment warten.`:e.data?.errors?.question?.[0]??e.message}finally{Y.value=!1}}}let me=y(()=>{if(!Z.value?.found)return[];let e=new Set(Z.value.sources.map(e=>e.n)),t=t=>t.split(/(\[\d+\])/).filter(Boolean).map(t=>{let n=t.match(/^\[(\d+)\]$/);return n&&e.has(Number(n[1]))?{cite:Number(n[1])}:{text:t}}),n=[];for(let e of Z.value.answer.split(`
|
||
`)){let r=e.trim();if(r){if(/^[-•*]\s+/.test(r)){let e=n[n.length-1],i=t(r.replace(/^[-•*]\s+/,``));e?.type===`list`?e.items.push(i):n.push({type:`list`,items:[i]})}else n.push({type:`p`,segments:t(r)})}}return n});return l(()=>{K.question?$(K.question):ee(()=>Q.value?.focus())}),(ee,l)=>(h(),i(oe,{title:`Frag das Portal`,width:`medium`},{default:m(()=>[p(se,{title:`Frag das Portal`,description:`Stellen Sie eine Frage – die Antwort kommt aus ${e.sources.length?e.sources.join(`, `):`den Inhalten des Portals`}.`,icon:`message-circle-question`},null,8,[`description`]),o(`div`,C,[o(`form`,{class:`grid min-w-0 gap-3`,onSubmit:l[2]||=f(e=>$(),[`prevent`])},[l[4]||=o(`label`,{for:`ask-question`,class:`sr-only`},`Ihre Frage`,-1),o(`div`,w,[g(o(`textarea`,{id:`ask-question`,ref_key:`field`,ref:Q,"onUpdate:modelValue":l[0]||=e=>q.value=e,rows:`2`,maxlength:`300`,placeholder:`z. B. Wie beantrage ich eine Fortbildung?`,class:`min-h-14 w-full min-w-0 flex-1 resize-none bg-transparent px-2 py-1.5 text-base outline-none placeholder:text-muted-foreground`,onKeydown:l[1]||=te(f(e=>$(),[`exact`,`prevent`]),[`enter`])},null,544),[[ne,q.value]]),p(c(n),{type:`submit`,disabled:Y.value||q.value.trim().length<3,class:`shrink-0`},{default:m(()=>[Y.value?(h(),i(c(t),{key:0,class:`animate-spin`})):(h(),i(c(ae),{key:1})),l[3]||=a(` Fragen `,-1)]),_:1},8,[`disabled`])]),J.value?v(``,!0):(h(),s(`div`,T,[(h(),s(_,null,u(pe,e=>o(`button`,{key:e,type:`button`,class:`rounded-pill border bg-card px-3.5 py-1.5 text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:t=>$(e)},r(e),9,E)),64))]))],32),o(`div`,D,[Y.value?(h(),i(x,{key:0},{default:m(()=>[o(`div`,O,[p(c(t),{class:`size-5 animate-spin text-brand`}),l[5]||=a(` Ich suche im Portal nach einer Antwort … `,-1)])]),_:1})):X.value?(h(),s(`p`,k,r(X.value),1)):Z.value?(h(),s(_,{key:2},[Z.value.found?(h(),i(x,{key:0},{default:m(()=>[o(`p`,A,r(J.value),1),o(`div`,j,[(h(!0),s(_,null,u(me.value,(e,t)=>(h(),s(_,{key:t},[e.type===`p`?(h(),s(`p`,M,[(h(!0),s(_,null,u(e.segments,(e,t)=>(h(),s(_,{key:t},[e.cite?(h(),s(`a`,{key:0,href:`#quelle-${e.cite}`,class:`mx-0.5 align-super text-xs font-semibold text-brand-text hover:underline`,"aria-label":`Quelle ${e.cite}`},`[`+r(e.cite)+`]`,9,N)):(h(),s(_,{key:1},[a(r(e.text),1)],64))],64))),128))])):(h(),s(`ul`,P,[(h(!0),s(_,null,u(e.items,(e,t)=>(h(),s(`li`,{key:t},[(h(!0),s(_,null,u(e,(e,t)=>(h(),s(_,{key:t},[e.cite?(h(),s(`a`,{key:0,href:`#quelle-${e.cite}`,class:`mx-0.5 align-super text-xs font-semibold text-brand-text hover:underline`,"aria-label":`Quelle ${e.cite}`},`[`+r(e.cite)+`]`,9,F)):(h(),s(_,{key:1},[a(r(e.text),1)],64))],64))),128))]))),128))]))],64))),128))]),l[6]||=o(`h2`,{class:`mt-6 mb-2 text-sm font-semibold`},`Quellen`,-1),o(`ol`,I,[(h(!0),s(_,null,u(Z.value.sources,e=>(h(),s(`li`,{id:`quelle-${e.n}`,key:e.n},[o(`a`,{href:e.url,class:`group flex items-start gap-3 rounded-lg border bg-background px-3 py-2.5 hover:border-brand-300 hover:bg-accent`},[o(`span`,z,r(e.n),1),o(`span`,B,[o(`span`,ce,r(e.title),1),o(`span`,V,[a(r(e.label),1),e.meta?(h(),s(_,{key:0},[a(` · `+r(e.meta),1)],64)):v(``,!0)])]),p(c(b),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})],8,R)],8,L))),128))]),l[7]||=o(`p`,{class:`mt-4 text-xs text-muted-foreground`},`Automatisch zusammengefasst – im Zweifel gilt, was in den Quellen steht.`,-1)]),_:1})):(h(),i(x,{key:1},{default:m(()=>[o(`div`,H,[p(c(re),{class:`mt-0.5 size-5 shrink-0 text-muted-foreground`}),o(`div`,U,[o(`p`,W,r(Z.value.answer),1),l[8]||=o(`p`,{class:`text-sm text-muted-foreground`},`Versuchen Sie es mit anderen Worten – oder fragen Sie direkt Ihre Ansprechpersonen.`,-1)])]),Z.value.suggestions.length?(h(),s(`div`,G,[l[9]||=o(`p`,{class:`text-sm font-medium`},`Vielleicht hilft Ihnen das weiter:`,-1),(h(!0),s(_,null,u(Z.value.suggestions,e=>(h(),s(`a`,{key:e.url,href:e.url,class:`flex items-center justify-between gap-3 rounded-lg border bg-background px-3 py-2 text-sm hover:bg-accent`},[o(`span`,ue,[a(r(e.title)+` `,1),o(`span`,de,`· `+r(e.label),1)]),p(c(b),{class:`size-4 shrink-0 text-muted-foreground`})],8,le))),128))])):v(``,!0)]),_:1}))],64)):v(``,!0)]),o(`p`,fe,[p(c(S),{class:`mt-px size-3.5 shrink-0`}),o(`span`,null,[l[10]||=a(` Gesucht wird nur in Inhalten, die Sie sehen dürfen. Fragen werden ohne Ihren Namen gespeichert, damit die Redaktion fehlende Inhalte ergänzen kann. `,-1),e.provider?(h(),s(_,{key:0},[a(` Die Frage und passende Textstellen werden zur Beantwortung an `+r(e.provider)+` übermittelt.`,1)],64)):v(``,!0)])])])]),_:1}))}};export{K as default}; |