@runeya/runeya
Version:
Monitor processes as a stack
308 lines (265 loc) • 65 kB
JavaScript
import{s as ze,a as Fe,c as te}from"./index-Bv49zKKl.js";import{a as b,o as p,b as V,W as c,bm as Ve,h as O,s as R,g as B,_ as Te,bn as Me,y as ge,B as ve,A as be,bo as ne,bg as Z,bh as $,l as x,F as U,q as re,e as j,aQ as Q,b8 as Pe,aS as ue,aT as xe,bp as Be,R as D,N as Ee,aC as Ke,C as De,aD as Ae,aE as He,bi as Re,be as je,bq as Ge,br as Ne,aU as N,U as We,d as le,t as A,V as ce,n as ie,f as W,T as Ue,aZ as qe,X as Ze,m as $e,a1 as Qe}from"./index-CXxIspfv.js";import{a as ye,b as Oe,d as Xe,e as Je,c as Ye,f as _e,h as et,s as tt,R as it,C as nt}from"./index-OI8gr_S5.js";function st(){let t=[];const e=(o,r,a=999)=>{const u=l(o,r,a),d=u.value+(u.key===o?0:a)+1;return t.push({key:o,value:d}),d},i=o=>{t=t.filter(r=>r.value!==o)},s=(o,r)=>l(o).value,l=(o,r,a=0)=>[...t].reverse().find(u=>!0)||{key:o,value:a},n=o=>o&&parseInt(o.style.zIndex,10)||0;return{get:n,set:(o,r,a)=>{r&&(r.style.zIndex=String(e(o,!0,a)))},clear:o=>{o&&(i(n(o)),o.style.zIndex="")},getCurrent:o=>s(o)}}var oe=st(),Ie={name:"TimesIcon",extends:ye};function lt(t,e,i,s,l,n){return p(),b("svg",c({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),e[0]||(e[0]=[V("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"},null,-1)]),16)}Ie.render=lt;var Se={name:"Portal",props:{appendTo:{type:[String,Object],default:"body"},disabled:{type:Boolean,default:!1}},data:function(){return{mounted:!1}},mounted:function(){this.mounted=Ve()},computed:{inline:function(){return this.disabled||this.appendTo==="self"}}};function ot(t,e,i,s,l,n){return n.inline?O(t.$slots,"default",{key:0}):l.mounted?(p(),R(Te,{key:1,to:i.appendTo},[O(t.$slots,"default")],8,["to"])):B("",!0)}Se.render=ot;var we={name:"BlankIcon",extends:ye};function rt(t,e,i,s,l,n){return p(),b("svg",c({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),e[0]||(e[0]=[V("rect",{width:"1",height:"1",fill:"currentColor","fill-opacity":"0"},null,-1)]),16)}we.render=rt;var at=Me(),dt=ge`
.p-virtualscroller-loader {
background: dt('virtualscroller.loader.mask.background');
color: dt('virtualscroller.loader.mask.color');
}
.p-virtualscroller-loading-icon {
font-size: dt('virtualscroller.loader.icon.size');
width: dt('virtualscroller.loader.icon.size');
height: dt('virtualscroller.loader.icon.size');
}
`,ut=`
.p-virtualscroller {
position: relative;
overflow: auto;
contain: strict;
transform: translateZ(0);
will-change: scroll-position;
outline: 0 none;
}
.p-virtualscroller-content {
position: absolute;
top: 0;
left: 0;
min-height: 100%;
min-width: 100%;
will-change: transform;
}
.p-virtualscroller-spacer {
position: absolute;
top: 0;
left: 0;
height: 1px;
width: 1px;
transform-origin: 0 0;
pointer-events: none;
}
.p-virtualscroller-loader {
position: sticky;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.p-virtualscroller-loader-mask {
display: flex;
align-items: center;
justify-content: center;
}
.p-virtualscroller-horizontal > .p-virtualscroller-content {
display: flex;
}
.p-virtualscroller-inline .p-virtualscroller-content {
position: static;
}
.p-virtualscroller .p-virtualscroller-loading {
transform: none !important;
min-height: 0;
position: sticky;
inset-block-start: 0;
inset-inline-start: 0;
}
`,he=ve.extend({name:"virtualscroller",css:ut,style:dt}),ct={name:"BaseVirtualScroller",extends:ze,props:{id:{type:String,default:null},style:null,class:null,items:{type:Array,default:null},itemSize:{type:[Number,Array],default:0},scrollHeight:null,scrollWidth:null,orientation:{type:String,default:"vertical"},numToleratedItems:{type:Number,default:null},delay:{type:Number,default:0},resizeDelay:{type:Number,default:10},lazy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loaderDisabled:{type:Boolean,default:!1},columns:{type:Array,default:null},loading:{type:Boolean,default:!1},showSpacer:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!1},tabindex:{type:Number,default:0},inline:{type:Boolean,default:!1},step:{type:Number,default:0},appendOnly:{type:Boolean,default:!1},autoSize:{type:Boolean,default:!1}},style:he,provide:function(){return{$pcVirtualScroller:this,$parentInstance:this}},beforeMount:function(){var e;he.loadCSS({nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce})}};function J(t){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(t)}function pe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),i.push.apply(i,s)}return i}function X(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?pe(Object(i),!0).forEach(function(s){Le(t,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pe(Object(i)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(i,s))})}return t}function Le(t,e,i){return(e=ht(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ht(t){var e=pt(t,"string");return J(e)=="symbol"?e:e+""}function pt(t,e){if(J(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var s=i.call(t,e);if(J(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ce={name:"VirtualScroller",extends:ct,inheritAttrs:!1,emits:["update:numToleratedItems","scroll","scroll-index-change","lazy-load"],data:function(){var e=this.isBoth();return{first:e?{rows:0,cols:0}:0,last:e?{rows:0,cols:0}:0,page:e?{rows:0,cols:0}:0,numItemsInViewport:e?{rows:0,cols:0}:0,lastScrollPos:e?{top:0,left:0}:0,d_numToleratedItems:this.numToleratedItems,d_loading:this.loading,loaderArr:[],spacerStyle:{},contentStyle:{}}},element:null,content:null,lastScrollPos:null,scrollTimeout:null,resizeTimeout:null,defaultWidth:0,defaultHeight:0,defaultContentWidth:0,defaultContentHeight:0,isRangeChanged:!1,lazyLoadState:{},resizeListener:null,resizeObserver:null,initialized:!1,watch:{numToleratedItems:function(e){this.d_numToleratedItems=e},loading:function(e,i){this.lazy&&e!==i&&e!==this.d_loading&&(this.d_loading=e)},items:{handler:function(e,i){(!i||i.length!==(e||[]).length)&&(this.init(),this.calculateAutoSize())},deep:!0},itemSize:function(){this.init(),this.calculateAutoSize()},orientation:function(){this.lastScrollPos=this.isBoth()?{top:0,left:0}:0},scrollHeight:function(){this.init(),this.calculateAutoSize()},scrollWidth:function(){this.init(),this.calculateAutoSize()}},mounted:function(){this.viewInit(),this.lastScrollPos=this.isBoth()?{top:0,left:0}:0,this.lazyLoadState=this.lazyLoadState||{}},updated:function(){!this.initialized&&this.viewInit()},unmounted:function(){this.unbindResizeListener(),this.initialized=!1},methods:{viewInit:function(){ne(this.element)&&(this.setContentEl(this.content),this.init(),this.calculateAutoSize(),this.bindResizeListener(),this.defaultWidth=Z(this.element),this.defaultHeight=$(this.element),this.defaultContentWidth=Z(this.content),this.defaultContentHeight=$(this.content),this.initialized=!0)},init:function(){this.disabled||(this.setSize(),this.calculateOptions(),this.setSpacerSize())},isVertical:function(){return this.orientation==="vertical"},isHorizontal:function(){return this.orientation==="horizontal"},isBoth:function(){return this.orientation==="both"},scrollTo:function(e){this.element&&this.element.scrollTo(e)},scrollToIndex:function(e){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto",l=this.isBoth(),n=this.isHorizontal(),o=l?e.every(function(m){return m>-1}):e>-1;if(o){var r=this.first,a=this.element,u=a.scrollTop,d=u===void 0?0:u,h=a.scrollLeft,y=h===void 0?0:h,L=this.calculateNumItems(),I=L.numToleratedItems,w=this.getContentPosition(),g=this.itemSize,C=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,E=arguments.length>1?arguments[1]:void 0;return v<=E?0:v},k=function(v,E,M){return v*E+M},z=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return i.scrollTo({left:v,top:E,behavior:s})},f=l?{rows:0,cols:0}:0,K=!1,F=!1;l?(f={rows:C(e[0],I[0]),cols:C(e[1],I[1])},z(k(f.cols,g[1],w.left),k(f.rows,g[0],w.top)),F=this.lastScrollPos.top!==d||this.lastScrollPos.left!==y,K=f.rows!==r.rows||f.cols!==r.cols):(f=C(e,I),n?z(k(f,g,w.left),d):z(y,k(f,g,w.top)),F=this.lastScrollPos!==(n?y:d),K=f!==r),this.isRangeChanged=K,F&&(this.first=f)}},scrollInView:function(e,i){var s=this,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"auto";if(i){var n=this.isBoth(),o=this.isHorizontal(),r=n?e.every(function(g){return g>-1}):e>-1;if(r){var a=this.getRenderedRange(),u=a.first,d=a.viewport,h=function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return s.scrollTo({left:C,top:k,behavior:l})},y=i==="to-start",L=i==="to-end";if(y){if(n)d.first.rows-u.rows>e[0]?h(d.first.cols*this.itemSize[1],(d.first.rows-1)*this.itemSize[0]):d.first.cols-u.cols>e[1]&&h((d.first.cols-1)*this.itemSize[1],d.first.rows*this.itemSize[0]);else if(d.first-u>e){var I=(d.first-1)*this.itemSize;o?h(I,0):h(0,I)}}else if(L){if(n)d.last.rows-u.rows<=e[0]+1?h(d.first.cols*this.itemSize[1],(d.first.rows+1)*this.itemSize[0]):d.last.cols-u.cols<=e[1]+1&&h((d.first.cols+1)*this.itemSize[1],d.first.rows*this.itemSize[0]);else if(d.last-u<=e+1){var w=(d.first+1)*this.itemSize;o?h(w,0):h(0,w)}}}}else this.scrollToIndex(e,l)},getRenderedRange:function(){var e=function(h,y){return Math.floor(h/(y||h))},i=this.first,s=0;if(this.element){var l=this.isBoth(),n=this.isHorizontal(),o=this.element,r=o.scrollTop,a=o.scrollLeft;if(l)i={rows:e(r,this.itemSize[0]),cols:e(a,this.itemSize[1])},s={rows:i.rows+this.numItemsInViewport.rows,cols:i.cols+this.numItemsInViewport.cols};else{var u=n?a:r;i=e(u,this.itemSize),s=i+this.numItemsInViewport}}return{first:this.first,last:this.last,viewport:{first:i,last:s}}},calculateNumItems:function(){var e=this.isBoth(),i=this.isHorizontal(),s=this.itemSize,l=this.getContentPosition(),n=this.element?this.element.offsetWidth-l.left:0,o=this.element?this.element.offsetHeight-l.top:0,r=function(y,L){return Math.ceil(y/(L||y))},a=function(y){return Math.ceil(y/2)},u=e?{rows:r(o,s[0]),cols:r(n,s[1])}:r(i?n:o,s),d=this.d_numToleratedItems||(e?[a(u.rows),a(u.cols)]:a(u));return{numItemsInViewport:u,numToleratedItems:d}},calculateOptions:function(){var e=this,i=this.isBoth(),s=this.first,l=this.calculateNumItems(),n=l.numItemsInViewport,o=l.numToleratedItems,r=function(d,h,y){var L=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.getLast(d+h+(d<y?2:3)*y,L)},a=i?{rows:r(s.rows,n.rows,o[0]),cols:r(s.cols,n.cols,o[1],!0)}:r(s,n,o);this.last=a,this.numItemsInViewport=n,this.d_numToleratedItems=o,this.$emit("update:numToleratedItems",this.d_numToleratedItems),this.showLoader&&(this.loaderArr=i?Array.from({length:n.rows}).map(function(){return Array.from({length:n.cols})}):Array.from({length:n})),this.lazy&&Promise.resolve().then(function(){var u;e.lazyLoadState={first:e.step?i?{rows:0,cols:s.cols}:0:s,last:Math.min(e.step?e.step:a,((u=e.items)===null||u===void 0?void 0:u.length)||0)},e.$emit("lazy-load",e.lazyLoadState)})},calculateAutoSize:function(){var e=this;this.autoSize&&!this.d_loading&&Promise.resolve().then(function(){if(e.content){var i=e.isBoth(),s=e.isHorizontal(),l=e.isVertical();e.content.style.minHeight=e.content.style.minWidth="auto",e.content.style.position="relative",e.element.style.contain="none";var n=[Z(e.element),$(e.element)],o=n[0],r=n[1];(i||s)&&(e.element.style.width=o<e.defaultWidth?o+"px":e.scrollWidth||e.defaultWidth+"px"),(i||l)&&(e.element.style.height=r<e.defaultHeight?r+"px":e.scrollHeight||e.defaultHeight+"px"),e.content.style.minHeight=e.content.style.minWidth="",e.content.style.position="",e.element.style.contain=""}})},getLast:function(){var e,i,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,l=arguments.length>1?arguments[1]:void 0;return this.items?Math.min(l?((e=this.columns||this.items[0])===null||e===void 0?void 0:e.length)||0:((i=this.items)===null||i===void 0?void 0:i.length)||0,s):0},getContentPosition:function(){if(this.content){var e=getComputedStyle(this.content),i=parseFloat(e.paddingLeft)+Math.max(parseFloat(e.left)||0,0),s=parseFloat(e.paddingRight)+Math.max(parseFloat(e.right)||0,0),l=parseFloat(e.paddingTop)+Math.max(parseFloat(e.top)||0,0),n=parseFloat(e.paddingBottom)+Math.max(parseFloat(e.bottom)||0,0);return{left:i,right:s,top:l,bottom:n,x:i+s,y:l+n}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},setSize:function(){var e=this;if(this.element){var i=this.isBoth(),s=this.isHorizontal(),l=this.element.parentElement,n=this.scrollWidth||"".concat(this.element.offsetWidth||l.offsetWidth,"px"),o=this.scrollHeight||"".concat(this.element.offsetHeight||l.offsetHeight,"px"),r=function(u,d){return e.element.style[u]=d};i||s?(r("height",o),r("width",n)):r("height",o)}},setSpacerSize:function(){var e=this,i=this.items;if(i){var s=this.isBoth(),l=this.isHorizontal(),n=this.getContentPosition(),o=function(a,u,d){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return e.spacerStyle=X(X({},e.spacerStyle),Le({},"".concat(a),(u||[]).length*d+h+"px"))};s?(o("height",i,this.itemSize[0],n.y),o("width",this.columns||i[1],this.itemSize[1],n.x)):l?o("width",this.columns||i,this.itemSize,n.x):o("height",i,this.itemSize,n.y)}},setContentPosition:function(e){var i=this;if(this.content&&!this.appendOnly){var s=this.isBoth(),l=this.isHorizontal(),n=e?e.first:this.first,o=function(d,h){return d*h},r=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return i.contentStyle=X(X({},i.contentStyle),{transform:"translate3d(".concat(d,"px, ").concat(h,"px, 0)")})};if(s)r(o(n.cols,this.itemSize[1]),o(n.rows,this.itemSize[0]));else{var a=o(n,this.itemSize);l?r(a,0):r(0,a)}}},onScrollPositionChange:function(e){var i=this,s=e.target,l=this.isBoth(),n=this.isHorizontal(),o=this.getContentPosition(),r=function(S,T){return S?S>T?S-T:S:0},a=function(S,T){return Math.floor(S/(T||S))},u=function(S,T,q,_,P,H){return S<=P?P:H?q-_-P:T+P-1},d=function(S,T,q,_,P,H,ee,ke){if(S<=H)return 0;var se=Math.max(0,ee?S<T?q:S-H:S>T?q:S-2*H),de=i.getLast(se,ke);return se>de?de-P:se},h=function(S,T,q,_,P,H){var ee=T+_+2*P;return S>=P&&(ee+=P+1),i.getLast(ee,H)},y=r(s.scrollTop,o.top),L=r(s.scrollLeft,o.left),I=l?{rows:0,cols:0}:0,w=this.last,g=!1,C=this.lastScrollPos;if(l){var k=this.lastScrollPos.top<=y,z=this.lastScrollPos.left<=L;if(!this.appendOnly||this.appendOnly&&(k||z)){var f={rows:a(y,this.itemSize[0]),cols:a(L,this.itemSize[1])},K={rows:u(f.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],k),cols:u(f.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],z)};I={rows:d(f.rows,K.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],k),cols:d(f.cols,K.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],z,!0)},w={rows:h(f.rows,I.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0]),cols:h(f.cols,I.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],!0)},g=I.rows!==this.first.rows||w.rows!==this.last.rows||I.cols!==this.first.cols||w.cols!==this.last.cols||this.isRangeChanged,C={top:y,left:L}}}else{var F=n?L:y,m=this.lastScrollPos<=F;if(!this.appendOnly||this.appendOnly&&m){var v=a(F,this.itemSize),E=u(v,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,m);I=d(v,E,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,m),w=h(v,I,this.last,this.numItemsInViewport,this.d_numToleratedItems),g=I!==this.first||w!==this.last||this.isRangeChanged,C=F}}return{first:I,last:w,isRangeChanged:g,scrollPos:C}},onScrollChange:function(e){var i=this.onScrollPositionChange(e),s=i.first,l=i.last,n=i.isRangeChanged,o=i.scrollPos;if(n){var r={first:s,last:l};if(this.setContentPosition(r),this.first=s,this.last=l,this.lastScrollPos=o,this.$emit("scroll-index-change",r),this.lazy&&this.isPageChanged(s)){var a,u,d={first:this.step?Math.min(this.getPageByFirst(s)*this.step,(((a=this.items)===null||a===void 0?void 0:a.length)||0)-this.step):s,last:Math.min(this.step?(this.getPageByFirst(s)+1)*this.step:l,((u=this.items)===null||u===void 0?void 0:u.length)||0)},h=this.lazyLoadState.first!==d.first||this.lazyLoadState.last!==d.last;h&&this.$emit("lazy-load",d),this.lazyLoadState=d}}},onScroll:function(e){var i=this;if(this.$emit("scroll",e),this.delay){if(this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.isPageChanged()){if(!this.d_loading&&this.showLoader){var s=this.onScrollPositionChange(e),l=s.isRangeChanged,n=l||(this.step?this.isPageChanged():!1);n&&(this.d_loading=!0)}this.scrollTimeout=setTimeout(function(){i.onScrollChange(e),i.d_loading&&i.showLoader&&(!i.lazy||i.loading===void 0)&&(i.d_loading=!1,i.page=i.getPageByFirst())},this.delay)}}else this.onScrollChange(e)},onResize:function(){var e=this;this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){if(ne(e.element)){var i=e.isBoth(),s=e.isVertical(),l=e.isHorizontal(),n=[Z(e.element),$(e.element)],o=n[0],r=n[1],a=o!==e.defaultWidth,u=r!==e.defaultHeight,d=i?a||u:l?a:s?u:!1;d&&(e.d_numToleratedItems=e.numToleratedItems,e.defaultWidth=o,e.defaultHeight=r,e.defaultContentWidth=Z(e.content),e.defaultContentHeight=$(e.content),e.init())}},this.resizeDelay)},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),window.addEventListener("orientationchange",this.resizeListener),this.resizeObserver=new ResizeObserver(function(){e.onResize()}),this.resizeObserver.observe(this.element))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("orientationchange",this.resizeListener),this.resizeListener=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},getOptions:function(e){var i=(this.items||[]).length,s=this.isBoth()?this.first.rows+e:this.first+e;return{index:s,count:i,first:s===0,last:s===i-1,even:s%2===0,odd:s%2!==0}},getLoaderOptions:function(e,i){var s=this.loaderArr.length;return X({index:e,count:s,first:e===0,last:e===s-1,even:e%2===0,odd:e%2!==0},i)},getPageByFirst:function(e){return Math.floor(((e??this.first)+this.d_numToleratedItems*4)/(this.step||1))},isPageChanged:function(e){return this.step&&!this.lazy?this.page!==this.getPageByFirst(e??this.first):!0},setContentEl:function(e){this.content=e||this.content||be(this.element,'[data-pc-section="content"]')},elementRef:function(e){this.element=e},contentRef:function(e){this.content=e}},computed:{containerClass:function(){return["p-virtualscroller",this.class,{"p-virtualscroller-inline":this.inline,"p-virtualscroller-both p-both-scroll":this.isBoth(),"p-virtualscroller-horizontal p-horizontal-scroll":this.isHorizontal()}]},contentClass:function(){return["p-virtualscroller-content",{"p-virtualscroller-loading":this.d_loading}]},loaderClass:function(){return["p-virtualscroller-loader",{"p-virtualscroller-loader-mask":!this.$slots.loader}]},loadedItems:function(){var e=this;return this.items&&!this.d_loading?this.isBoth()?this.items.slice(this.appendOnly?0:this.first.rows,this.last.rows).map(function(i){return e.columns?i:i.slice(e.appendOnly?0:e.first.cols,e.last.cols)}):this.isHorizontal()&&this.columns?this.items:this.items.slice(this.appendOnly?0:this.first,this.last):[]},loadedRows:function(){return this.d_loading?this.loaderDisabled?this.loaderArr:[]:this.loadedItems},loadedColumns:function(){if(this.columns){var e=this.isBoth(),i=this.isHorizontal();if(e||i)return this.d_loading&&this.loaderDisabled?e?this.loaderArr[0]:this.loaderArr:this.columns.slice(e?this.first.cols:this.first,e?this.last.cols:this.last)}return this.columns}},components:{SpinnerIcon:Oe}},ft=["tabindex"];function mt(t,e,i,s,l,n){var o=x("SpinnerIcon");return t.disabled?(p(),b(U,{key:1},[O(t.$slots,"default"),O(t.$slots,"content",{items:t.items,rows:t.items,columns:n.loadedColumns})],64)):(p(),b("div",c({key:0,ref:n.elementRef,class:n.containerClass,tabindex:t.tabindex,style:t.style,onScroll:e[0]||(e[0]=function(){return n.onScroll&&n.onScroll.apply(n,arguments)})},t.ptmi("root")),[O(t.$slots,"content",{styleClass:n.contentClass,items:n.loadedItems,getItemOptions:n.getOptions,loading:l.d_loading,getLoaderOptions:n.getLoaderOptions,itemSize:t.itemSize,rows:n.loadedRows,columns:n.loadedColumns,contentRef:n.contentRef,spacerStyle:l.spacerStyle,contentStyle:l.contentStyle,vertical:n.isVertical(),horizontal:n.isHorizontal(),both:n.isBoth()},function(){return[V("div",c({ref:n.contentRef,class:n.contentClass,style:l.contentStyle},t.ptm("content")),[(p(!0),b(U,null,re(n.loadedItems,function(r,a){return O(t.$slots,"item",{key:a,item:r,options:n.getOptions(a)})}),128))],16)]}),t.showSpacer?(p(),b("div",c({key:0,class:"p-virtualscroller-spacer",style:l.spacerStyle},t.ptm("spacer")),null,16)):B("",!0),!t.loaderDisabled&&t.showLoader&&l.d_loading?(p(),b("div",c({key:1,class:n.loaderClass},t.ptm("loader")),[t.$slots&&t.$slots.loader?(p(!0),b(U,{key:0},re(l.loaderArr,function(r,a){return O(t.$slots,"loader",{key:a,options:n.getLoaderOptions(a,n.isBoth()&&{numCols:t.d_numItemsInViewport.cols})})}),128)):B("",!0),O(t.$slots,"loadingicon",{},function(){return[j(o,c({spin:"",class:"p-virtualscroller-loading-icon"},t.ptm("loadingIcon")),null,16)]})],16)):B("",!0)],16,ft))}Ce.render=mt;var gt=ge`
.p-select {
display: inline-flex;
cursor: pointer;
position: relative;
user-select: none;
background: dt('select.background');
border: 1px solid dt('select.border.color');
transition:
background dt('select.transition.duration'),
color dt('select.transition.duration'),
border-color dt('select.transition.duration'),
outline-color dt('select.transition.duration'),
box-shadow dt('select.transition.duration');
border-radius: dt('select.border.radius');
outline-color: transparent;
box-shadow: dt('select.shadow');
}
.p-select:not(.p-disabled):hover {
border-color: dt('select.hover.border.color');
}
.p-select:not(.p-disabled).p-focus {
border-color: dt('select.focus.border.color');
box-shadow: dt('select.focus.ring.shadow');
outline: dt('select.focus.ring.width') dt('select.focus.ring.style') dt('select.focus.ring.color');
outline-offset: dt('select.focus.ring.offset');
}
.p-select.p-variant-filled {
background: dt('select.filled.background');
}
.p-select.p-variant-filled:not(.p-disabled):hover {
background: dt('select.filled.hover.background');
}
.p-select.p-variant-filled:not(.p-disabled).p-focus {
background: dt('select.filled.focus.background');
}
.p-select.p-invalid {
border-color: dt('select.invalid.border.color');
}
.p-select.p-disabled {
opacity: 1;
background: dt('select.disabled.background');
}
.p-select-clear-icon {
position: absolute;
top: 50%;
margin-top: -0.5rem;
color: dt('select.clear.icon.color');
inset-inline-end: dt('select.dropdown.width');
}
.p-select-dropdown {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
background: transparent;
color: dt('select.dropdown.color');
width: dt('select.dropdown.width');
border-start-end-radius: dt('select.border.radius');
border-end-end-radius: dt('select.border.radius');
}
.p-select-label {
display: block;
white-space: nowrap;
overflow: hidden;
flex: 1 1 auto;
width: 1%;
padding: dt('select.padding.y') dt('select.padding.x');
text-overflow: ellipsis;
cursor: pointer;
color: dt('select.color');
background: transparent;
border: 0 none;
outline: 0 none;
}
.p-select-label.p-placeholder {
color: dt('select.placeholder.color');
}
.p-select.p-invalid .p-select-label.p-placeholder {
color: dt('select.invalid.placeholder.color');
}
.p-select:has(.p-select-clear-icon) .p-select-label {
padding-inline-end: calc(1rem + dt('select.padding.x'));
}
.p-select.p-disabled .p-select-label {
color: dt('select.disabled.color');
}
.p-select-label-empty {
overflow: hidden;
opacity: 0;
}
input.p-select-label {
cursor: default;
}
.p-select .p-select-overlay {
min-width: 100%;
}
.p-select-overlay {
position: absolute;
top: 0;
left: 0;
background: dt('select.overlay.background');
color: dt('select.overlay.color');
border: 1px solid dt('select.overlay.border.color');
border-radius: dt('select.overlay.border.radius');
box-shadow: dt('select.overlay.shadow');
}
.p-select-header {
padding: dt('select.list.header.padding');
}
.p-select-filter {
width: 100%;
}
.p-select-list-container {
overflow: auto;
}
.p-select-option-group {
cursor: auto;
margin: 0;
padding: dt('select.option.group.padding');
background: dt('select.option.group.background');
color: dt('select.option.group.color');
font-weight: dt('select.option.group.font.weight');
}
.p-select-list {
margin: 0;
padding: 0;
list-style-type: none;
padding: dt('select.list.padding');
gap: dt('select.list.gap');
display: flex;
flex-direction: column;
}
.p-select-option {
cursor: pointer;
font-weight: normal;
white-space: nowrap;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
padding: dt('select.option.padding');
border: 0 none;
color: dt('select.option.color');
background: transparent;
transition:
background dt('select.transition.duration'),
color dt('select.transition.duration'),
border-color dt('select.transition.duration'),
box-shadow dt('select.transition.duration'),
outline-color dt('select.transition.duration');
border-radius: dt('select.option.border.radius');
}
.p-select-option:not(.p-select-option-selected):not(.p-disabled).p-focus {
background: dt('select.option.focus.background');
color: dt('select.option.focus.color');
}
.p-select-option.p-select-option-selected {
background: dt('select.option.selected.background');
color: dt('select.option.selected.color');
}
.p-select-option.p-select-option-selected.p-focus {
background: dt('select.option.selected.focus.background');
color: dt('select.option.selected.focus.color');
}
.p-select-option-blank-icon {
flex-shrink: 0;
}
.p-select-option-check-icon {
position: relative;
flex-shrink: 0;
margin-inline-start: dt('select.checkmark.gutter.start');
margin-inline-end: dt('select.checkmark.gutter.end');
color: dt('select.checkmark.color');
}
.p-select-empty-message {
padding: dt('select.empty.message.padding');
}
.p-select-fluid {
display: flex;
width: 100%;
}
.p-select-sm .p-select-label {
font-size: dt('select.sm.font.size');
padding-block: dt('select.sm.padding.y');
padding-inline: dt('select.sm.padding.x');
}
.p-select-sm .p-select-dropdown .p-icon {
font-size: dt('select.sm.font.size');
width: dt('select.sm.font.size');
height: dt('select.sm.font.size');
}
.p-select-lg .p-select-label {
font-size: dt('select.lg.font.size');
padding-block: dt('select.lg.padding.y');
padding-inline: dt('select.lg.padding.x');
}
.p-select-lg .p-select-dropdown .p-icon {
font-size: dt('select.lg.font.size');
width: dt('select.lg.font.size');
height: dt('select.lg.font.size');
}
`,vt={root:function(e){var i=e.instance,s=e.props,l=e.state;return["p-select p-component p-inputwrapper",{"p-disabled":s.disabled,"p-invalid":i.$invalid,"p-variant-filled":i.$variant==="filled","p-focus":l.focused,"p-inputwrapper-filled":i.$filled,"p-inputwrapper-focus":l.focused||l.overlayVisible,"p-select-open":l.overlayVisible,"p-select-fluid":i.$fluid,"p-select-sm p-inputfield-sm":s.size==="small","p-select-lg p-inputfield-lg":s.size==="large"}]},label:function(e){var i=e.instance,s=e.props;return["p-select-label",{"p-placeholder":!s.editable&&i.label===s.placeholder,"p-select-label-empty":!s.editable&&!i.$slots.value&&(i.label==="p-emptylabel"||i.label.length===0)}]},clearIcon:"p-select-clear-icon",dropdown:"p-select-dropdown",loadingicon:"p-select-loading-icon",dropdownIcon:"p-select-dropdown-icon",overlay:"p-select-overlay p-component",header:"p-select-header",pcFilter:"p-select-filter",listContainer:"p-select-list-container",list:"p-select-list",optionGroup:"p-select-option-group",optionGroupLabel:"p-select-option-group-label",option:function(e){var i=e.instance,s=e.props,l=e.state,n=e.option,o=e.focusedOption;return["p-select-option",{"p-select-option-selected":i.isSelected(n)&&s.highlightOnSelect,"p-focus":l.focusedOptionIndex===o,"p-disabled":i.isOptionDisabled(n)}]},optionLabel:"p-select-option-label",optionCheckIcon:"p-select-option-check-icon",optionBlankIcon:"p-select-option-blank-icon",emptyMessage:"p-select-empty-message"},bt=ve.extend({name:"select",style:gt,classes:vt}),yt={name:"BaseSelect",extends:Fe,props:{options:Array,optionLabel:[String,Function],optionValue:[String,Function],optionDisabled:[String,Function],optionGroupLabel:[String,Function],optionGroupChildren:[String,Function],scrollHeight:{type:String,default:"14rem"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},labelId:{type:String,default:null},labelClass:{type:[String,Object],default:null},labelStyle:{type:Object,default:null},panelClass:{type:[String,Object],default:null},overlayStyle:{type:Object,default:null},overlayClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},appendTo:{type:[String,Object],default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},resetFilterOnClear:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!1},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},highlightOnSelect:{type:Boolean,default:!0},checkmark:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:bt,provide:function(){return{$pcSelect:this,$parentInstance:this}}};function Y(t){"@babel/helpers - typeof";return Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(t)}function Ot(t){return Lt(t)||wt(t)||St(t)||It()}function It(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function St(t,e){if(t){if(typeof t=="string")return ae(t,e);var i={}.toString.call(t).slice(8,-1);return i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set"?Array.from(t):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ae(t,e):void 0}}function wt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Lt(t){if(Array.isArray(t))return ae(t)}function ae(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}function fe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),i.push.apply(i,s)}return i}function me(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(i),!0).forEach(function(s){G(t,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):fe(Object(i)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(i,s))})}return t}function G(t,e,i){return(e=Ct(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ct(t){var e=kt(t,"string");return Y(e)=="symbol"?e:e+""}function kt(t,e){if(Y(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var s=i.call(t,e);if(Y(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zt={name:"Select",extends:yt,inheritAttrs:!1,emits:["change","focus","blur","before-show","before-hide","show","hide","filter"],outsideClickListener:null,scrollHandler:null,resizeListener:null,labelClickListener:null,matchMediaOrientationListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,data:function(){return{clicked:!1,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1,queryOrientation:null}},watch:{modelValue:function(){this.isModelValueChanged=!0},options:function(){this.autoUpdateModel()}},mounted:function(){this.autoUpdateModel(),this.bindLabelClickListener(),this.bindMatchMediaOrientationListener()},updated:function(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindLabelClickListener(),this.unbindMatchMediaOrientationListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(oe.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,i){return this.virtualScrollerDisabled?e:i&&i(e).index},getOptionLabel:function(e){return this.optionLabel?N(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?N(e,this.optionValue):e},getOptionRenderKey:function(e,i){return(this.dataKey?N(e,this.dataKey):this.getOptionLabel(e))+"_"+i},getPTItemOptions:function(e,i,s,l){return this.ptm(l,{context:{option:e,index:s,selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(s,i),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.optionDisabled?N(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return N(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return N(e,this.optionGroupChildren)},getAriaPosInset:function(e){var i=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(s){return i.isOptionGroup(s)}).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.editable?-1:this.findSelectedOptionIndex(),e&&D(this.$refs.focusInput)},hide:function(e){var i=this,s=function(){i.$emit("before-hide"),i.overlayVisible=!1,i.clicked=!1,i.focusedOptionIndex=-1,i.searchValue="",i.resetFilterOnHide&&(i.filterValue=null),e&&D(i.$refs.focusInput)};setTimeout(function(){s()},0)},onFocus:function(e){this.disabled||(this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.editable?-1:this.findSelectedOptionIndex(),this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){var i=this;setTimeout(function(){var s,l;i.focused=!1,i.focusedOptionIndex=-1,i.searchValue="",i.$emit("blur",e),(s=(l=i.formField).onBlur)===null||s===void 0||s.call(l,e)},100)},onKeyDown:function(e){if(this.disabled){e.preventDefault();return}if(Ge())switch(e.code){case"Backspace":this.onBackspaceKey(e,this.editable);break;case"Enter":case"NumpadDecimal":this.onEnterKey(e);break;default:e.preventDefault();return}var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!i&&Ne(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key));break}this.clicked=!1},onEditableInput:function(e){var i=e.target.value;this.searchValue="";var s=this.searchOptions(e,i);!s&&(this.focusedOptionIndex=-1),this.updateModel(e,i),!this.overlayVisible&&Q(i)&&this.show()},onContainerClick:function(e){this.disabled||this.loading||e.target.tagName==="INPUT"||e.target.getAttribute("data-pc-section")==="clearicon"||e.target.closest('[data-pc-section="clearicon"]')||((!this.overlay||!this.overlay.contains(e.target))&&(this.overlayVisible?this.hide(!0):this.show(!0)),this.clicked=!0)},onClearClick:function(e){this.updateModel(e,null),this.resetFilterOnClear&&(this.filterValue=null)},onFirstHiddenFocus:function(e){var i=e.relatedTarget===this.$refs.focusInput?je(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;D(i)},onLastHiddenFocus:function(e){var i=e.relatedTarget===this.$refs.focusInput?Re(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;D(i)},onOptionSelect:function(e,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=this.getOptionValue(i);this.updateModel(e,l),s&&this.hide(!0)},onOptionMouseMove:function(e,i){this.focusOnHover&&this.changeFocusedOptionIndex(e,i)},onFilterChange:function(e){var i=e.target.value;this.filterValue=i,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:i}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){if(!e.isComposing)switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0);break}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){at.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){switch(e.code){case"Escape":this.onEscapeKey(e);break}},onArrowDownKey:function(e){if(!this.overlayVisible)this.show(),this.editable&&this.changeFocusedOptionIndex(e,this.findSelectedOptionIndex());else{var i=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onArrowUpKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.altKey&&!i)this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var s=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,s),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(i){var s=e.currentTarget;e.shiftKey?s.setSelectionRange(0,e.target.selectionStart):(s.setSelectionRange(0,0),this.focusedOptionIndex=-1)}else this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onEndKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(i){var s=e.currentTarget;if(e.shiftKey)s.setSelectionRange(e.target.selectionStart,s.value.length);else{var l=s.value.length;s.setSelectionRange(l,l),this.focusedOptionIndex=-1}}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?(this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)),e.preventDefault()},onSpaceKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;!i&&this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault(),e.stopPropagation()},onTabKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i||(this.overlayVisible&&this.hasFocusableElements()?(D(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i&&!this.overlayVisible&&this.show()},onOverlayEnter:function(e){var i=this;oe.set("overlay",e,this.$primevue.config.zIndex.overlay),He(e,{position:"absolute",top:"0"}),this.alignOverlay(),this.scrollInView(),this.$attrSelector&&e.setAttribute(this.$attrSelector,""),setTimeout(function(){i.autoFilterFocus&&i.filter&&D(i.$refs.filterInput.$el),i.autoUpdateModel()},1)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){var e=this;this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.autoFilterFocus&&this.filter&&!this.editable&&this.$nextTick(function(){e.$refs.filterInput&&D(e.$refs.filterInput.$el)}),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){oe.clear(e)},alignOverlay:function(){this.appendTo==="self"?Ke(this.overlay,this.$el):this.overlay&&(this.overlay.style.minWidth=De(this.$el)+"px",Ae(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(i){var s=i.composedPath();e.overlayVisible&&e.overlay&&!s.includes(e.$el)&&!s.includes(e.overlay)&&e.hide()},document.addEventListener("click",this.outsideClickListener,!0))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener,!0),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new nt(this.$refs.container,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!Ee()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindLabelClickListener:function(){var e=this;if(!this.editable&&!this.labelClickListener){var i=document.querySelector('label[for="'.concat(this.labelId,'"]'));i&&ne(i)&&(this.labelClickListener=function(){D(e.$refs.focusInput)},i.addEventListener("click",this.labelClickListener))}},unbindLabelClickListener:function(){if(this.labelClickListener){var e=document.querySelector('label[for="'.concat(this.labelId,'"]'));e&&ne(e)&&e.removeEventListener("click",this.labelClickListener)}},bindMatchMediaOrientationListener:function(){var e=this;if(!this.matchMediaOrientationListener){var i=matchMedia("(orientation: portrait)");this.queryOrientation=i,this.matchMediaOrientationListener=function(){e.alignOverlay()},this.queryOrientation.addEventListener("change",this.matchMediaOrientationListener)}},unbindMatchMediaOrientationListener:function(){this.matchMediaOrientationListener&&(this.queryOrientation.removeEventListener("change",this.matchMediaOrientationListener),this.queryOrientation=null,this.matchMediaOrientationListener=null)},hasFocusableElements:function(){return Be(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionExactMatched:function(e){var i;return this.isValidOption(e)&&typeof this.getOptionLabel(e)=="string"&&((i=this.getOptionLabel(e))===null||i===void 0?void 0:i.toLocaleLowerCase(this.filterLocale))==this.searchValue.toLocaleLowerCase(this.filterLocale)},isOptionStartsWith:function(e){var i;return this.isValidOption(e)&&typeof this.getOptionLabel(e)=="string"&&((i=this.getOptionLabel(e))===null||i===void 0?void 0:i.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return Q(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return xe(this.d_value,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex(function(i){return e.isValidOption(i)})},findLastOptionIndex:function(){var e=this;return ue(this.visibleOptions,function(i){return e.isValidOption(i)})},findNextOptionIndex:function(e){var i=this,s=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(l){return i.isValidOption(l)}):-1;return s>-1?s+e+1:e},findPrevOptionIndex:function(e){var i=this,s=e>0?ue(this.visibleOptions.slice(0,e),function(l){return i.isValidOption(l)}):-1;return s>-1?s:e},findSelectedOptionIndex:function(){var e=this;return this.$filled?this.visibleOptions.findIndex(function(i){return e.isValidSelectedOption(i)}):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,i){var s=this;this.searchValue=(this.searchValue||"")+i;var l=-1,n=!1;return Q(this.searchValue)&&(l=this.visibleOptions.findIndex(function(o){return s.isOptionExactMatched(o)}),l===-1&&(l=this.visibleOptions.findIndex(function(o){return s.isOptionStartsWith(o)})),l!==-1&&(n=!0),l===-1&&this.focusedOptionIndex