1import{p as J,s as E,w as X,j as e,b8 as k,a as P,bc as Z,d as U,e as u,g as b,b2 as ee,r as te,aG as v,b4 as se,a5 as ae,aW as ne,T as re,P as V}from"./index-B-XoyWcT.js";import{R as M,C as ie,e as le,L as oe,U as ce}from"./AttachmentLinkPreview-DDVRxX8-.js";import{n as H}from"./note-body-migration-C-Y9HSTg.js";import{n as q,H as de}from"./HashtagChip-CefVyJh6.js";import{i as pe,h as me,e as xe,g as O}from"./date-utils-CvIgZV1q.js";import{E as D,C as ue}from"./bookmark-category-icon-UWKt-qQw.js";import{p as he,u as fe}from"./page-images-DcWcmD1O.js";import{L as ge}from"./link-2-Bdz0DboY.js";import"./mask-email-BqD4ixP4.js";import"./copy-FCNkX7J-.js";import"./book-open-Tq5SwSgt.js";import"./palette-foKruS-W.js";const R="omanote_public_share_viewer_token";function je(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Ne(){const t=J(R,E);if(t)return t;const a=je();return X(R,E,a),a}function I(t){try{return new URL(t).hostname.replace(/^www\./,"")}catch{return t}}function y({runs:t,text:a}){return!t||t.length===0?e.jsx(e.Fragment,{children:a}):e.jsx(e.Fragment,{children:t.map((i,n)=>{let r=i.text;i.code&&(r=e.jsx("code",{className:"rounded bg-app-surface-muted px-1.5 py-0.5 font-mono text-[0.92em] text-app-ink",children:r})),i.bold&&(r=e.jsx("strong",{children:r})),i.italic&&(r=e.jsx("em",{children:r})),i.strike&&(r=e.jsx("s",{children:r})),i.underline&&(r=e.jsx("u",{children:r}));const c=i.href?q(i.href):null;return c&&(r=e.jsx("a",{href:c,target:"_blank",rel:"noreferrer nofollow",className:"underline decoration-2 underline-offset-2",children:r})),e.jsx("span",{children:r},n)})})}const _=["list-disc","list-[circle]","list-[square]"],B=["list-decimal","list-[lower-alpha]","list-[lower-roman]"];function G(t,a){const i=t[a].depth??0,n={kind:t[a].listKind??"bullet",depth:i,items:[]};let r=a;for(;r<t.length&&t[r].type==="listItem"&&(t[r].depth??0)>=i;)if((t[r].depth??0)===i)n.items.push({block:t[r],children:null}),r+=1;else{const{node:c,next:d}=G(t,r);n.items[n.items.length-1].children=c,r=d}return{node:n,next:r}}function W({node:t}){const a=t.kind==="bullet"?"ul":"ol",i=t.kind==="bullet"?_[t.depth%_.length]:B[t.depth%B.length];return e.jsx(a,{className:P("pl-5",t.depth===0?"m-0":"mt-1 mb-0",i),children:t.items.map((n,r)=>e.jsxs("li",{className:P("marker:text-app-ink-faint text-app-ink",t.depth===0?"mb
1-2 mt-0":"m-0"),children:[e.jsx(y,{runs:n.block.runs,text:n.block.text}),n.children?e.jsx(W,{node:n.children}):null]},r))})}function be({block:t}){var n,r,c,d,h,o;const a=q(t.url??"");return a?!((n=t.title)!=null&&n.trim()||(r=t.description)!=null&&r.trim()||(c=t.thumbnailUrl)!=null&&c.trim())?e.jsxs("a",{href:a,target:"_blank",rel:"noreferrer nofollow",className:"group flex items-center gap-2 rounded-2xl border border-app-line bg-app-surface p-3 text-sm font-medium text-app-ink no-underline transition hover:bg-app-surface-hover",children:[e.jsx(ge,{className:"h-4 w-4 shrink-0 text-app-ink-faint"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:I(a)}),e.jsx(D,{className:"h-4 w-4 shrink-0 text-app-ink-faint opacity-0 transition group-hover:opacity-100"})]}):e.jsxs("a",{href:a,target:"_blank",rel:"noreferrer nofollow",className:"group flex items-center gap-3 rounded-2xl border border-app-line bg-app-surface p-3 no-underline transition hover:bg-app-surface-hover",children:[t.thumbnailUrl?e.jsx("img",{src:t.thumbnailUrl,alt:"",className:"h-16 w-24 shrink-0 rounded-xl border border-app-line object-cover"}):null,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-semibold text-app-ink",children:((d=t.title)==null?void 0:d.trim())||I(a)}),(h=t.description)!=null&&h.trim()?e.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-app-ink-muted",children:t.description}):null,e.jsx("p",{className:"mt-1 truncate text-xs text-app-ink-faint",children:((o=t.siteName)==null?void 0:o.trim())||I(a)})]}),e.jsx(D,{className:"h-4 w-4 shrink-0 self-start text-app-ink-faint opacity-0 transition group-hover:opacity-100"})]}):null}function we({blocks:t}){const a=[];let i=0;for(;i<t.length;){const n=t[i],r=`${n.type}-${i}`;if(n.type==="listItem"){const{node:c,next:d}=G(t,i);a.push(e.jsx(W,{node:c},r)),i=d;continue}switch(n.type){case"heading":{const c=n.level??2,d=c===1?"text-2xl font-bold text-app-ink":c===2?"text-xl font-bold text-app-ink":"text-lg font-semibold text-app-ink";a.push(e.jsx("p",{className:`${d} mt-3`,children:e.jsx(y,{runs:n.runs,text:n.text})},r));break}case"todo":a.push(e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{"aria-hidden":"true",className:["mt-1.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border",n.checked?"border-app-accent bg-app-accent text-app-surface":"border-app-line-strong"].join(" "),children:n.checked?e.jsx("svg",{viewBox:"0 0 12 12",className:"h-3 w-3",children:e.jsx("path",{d:"M2.5 6.5l2.5 2.5 4.5-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),e.jsx("span",{className:n.checked?"text-app-ink-faint line-through":"text-app-ink",children:e.jsx(y,{runs:n.runs,text:n.text})})]},r));break;case"link":a.push(e.jsx(be,{block:n},r));break;case"quote":a.push(e.jsx("blockquote",{className:"border-l-2 border-app-line-strong pl-4 text-app-ink-muted",children:e.jsx(y,{runs:n.runs,text:n.text})},r));break;case"code":a.push(e.jsx("pre",{className:"overflow-x-auto rounded-xl bg-app-surface-muted p-3 font-mono text-sm text-app-ink",children:n.text},r));break;case"image":n.url&&a.push(e.jsx("img",{src:he(n.url),alt:"",loading:"lazy",className:"max-h-[520px] w-full rounded-2xl border border-app-line object-contain"},r));break;case"divider":a.push(e.jsx("hr",{className:"my-3 border-t border-app-line"},r));break;default:a.push(e.jsx("p",{className:"text-app-ink",children:e.jsx(y,{runs:n.runs,text:n.text})},r))}i+=1}return e.jsx("div",{className:"flex flex-col gap-3 whitespace-pre-line",children:a})}function ve({canvas:t,onUnshare:a,formatDate:i}){return e.jsx("div",{className:"public-page min-h-screen bg-app-canvas",children:e.jsxs("div",{className:"mx-auto w-full max-w-[720px] px-5 py-10",children:[e.jsxs("div",{className:"mb-8 flex items-center justify-between gap-3",children:[e.jsx(k,{to:"/",className:"flex items-center gap-2 text-app-ink",children:e.jsx("img",{src:"/logo.svg",alt:"Omanote",className:"h-7 w-auto"})}),t.isOwner?e.jsx("button",{type:"button",onClick:a,className:"rounded-full border border-app-line px-3 py-1 text-xs font-medium text-app-ink-muted transition hover:bg-app-surface-hover",children:"Stop sharing"}):null]}),e.jsx("h1",{className:"text-3xl font-bold text-app-ink md:text-4xl",children:t.title.trim()||"Untitled page"}),t.description?e.jsx("p",{className:"mt-2 text-sm text-app-ink-muted",children:t.description}):null,e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-xs text-app-ink-faint",children:[t.ownerImageUrl?e.jsx("img",{src:t.ownerImageUrl,alt:"",className:"h-5 w-5 rounded-full"}):null,e.jsx("span",{children:t.ownerName}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{children:[t.viewCount," ",t.viewCount===1?"view":"views"]}),t.snapshotUpdatedAt?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{children:["Updated ",i(t.snapshotUpdatedAt)]})]}):null]}),e.jsx("div",{className:"mt-8",children:t.blocks.length===0?e.jsx("p",{className:"text-sm text-app-ink-faint",children:"This page is empty."}):e.jsx(we,{blocks:t.blocks})})]})})}function L({name:t,imageUrl:a}){const i=t.trim().charAt(0).toUpperCase()||"?";return a?e.jsxs("div",{className:"relative h-6 w-6 overflow-hidden rounded-full bg-app-line",children:[e.jsx("div",{className:"flex h-full w-full items-center justify-center text-[10px] font-bold uppercase text-app-ink-muted",children:i}),e.jsx("img",{src:a,alt:t,referrerPolicy:"no-referrer",className:"absolute inset-0 h-full w-full rounded-full object-cover",onError:n=>{n.currentTarget.style.display="none"}})]}):e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-app-line text-[10px] font-bold uppercase text-app-ink-muted",children:i})}function ke({bookmark:t}){var h,o,p,f,w;let a=t.url;try{a=new URL(t.url).hostname.replace(/^www\./,"")}catch{a=t.url}const i=((h=t.siteName)==null?void 0:h.trim())||a,n=((o=t.faviconUrl)==null?void 0:o.trim())||void 0,r=((p=t.thumbnailUrl)==null?void 0:p.trim())||void 0,c=((f=t.title)==null?void 0:f.trim())||a,d=((w=t.description)==null?void 0:w.trim())||void 0;return e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col overflow-hidden rounded-2xl border border-app-line bg-app-surface transition hover:border-app-line hover:shadow-sm",children:[e.jsx("div",{className:"aspect-[2/1] w-full overflow-hidden bg-app-surface-muted",children:e.jsxs("div",{className:"relative h-full w-full",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-app-ink-faint",children:e.jsx(V,{className:"h-8 w-8"})}),r&&e.jsx("img",{src:r,alt:"",referrerPolicy:"no-referrer",className:"relative z-10 h-full w-full object-cover transition group-hover:scale-[1.02]",onError:N=>{N.currentTarget.style.display="none"}})]})}),e.jsxs("div",{className:"flex flex-col gap-1.5 p-4",children:[e.jsx("p",{className:"line-clamp-2 text-[15px] font-bold leading-snug text-app-ink",children:c}),d&&e.jsx("p",{className:"line-clamp-2 text-sm leading-relaxed text-app-ink-muted",children:d}),e.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[n&&e.jsxs("div",{className:"relative h-4 w-4 flex-shrink-0 overflow-hidden rounded-sm bg-app-surface-muted text-app-ink-faint",children:[e.jsx(V,{className:"absolute inset-0 h-3.5 w-3.5"}),e.jsx("img",{src:n,alt:"",referrerPolicy:"no-referrer",className:"absolute inset-0 h-full w-full object-contain",onError:N=>{N.currentTarget.style.display="none"}})]}),e.jsx("span",{className:"truncate text-xs text-app-ink-faint",children:i}),e.jsx(D,{className:"ml-auto h-3 w-3 flex-shrink-0 text-app-ink-faint opacity-0 transition group-hover:opacity-100"})]})]})]})}function ye({note:t}){const a=H(t.body);return e.jsxs("div",{children:[e.jsx("div",{className:"text-sm leading-relaxed text-app-ink-muted",children:e.jsx(M,{value:a,paragraphClassName:"text-sm leading-relaxed text-app-ink-muted break-words"})}),t.tags.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.tags.map(i=>e.jsx(de,{name:i},i))})]})}function Ce({notes:t,linkViewMode:a}){const i=le(...t.flatMap(n=>[n.title,H(n.body)]));return i.length===0?null:e.jsxs("div",{className:"mt-2 rounded-2xl border border-app-line bg-app-surface px-6 py-6",children:[e.jsx("p",{className:"mb-3 text-xs font-bold uppercase text-app-ink-faint",children:"Attached links"}),a==="list"?e.jsx("ol",{className:"list-outside list-decimal space-y-2 pl-5",children:i.map(n=>e.jsx("li",{children:e.jsx(oe,{url:n})},n))}):e.jsx("div",{className:"flex flex-col gap-2",children:i.map(n=>e.jsx(ce,{url:n},n))})]})}function z(t){return[...t].sort((a,i)=>{const n=a.dueDateKey!=null,r=i.dueDateKey!=null;if(n&&r){if(a.dueDateKey<i.dueDateKey)return-1;if(a.dueDateKey>i.dueDateKey)return 1;if(a.dueTime&&i.dueTime){if(a.dueTime<i.dueTime)return-1;if(a.dueTime>i.dueTime)return 1}return a.dueTime?-1:i.dueTime?1:a.title.localeCompare(i.title)}return n?-1:r?1:a.title.localeCompare(i.title)})}function Ue(t,a){const i=new Map,n=[];for(const o of t){if(!o.dueDateKey){n.push(o);continue}const p=i.get(o.dueDateKey)??[];p.push(o),i.set(o.dueDateKey,p)}const r=[],c=[],d=[];for(const[o,p]of i){const f=z(p);if(o===a)c.push({key:o,title:"Today",todos:f});else if(o<a){const w=f.some(N=>N.status==="open");r.push({key:o,title:w?xe(o):O(o),todos:f})}else d.push({key:o,title:O(o),todos:f})}r.sort((o,p)=>p.key.localeCompare(o.key)),d.sort((o,p)=>o.key.localeCompare(p.key));const h=[...r,...c,...d];return n.length>0&&h.push({key:"no-date",title:"No date",todos:z(n)}),h}function T(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Oe(){const{shareCode:t}=Z(),a=U(u.sharedTodoFolders.getPublicShare,{shareCode:t??""}),i=U(u.sharedFolders.getPublicShare,{shareCode:t??""}),n=U(u.sharedNoteFolders.getPublicShare,{shareCode:t??""}),r=U(u.sharedPages.getPublicShare,{shareCode:t??""}),c=b(u.sharedTodoFolders.recordShareView),d=b(u.sharedFolders.recordShareView),h=b(u.sharedNoteFolders.recordShareView),o=b(u.sharedPages.recordShareView),p=b(u.sharedFolders.unshareFromPublicPage),f=b(u.sharedNoteFolders.unshareFromPublicPage),w=b(u.sharedPages.unshareFromPublicPage),{getToken:N}=ee(),C=a!=null,S=!C&&n!==void 0&&n!==null,F=!C&&!S&&r!==void 0&&r!==null,g=a??i??n??r,Q=C?c:S?h:F?o:d,Y=a!==void 0&&i!==void 0&&n!==void 0&&r!==void 0;if(te.useEffect(()=>{!t||g===void 0||g===null||Q({shareCode:t,viewerToken:Ne()})},[t,g!=null]),!Y)return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"omanote | Shared folder",noIndex:!0}),e.jsx("div",{className:"public-page flex min-h-screen items-center justify-center bg-app-canvas",children:e.jsx(se,{className:"h-8 w-8"})})]});if(g==null)return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"omanote | Shared folder",noIndex:!0}),e.jsxs("div",{className:"public-page flex min-h-screen flex-col items-center justify-center gap-4 bg-app-canvas px-4",children:[e.jsx(k,{to:"/",className:"flex items-center gap-2 text-app-ink",children:e.jsx("img",{src:"/logo.svg",alt:"Omanote",className:"h-7 w-auto"})}),e.jsx("p",{className:"text-sm text-app-ink-muted",children:"This link is no longer available."})]})]});if(F){const s=r;return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:`${s.title||"Untitled page"} | omanote`,description:s.description??void 0,ogImage:s.thumbnailUrl??void 0,noIndex:!0}),e.jsx(ve,{canvas:s,formatDate:m=>
1m?T(m):"",onUnshare:()=>{t&&w({shareCode:t}).then(m=>fe(m??[],()=>N({template:"convex"})))}})]})}if(C){const s=g,m=ae(new Date);return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:`${s.folderName} by ${s.ownerName.split(" ")[0]} | omanote`,description:s.description||`${s.folderName} â a shared folder by ${s.ownerName} on omanote.`,ogImage:s.thumbnailUrl??void 0,noIndex:!0}),e.jsxs("div",{className:"public-page min-h-screen bg-app-canvas",children:[e.jsx("header",{className:"sticky top-0 z-10 border-b border-app-line bg-app-surface/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-5xl items-center justify-between px-4 py-3",children:[e.jsx(k,{to:"/",className:"flex items-center transition hover:opacity-70",children:e.jsx("img",{src:"/logo.svg",alt:"Omanote",className:"h-7 w-auto"})}),s.isOwner&&e.jsx("button",{type:"button",onClick:async()=>{await p({shareCode:s.shareCode})},className:"rounded-lg border border-danger-line bg-danger-surface px-3 py-1.5 text-xs font-medium text-danger-ink transition hover:bg-danger-surface",children:"Unshare"})]})}),e.jsxs("main",{className:"mx-auto max-w-5xl px-4 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold text-app-ink",children:[s.folderIcon?e.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-app-surface-muted text-app-ink-faint",children:e.jsx(ue,{icon:s.folderIcon,size:"sm"})}):null,e.jsx("span",{children:s.folderName})]}),s.description?e.jsx("p",{className:"mt-2 text-sm text-app-ink-muted",children:s.description}):null,e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{name:s.ownerName,imageUrl:s.ownerImageUrl}),e.jsx("span",{className:"text-sm text-app-ink-muted",children:s.ownerName})]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsxs("span",{className:"text-sm text-app-ink-faint",children:["Updated ",T(s.snapshotUpdatedAt??s.createdAt)]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsxs("span",{className:"text-sm text-app-ink-faint",children:[s.todos.filter(j=>j.status==="done").length,"/",s.todos.length," todos"]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsx("span",{className:"text-sm text-app-ink-faint",children:s.viewCount===0?"No views yet":s.viewCount===1?"1 view":`${s.viewCount} views`})]})]}),s.todos.length===0?e.jsx("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-app-line bg-app-surface py-16 text-center",children:e.jsx("p",{className:"text-sm font-medium text-app-ink-muted",children:"No todos in this folder yet."})}):e.jsx("div",{className:"flex flex-col gap-6",children:Ue(s.todos,m).map(j=>e.jsxs("section",{className:"flex flex-col gap-1",children:[e.jsx("h2",{className:"text-sm font-bold text-app-ink-faint",children:j.title}),j.todos.map(x=>{const K=pe(x.dueDateKey,x.dueTime),$=x.status==="open"&&x.dueDateKey&&x.dueDateKey<m?ne(x.dueDateKey,m):0,A=x.status==="done"?me(x.completedAt??x.createdAt):"";return e.jsxs("div",{className:"flex items-start gap-3 py-2",children:[e.jsx(re,{as:"span",checked:x.status==="done",align:"text"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("div",{className:P("text-base leading-6",x.status==="done"?"text-app-ink-muted line-through":"text-app-ink"),children:e.jsx(M,{value:x.title})}),K?e.jsxs("span",{className:"rounded-md bg-app-surface-muted px-2 py-0.5 text-[11px] text-app-ink-faint whitespace-nowrap",children:[K,$>0?e.jsxs("span",{className:"text-warning-ink",children:[" · overdue ",$,"d"]}):null]}):null,A?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-app-ink-faint whitespace-nowrap",children:[e.jsx(ie,{className:"h-3 w-3"}),A]}):null]})})]},x.id)})]},j.key))})]})]})]})}if(S){const s=g;return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:`${s.folderName} by ${s.ownerName.split(" ")[0]} | omanote`,description:s.description||`${s.folderName} â a shared note folder by ${s.ownerName} on omanote.`,ogImage:s.thumbnailUrl??void 0,noIndex:!0}),e.jsxs("div",{className:"public-page min-h-screen bg-app-canvas",children:[e.jsx("header",{className:"sticky top-0 z-10 border-b border-app-line bg-app-surface/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-5xl items-center justify-between px-4 py-3",children:[e.jsx(k,{to:"/",className:"flex items-center transition hover:opacity-70",children:e.jsx("img",{src:"/logo.svg",alt:"Omanote",className:"h-7 w-auto"})}),s.isOwner&&e.jsx("button",{type:"button",onClick:async()=>{await f({shareCode:s.shareCode})},className:"rounded-lg border border-danger-line bg-danger-surface px-3 py-1.5 text-xs font-medium text-danger-ink transition hover:bg-danger-surface",children:"Unshare"})]})}),e.jsxs("main",{className:"mx-auto max-w-5xl px-4 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-bold text-app-ink",children:[s.folderIcon&&e.jsx("span",{className:"mr-2",children:s.folderIcon}),s.folderName]}),s.description?e.jsx("p",{className:"mt-2 text-sm text-app-ink-muted",children:s.description}):null,e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{name:s.ownerName,imageUrl:s.ownerImageUrl}),e.jsx("span",{className:"text-sm text-app-ink-muted",children:s.ownerName})]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsxs("span",{className:"text-sm text-app-ink-faint",children:["Updated ",T(s.snapshotUpdatedAt??s.createdAt)]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsx("span",{className:"text-sm text-app-ink-faint",children:s.viewCount===0?"No views yet":s.viewCount===1?"1 view":`${s.viewCount} views`})]})]}),s.notes.length===0?e.jsx("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-app-line bg-app-surface py-16 text-center",children:e.jsx("p",{className:"text-sm font-medium text-app-ink-muted",children:"No notes in this folder yet."})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-2xl border border-app-line bg-app-surface px-6 py-6 flex flex-col gap-4",children:s.notes.map(m=>e.jsx(ye,{note:m},m.id))}),e.jsx(Ce,{notes:s.notes,linkViewMode:s.linkViewMode})]})]})]})]})}const l=g;return e.jsxs(e.Fragment,{children:[e.jsx(v,{title:`${l.categoryName} by ${l.ownerName.split(" ")[0]} | omanote`,description:l.description||`${l.categoryName} â a shared bookmark folder by ${l.ownerName} on omanote.`,ogImage:l.thumbnailUrl??void 0,noIndex:!0}),e.jsxs("div",{className:"public-page min-h-screen bg-app-canvas",children:[e.jsx("header",{className:"sticky top-0 z-10 border-b border-app-line bg-app-surface/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-5xl items-center justify-between px-4 py-3",children:[e.jsx(k,{to:"/",className:"flex items-center transition hover:opacity-70",children:e.jsx("img",{src:"/logo.svg",alt:"Omanote",className:"h-7 w-auto"})}),l.isOwner&&e.jsx("button",{type:"button",onClick:async()=>{await p({shareCode:l.shareCode})},className:"rounded-lg border border-danger-line bg-danger-surface px-3 py-1.5 text-xs font-medium text-danger-ink transition hover:bg-danger-surface",children:"Unshare"})]})}),e.jsxs("main",{className:"mx-auto max-w-5xl px-4 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-bold text-app-ink",children:[l.categoryIcon&&e.jsx("span",{className:"mr-2",children:l.categoryIcon}),l.categoryName]}),l.description?e.jsx("p",{className:"mt-2 text-sm text-app-ink-muted",children:l.description}):null,e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{name:l.ownerName,imageUrl:l.ownerImageUrl}),e.jsx("span",{className:"text-sm text-app-ink-muted",children:l.ownerName})]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsxs("span",{className:"text-sm text-app-ink-faint",children:["Updated ",T(l.snapshotUpdatedAt??l.createdAt)]}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsx("span",{className:"text-sm text-app-ink-faint",children:l.bookmarks.length===1?"1 link":`${l.bookmarks.length} links`}),e.jsx("span",{className:"text-app-ink-faint",children:"·"}),e.jsx("span",{className:"text-sm text-app-ink-faint",children:l.viewCount===0?"No views yet":l.viewCount===1?"1 view":`${l.viewCount} views`})]})]}),l.bookmarks.length===0?e.jsx("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-app-line bg-app-surface py-16 text-center",children:e.jsx("p",{className:"text-sm font-medium text-app-ink-muted",children:"No bookmarks in this folder yet."})}):l.linkViewMode==="list"?e.jsx("ol",{className:"list-outside list-decimal space-y-3 pl-5",children:l.bookmarks.map(s=>{var j;const m=((j=s.title)==null?void 0:j.trim())||s.url;return e.jsx("li",{children:e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex items-center gap-1.5 text-sm font-bold text-app-ink underline decoration-2 decoration-zinc-300 underline-offset-2 transition hover:decoration-zinc-900",children:[m,e.jsx(D,{className:"h-3 w-3 flex-shrink-0 text-app-ink-faint opacity-0 transition group-hover:opacity-100"})]})},s.id)})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:l.bookmarks.map(s=>e.jsx(ke,{bookmark:s},s.id))})]})]})]})}export{Oe as SharedFolderPage};
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.