import{u as k,r as o,j as e,z as S,W as T,a as m,B as C,R as E,K as L}from"./index-DMhQuCwd.js";import{S as B,a as H,b as z,c as A,d as O}from"./sheet-DRBecUnd.js";import{A as R}from"./arrow-left-DGg550oS.js";import{L as F}from"./list-BiL86ev-.js";function K({title:i,subtitle:l,lastUpdated:d,icon:c,canonicalPath:u,seoTitle:f,seoDescription:b,tocItems:n,summaryContent:x,children:j}){const{t}=k("common"),[h,v]=o.useState(""),[N,p]=o.useState(!1);o.useEffect(()=>{const s=new IntersectionObserver(r=>{r.forEach(a=>{a.isIntersecting&&v(a.target.id)})},{rootMargin:"-20% 0px -70% 0px",threshold:0});return n.forEach(r=>{const a=document.getElementById(r.id);a&&s.observe(a)}),()=>s.disconnect()},[n]);const g=o.useCallback(s=>{const r=document.getElementById(s);if(r){const w=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--nav-height")||"96")+24,y=r.getBoundingClientRect().top+window.scrollY-w;window.scrollTo({top:y,behavior:"smooth"}),window.history.replaceState(null,"",`#${s}`),p(!1)}},[]);return o.useEffect(()=>{window.scrollTo(0,0)},[]),e.jsxs(e.Fragment,{children:[e.jsx(S,{title:f,description:b,canonicalPath:u}),e.jsxs("div",{className:"min-h-screen w-full bg-background",children:[e.jsxs("section",{className:"relative w-full",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-primary-700/5 via-primary-700/[0.02] to-background"}),e.jsxs("div",{className:"relative z-10 max-w-[1400px] mx-auto px-5 sm:px-6 lg:px-8 pt-28 md:pt-36 pb-12 md:pb-16",children:[e.jsxs(T,{to:"/",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors mb-8 text-sm font-medium",children:[e.jsx(R,{className:"h-4 w-4"}),t("legal.backToHome","Back to Home")]}),e.jsxs("div",{className:"flex items-start gap-4 md:gap-5",children:[e.jsx("div",{className:"p-3 md:p-4 rounded-2xl bg-primary-700/10 dark:bg-primary-700/20 border border-primary-700/20",children:e.jsx(c,{className:"h-7 w-7 md:h-8 md:w-8 text-primary-700"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-semibold text-foreground tracking-tight",children:i}),l&&e.jsx("p",{className:"text-muted-foreground mt-2 text-lg",children:l}),e.jsx("p",{className:"text-muted-foreground/80 mt-3 text-sm",children:t("legal.lastUpdated","Last updated {{date}}",{date:d})})]})]})]})]}),e.jsx("section",{className:"relative w-full pb-24",children:e.jsx("div",{className:"max-w-[1400px] mx-auto px-5 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex gap-12 lg:gap-16",children:[e.jsx("aside",{className:"hidden lg:block w-64 flex-shrink-0",children:e.jsxs("div",{className:"sticky top-[calc(var(--nav-height)+2rem)]",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-4 uppercase tracking-wider",children:t("legal.toc.title","Table of Contents")}),e.jsx("nav",{className:"space-y-1",children:n.map(s=>e.jsxs("button",{onClick:()=>g(s.id),className:m("w-full text-left px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 flex items-center gap-2",h===s.id?"bg-primary-700/10 text-primary-700 dark:bg-primary-700/20":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[s.icon&&e.jsx(s.icon,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:s.label})]},s.id))})]})}),e.jsxs("main",{className:"flex-1 min-w-0 max-w-[820px]",children:[x&&e.jsxs("div",{className:"mb-12 p-6 md:p-8 rounded-2xl bg-card border border-border/50 shadow-sm",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4 flex items-center gap-2",children:t("legal.atAGlance","At a Glance")}),x]}),e.jsx("div",{className:"prose prose-neutral dark:prose-invert max-w-none prose-headings:scroll-mt-[calc(var(--nav-height)+2rem)] prose-p:text-muted-foreground prose-p:leading-relaxed prose-li:text-muted-foreground prose-strong:text-foreground prose-h2:text-2xl prose-h2:font-semibold prose-h2:border-b prose-h2:border-border prose-h2:pb-4 prose-h2:mb-6 prose-h3:text-lg prose-h3:font-medium",children:j})]})]})})}),e.jsx("div",{className:"lg:hidden fixed bottom-6 right-6 z-40",children:e.jsxs(B,{open:N,onOpenChange:p,children:[e.jsx(H,{asChild:!0,children:e.jsxs(C,{size:"lg",className:"h-14 px-5 rounded-full shadow-lg bg-primary-700 hover:bg-primary-700/90 text-white",children:[e.jsx(F,{className:"h-5 w-5 mr-2"}),t("legal.jumpToSection","Jump to Section")]})}),e.jsxs(z,{side:"bottom",className:"h-[70vh] rounded-t-3xl",children:[e.jsx(A,{className:"pb-4 border-b border-border",children:e.jsx(O,{className:"text-left",children:t("legal.toc.title","Table of Contents")})}),e.jsx("nav",{className:"py-4 space-y-1 overflow-y-auto max-h-[calc(70vh-80px)]",children:n.map(s=>e.jsxs("button",{onClick:()=>g(s.id),className:m("w-full text-left px-4 py-4 rounded-xl text-base font-medium transition-all flex items-center justify-between",h===s.id?"bg-primary-700/10 text-primary-700":"text-foreground hover:bg-muted/50"),children:[e.jsxs("span",{className:"flex items-center gap-3",children:[s.icon&&e.jsx(s.icon,{className:"h-5 w-5 flex-shrink-0"}),s.label]}),e.jsx(E,{className:"h-4 w-4 text-muted-foreground"})]},s.id))})]})]})}),e.jsx(L,{})]})]})}function M({id:i,title:l,children:d,className:c}){return e.jsxs("section",{id:i,className:m("mb-16 scroll-mt-[calc(var(--nav-height)+2rem)]",c),children:[e.jsx("h2",{className:"text-2xl font-semibold text-foreground border-b border-border pb-4 mb-6",children:l}),d]})}export{K as L,M as a};