import{h as e,r as t,H as i,g as s}from"./p-6b2342e0.js";import{c as o,V as r,I as a}from"./p-6e1ab235.js";import{V as n,I as l}from"./p-4415ad28.js";import{s as c}from"./p-519a7d55.js";import{T as p}from"./p-57f220b5.js";import{V as d}from"./p-3b791b5d.js";import{D as f,d as h}from"./p-f28a6074.js";import{V as m}from"./p-9af0e2e7.js";import{f as v}from"./p-6e70d3cc.js";import{C as g}from"./p-2d0d575f.js";import{t as b}from"./p-6c43d54a.js";import{i as u,n as j,s as S,P as y}from"./p-9dcecdd3.js";import"./p-a528714c.js";import"./p-331a62d5.js";var R=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class w extends r{render(){return"pageSizeSelectorMobile"===this.type?this.renderPageSizeSelectorMobile():this.renderPageSizeSelectorMobileAndCurrentPageLabel()}renderPageSizeSelectorMobile(){const e=d.tWithPreservedBlocks("Show [{0} items / page]",w.clickableReg,this.pageSize);return this.renderTranslatedMessage(e)}renderPageSizeSelectorMobileAndCurrentPageLabel(){const e=this.total>0?this.pageSize*(this.current-1)+1:0,t=Math.min(this.current*this.pageSize,this.total),i=d.tWithPreservedBlocks("Viewing [{0}-{1}] of {2}",w.clickableReg,e,t,this.total);return this.renderTranslatedMessage(i)}renderTranslatedMessage(t){return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-4"},t.map((t=>t.isPreserved?this.pageSizeSelectorMobileDropdownRenderer.render(e("vega-button-link",{label:t.content})):e("vega-font",{variant:"font-field-label",color:"text-primary"},t.content))))}}w.clickableReg=/(\[[^\]]*\])/g,R([o()],w.prototype,"translationSlimmer",void 0),R([o()],w.prototype,"type",void 0),R([o()],w.prototype,"pageSize",void 0),R([o()],w.prototype,"total",void 0),R([o()],w.prototype,"current",void 0),R([o()],w.prototype,"pageSizeSelectorMobileDropdownRenderer",void 0);var z=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class P extends r{render(t){var i;const s=(this.isAllActive||u(this.pageSizeSelectorOptions,this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize]).map(j),o=S(s),r=this.translationSlimmer.t("Items Per Page");return e("vega-dropdown",{trigger:"click",selectType:"single",alignment:"center",minWidth:160,selectedSourceKey:(this.isAllActive?y:this.pageSize).toString(),source:[{key:"items-per-page",label:r,children:[...o.map((e=>({key:e.value.toString(),label:e.label})))]}],ref:e=>{f.addUniqueObserverToNode(e,m,(e=>{this.notifyParentPagination(e.detail)}))},isScreenPosition:null===(i=this.dropdownProps)||void 0===i?void 0:i.isScreenPosition},t)}notifyParentPagination(e){const t=v(this.host,"vega-pagination");t&&g.notify(h.getSubject(t,b),{host:this.host,detail:e})}}z([o()],P.prototype,"host",void 0),z([o()],P.prototype,"translationSlimmer",void 0),z([o()],P.prototype,"pageSizeSelectorOptions",void 0),z([o({writable:!0})],P.prototype,"pageSize",void 0),z([o()],P.prototype,"dropdownProps",void 0),z([o()],P.prototype,"total",void 0),z([o()],P.prototype,"isAllActive",void 0);var M=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};const O=class{constructor(e){t(this,e),this.globalSlimmers={},this.translationSlimmer=new p,this.vegaComponentUsageRuntimeMetricsSlimmer=new n,this.pageSizeSelectorMobileRenderer=new w,this.pageSizeSelectorMobileDropdownRenderer=new P,this.pageSize=10,this.pageSizeSelectorOptions=[10,20,50,100],this.total=0,this.current=1,this.isAllActive=!1}render(){return c(e(i,null,this.pageSizeSelectorMobileRenderer.render()),this.host)}get host(){return s(this)}};M([l()],O.prototype,"globalSlimmers",void 0),M([a()],O.prototype,"translationSlimmer",void 0),M([a()],O.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),M([a()],O.prototype,"pageSizeSelectorMobileRenderer",void 0),M([a()],O.prototype,"pageSizeSelectorMobileDropdownRenderer",void 0),O.style=":host{display:inline-block}";export{O as vega_pagination_page_size_selector_mobile}