import{az as q,aK as $,d as z,aW as j,J as h,o as c,c as C,t as L,q as I,w as V,L as X,a,aS as Z,aD as O,aO as Fe,aA as ee,aJ as ae,bC as te,aB as F,r as E,K as Y,cc as Je,f as ne,F as le,n as se,x as We,y as $e,Y as k,g as re,U as De,bw as Qe,O as D,cd as Re,ce as ie,cf as Ve,Q as Ye,al as Ge,aU as He,cg as Xe,aP as M,bp as K,bR as Ze,bS as ea,aE as aa,__tla as ta}from"./index-2eab2d23.js";let ue,na=Promise.all([(()=>{try{return ta}catch{}})()]).then(async()=>{const G=Symbol("elPaginationKey"),oe=q({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:$}}),pe={click:e=>e instanceof MouseEvent},ce=["disabled","aria-label","aria-disabled"],ge={key:0},de=z({name:"ElPaginationPrev"});var be=O(z({...de,props:oe,emits:pe,setup(e){const u=e,{t:n}=j(),g=h(()=>u.disabled||u.currentPage<=1);return(r,o)=>(c(),C("button",{type:"button",class:"btn-prev",disabled:a(g),"aria-label":r.prevText||a(n)("el.pagination.prev"),"aria-disabled":a(g),onClick:o[0]||(o[0]=b=>r.$emit("click",b))},[r.prevText?(c(),C("span",ge,L(r.prevText),1)):(c(),I(a(Z),{key:1},{default:V(()=>[(c(),I(X(r.prevIcon)))]),_:1}))],8,ce))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/prev.vue"]]);const ve=q({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:$}}),me=["disabled","aria-label","aria-disabled"],fe={key:0},Ce=z({name:"ElPaginationNext"});var ye=O(z({...Ce,props:ve,emits:["click"],setup(e){const u=e,{t:n}=j(),g=h(()=>u.disabled||u.currentPage===u.pageCount||u.pageCount===0);return(r,o)=>(c(),C("button",{type:"button",class:"btn-next",disabled:a(g),"aria-label":r.nextText||a(n)("el.pagination.next"),"aria-disabled":a(g),onClick:o[0]||(o[0]=b=>r.$emit("click",b))},[r.nextText?(c(),C("span",fe,L(r.nextText),1)):(c(),I(a(Z),{key:1},{default:V(()=>[(c(),I(X(r.nextIcon)))]),_:1}))],8,me))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/next.vue"]]);const Q=()=>Fe(G,{}),xe=q({pageSize:{type:Number,required:!0},pageSizes:{type:ee(Array),default:()=>ae([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:te}}),Pe=z({name:"ElPaginationSizes"});var ze=O(z({...Pe,props:xe,emits:["page-size-change"],setup(e,{emit:u}){const n=e,{t:g}=j(),r=F("pagination"),o=Q(),b=E(n.pageSize);Y(()=>n.pageSizes,(d,y)=>{if(!Je(d,y)&&Array.isArray(d)){const p=d.includes(n.pageSize)?n.pageSize:n.pageSizes[0];u("page-size-change",p)}}),Y(()=>n.pageSize,d=>{b.value=d});const P=h(()=>n.pageSizes);function w(d){var y;d!==b.value&&(b.value=d,(y=o.handleSizeChange)==null||y.call(o,Number(d)))}return(d,y)=>(c(),C("span",{class:k(a(r).e("sizes"))},[ne(a($e),{"model-value":b.value,disabled:d.disabled,"popper-class":d.popperClass,size:d.size,teleported:d.teleported,"validate-event":!1,onChange:w},{default:V(()=>[(c(!0),C(le,null,se(a(P),p=>(c(),I(a(We),{key:p,value:p,label:p+a(g)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported"])],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/sizes.vue"]]);const he=q({size:{type:String,values:te}}),ke=["disabled"],Se=z({name:"ElPaginationJumper"});var Ne=O(z({...Se,props:he,setup(e){const{t:u}=j(),n=F("pagination"),{pageCount:g,disabled:r,currentPage:o,changeEvent:b}=Q(),P=E(),w=h(()=>{var p;return(p=P.value)!=null?p:o==null?void 0:o.value});function d(p){P.value=p?+p:""}function y(p){p=Math.trunc(+p),b==null||b(p),P.value=void 0}return(p,S)=>(c(),C("span",{class:k(a(n).e("jump")),disabled:a(r)},[re("span",{class:k([a(n).e("goto")])},L(a(u)("el.pagination.goto")),3),ne(a(De),{size:p.size,class:k([a(n).e("editor"),a(n).is("in-pagination")]),min:1,max:a(g),disabled:a(r),"model-value":a(w),"validate-event":!1,label:a(u)("el.pagination.page"),type:"number","onUpdate:modelValue":d,onChange:y},null,8,["size","class","max","disabled","model-value","label"]),re("span",{class:k([a(n).e("classifier")])},L(a(u)("el.pagination.pageClassifier")),3)],10,ke))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);const _e=q({total:{type:Number,default:1e3}}),Te=["disabled"],Be=z({name:"ElPaginationTotal"});var Ee=O(z({...Be,props:_e,setup(e){const{t:u}=j(),n=F("pagination"),{disabled:g}=Q();return(r,o)=>(c(),C("span",{class:k(a(n).e("total")),disabled:a(g)},L(a(u)("el.pagination.total",{total:r.total})),11,Te))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/total.vue"]]);const we=q({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),Ie=["onKeyup"],Me=["aria-current","aria-label","tabindex"],Ae=["tabindex","aria-label"],Ue=["aria-current","aria-label","tabindex"],qe=["tabindex","aria-label"],je=["aria-current","aria-label","tabindex"],Le=z({name:"ElPaginationPager"});var Ke=O(z({...Le,props:we,emits:["change"],setup(e,{emit:u}){const n=e,g=F("pager"),r=F("icon"),{t:o}=j(),b=E(!1),P=E(!1),w=E(!1),d=E(!1),y=E(!1),p=E(!1),S=h(()=>{const t=n.pagerCount,l=(t-1)/2,s=Number(n.currentPage),N=Number(n.pageCount);let B=!1,_=!1;N>t&&(s>t-l&&(B=!0),s["more","btn-quickprev",r.b(),g.is("disabled",n.disabled)]),J=h(()=>["more","btn-quicknext",r.b(),g.is("disabled",n.disabled)]),A=h(()=>n.disabled?-1:0);function W(t=!1){n.disabled||(t?w.value=!0:d.value=!0)}function U(t=!1){t?y.value=!0:p.value=!0}function i(t){const l=t.target;if(l.tagName.toLowerCase()==="li"&&Array.from(l.classList).includes("number")){const s=Number(l.textContent);s!==n.currentPage&&u("change",s)}else l.tagName.toLowerCase()==="li"&&Array.from(l.classList).includes("more")&&v(t)}function v(t){const l=t.target;if(l.tagName.toLowerCase()==="ul"||n.disabled)return;let s=Number(l.textContent);const N=n.pageCount,B=n.currentPage,_=n.pagerCount-2;l.className.includes("more")&&(l.className.includes("quickprev")?s=B-_:l.className.includes("quicknext")&&(s=B+_)),Number.isNaN(+s)||(s<1&&(s=1),s>N&&(s=N)),s!==B&&u("change",s)}return Qe(()=>{const t=(n.pagerCount-1)/2;b.value=!1,P.value=!1,n.pageCount>n.pagerCount&&(n.currentPage>n.pagerCount-t&&(b.value=!0),n.currentPage(c(),C("ul",{class:k(a(g).b()),onClick:v,onKeyup:Ye(i,["enter"])},[t.pageCount>0?(c(),C("li",{key:0,class:k([[a(g).is("active",t.currentPage===1),a(g).is("disabled",t.disabled)],"number"]),"aria-current":t.currentPage===1,"aria-label":a(o)("el.pagination.currentPage",{pager:1}),tabindex:a(A)}," 1 ",10,Me)):D("v-if",!0),b.value?(c(),C("li",{key:1,class:k(a(f)),tabindex:a(A),"aria-label":a(o)("el.pagination.prevPages",{pager:t.pagerCount-2}),onMouseenter:l[0]||(l[0]=s=>W(!0)),onMouseleave:l[1]||(l[1]=s=>w.value=!1),onFocus:l[2]||(l[2]=s=>U(!0)),onBlur:l[3]||(l[3]=s=>y.value=!1)},[!w.value&&!y.value||t.disabled?(c(),I(a(ie),{key:1})):(c(),I(a(Re),{key:0}))],42,Ae)):D("v-if",!0),(c(!0),C(le,null,se(a(S),s=>(c(),C("li",{key:s,class:k([[a(g).is("active",t.currentPage===s),a(g).is("disabled",t.disabled)],"number"]),"aria-current":t.currentPage===s,"aria-label":a(o)("el.pagination.currentPage",{pager:s}),tabindex:a(A)},L(s),11,Ue))),128)),P.value?(c(),C("li",{key:2,class:k(a(J)),tabindex:a(A),"aria-label":a(o)("el.pagination.nextPages",{pager:t.pagerCount-2}),onMouseenter:l[4]||(l[4]=s=>W()),onMouseleave:l[5]||(l[5]=s=>d.value=!1),onFocus:l[6]||(l[6]=s=>U()),onBlur:l[7]||(l[7]=s=>p.value=!1)},[!d.value&&!p.value||t.disabled?(c(),I(a(ie),{key:1})):(c(),I(a(Ve),{key:0}))],42,qe)):D("v-if",!0),t.pageCount>1?(c(),C("li",{key:3,class:k([[a(g).is("active",t.currentPage===t.pageCount),a(g).is("disabled",t.disabled)],"number"]),"aria-current":t.currentPage===t.pageCount,"aria-label":a(o)("el.pagination.currentPage",{pager:t.pageCount}),tabindex:a(A)},L(t.pageCount),11,je)):D("v-if",!0)],42,Ie))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);const m=e=>typeof e!="number",Oe=q({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>K(e)&&Math.trunc(e)===e&&e>4&&e<22&&e%2==1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:ee(Array),default:()=>ae([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:$,default:()=>Ze},nextText:{type:String,default:""},nextIcon:{type:$,default:()=>ea},teleported:{type:Boolean,default:!0},small:Boolean,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean}),H="ElPagination";ue=aa(z({name:H,props:Oe,emits:{"update:current-page":e=>K(e),"update:page-size":e=>K(e),"size-change":e=>K(e),"current-change":e=>K(e),"prev-click":e=>K(e),"next-click":e=>K(e)},setup(e,{emit:u,slots:n}){const{t:g}=j(),r=F("pagination"),o=Ge().vnode.props||{},b="onUpdate:currentPage"in o||"onUpdate:current-page"in o||"onCurrentChange"in o,P="onUpdate:pageSize"in o||"onUpdate:page-size"in o||"onSizeChange"in o,w=h(()=>{if(m(e.total)&&m(e.pageCount)||!m(e.currentPage)&&!b)return!1;if(e.layout.includes("sizes")){if(m(e.pageCount)){if(!m(e.total)&&!m(e.pageSize)&&!P)return!1}else if(!P)return!1}return!0}),d=E(m(e.defaultPageSize)?10:e.defaultPageSize),y=E(m(e.defaultCurrentPage)?1:e.defaultCurrentPage),p=h({get:()=>m(e.pageSize)?d.value:e.pageSize,set(i){m(e.pageSize)&&(d.value=i),P&&(u("update:page-size",i),u("size-change",i))}}),S=h(()=>{let i=0;return m(e.pageCount)?m(e.total)||(i=Math.max(1,Math.ceil(e.total/p.value))):i=e.pageCount,i}),f=h({get:()=>m(e.currentPage)?y.value:e.currentPage,set(i){let v=i;i<1?v=1:i>S.value&&(v=S.value),m(e.currentPage)&&(y.value=v),b&&(u("update:current-page",v),u("current-change",v))}});function J(i){f.value=i}function A(){e.disabled||(f.value-=1,u("prev-click",f.value))}function W(){e.disabled||(f.value+=1,u("next-click",f.value))}function U(i,v){i&&(i.props||(i.props={}),i.props.class=[i.props.class,v].join(" "))}return Y(S,i=>{f.value>i&&(f.value=i)}),He(G,{pageCount:S,disabled:h(()=>e.disabled),currentPage:f,changeEvent:J,handleSizeChange:function(i){p.value=i;const v=S.value;f.value>v&&(f.value=v)}}),()=>{var i,v;if(!w.value)return Xe(H,g("el.pagination.deprecationWarning")),null;if(!e.layout||e.hideOnSinglePage&&S.value<=1)return null;const t=[],l=[],s=M("div",{class:r.e("rightwrapper")},l),N={prev:M(be,{disabled:e.disabled,currentPage:f.value,prevText:e.prevText,prevIcon:e.prevIcon,onClick:A}),jumper:M(Ne,{size:e.small?"small":"default"}),pager:M(Ke,{currentPage:f.value,pageCount:S.value,pagerCount:e.pagerCount,onChange:J,disabled:e.disabled}),next:M(ye,{disabled:e.disabled,currentPage:f.value,pageCount:S.value,nextText:e.nextText,nextIcon:e.nextIcon,onClick:W}),sizes:M(ze,{pageSize:p.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,teleported:e.teleported,size:e.small?"small":"default"}),slot:(v=(i=n==null?void 0:n.default)==null?void 0:i.call(n))!=null?v:null,total:M(Ee,{total:m(e.total)?0:e.total})},B=e.layout.split(",").map(T=>T.trim());let _=!1;return B.forEach(T=>{T!=="->"?_?l.push(N[T]):t.push(N[T]):_=!0}),U(t[0],r.is("first")),U(t[t.length-1],r.is("last")),_&&l.length>0&&(U(l[0],r.is("first")),U(l[l.length-1],r.is("last")),t.push(s)),M("div",{class:[r.b(),r.is("background",e.background),{[r.m("small")]:e.small}]},t)}}}))});export{ue as E,na as __tla};