1import{d as E,z as N,h as M,r as R,l as i,n as q,f as o,F as d,e as y,x as b,v as I,m as h,t as _,_ as K,o as r,q as k,p as T,A as $}from"#entry";const F={key:1,class:"pagination-button is-disabled","aria-disabled":"true"},O={key:0,class:"pagination-ellipsis","aria-hidden":"true"},V={key:3,class:"pagination-button is-disabled","aria-disabled":"true"},z=["disabled"],A={class:"pagination-status"},D=["disabled"],x=5,H=16,W=E({__name:"PublicPagination",props:{meta:{},hrefMode:{type:Boolean}},emits:["page-change"],setup(v,{emit:B}){const l=v,P=B,C=N(),n=M(()=>({current_page:l.meta?.current_page??1,last_page:l.meta?.last_page??1,per_page:l.meta?.per_page??15,total:l.meta?.total??0})),L=M(()=>{const{current_page:a,last_page:e}=n.value;let s=Math.max(1,a-Math.floor(x/2));const t=Math.min(e,s+x-1);s=Math.max(1,t-x+1);const g=[],c=p=>g.push({type:"page",page:p,key:`p${p}`});s>1&&(c(1),s>3?g.push({type:"gap",page:0,key:"gap-start"}):s===3&&c(2));for(let p=s;p<=t;p++)c(p);return t<e&&(t<e-2?g.push({type:"gap",page:0,key:"gap-end"}):t===e-2&&c(e-1),c(e)),g}),m=a=>{const e={...C.query};return a<=1?delete e.page:e.page=String(a),{path:C.path,query:e}},f=R(null),S=()=>{let a=0;for(const e of["header","#news-ticker"]){const s=document.querySelector(e);if(!s)continue;const t=window.getComputedStyle(s);t.position!=="fixed"||t.visibility==="hidden"||t.opacity==="0"||(a=Math.max(a,s.getBoundingClientRect().bottom))}return a},u=a=>{if(a&&(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey))return;const e=f.value?.closest(".content-list, .main-content")??f.value?.parentElement;if(!e)return;const s=e.getBoundingClientRect().top+window.scrollY-S()-H,t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:Math.max(0,s),behavior:t?"auto":"smooth"})},w=a=>{a<1||a>n.value.last_page||a===n.value.current_page||(P("page-change",a),u())};return(a,e)=>{const s=K;return o(n).last_page>1?(r(),i("nav",{key:0,ref_key:"navEl",ref:f,class:"public-pagination","aria-label":"ãã¼ã¸ãã¼ã·ã§ã³"},[v.hrefMode?(r(),i(d,{key:0},[o(n).current_page>1?(r(),y(s,{key:0,to:m(o(n).current_page-1),class:"pagination-button",rel:"prev","aria-current":void 0,onClick:u},{default:b(()=>[...e[2]||(e[2]=[k(" å㸠",-1)])]),_:1},8,["to"])):(r(),i("span",F,"åã¸")),(r(!0),i(d,null,I(o(L),t=>(r(),i(d,{key:t.key},[t.type==="gap"?(r(),i("span",O,"â¦")):(r(),y(s,{key:1,to:m(t.page),class:T(["pagination-number",{current:t.page===o(n).current_page}]),"aria-current":t.page===o(n).current_page?"page":void 0,"aria-label":`${t.page}ãã¼ã¸ç®`,onClick:u},{default:b(()=>[k(_(t.page),1)]),_:2},1032,["to","class","aria-current","aria-label"]))],64))),128)),o(n).current_page<o(n).last_page?(r(),y(s,{key:2,to:m(o(n).current_page+1),class:"pagination-button",rel:"next","aria-current":void 0,onClick:u},{default:b(()=>[...e[3]||(e[3]=[k(" 次㸠",-1)])]),_:1},8,["to"])):(r(),i("span",V,"次ã¸"))],64)):(r(),i(d,{key:1},[h("button",{type:"button",class:"pagination-button",disabled:o(n).current_page<=1,onClick:e[0]||(e[0]=t=>w(o(n).current_page-1))}," å㸠",8,z),h("p",A,_(o(n).current_page)+" / "+_(o(n).last_page)+" ãã¼ã¸ (å
¨"+_(o(n).total)+"ä»¶) ",1),h("button",{type:"button",class:"pagination-button",disabled:o(n).current_page>=o(n).last_page,onClick:e[1]||(e[1]=t=>w(o(n).current_page+1))}," 次㸠",8,D)],64))],512)):q("",!0)}}}),G=Object.assign($(W,[["__scopeId","data-v-a7bd179a"]]),{__name:"PublicPagination"});export{G as _};
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.