1import{r as o,j as e}from"./vendor-react-BzXAup97.js";import{l as H,N as ue,D as me,i as xe,j as pe,k as z}from"./AuthenticatedLayout-CluqGnv5.js";import{u as he,n as fe,e as R,B as n,j as ge,k as we,l as be,m as je,H as ve}from"./app-BcVXXONv.js";import{u as Ne,H as W,r as c,L as u}from"./vendor-inertia-C6ujBw2R.js";import{M as _e}from"./MobileFileListView-B_ncN___.js";import{I as ke}from"./Input-Cg7VKGAS.js";import{S as ye}from"./Select-By7TTUYq.js";import{P as Ce,c as Se}from"./pageTourSteps-juFvO02i.js";import{T as De,a as Te,b as G,c as g,d as Pe,e as w}from"./Table-Cn6JNXmi.js";import{C as $}from"./Checkbox-CcTSxegg.js";import{P as Me,a as Ie,b as _,c as Be,d as Ee,e as Le,f as Oe}from"./pagination-ePB1TrOR.js";import{D as Ae}from"./DeleteConfirmModal-D3fiv-Zp.js";import{aD as V,H as Fe,az as He,P as k,a3 as J,T as K,ad as ze,ah as Re,ai as We}from"./vendor-lucide-1jXEw7Bh.js";import"./vendor-radix-Bha8dDJB.js";import"./vendor-tiptap-CF47o3zI.js";import"./pushNotifications-BVHqr3g7.js";import"./vendor-firebase-CCnLmBjb.js";import"./UpgradeModal-H1XLTufz.js";import"./upgradeFeatureCatalog-DQsdO-8d.js";import"./AppModal-Bf_aZlPN.js";import"./transition-Cx0OHrt1.js";import"./dialog-D_ql7LVY.js";import"./Sheet-BZ90mOOl.js";import"./rememberedProfile-pkm-wW4S.js";import"./vendor-framer-DOQvBjnK.js";import"./vendor-dnd-aV9yv6Pg.js";import"./useRoutePulse-Cu98qn9H.js";import"./vendor-ably-DQ6H01js.js";import"./vendor-recharts-MX9_f30n.js";import"./vendor-assistant-ui-rpsJ9Qdc.js";import"./vendor-voip-BKCre8sD.js";const U="notes-sidebar-collapsed",T=20;function P(d,y){const s=new Date(d),m=y==="tr"?"tr-TR":"en-US";return s.toLocaleDateString(m,{day:"numeric",month:"long",year:"numeric"})}function jt({boards:d,driveWorkspaces:y=[]}){const{t:s,locale:m}=he(),{props:Y}=Ne(),q=Y.auth?.user?.role==="admin",Q=fe(),[M,b]=o.useState(null),[X,j]=o.useState(!1),[C,I]=o.useState("grid"),[l,x]=o.useState([]),[Z,p]=o.useState(!1),[h,S]=o.useState(1),[ee,B]=o.useState(0),[te,se]=o.useState([]),E=(()=>
1{const t=[...y,...te].filter(Boolean);return t.length>0?t:["drawpad"]})(),[v,L]=o.useState(E[0]??"drawpad"),[re,O]=o.useState(!1),[A,F]=o.useState(""),[i,ae]=o.useState(()=>typeof window>"u"?!1:localStorage.getItem(U)==="1");o.useEffect(()=>{localStorage.setItem(U,i?"1":"0")},[i]),o.useEffect(()=>{localStorage.getItem("tour-drawpad-index")||B(Date.now())},[]),o.useEffect(()=>{const t=()=>B(Date.now());return window.addEventListener("trigger-onboarding",t),()=>window.removeEventListener("trigger-onboarding",t)},[]);const oe=()=>{localStorage.setItem("tour-drawpad-index","1")},{paginatedBoards:N,totalPages:f}=o.useMemo(()=>{const t=d.length,r=Math.max(1,Math.ceil(t/T)),a=(h-1)*T;return{paginatedBoards:d.slice(a,a+T),totalPages:r}},[d,h]),le=N.length>0&&N.every(t=>l.includes(t.id)),de=t=>x(t?N.map(r=>r.id):[]),ne=(t,r)=>{x(a=>r?a.includes(t)?a:[...a,t]:a.filter(D=>D!==t))},ie=()=>{p(!1);const t=l.filter(r=>d.find(a=>a.id===r)?.is_owned_by_current_user!==!1);t.length!==0&&c.post(route("drawpad.bulk-destroy"),{ids:t},{preserveScroll:!0,onSuccess:()=>x([])})},ce=()=>{l.length===0||!v.trim()||c.post(route("drawpad.bulk-move"),{ids:l,workspace:v.trim()},{preserveScroll:!0,onSuccess:()=>{p(!1),x([])}})};if(Q){const t=d.map(r=>({id:r.id,uuid:r.uuid,title:r.title,updated_at:r.updated_at,created_at:r.created_at}));return e.jsxs(H,{children:[e.jsx(W,{title:s("sidebar.drawpad")}),e.jsx(_e,{items:t,title:s("sidebar.drawpad"),icon:V,onItemClick:r=>c.visit(route("drawpad.show",r.uuid)),onCreateClick:()=>c.post(route("drawpad.store"),{},{preserveScroll:!0}),emptyMessage:s("office.no_documents","No documents yet")})]})}return e.jsxs(H,{fullWidth:!0,sidebarCollapsed:i,header:e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>ae(t=>!t),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-accent hover:text-accent-foreground",title:s(i?"sidebar.expand_sidebar":"sidebar.collapse_sidebar"),"aria-label":s(i?"sidebar.expand_sidebar":"sidebar.collapse_sidebar"),children:i?e.jsx(Re,{className:"h-5 w-5"}):e.jsx(We,{className:"h-5 w-5"})}),e.jsx(u,{href:route("drawpad.create"),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-accent hover:text-accent-foreground",title:s("drawpad.new_board"),"aria-label":s("drawpad.new_board"),children:e.jsx(k,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0 flex flex-col justify-center ml-2",children:[e.jsx("h2",{className:"truncate text-lg font-semibold text-foreground leading-tight",children:s("sidebar.drawpad")}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground truncate hidden sm:block",children:s("drawpad.all_boards")})]})]}),children:[e.jsx(W,{title:s("drawpad.all_boards")}),e.jsx(Ce,{startTrigger:ee,steps:Se(s),onComplete:oe}),e.jsxs("div",{className:"flex overflow-hidden rounded-xl border border-border bg-card shadow-sm h-[calc(100vh-theme(spacing.14))] md:h-[calc(100vh-theme(spacing.16))]",children:[e.jsx(ue,{collapsed:i,showAdminSection:q,shared:!1,folder_id:null,trash_view:!1}),e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden bg-background relative",children:e.jsx("div",{className:"flex-1 overflow-y-auto p-6 md:p-8 tour-drawpad-list",children:e.jsxs("div",{className:"max-w-7xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("drawpad.my_boards","My Boards")}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s("drawpad.manage_boards_desc","Create and manage your drawing boards.")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex rounded-lg border border-border bg-muted/30 p-0.5",children:[e.jsx("button",{type:"button",onClick:()=>I("grid"),className:R("rounded-md p-2 transition",C==="grid"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),"aria-label":s("common.grid_view","Grid view"),children:e.jsx(Fe,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>I("list"),className:R("rounded-md p-2 transition",C==="list"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),"aria-label":s("common.list_view","List view"),children:e.jsx(He,{className:"h-4 w-4"})})]}
1),e.jsx(u,{href:route("drawpad.create"),className:"tour-drawpad-new",children:e.jsxs(n,{className:"gap-2 px-6 h-11 font-medium shadow-lg shadow-primary/20",children:[e.jsx(k,{className:"h-5 w-5"}),s("drawpad.new_board")]})})]})]}),C==="list"?e.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l.length>0&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs bg-muted/40 border-b border-border/60",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:s("office.pdf_bulk_selected",{count:l.length},`${l.length} document selected`)}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(n,{variant:"outline",size:"sm",className:"h-7 px-3",onClick:()=>p(!0),children:s("office.pdf_bulk_actions","Bulk actions")}),e.jsx("button",{type:"button",className:"text-[11px] text-muted-foreground hover:text-foreground underline",onClick:()=>x([]),children:s("common.clear","Clear")})]})]}),e.jsxs(De,{children:[e.jsx(Te,{children:e.jsxs(G,{className:"bg-muted/40 hover:bg-muted/40 border-border",children:[e.jsx(g,{className:"w-8 text-xs uppercase tracking-wide text-muted-foreground",children:e.jsx($,{checked:le?!0:l.length>0?"indeterminate":!1,onCheckedChange:t=>de(t===!0),"aria-label":s("office.pdf_bulk_select_all","Select all")})}),e.jsx(g,{className:"text-xs uppercase tracking-wide text-muted-foreground",children:s("drawpad.col_title","Title")}),e.jsx(g,{className:"text-xs uppercase tracking-wide text-muted-foreground hidden sm:table-cell",children:s("drawpad.col_updated","Updated")}),e.jsx(g,{className:"text-xs uppercase tracking-wide text-muted-foreground hidden md:table-cell",children:s("drawpad.col_created","Created")}),e.jsx(g,{className:"text-right text-xs uppercase tracking-wide text-muted-foreground",children:s("drive.col_actions","Actions")})]})}),e.jsx(Pe,{children:N.map(t=>e.jsxs(G,{"data-state":l.includes(t.id)?"selected":void 0,className:"group/row last:border-b-0",children:[e.jsx(w,{children:e.jsx($,{checked:l.includes(t.id),onCheckedChange:r=>ne(t.id,r===!0),"aria-label":s("office.pdf_bulk_select_row","Select row"),onClick:r=>r.stopPropagation()})}),e.jsxs(w,{children:[e.jsx(u,{href:route("drawpad.show",t.uuid),className:"font-medium text-foreground hover:text-primary truncate block max-w-[240px] md:max-w-[320px]",children:t.title||s("drawpad.untitled")}),t.is_owned_by_current_user===!1&&e.jsx("span",{className:"mt-0.5 block text-[10px] font-medium text-primary/80",children:s("drawpad.team_owner_board","Team account")})]}),e.jsx(w,{className:"text-xs text-muted-foreground hidden sm:table-cell",children:P(t.updated_at,m)}),e.jsx(w,{className:"text-xs text-muted-foreground hidden md:table-cell",children:P(t.created_at,m)}),e.jsx(w,{className:"text-right",children:e.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.jsx(n,{asChild:!0,variant:"outline",size:"icon",className:"h-7 w-7",children:e.jsx(u,{href:route("drawpad.show",t.uuid),children:e.jsx(J,{className:"h-3.5 w-3.5"})})}),t.is_owned_by_current_user!==!1&&e.jsx(n,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 text-destructive border-destructive/40 hover:bg-destructive/10",onClick:()=>{b(t),j(!0)},children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})})]},t.id))})]}),f>1&&e.jsxs("div",{className:"border-t border-border px-4 py-3 flex items-center justify-between",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("common.page","Page")," ",h," ",s("common.of","of")," ",f]}),e.jsx(Me,{children:e.jsxs(Ie,{children:[e.jsx(_,{children:e.jsx(Be,{href:"#",onClick:t=>{t.preventDefault(),S(r=>Math.max(1,r-1))},className:"cursor-pointer"})}),Array.from({length:f},(t,r)=>r+1).filter(t=>t===1||t===f||Math.abs(t-h)<=1).reduce((t,r,a,D)=>(a>0&&r-(D[a-1]??0)>1&&t.push(-1),t.push(r),t),[]).map((t,r)=>t===-1?e.jsx(_,{children:e.jsx(Ee,{})},`ellipsis-${r}`):e.jsx(_,{children:e.jsx(Le,{href:"#",onClick:a=>{a.preventDefault(),S(t)},isActive:h===t,className:"cursor-pointer",children:t})},t)),e.jsx(_,{children:e.jsx(Oe,{href:"#",onClick:t=>{t.preventDefault(),S(r=>Math.min(f,r+1))},className:"cursor-pointer"})})]})})]})]}
1):e.jsxs("div",{className:"tour-drawpad-grid grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:[e.jsxs(u,{href:route("drawpad.create"),className:"group relative flex flex-col items-center justify-center gap-4 rounded-2xl border-2 border-dashed border-muted-foreground/20 bg-muted/5 p-8 transition-all hover:border-primary/50 hover:bg-primary/5",children:[e.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-background shadow-sm transition-transform group-hover:scale-110",children:e.jsx(k,{className:"h-7 w-7 text-primary"})}),e.jsx("span",{className:"font-semibold text-muted-foreground transition-colors group-hover:text-primary",children:s("office.create_new","Create New")})]}),d.map(t=>e.jsxs("div",{className:"group relative flex flex-col overflow-hidden rounded-2xl border border-border/50 bg-card transition-all hover:shadow-xl hover:shadow-primary/5 hover:border-primary/20",children:[e.jsxs(u,{href:route("drawpad.show",t.uuid),className:"flex-1",children:[e.jsxs("div",{className:"aspect-[4/3] w-full bg-muted/30 flex items-center justify-center overflow-hidden relative",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"}),e.jsx(V,{className:"h-16 w-16 text-muted-foreground/20 transition-transform group-hover:scale-110 group-hover:text-primary/20"})]}),e.jsxs("div",{className:"p-5",children:[e.jsx("h3",{className:"font-bold text-foreground truncate group-hover:text-primary transition-colors",children:t.title||s("drawpad.untitled")}),t.is_owned_by_current_user===!1&&e.jsx("p",{className:"mt-0.5 text-[10px] font-medium text-primary/80",children:s("drawpad.team_owner_board","Team account")}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx("span",{className:"h-1 w-1 rounded-full bg-muted-foreground/40"}),P(t.updated_at,m)]})]})]}),e.jsx("div",{className:"absolute top-3 right-3 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsxs(me,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(n,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full bg-background/80 shadow-md",children:e.jsx(ze,{className:"h-4 w-4"})})}),e.jsxs(pe,{align:"end",className:"w-40",children:[e.jsxs(z,{className:"cursor-pointer flex items-center gap-2",onClick:r=>{r.preventDefault(),r.stopPropagation(),c.visit(route("drawpad.show",t.uuid))},children:[e.jsx(J,{className:"h-4 w-4"}),s("common.edit","Edit")]}),t.is_owned_by_current_user!==!1&&e.jsxs(z,{className:"cursor-pointer flex items-center gap-2 text-destructive",onClick:r=>{r.preventDefault(),r.stopPropagation(),b(t),j(!0)},children:[e.jsx(K,{className:"h-4 w-4"}),s("common.delete","Delete")]})]})]})})]},t.uuid))]})]})})})]}),e.jsx(ge,{open:Z,onOpenChange:p,children:e.jsx(we,{side:"right",className:"max-w-sm",children:e.jsxs("div",{className:"mx-auto w-full max-w-md flex flex-col gap-4 p-4",children:[e.jsx(be,{children:e.jsx(je,{className:"text-base font-semibold",children:s("office.pdf_bulk_actions_title","Bulk actions")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs",children:s("office.pdf_bulk_selected",{count:l.length},`${l.length} board selected`)}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-border bg-card px-3 py-3",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-foreground",children:s("office.pdf_bulk_delete","Delete selected")}),e.jsx("p",{className:"text-xs",children:s("office.pdf_bulk_delete_hint","Deletes all selected PDFs. This cannot be undone.")}),e.jsx(n,{type:"button",variant:"destructive",className:"w-full",onClick:ie,disabled:l.length===0,children:s("office.pdf_bulk_delete_btn","Delete selected")})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-border bg-card px-3 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-foreground",children:s("office.pdf_bulk_move","Move to Drive folder")}),e.jsx("button",{type:"button",onClick:()=>O(t=>!t),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground transition","aria-label":s("office.pdf_bulk_move_new_folder","New folder"),children:e.jsx(k,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(ye,{value:v,onCh
1ange:t=>L(t.target.value),className:"flex-1 min-w-0",children:E.map(t=>e.jsx("option",{value:t,children:t},t))})}),re&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(ke,{value:A,onChange:t=>F(t.target.value),placeholder:s("office.pdf_bulk_move_workspace","Folder name (e.g. docs/signatures)"),onKeyDown:t=>{if(t.key==="Enter"){const r=A.trim().replace(/^\/+|\/+$/g,"");r&&(se(a=>a.includes(r)?a:[...a,r]),L(r),F(""),O(!1))}}}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s("office.pdf_bulk_move_workspace_hint","Enter and press Enter to add and select.")})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:s("office.pdf_bulk_move_hint","Boards are exported as JSON and saved to the Drive folder.")}),e.jsx(n,{type:"button",variant:"outline",className:"w-full",onClick:ce,disabled:l.length===0||!v.trim(),title:s("office.pdf_bulk_move_hint","Boards are exported as JSON and saved to the Drive folder."),children:s("office.pdf_bulk_move_btn","Move selected")})]})]}),e.jsx(ve,{children:e.jsx(n,{type:"button",variant:"outline",className:"w-full",onClick:()=>p(!1),children:s("common.close","Close")})})]})})}),e.jsx(Ae,{isOpen:X,onClose:()=>{j(!1),b(null)},onConfirm:()=>{M&&c.delete(route("drawpad.destroy",M.uuid),{preserveScroll:!0,onFinish:()=>{j(!1),b(null)}})},title:s("drawpad.delete_confirm"),description:s("drawpad.delete_confirm")})]})}export{jt 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.