PageSourceSearch

https://thoughttidy.app/assets/legal._doc-Br7Ijy0R.js

js thoughttidy.app collected 2026-10-02 01:15:29 UTC 5,427 bytes, 7 lines download raw bytes

1import{b as f,r as c,D as g,j as e,L as j}from"./index-DzDw-ZtS.js";import{c as m,P as y,B as d}from"./PageShell-BRk26vZM.js";import{E as u}from"./external-link-BkpsVZJ8.js";const w=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],N=m("mail",w);const b=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],k=m("triangle-alert",b);function z(){const{doc:n}=f.useParams(),r=g[n],[a,t]=c.useState({status:"loading"});return c.useEffect(()=>{let l=!1;return t({status:"loading"}),fetch(r.url,{cache:"no-store"}).then(async s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);const o=await s.text();l||t({status:"ok",text:o})}).catch(()=>{l||t({status:"error"})}),()=>{l=!0}},[r.url]),e.jsx(y,{children:e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-20",children:[e.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-accent",children:"Legal"}),e.jsx("h1",{className:"mt-2 text-4xl font-semibold tracking-tight md:text-5xl",children:r.title}),e.jsx("p",{className:"mt-4 text-lg text-muted-foreground",children:r.description}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("a",{href:r.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 hover:text-foreground",children:[e.jsx(u,{className:"h-3.5 w-3.5"})," View raw source (",r.sourceLabel,")"]}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx(j,{to:"/legal/$doc",params:{doc:n==="privacy"?"eula":"privacy"},className:"hover:text-foreground",children:n==="privacy"?"Read the EULA":"Read the Privacy Policy"})]}),e.jsxs("div",{className:"mt-10",children:[a.status==="loading"&&e.jsx(v,{}),a.status==="ok"&&e.jsx($,{text:a.text}),a.status==="error"&&e.jsx(L,{title:r.title})]})]})})}function v(){return e.jsx("div",{className:"space-y-3","aria-busy":"true","aria-live":"polite",children:Array.from({length:8}).map((n,r)=>e.jsx("div",{className:"h-3 animate-pulse rounded bg-secondary",style:{width:`${60+r*37%35}%`}},r))})}function L({title:n}){const r=encodeURIComponent(`Legal docs not loading — ${n}`),a=encodeURIComponent(`Hi North Panda Labs,
2
3I tried to read the ${n} on thoughttidy and it failed to load.
4
5Thanks!`);return e.jsxs("div",{className:"rounded-xl border border-border bg-card p-6",children:[e.jsx("div",{className:"mb-3 inline-flex h-9 w-9 items-center justify-center rounded-lg bg-destructive/10 text-destructive",children:e.jsx(k,{className:"h-5 w-5"})}),e.jsx("h2",{className:"text-lg font-semibold",children:"We couldn't load this document"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Something went wrong fetching the ",n," from GitHub. Please contact us so we can fix it — let us know the legal docs are not working."]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(d,{asChild:!0,size:"sm",children:e.jsxs("a",{href:`mailto:[email protected]?subject=${r}&body=${a}`,children:[e.jsx(N,{className:"mr-1.5 h-4 w-4"})," Email [email protected]"]})}),e.jsx(d,{asChild:!0,size:"sm",variant:"outline",children:e.jsxs("a",{href:"https://raw.githubusercontent.com/northpandalabs/Thought-Tidy/refs/heads/main/legal/",target:"_blank",rel:"noreferrer",children:[e.jsx(u,{className:"mr-1.5 h-4 w-4"})," View on GitHub"]})})]})]})}function $({text:n}){const r=E(n);return e.jsx("article",{className:"space-y-5 text-[15px] leading-relaxed text-foreground/90",children:r.map((a,t)=>a.type==="h1"?e.jsx("h2",{className:"mt-8 text-2xl font-semibold tracking-tight text-foreground",children:a.text},t):a.type==="h2"?e.jsx("h3",{className:"mt-6 text-lg font-semibold tracking-tight text-foreground",children:a.text},t):a.type==="list"?e.jsx("ul",{className:"ml-5 list-disc space-y-1.5 marker:text-muted-foreground",children:a.items.map((l,s)=>e.jsx("li",{children:h(l)},s))},t):a.type==="hr"?e.jsx("hr",{className:"border-border"},t):e.jsx("p",{className:"whitespace-pre-wrap",children:h(a.text)},t))})}function E(n){const a=n.replace(/\r\n/g,`
6`).trim().split(/\n\s*\n/),t=[];for(const l of a){const s=l.replace(/\n+$/g,"");if(!s.trim())continue;if(/^[-=_*]{3,}$/.test(s.trim())){t.push({type:"hr"});continue}const o=s.split(`
7`);if(o.every(i=>/^\s*[-*•]\s+/.test(i))){t.push({type:"list",items:o.map(i=>i.replace(/^\s*[-*•]\s+/,""))});continue}if(o.length===1){const i=o[0].trim();if(/^#\s+/.test(i)){t.push({type:"h1",text:i.replace(/^#\s+/,"")});continue}if(/^##\s+/.test(i)){t.push({type:"h2",text:i.replace(/^##\s+/,"")});continue}const x=i.length<=80&&i===i.toUpperCase()&&/[A-Z]/.test(i)&&!i.endsWith("."),p=/^\d+\.\s+[A-Z][^.]{0,80}$/.test(i);if(x){t.push({type:"h1",text:i});continue}if(p){t.push({type:"h2",text:i});continue}}t.push({type:"p",text:s})}return t}function h(n){const r=[],a=/(https?:\/\/[^\s)]+|[\w.+-]+@[\w.-]+\.[A-Za-z]{2,})/g;let t=0,l;for(;l=a.exec(n);){l.index>t&&r.push(n.slice(t,l.index));const s=l[0],o=s.includes("@")?`mailto:${s}`:s;r.push({href:o,label:s}),t=l.index+s.length}return t<n.length&&r.push(n.slice(t)),r.map((s,o)=>typeof s=="string"?e.jsx("span",{children:s},o):e.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:s.label},o))}
7export{z as component};

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.