1import{a as M}from"/build/_shared/chunk-QMEVHKTZ.js";import{a as P}from"/build/_shared/chunk-RENFGZ3H.js";import{a as T}from"/build/_shared/chunk-OGDX4OUN.js";import{a as U}from"/build/_shared/chunk-7YCDFLR5.js";import{a as b}from"/build/_shared/chunk-BP2BPXNE.js";import{k as L,l as S}from"/build/_shared/chunk-3E6NCEC4.js";import{M as x,N as w,O as v,P as k,Q as d,R as h}from"/build/_shared/chunk-T7GJUR44.js";import{a as O}from"/build/_shared/chunk-RFWNXNZ4.js";import{a as N,c as n}from"/build/_shared/chunk-HGEPBCFH.js";import{a as I}from"/build/_shared/chunk-KPWQHS6G.js";import{a as C,j as m,p as y,v as f}from"/build/_shared/chunk-5FMQP7OK.js";import{d as s}from"/build/_shared/chunk-T36URGAI.js";var F=s(T());var D=s(I());var E=s(O());var z=s(U());var $=s(C());var t=s(f());function _({site:o}){let a=`/${o.site_path}`,[r,i]=(0,$.useState)(!1);return(0,t.jsxs)("ul",{className:"mb-6 flex items-center md:mb-0",children:[(0,t.jsx)("li",{className:"mr-3 hidden flex-1 sm:inline-block sm:pb-0",children:(0,t.jsx)("a",{className:"inline-block py-1 font-medium text-gray-500",href:a,children:a})}),(0,t.jsx)("li",{className:"mr-3 font-medium",children:(0,t.jsx)(x,{children:({open:p})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{className:d.button.borderLessSecondary,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,t.jsxs)("span",{className:"whitespace-nowrap",children:[" ",(0,t.jsx)(n,{id:"note.toolbar.settings"})]}),(0,t.jsx)(v,{})]}),(0,t.jsx)(w,{show:r,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,t.jsx)(x.Items,{static:!0,className:"absolute left-0 z-50 w-56 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md border border-gray-200 bg-gray-100 shadow-lg outline-none dark:divide-gray-700 dark:border-gray-800 dark:bg-gray-800",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:(0,t.jsx)(k,{href:`${a}/edit`,children:(0,t.jsx)(n,{id:"note.toolbar.edit_site"})})})})]})})}),(0,t.jsx)("li",{children:(0,t.jsxs)("a",{href:`${a}/search`,className:d.button.tertiary,children:[(0,t.jsx)(n,{id:"note.toolbar.search"}),(0,t.jsx)(L,{className:"ml-2 h-4 w-4"})]})}),(0,t.jsx)("li",{children:(0,t.jsxs)("a",{href:`${a}/new`,className:d.button.primary,children:[(0,t.jsx)(n,{id:"note.toolbar.new"}),(0,t.jsx)(S,{className:"ml-2 h-4 w-4"})]})})]})}var e=s(f());function H(){let o=N();return(0,e.jsx)(h,{main:(0,e.jsxs)("article",{children:[(0,e.jsx)(b,{title:o.formatMessage({id:"site.error.title"})}),(0,e.jsx)("p",{className:"mb-6 max-w-2xl md:text-lg lg:mb-8 lg:text-xl",children:(0,e.jsx)(n,{id:"site.error.description"})})]})})}function B(){let{user:o,site:a,notes:r,totalNotes:i,page:p,perPage:c,isOwnSite:u,shouldUpgrade:g}=y();return(0,e.jsx)(h,{hidesNavOptions:!o,main:(0,e.jsxs)(e.Fragment,{children:[g&&(0,e.jsx)(M,{}),(0,e.jsxs)("article",{children:[u&&(0,e.jsx)(_,{site:a}),(0,e.jsx)(b,{title:a.name}),(0,e.jsx)("p",{children:a.headline}),(0,e.jsx)("ul",{className:"pt-8",children:r&&r.map(l=>(0,e.jsx)("li",{className:"mb-4 list-none",children:(0,e.jsxs)(m,{to:`/${a.site_path}/${l.path}`,className:"mb-4",children:[u&&(0,e.jsx)(P,{note:l}),(0,e.jsx)("div",{className:"text-lg font-bold",children:l.title}),(0,e.jsx)("div",{className:"text-sm",children:l.headline}),u&&(0,e.jsxs)("span",{className:"flex text-xs leading-tight text-gray-500",children:["/",l.path]})]})},l.id))}),o&&(r==null?void 0:r.length)===0&&(0,e.jsx)("p",{className:"mt-8 text-center text-gray-500 dark:text-gray-400",children:(0,e.jsx)(m,{to:`/${a.site_path}/new`,className:d.button.secondary,children:"Create your first note"})}),(0,e.jsx)(V,{site:a,totalNotes:i,page:p,per_page:c})]})]})})}function V({site:o,totalNotes:a,page:r,per_page:i}){if(a<=i)return null;let p=Math.ceil(a/i),c="flex h-8 items-center justify-center rounded-lg px-3 leading-tight hover:bg-gray-100 hover:text-gray-700 dark:border-gray-700 dark:hover:bg-gray-700 dark:hover:text-white",u="flex h-8 items-center justify-center rounded-lg px-3 leading-tight text-white";return(0,e.jsx)("div",{className:"paging navigation mt-12 border-t border-gray-200 text-gray-500 dark:border-gray-800",children:(0,e.jsx)(F.default,{breakLabel:"...",pageLabelBuilder:g=>(0,e.jsx)(m,{className:g===r?u:c,to:`/${o.site_path}?page=${g}`,children:g}),previousLabel:r>1&&(0,e.jsx)(m,{className:c,to:`/${o.site_path}?page=${r-1}`,children:"Previous"}),nextLabel:r<p&&(0,e.jsx)(m,{className:c,to:`/${o.site_path}?page=${r+1}`,children:"Next"}),nextClassName:"paging-next",previousClassName:"paging-previous",pageRangeDisplayed:5,pageCount:p,renderOnZeroPageCount:null})})}
1export{H as a,B as b};
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.