1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CobRY8C4.js","assets/index-DDfni-Mu.css"])))=>i.map(i=>d[i]); 2import{a0 as re,s as b,l as P,r as c,j as e,b5 as ne,I as ie,aN as le,k as j,B as I,O as oe,L as T,ar as ce,Z as de,aL as ue,R as me,C as pe,ad as ge,_ as F,i as K,D as fe,p as xe,q as he,t as je,aB as ve,b as ye,S as C,J as E,K as z,M as R,N as S,v as be,w as O,bM as _e,Q as ke,h as we,n as Ne,y as Se,A as Ie,cf as Le,bQ as Me,aH as Ae,aI as Te,aJ as V,e as De,X as A}from"./index-CobRY8C4.js";import{u as Ce}from"./useHasRM12License-DahK1hjI.js";import{h as q,a as D,M as L,b as B,d as Ee,c as G,e as U}from"./types-CWKmZm0C.js";import{ensurePdfMake as ze}from"./pdfmakeSetup-jY1X3cRL.js";import{L as Re}from"./link-2-DwQaa-SS.js";import"./keys-DOMHfaVa.js";import"./vfs_fonts-BwDagwDl.js";/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const Pe=re("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);async function Be(a){const{organizationId:t,isSuperuser:r}=a;let n=b.from("form_templates").select("id, name, description, material_category, organization_id, is_published, archived_at, updated_at").order("updated_at",{ascending:!1});!r&&t&&(n=n.or(`organization_id.eq.${t},organization_id.is.null`));const s=b.from("documents").select("id, filename, description, material_category, organization_id, program_id, program_step_id, step_group, visibility_scope, created_at").is("deleted_at",null).order("created_at",{ascending:!1}),[l,o]=await Promise.all([n,s]);if(l.error)throw l.error;if(o.error)throw o.error;const v=l.data??[],f=o.data??[],g=v.map(i=>i.id),u=new Map;if(g.length>0){const{data:i}=await b.from("template_bindings").select("template_id, situation_id").eq("situation_type","program_step").in("template_id",g);for(const m of i??[])u.has(m.template_id)||u.set(m.template_id,m.situation_id)}const h=new Set;for(const i of u.values())h.add(i);for(const i of f)i.program_step_id&&h.add(i.program_step_id);const y=new Map;if(h.size>0){const{data:i}=await b.from("program_steps").select("id, title").in("id",Array.from(h));for(const m of i??[])y.set(m.id,m.title)}const w=v.map(i=>{const m=u.get(i.id)??null;return{id:i.id,kind:"form",title:i.name,description:i.description,category:i.material_category,organizationId:i.organization_id,programId:null,programStepId:m,stepTitle:m?y.get(m)??null:null,stepGroup:null,isPublished:i.is_published,archivedAt:i.archived_at,visibilityScope:null,hasBinding:m!==null,updatedAt:i.updated_at}}),k=f.map(i=>({id:i.id,kind:"pdf",title:i.filename,description:i.description,category:i.material_category,organizationId:i.organization_id,programId:i.program_id,programStepId:i.program_step_id,stepTitle:i.program_step_id?y.get(i.program_step_id)??null:null,stepGroup:i.step_group,isPublished:!0,archivedAt:null,visibilityScope:i.visibility_scope,hasBinding:!1,updatedAt:i.created_at}));return[...w,...k]}async function Oe(a,t){const{error:r}=await b.from("form_templates").update({material_category:t}).eq("id",a);if(r)throw r;await Fe(a,"set_material_category",{material_category:t})}async function Ve(a,t){const{error:r}=await b.from("documents").update({material_category:t}).eq("id",a);if(r)throw r}async function $e(a,t){const r={};t.programId!==void 0&&(r.program_id=t.programId),t.programStepId!==void 0&&(r.program_step_id=t.programStepId),t.stepGroup!==void 0&&(r.step_group=t.stepGroup);const{error:n}=await b.from("documents").update(r).eq("id",a);if(n)throw n}async function Fe(a,t,r){try{await P("log_material_change",{_template_id:a,_action:t,_diff:r})}catch{}}async function Ke(a){const{data:t,error:r}=await b.from("program_steps").select("id, title, step_number, step_group").eq("program_id",a).order("sort_order",{ascending:!0});if(r)throw r;return t??[]}async function qe(){const{data:a,error:t}=await b.from("treatment_programs").select("id, name").eq("is_active",!0).order("name");if(t)throw t;return a??[]}const Ge={search:"",categories:[],kind:"all",showAllRegardlessOfTab:!1};function Ue(a){const{organizationId:t,isSuperuser:r}=a,[n,s]=c.useState([]),[l,o]=c.useState(!0),[v,f]=c.useState(null),g=c.useCallback(async()=>{o(!0),f(null);try{s(await Be({organizationId:t,isSuperuser:r}))}catch(u){f(u.message)}finally{o(!1)}},[t,r]);return c.useEffect(()=>{g()},[g]),{items:n,loading:l,error:v,refresh:g}}function He(a,t,r){const n=t.search.trim().toLowerCase();return a.filter(s=>!(t.kind!=="all"&&s.kind!==t.kind||!t.showAllRegardlessOfTab&&r!=="all"&&s.category!==r||t.categories.length>0&&(!s.category||!t.categories.includes(s.category))||n&&![s.title,s.description??"",s.stepTitle??"",s.stepGroup??"",s.category??""].join(" ").toLowerCase().includes(n)))}function Qe(a){return c.useMemo(()=>{let t=0,r=0,n=0;for(const s of a){const l=q(s);l==="uploaded"&&(t+=1),l==="published"&&(r+=1),l==="coupled"&&(n+=1)}return{uploaded:t,published:r,coupled:n,total:a.length}},[a])}function Je({filters:a,onChange:t}){const r=s=>{const l=a.categories.includes(s);t({...a,categories:l?a.categories.filter(o=>o!==s):[...a.categories,s]})},n=["all","pdf","form"];return e.jsxs("div",{className:"space-y-3 rounded-xl border bg-card p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ne,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(ie,{value:a.search,onChange:s=>t({...a,search:s.target.value}),placeholder:"Sök i allt material (namn, beskrivning, steg, kategori)â¦",className:"pl-9","aria-label":"Sök material"}),a.search&&e.jsx("button",{type:"button",onClick:()=>t({...a,search:""}),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Rensa sökning",children:e.jsx(le,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Kategori:"}),D.map(s=>{const l=a.categories.includes(s);return e.jsx(j,{role:"button",tabIndex:0,onClick:()=>r(s),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r(s))},variant:l?"default":"outline",className:"cursor-pointer select-none",children:L[s]},s)})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-1",children:n.map(s=>
7e.jsx(I,{type:"button",size:"sm",variant:a.kind===s?"default":"outline",onClick:()=>t({...a,kind:s}),children:s==="all"?"Alla typer":B[s]},s))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oe,{id:"show-all-materials",checked:a.showAllRegardlessOfTab,onCheckedChange:s=>t({...a,showAllRegardlessOfTab:s})}),e.jsx(T,{htmlFor:"show-all-materials",className:"text-sm text-muted-foreground",children:"Visa allt oavsett flik"})]})]})]})}function Xe({item:a}){const t=Ee(a),r=[{key:"uploaded",done:t.uploaded,icon:de},{key:"published",done:t.published,icon:Pe},{key:"coupled",done:t.coupled,icon:Re}];return e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:r.map(n=>{const s=n.done?ce:n.icon;return e.jsxs(j,{variant:n.done?"default":"outline",className:n.done?"gap-1":"gap-1 text-muted-foreground",children:[e.jsx(s,{className:"h-3 w-3"}),G[n.key]]},n.key)})})}function Ye({item:a,onDiagnose:t,demo:r}){const n=a.kind==="pdf"?ue:me,s=U(a);return e.jsxs(pe,{className:"flex flex-col gap-3 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(n,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",title:a.title,children:a.title}),a.description&&e.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:a.description})]})]}),e.jsx(j,{variant:"secondary",className:"shrink-0",children:B[a.kind]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.category?e.jsx(j,{variant:"outline",children:L[a.category]}):e.jsx(j,{variant:"outline",className:"text-amber-600",children:"Ingen kategori"}),a.stepTitle&&e.jsxs(j,{variant:"outline",children:["Steg: ",a.stepTitle]}),a.stepGroup&&!a.stepTitle&&e.jsxs(j,{variant:"outline",children:["Avsnitt: ",a.stepGroup]}),a.organizationId===null&&e.jsx(j,{variant:"outline",children:"Global"})]}),e.jsx(Xe,{item:a}),e.jsxs("div",{className:"mt-auto flex items-center justify-between gap-2 pt-1",children:[s.visibleInTabs?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-emerald-600",children:[e.jsx(ge,{className:"h-3.5 w-3.5"}),"Syns under flikarna"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-amber-600",children:[e.jsx(F,{className:"h-3.5 w-3.5"}),s.reasons.length===1?"1 sak att Ã¥tgärda":`${s.reasons.length} saker att Ã¥tgärda`]}),e.jsxs("div",{className:"flex items-center gap-1",children:[r&&e.jsxs(I,{size:"sm",variant:"outline",disabled:r.exhausted,onClick:()=>r.onOpen(a),children:[r.exhausted&&e.jsx(K,{className:"mr-1 h-3.5 w-3.5"}),"Ãppna"]}),e.jsx(I,{size:"sm",variant:"ghost",onClick:()=>t(a),children:"Varför syns det inte?"})]})]})]})}const x="__none__";function Ze({item:a,open:t,onOpenChange:r,onSaved:n}){const[s,l]=c.useState(x),[o,v]=c.useState([]),[f,g]=c.useState([]),[u,h]=c.useState(x),[y,w]=c.useState(x),[k,i]=c.useState(!1);if(c.useEffect(()=>{a&&(l(a.category??x),h(a.programId??x),w(a.programStepId??x),a.kind==="pdf"&&qe().then(v))},[a]),c.useEffect(()=>{u&&u!==x?Ke(u).then(g):g([])},[u]),!a)return null;const m=U(a),N=async()=>{i(!0);try{const d=s===x?null:s;a.kind==="form"?await Oe(a.id,d):(await Ve(a.id,d),await $e(a.id,{programId:u===x?null:u,programStepId:y===x?null:y})),O({title:"Sparat",description:"Materialet uppdaterades."}),n(),r(!1)}catch(d){O({title:"Kunde inte spara",description:d instanceof Error?d.message:"Okänt fel",variant:"destructive"})}finally{i(!1)}};return e.jsx(fe,{open:t,onOpenChange:r,children:e.jsxs(xe,{className:"max-h-[85vh] overflow-y-auto",children:[e.jsxs(he,{children:[e.jsx(je,{className:"truncate",children:a.title}),e.jsxs(ve,{children:["Varför materialet ",m.visibleInTabs?"syns":"inte syns"," under flikarna."]})]}),e.jsxs("div",{className:"space-y-4",children:[m.visibleInTabs?e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-emerald-50 p-3 text-sm text-emerald-700",children:[e.jsx(ye,{className:"h-4 w-4"}),"Materialet uppfyller alla krav och syns under kategoriflikarna."]}):e.jsx("ul",{className:"space-y-2",children:m.reasons.map(d=>e.jsxs("li",{className:"flex items-start gap-2 rounded-lg bg-amber-50 p-3 text-sm text-amber-700",children:[e.jsx(F,{className:"mt-0.5 h-4 w-4 shrink-0"}),d]},d))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"Kategori"}),e.jsxs(C,{value:s,onValueChange:l,children:[e.jsx(E,{children:e.jsx(z,{placeholder:"Välj kategori"})}),e.jsxs(R,{children:[e.jsx(S,{value:x,children:"Ingen kategori"}),D.map(d=>e.jsx(S,{value:d,children:L[d]},d))]})]})]}),a.kind==="pdf"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"Program"}),e.jsxs(C,{value:u,onValueChange:h,children:[e.jsx(E,{children:e.jsx(z,{placeholder:"Välj program"})}),e.jsxs(R,{children:[e.jsx(S,{value:x,children:"Inget program"}),o.map(d=>e.jsx(S,{value:d.id,children:d.name},d.id))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"Visa under steg / avsnitt"}),e.jsxs(C,{value:y,onValueChange:w,disabled:f.length===0,children:[e.jsx(E,{children:e.jsx(z,{placeholder:"Välj steg"})}),e.jsxs(R,{children:[e.jsx(S,{value:x,children:"Inget specifikt steg"}),f.map(d=>e.jsxs(S,{value:d.id,children:[d.step_group?`${d.step_group} â `:"",d.title]},d.id))]})]})]})]}),a.kind==="form"&&!a.hasBinding&&e.jsx("p",{className:"rounded-lg bg-muted/50 p-3 text-xs text-muted-foreground",children:"Stegkoppling av formulärmallar görs i programstegets redigeringsvy (mall-kopplingar per steg)."})]}),e.jsxs(be,{children:[e.jsx(I,{variant:"outline",onClick:()=>r(!1),disabled:k,children:"Stäng"}),e.jsx(I,{onClick:N,disabled:k,children:k?"Spararâ¦":"Spara ändringar"})]})]})})}function H(a){const t=a??{};return{used:t.used??0,viewLimit:t.view_limit??0,isLocked:t.is_locked??!1,remaining:t.remaining??0,allowed:t.allowed}}async function We(a){const{data:t,error:r}=await P("get_material_demo_status",{_program_id:a});if(r)throw r;return H(t)}async function ea(a){const{data:t,error:r}=await P("register_material_demo_view",{_material_kind:a.kind,_material_id:a.materialId,_program_id:a.programId,_organization_id:a.organizationId});if(r)throw r;return H(t)}async function aa(){var r;const{supabase:a}=await _e(async()=>{const{supabase:n}=await import("./index-CobRY8C4.js").then(s=>s.hS);return{supabase:n}},__vite__mapDeps([0,1])),{data:t}=await a.from("treatment_programs").select("id").eq("name","RM-12").limit(1);return((r=t==null?void 0:t[0])==null?void 0:r.id)??null}function ta({demoMode:a,programId:t,organizationId:r}){const[n,s]=c.useState(null),[l,o]=c.useState(a);c.useEffect(()=>{if(!a){s(null),o(!1);return}let g=!1;return o(!0),We(t).then(u=>{g||s(u)}).catch(()=>{g||s(null)}).finally(()=>{g||o(!1)}),()=>{g=!0}},[a,t]);const v=c.useCallback(async(g,u)=>{const h=await ea({kind:g,materialId:u,programId:t,organizationId:r});return s(h),h},[r,t]),f=a&&n!==null&&(n.isLocked||n.remaining<=0);return{status:n,loading:l,openMaterial:v,exhausted:f}}function $(a){const t=new Date(a);return Number.isNaN(t.getTime())?"â":t.toISOString().slice(0,10)}function sa(a){const t=new Map;for(const r of a){const n=r.category?L[r.category]:"Ingen kategori",s=t.get(n)??[];s.push(r),t.set(n,s)}return Array.from(t.entries()).map(([r,n])=>({label:r,items:n}))}async function ra(a){const t=await ze(),r=sa(a),n=[{text:"Materialbibliotek",style:"h1"}
7,{text:`Utskrift ${$(new Date().toISOString())} · ${a.length} material`,style:"meta"}];for(const s of r)n.push({text:`${s.label} (${s.items.length})`,style:"h2"}),n.push({table:{headerRows:1,widths:["*",55,70,60],body:[[{text:"Titel",bold:!0},{text:"Typ",bold:!0},{text:"Status",bold:!0},{text:"Uppdaterad",bold:!0}],...s.items.map(l=>[l.title,B[l.kind],G[q(l)],$(l.updatedAt)])]},layout:"lightHorizontalLines",margin:[0,0,0,12]});t.createPdf({pageSize:"A4",pageMargins:[36,40,36,40],content:n,defaultStyle:{fontSize:9},styles:{h1:{fontSize:16,bold:!0,margin:[0,0,0,2]},meta:{fontSize:9,color:"#6B7280",margin:[0,0,0,14]},h2:{fontSize:11,bold:!0,margin:[0,8,0,4]}}}).download("materialbibliotek.pdf")}function na({items:a,onDiagnose:t,demo:r}){const n=new Map;for(const s of a){const l=s.category?L[s.category]:"Ingen kategori",o=n.get(l)??[];o.push(s),n.set(l,o)}return e.jsx("div",{className:"space-y-8",children:Array.from(n.entries()).map(([s,l])=>e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2 border-b pb-2",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:s}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[l.length," material"]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:l.map(o=>e.jsx(Ye,{item:o,onDiagnose:t,demo:r??void 0},`${o.kind}-${o.id}`))})]},s))})}function ia({status:a}){return a?a.isLocked||a.viewLimit===0?e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:[e.jsx(K,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"Materialet är lÃ¥st i demoläge. Licensgivaren har valt att inte visa nÃ¥got innehÃ¥ll utan licens â kontakta oss för att lÃ¥sa upp."})]}):e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:[e.jsx(ke,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Demoläge: du kan öppna ",a.viewLimit," material utan licens."," ",a.remaining>0?`${a.remaining} av ${a.viewLimit} Ã¥terstÃ¥r.`:"Du har använt alla demovisningar â kontakta oss för licens."]})]}):null}function ga(){const{hasRole:a}=we(),t=Ne(),r=a("superuser"),n=r||a("therapist")||a("company_admin")||a("conglomerate_admin"),{items:s,loading:l,error:o,refresh:v}=Ue({organizationId:t,isSuperuser:r}),[f,g]=c.useState(Ge),[u,h]=c.useState("all"),[y,w]=c.useState(null),[k,i]=c.useState(!1),m=Qe(s),N=c.useMemo(()=>He(s,f,u),[s,f,u]),d=c.useMemo(()=>{const p=new Map;p.set("all",s.length);for(const _ of D)p.set(_,s.filter(se=>se.category===_).length);return p},[s]),Q=p=>{w(p),i(!0)},J=Ce(r?void 0:t??void 0),M=!r&&J===!1,[X,Y]=c.useState(null);c.useEffect(()=>{if(!M)return;let p=!1;return aa().then(_=>{p||Y(_)}).catch(()=>{}),()=>{p=!0}},[M]);const{status:Z,openMaterial:W,exhausted:ee}=ta({demoMode:M,programId:X,organizationId:t}),ae=async p=>{try{const _=await W(p.kind,p.id);if(!_.allowed){A.error("Demovisningarna är förbrukade. Kontakta oss för licens.");return}A.success(_.remaining>0?`${p.title} öppnad. ${_.remaining} demovisningar kvar.`:`${p.title} öppnad. Detta var din sista demovisning.`)}catch{A.error("Kunde inte registrera demovisningen.")}},te=async()=>{try{await ra(N)}catch{A.error("Kunde inte skapa PDF.")}};return n?e.jsxs("div",{className:"mx-auto max-w-[1200px] space-y-6 px-4 py-8",children:[e.jsxs("div",{children:[e.jsxs(Se,{to:"/",className:"mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(Ie,{className:"h-4 w-4"}),"Tillbaka"]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Materialbibliotek"})]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:te,disabled:l||N.length===0,children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Skriv ut som PDF"]})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Allt behandlingsmaterial samlat â fördjupningsuppgifter, manualer och PDF:er per kategori."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-xs",children:[e.jsxs(j,{variant:"outline",children:[m.total," totalt"]}),e.jsxs(j,{variant:"outline",children:[m.coupled," kopplade"]}),e.jsxs(j,{variant:"outline",children:[m.published," publicerade (ej kopplade)"]}),e.jsxs(j,{variant:"outline",children:[m.uploaded," endast uppladdade"]})]})]}),M&&e.jsx(ia,{status:Z}),e.jsx(Je,{filters:f,onChange:g}),e.jsx(Ae,{value:u,onValueChange:p=>h(p),children:e.jsxs(Te,{className:"flex-wrap",children:[e.jsxs(V,{value:"all",children:["Alla (",d.get("all")??0,")"]}),D.map(p=>e.jsxs(V,{value:p,children:[L[p]," (",d.get(p)??0,")"]},p))]})}),l?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(De,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):o?e.jsxs("div",{className:"rounded-xl border bg-card p-8 text-center text-sm text-destructive",children:["Kunde inte ladda material: ",o]}):N.length===0?e.jsx("div",{className:"rounded-xl border bg-card p-10 text-center text-sm text-muted-foreground",children:"Inget material matchar filtren."}):e.jsx(na,{items:N,onDiagnose:Q,demo:M?{exhausted:ee,onOpen:ae}:null}),e.jsx(Ze,{item:y,open:k,onOpenChange:i,onSaved:v})]}):e.jsx("div",{className:"mx-auto max-w-3xl px-4 py-10",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Du har inte Ã¥tkomst till materialbiblioteket."})})}export{ga 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.