1import{c as p,r as o,j as e,b2 as H,w as u,b3 as q,b4 as z,b5 as U,b6 as $,b7 as W,aq as F,aD as B,a1 as T,b8 as Y,b9 as Z,L,ba as G,bb as w,bc as g,bd as v,D as K,E as J,G as Q,J as X,a3 as ee,d as te,aw as ae,M,O as E,be as ie}from"./index-DVnvwKss.js";import{L as _}from"./lock-D_WmPVvn.js";import{C as re}from"./chart-column-4glrh6i_.js";import{G as se}from"./graduation-cap-B6HRXtd7.js";import{P as ne}from"./package-CWCtnPMe.js";import{S as oe}from"./star-DgJGUcrD.js";import{T as le}from"./tag-BsS18FKR.js";import{U as ce}from"./users-Slprv71S.js";import{S as de}from"./send-DbAweDjN.js";import{C as he}from"./code-DeKqVZ0y.js";import{L as me}from"./link-2-FU3pAgyk.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const pe=p("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const fe=p("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const xe=p("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 17 * @license lucide-react v0.462.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const ue=p("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 22 * @license lucide-react v0.462.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const ye=p("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 27 * @license lucide-react v0.462.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const be=p("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 32 * @license lucide-react v0.462.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */const O=p("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** 37 * @license lucide-react v0.462.0 - ISC 38 * 39 * This source code is licensed under the ISC license. 40 * See the LICENSE file in the root directory of this source tree. 41 */const we=p("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 42 * @license lucide-react v0.462.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */const ge=p("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 47 * @license lucide-react v0.462.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */const ve=p("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 52 * @license lucide-react v0.462.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const je=p("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** 57 * @license lucide-react v0.462.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */const C=p("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** 62 * @license lucide-react v0.462.0 - ISC 63 * 64 * This source code is licensed under the ISC license. 65 * See the LICENSE file in the root directory of this source tree. 66 */const ke=p("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** 67 * @license lucide-react v0.462.0 - ISC 68 * 69 * This source code is licensed under the ISC license. 70 * See the LICENSE file in the root directory of this source tree. 71 */const Ne=p("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 72 * @license lucide-react v0.462.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const Ce=p("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 77 * @license lucide-react v0.462.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const Se=p("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),S=o.forwardRef(({className:a,activeClassName:t,pendingClassName:s,to:i,...r},n)=>e.jsx(H,{ref:n,to:i,className:({isActive:l,isPending:d})=>u(a,l&&t,d&&s),...r}));S.displayName="NavLink";var Le=Symbol.for("react.lazy"),k=q[" use ".trim().toString()];function Me(a){return typeof a=="object"&&a!==null&&"then"in a}function V(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===Le&&"_payload"in a&&Me(a._payload)}function Ee(a){const t=_e(a),s=o.forwardRef((i,r)=>{let{children:n,...l}=i;V(n)&&typeof k=="function"&&(n=k(n._payload));
81const d=o.Children.toArray(n),h=d.find(Pe);if(h){const m=h.props.children,b=d.map(c=>c===h?o.Children.count(m)>1?o.Children.only(null):o.isValidElement(m)?m.props.children:null:c);return e.jsx(t,{...l,ref:r,children:o.isValidElement(m)?o.cloneElement(m,void 0,b):null})}return e.jsx(t,{...l,ref:r,children:n})});return s.displayName=`${a}.Slot`,s}function _e(a){const t=o.forwardRef((s,i)=>{let{children:r,...n}=s;if(V(r)&&typeof k=="function"&&(r=k(r._payload)),o.isValidElement(r)){const l=Re(r),d=Ae(n,r.props);return r.type!==o.Fragment&&(d.ref=i?z(i,l):l),o.cloneElement(r,d)}return o.Children.count(r)>1?o.Children.only(null):null});return t.displayName=`${a}.SlotClone`,t}var Oe=Symbol("radix.slottable");function Pe(a){return o.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Oe}function Ae(a,t){const s={...t};for(const i in t){const r=a[i],n=t[i];/^on[A-Z]/.test(i)?r&&n?s[i]=(...d)=>{const h=n(...d);return r(...d),h}:r&&(s[i]=r):i==="style"?s[i]={...r,...n}:i==="className"&&(s[i]=[r,n].filter(Boolean).join(" "))}return{...a,...s}}function Re(a){var i,r;let t=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?a.ref:(t=(r=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:r.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?a.props.ref:a.props.ref||a.ref)}var Ie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=Ie.reduce((a,t)=>{const s=Ee(`Primitive.${t}`),i=o.forwardRef((r,n)=>{const{asChild:l,...d}=r,h=l?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(h,{...d,ref:n})});return i.displayName=`Primitive.${t}`,{...a,[t]:i}},{}),Ve=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),De="VisuallyHidden",D=o.forwardRef((a,t)=>e.jsx(Te.span,{...a,ref:t,style:{...Ve,...a.style}}));D.displayName=De;var He=D;const P=[{label:"Dashboard",items:[{name:"Overview",href:"/admin",icon:be},{name:"Analytics",href:"/admin/analytics",icon:re},{name:"Site Settings",href:"/admin/site-settings",icon:Ne}]},{label:"Content",items:[{name:"Articles",href:"/admin/articles",icon:ue},{name:"New Article",href:"/admin/articles/new",icon:Ce},{name:"The Review",href:"/admin/thereview",icon:ve},{name:"PhD Journey",href:"/admin/phd-journey",icon:se},{name:"Pleroma Landing",href:"/admin/pleroma-landing",icon:te},{name:"Site Images",href:"/admin/site-images",icon:ye},{name:"Media Kit",href:"/admin/media-kit",icon:fe}]},{label:"Commerce",items:[{name:"Products",href:"/admin/products",icon:ne},{name:"Orders",href:"/admin/orders",icon:ae},{name:"Invoices",href:"/admin/invoices",icon:ke},{name:"Reviews",href:"/admin/reviews",icon:oe},{name:"Promo Codes",href:"/admin/promo-codes",icon:le}]},{label:"Audience",items:[{name:"Subscribers",href:"/admin/subscribers",icon:ce},{name:"Monthly Newsletter",href:"/admin/monthly-newsletter",icon:M},{name:"Broadcasts",href:"/admin/broadcasts",icon:de},{name:"Contact Messages",href:"/admin/contact-messages",icon:M},{name:"Help FAQs",href:"/admin/help-faqs",icon:pe},{name:"Web Dev Inquiries",href:"/admin/inquiries",icon:he},{name:"Sidebar Ads",href:"/admin/sidebar-ads",icon:ge},{name:"UTM Builder",href:"/admin/utm-builder",icon:me},{name:"Subscribe Link",href:"/admin/subscribe-link",icon:Se}]}];function A({onNavClick:a,collapsed:t=!1,onToggleCollapsed:s,showCollapseToggle:i=!1,locked:r=!1,onToggleLocked:n}){const l=F(),d=B(),{signOut:h,user:m}=T(),{data:b}=Y(m==null?void 0:m.id),c=b?[...P,{label:"Administration",items:[{name:"Team",href:"/admin/team",icon:xe}]}]:P,y=async()=>{const{error:f}=await h();f?ee.error("Error signing out"):d("/portal-access")},j=f=>f.some(x=>l.pathname.startsWith(x.href));return e.jsx(Z,{delayDuration:100,children:e.jsxs("div",{className:"flex flex-col h-full bg-primary text-white",children:[e.jsxs("div",{className:u("border-b border-white/10 flex items-center",t?"p-3 justify-center":"p-6 justify-between gap-2"),children:[e.jsxs(L,{to:"/admin",className:"flex items-center gap-3 min-w-0",onClick:a,children:[e.jsx(G,{size:"sm",variant:"light"}),!t&&e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-heading text-lg tracking-wide",children:"Admin"}),e.jsx("p",{className:"text-xs text-white/60 truncate",children:"Nick's Notes"})]})]}),i&&!t&&e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n&&e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{onClick:n,"aria-label":r?"Unlock sidebar (allow auto-collapse on tablet)":"Lock sidebar (prevent auto-collapse on tablet)","aria-pressed":r,className:u("p-1.5 rounded transition-colors",r?"bg-white/15 text-white hover:bg-white/25":"text-white/70 hover:bg-white/10 hover:text-white"),children:r?e.jsx(_,{className:"h-4 w-4"}):e.jsx(O,{className:"h-4 w-4"})})}),e.jsx(v,{side:"bottom",children:r?"Locked â auto-collapse disabled":"Lock sidebar state"})]}),e.jsx("button",{onClick:s,"aria-label":"Collapse sidebar",className:"p-1.5 rounded hover:bg-white/10 text-white/70 hover:text-white transition-colors",children:e.jsx(je,{className:"h-4 w-4"})})]})]}),i&&t&&e.jsxs("div",{className:"px-2 pt-2 flex flex-col items-center gap-1",children:[e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{onClick:s,"aria-label":"Expand sidebar",className:"p-2 rounded hover:bg-white/10 text-white/70 hover:text-white transition-colors",children:e.jsx(C,{className:"h-4 w-4"})})}),e.jsx(v,{side:"right",children:"Expand sidebar"})]}),n&&e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{onClick:n,"aria-label":r?"Unlock sidebar":"Lock sidebar","aria-pressed":r,className:u("p-2 rounded transition-colors",r?"bg-white/15 text-white hover:bg-white/25":"text-white/70 hover:bg-white/10 hover:text-white"),children:r?e.jsx(_,{className:"h-4 w-4"}):e.jsx(O,{className:"h-4 w-4"})})}),e.jsx(v,{side:"right",children:r?"Locked â auto-collapse disabled":"Lock sidebar state"})]})]}),e.jsx("nav",{className:u("flex-1 overflow-y-auto",t?"p-2 space-y-1":"p-4 space-y-2"),children:c.map(f=>t?e.jsx("div",{className:"space-y-1 pb-2 mb-1 border-b border-white/5 last:border-b-0",children:f.items.map(x=>{const N=x.icon;return e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsx(S,{to:x.href,onClick:a,className:"flex items-center justify-center p-2.5 text-white/70 hover:text-white hover:bg-white/10 transition-colors rounded",activeClassName:"bg-white/20 text-white",children:e.jsx(N,{className:"h-5 w-5"})})}),e.jsxs(v,{side:"right",children:[e.jsx("span",{className:"text-xs text-white/50 mr-2",children:f.label}),x.name]})]},x.name)})},f.label):e.jsxs(K,{defaultOpen:f.label==="Dashboard"||f.label==="Content"||j(f.items),children:[e.jsxs(J,{className:"flex items-center justify-between w-full px-2 py-2 text-xs font-semibold text-white/60 uppercase tracking-wide hover:text-white transition-colors group",children:[e.jsx("span",{children:f.label}),e.jsx(Q,{className:"h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180"})]}),e.jsx(X,{children:e.jsx("div",{className:"mt-1 space-y-1",children:f.items.map(x=>{const N=x.icon;return e.jsxs(S,{to:x.href,onClick:a,className:"flex items-center gap-3 px-4 py-2.5 text-sm font-medium text-white/70 hover:text-white hover:bg-white/10 transition-colors rounded",activeClassName:"bg-white/20 text-white",children:[e.jsx(N,{className:"h-4 w-4"}),x.name]},x.name)})})})]},f.label))}),e.jsxs("div",{className:u("border-t border-white/10",t?"p-2":"p-4"),children:[!t&&e.jsx("div",{className:"mb-3 px-4",children:e.jsx("p",{className:"text-sm text-white/60 truncate",children:m==null?void 0:m.email})}),e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsxs("button",{onClick:y,className:u("flex items-center gap-3 w-full text-sm font-medium text-white/70 hover:text-white hover:bg-white/10 transition-colors rounded",t?"justify-center p-2.5":"px-4 py-3"),children:[e.jsx(we,{className:"h-5 w-5"}),!t&&"Sign Out"]})}),t&&e.jsx(v,{side:"right",children:"Sign Out"})]})]}),e.jsx("div",{className:u("border-t border-white/10",t?"p-2":"p-4"),children:e.jsxs(w,{children:[e.jsx(g,{asChild:!0,children:e.jsx(L,{to:"/",className:u("flex items-center justify-center gap-2 text-sm font-medium bg-white/10 hover:bg-white/20 transition-colors rounded",t?"p-2.5":"px-4 py-2"),children:t?e.jsx(C,{className:"h-4 w-4 rotate-180"}):"View Site"})}),t&&e.jsx(v,{side:"right",children:"View Site"})]})})]})})}function qe({open:a,onClose:t,collapsed:s=!1,onToggleCollapsed:i,locked:r=!1,onToggleLocked:n}){return e.jsxs(e.Fragment,{children:[e.jsx("aside",{className:u("fixed left-0 top-0 bottom-0 hidden md:flex flex-col transition-[width] duration-200 ease-in-out z-30",s?"w-16":"w-16 lg:w-64"),children:e.jsx(A,{collapsed:s,onToggleCollapsed:i,showCollapseToggle:!0,locked:r,onToggleLocked:n})}),e.jsx(U,{open:a,onOpenChange:l=>!l&&(t==null?void 0:t()),children:e.jsxs($,{side:"left",className:"w-64 p-0 border-r-0 [&>button]:text-white",children:[e.jsx(He,{children:e.jsx(W,{children:"Navigation"})}),e.jsx(A,{onNavClick:t})]})})]})}const R="na_admin_sidebar_collapsed",I="na_admin_sidebar_locked";function Qe({children:a,title:t,action:s}){const{user:i}
81=T(),[r,n]=o.useState(!1),[l,d]=o.useState(()=>typeof window>"u"?!1:localStorage.getItem(I)==="1"),[h,m]=o.useState(()=>{if(typeof window>"u")return!1;const c=localStorage.getItem(R);return c==="1"?!0:c==="0"?!1:window.matchMedia("(max-width: 1023px)").matches}),b=o.useRef(!1);return o.useEffect(()=>{if(!(i!=null&&i.id)){b.current=!1;return}let c=!1;return(async()=>{const{data:y,error:j}=await E.from("admin_ui_preferences").select("sidebar_collapsed, sidebar_locked").eq("user_id",i.id).maybeSingle();c||(!j&&y&&(typeof y.sidebar_collapsed=="boolean"&&m(y.sidebar_collapsed),typeof y.sidebar_locked=="boolean"&&d(y.sidebar_locked)),b.current=!0)})(),()=>{c=!0}},[i==null?void 0:i.id]),o.useEffect(()=>{try{localStorage.setItem(R,h?"1":"0")}catch{}},[h]),o.useEffect(()=>{try{localStorage.setItem(I,l?"1":"0")}catch{}},[l]),o.useEffect(()=>{if(!(i!=null&&i.id)||!b.current)return;const c=setTimeout(()=>{E.from("admin_ui_preferences").upsert({user_id:i.id,sidebar_collapsed:h,sidebar_locked:l},{onConflict:"user_id"}).then(()=>{})},250);return()=>clearTimeout(c)},[h,l,i==null?void 0:i.id]),o.useEffect(()=>{if(l)return;const c=window.matchMedia("(max-width: 1023px)"),y=j=>{m(j.matches)};return c.addEventListener("change",y),()=>c.removeEventListener("change",y)},[l]),e.jsxs("div",{className:"min-h-screen bg-secondary",children:[e.jsx(qe,{open:r,onClose:()=>n(!1),collapsed:h,onToggleCollapsed:()=>m(c=>!c),locked:l,onToggleLocked:()=>d(c=>!c)}),e.jsxs("main",{className:u("transition-[margin] duration-200 ease-in-out",h?"md:ml-16":"md:ml-16 lg:ml-64"),children:[e.jsx("header",{className:"bg-background border-b border-border px-4 py-4 md:px-6 md:py-5 lg:px-8 lg:py-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{className:"md:hidden p-2 -ml-2 hover:bg-muted rounded-md",onClick:()=>n(!0),"aria-label":"Open navigation",children:e.jsx(ie,{className:"h-5 w-5"})}),h&&e.jsx("button",{className:"hidden md:inline-flex p-2 -ml-2 hover:bg-muted rounded-md text-muted-foreground hover:text-foreground",onClick:()=>m(!1),"aria-label":"Expand sidebar",title:"Expand sidebar",children:e.jsx(C,{className:"h-5 w-5"})}),e.jsx("h1",{className:"font-heading text-xl md:text-2xl truncate",children:t}),s&&e.jsx("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:s})]})}),e.jsx("div",{className:"p-4 md:p-6 lg:p-8",children:a})]})]})}export{Qe as A,xe as C,ue as F,ye as I,ge as M,Ce as S,D as V};
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.