PageSourceSearch

https://www.evening-kazan.ru/_nuxt/KHNPxhm0.js

js evening-kazan.ru collected 2026-09-24 08:26:23 UTC 3,065 bytes, 1 lines download raw bytes

1import{d as k,Q,i,o as v,c as m,e as x,b,b4 as V,j as h,$ as _,F as $,m as N,l as B,q as M,t as A,b5 as C}from"./D1ZZI4G5.js";function f(c,d=0){return Array.from({length:c},(e,p)=>d+p)}const S={key:"prev"},E={key:"next"},L=k({__name:"buttons",props:{modelValue:{},firstPage:{default:1},lastPage:{default:1},totalVisible:{default:6},ellipsis:{default:"..."},disabled:{type:Boolean},useQuery:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(c,{emit:d}){const e=c,p=d,o=Q(),t=i({get(){return e.modelValue??1},set(a){p("update:modelValue",a)}}),g=i(()=>{if(e.lastPage<=0||Number.isNaN(e.lastPage)||e.lastPage>Number.MAX_SAFE_INTEGER)return[];if(e.totalVisible<=0)return[];if(e.totalVisible===1)return[t.value];if(e.lastPage<=e.totalVisible)return f(e.lastPage,e.firstPage);const a=e.totalVisible%2===0,s=a?e.totalVisible/2:Math.floor(e.totalVisible/2),l=a?s:s+1,y=e.lastPage-s;if(l-t.value>=0)return[...f(Math.max(1,e.totalVisible-1),e.firstPage),e.ellipsis,e.lastPage];if(t.value-y>=(a?1:0)){const u=e.totalVisible-1,P=e.lastPage-u+e.firstPage;return[e.firstPage,e.ellipsis,...f(u,P)]}else{const u=Math.max(1,e.totalVisible-3),P=u===1?t.value:t.value-Math.ceil(u/2)+e.firstPage;return[e.firstPage,e.ellipsis,...f(u,P),e.ellipsis,e.lastPage]}}),r=i(()=>g.value.map((a,s)=>{if(typeof a=="string")return{isActive:!1,key:`ellipsis-${s}`,page:a,props:{color:"secondary",disabled:!0}};{const l=a===t.value;return{isActive:l,key:a,page:+a,props:{color:l?"primary":"secondary",href:e.useQuery?a===1?o.path:`${o.path}?page=${a}`:null,onClick:()=>{e.useQuery||t.value!==a&&(t.value=a)},disabled:e.disabled||+e.lastPage<2}}}})),n=i(()=>{const a=e.disabled||t.value<=e.firstPage,s=e.disabled||t.value>=e.firstPage+e.lastPage-1,l=t.value>1?t.value-1:1,y=t.value<e.lastPage?t.value+1:e.lastPage;return{prev:{icon:"chevron-left",href:e.useQuery?l===1?o.path:`${o.path}?page=${l}`:null,onClick:()=>{e.useQuery||(t.value-=1)},color:"secondary",disabled:a},next:{icon:"chevron-right",href:e.useQuery?`${o.path}?page=${y}`:null,onClick:()=>{e.useQuery||(t.value+=1)},color:"secondary",disabled:s}}});return(a,s)=>(v(),m("ul",null,[x("li",S,[b(h(_),V(n.value.prev,{size:"small"}),null,16)]),(v(!0),m($,null,N(r.value,l=>(v(),m("li",{key:l.key},[b(h(_),V({ref_for:!0},l.props,{size:"small"}),{default:B(()=>[M(A(l.page),1)]),_:2},1040)]))),128)),x("li",E,[b(h(_),V(n.value.next,{size:"small"}),null,16)])]))}}),q={class:"base-pagination"},D=k({name:"BasePagination",__name:"index",props:{modelValue:{},meta:{},useQuery:{type:Boolean}},emits:["update:modelValue"],setup(c,{emit:d}){const e=c,p=d,o=C("(min-width: 1024px)"),t=i(()=>o.value?6:4),g=i({get(){var r;return((r=e.modelValue)==null?void 0:r.page)||1},set(r){const n={...e.modelValue,page:r};p("update:modelValue",n)}});return(r,n)=>{var a;return v(),m("div",q,[b(L,{modelValue:g.value,"onUpdate:modelValue":n[0]||(n[0]=s=>g.value=s),"last-page":((a=r.meta)==null?void 0:a.last_page)??1,"use-query":r.useQuery,"total-visible":t.value},null,8,["modelValue","last-page","use-query","total-visible"])])}}});export{D 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.