medicine/Medicine-Server/admin/assets/Select-24ba44f4.js

331 lines
62 KiB
JavaScript

import{d as re,u as kt,q as ze,d5 as rn,d8 as an,n as B,r as P,a7 as $e,e1 as rt,bE as Ee,h as u,y as sn,aj as vt,A as ut,aA as dn,eg as gt,s as Ot,f as L,B as H,k as le,l as Ft,p as ve,eh as un,H as ct,ei as cn,ag as ce,v as je,N as Mt,a6 as Se,T as Pt,j as oe,I as at,g as zt,t as te,ej as fn,m as Re,ah as Je,D as bt,ai as hn,c2 as vn,Y as gn,z as bn,ek as pn,w as mn,el as yn,K as wn,em as xn,bI as Cn,x as Sn,V as Rn,W as Tn,P as pt,c0 as kn,en as On,a2 as se}from"./index-e7476adc.js";import{a as It,u as mt}from"./Eye-aa255ab4.js";import{c as _t,a as Ke,i as ft,f as Fn,_ as Mn,u as Pn,b as st,V as zn,d as In,e as _n}from"./Tooltip-15ee251f.js";import{N as An}from"./Input-5c51dd0a.js";import{N as Qe}from"./Tag-4d6be00a.js";import{b as Bn}from"./next-frame-once-7035a838.js";function De(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function Nn(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function et(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(o=>{o&&o(n)})}}function yt(e){return e&-e}class En{constructor(t,n){this.l=t,this.min=n;const o=new Array(t+1);for(let l=0;l<t+1;++l)o[l]=0;this.ft=o}add(t,n){if(n===0)return;const{l:o,ft:l}=this;for(t+=1;t<=o;)l[t]+=n,t+=yt(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:o,l}=this;if(t>l)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=t*o;for(;t>0;)s+=n[t],t-=yt(t);return s}getBound(t){let n=0,o=this.l;for(;o>n;){const l=Math.floor((n+o)/2),s=this.sum(l);if(s>t){o=l;continue}else if(s<t){if(n===l)return this.sum(n+1)<=t?n+1:l;n=l}else return l}return n}}let Le;function Ln(){return Le===void 0&&("matchMedia"in window?Le=window.matchMedia("(pointer:coarse)").matches:Le=!1),Le}let tt;function wt(){return tt===void 0&&(tt="chrome"in window?window.devicePixelRatio:1),tt}const $n=Ke(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Ke("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Ke("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Kn=re({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=kt();$n.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:_t,ssr:t}),ze(()=>{const{defaultScrollIndex:p,defaultScrollKey:x}=e;p!=null?b({index:p}):x!=null&&b({key:x})});let n=!1,o=!1;rn(()=>{if(n=!1,!o){o=!0;return}b({top:v.value,left:h})}),an(()=>{n=!0,o||(o=!0)});const l=B(()=>{const p=new Map,{keyField:x}=e;return e.items.forEach((N,q)=>{p.set(N[x],q)}),p}),s=P(null),a=P(void 0),r=new Map,m=B(()=>{const{items:p,itemSize:x,keyField:N}=e,q=new En(p.length,x);return p.forEach((Y,U)=>{const V=Y[N],Z=r.get(V);Z!==void 0&&q.add(U,Z)}),q}),f=P(0);let h=0;const v=P(0),O=$e(()=>Math.max(m.value.getBound(v.value-rt(e.paddingTop))-1,0)),z=B(()=>{const{value:p}=a;if(p===void 0)return[];const{items:x,itemSize:N}=e,q=O.value,Y=Math.min(q+Math.ceil(p/N+1),x.length-1),U=[];for(let V=q;V<=Y;++V)U.push(x[V]);return U}),b=(p,x)=>{if(typeof p=="number"){T(p,x,"auto");return}const{left:N,top:q,index:Y,key:U,position:V,behavior:Z,debounce:d=!0}=p;if(N!==void 0||q!==void 0)T(N,q,Z);else if(Y!==void 0)R(Y,Z,d);else if(U!==void 0){const y=l.value.get(U);y!==void 0&&R(y,Z,d)}else V==="bottom"?T(0,Number.MAX_SAFE_INTEGER,Z):V==="top"&&T(0,0,Z)};let k,$=null;function R(p,x,N){const{value:q}=m,Y=q.sum(p)+rt(e.paddingTop);if(!N)s.value.scrollTo({left:0,top:Y,behavior:x});else{k=p,$!==null&&window.clearTimeout($),$=window.setTimeout(()=>{k=void 0,$=null},16);const{scrollTop:U,offsetHeight:V}=s.value;if(Y>U){const Z=q.get(p);Y+Z<=U+V||s.value.scrollTo({left:0,top:Y+Z-V,behavior:x})}else s.value.scrollTo({left:0,top:Y,behavior:x})}}function T(p,x,N){s.value.scrollTo({left:p,top:x,behavior:N})}function K(p,x){var N,q,Y;if(n||e.ignoreItemResize||D(x.target))return;const{value:U}=m,V=l.value.get(p),Z=U.get(V),d=(Y=(q=(N=x.borderBoxSize)===null||N===void 0?void 0:N[0])===null||q===void 0?void 0:q.blockSize)!==null&&Y!==void 0?Y:x.contentRect.height;if(d===Z)return;d-e.itemSize===0?r.delete(p):r.set(p,d-e.itemSize);const j=d-Z;if(j===0)return;U.add(V,j);const ee=s.value;if(ee!=null){if(k===void 0){const de=U.sum(V);ee.scrollTop>de&&ee.scrollBy(0,j)}else if(V<k)ee.scrollBy(0,j);else if(V===k){const de=U.sum(V);d+de>ee.scrollTop+ee.offsetHeight&&ee.scrollBy(0,j)}J()}f.value++}const w=!Ln();let C=!1;function M(p){var x;(x=e.onScroll)===null||x===void 0||x.call(e,p),(!w||!C)&&J()}function W(p){var x;if((x=e.onWheel)===null||x===void 0||x.call(e,p),w){const N=s.value;if(N!=null){if(p.deltaX===0&&(N.scrollTop===0&&p.deltaY<=0||N.scrollTop+N.offsetHeight>=N.scrollHeight&&p.deltaY>=0))return;p.preventDefault(),N.scrollTop+=p.deltaY/wt(),N.scrollLeft+=p.deltaX/wt(),J(),C=!0,Bn(()=>{C=!1})}}}function G(p){if(n||D(p.target)||p.contentRect.height===a.value)return;a.value=p.contentRect.height;const{onResize:x}=e;x!==void 0&&x(p)}function J(){const{value:p}=s;p!=null&&(v.value=p.scrollTop,h=p.scrollLeft)}function D(p){let x=p;for(;x!==null;){if(x.style.display==="none")return!0;x=x.parentElement}return!1}return{listHeight:a,listStyle:{overflow:"auto"},keyToIndex:l,itemsStyle:B(()=>{const{itemResizable:p}=e,x=Ee(m.value.sum());return f.value,[e.itemsStyle,{boxSizing:"content-box",height:p?"":x,minHeight:p?x:"",paddingTop:Ee(e.paddingTop),paddingBottom:Ee(e.paddingBottom)}]}),visibleItemsStyle:B(()=>(f.value,{transform:`translateY(${Ee(m.value.sum(O.value))})`})),viewportItems:z,listElRef:s,itemsElRef:P(null),scrollTo:b,handleListResize:G,handleListScroll:M,handleListWheel:W,handleItemResize:K}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:o}=this;return u(vt,{onResize:this.handleListResize},{default:()=>{var l,s;return u("div",sn(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?u("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[u(o,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(a=>{const r=a[t],m=n.get(r),f=this.$slots.default({item:a,index:m})[0];return e?u(vt,{key:r,onResize:h=>this.handleItemResize(r,h)},{default:()=>f}):(f.key=r,f)})})]):(s=(l=this.$slots).empty)===null||s===void 0?void 0:s.call(l)])}})}}),pe="v-hidden",Dn=Ke("[v-hidden]",{display:"none!important"}),xt=re({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=P(null),o=P(null);function l(){const{value:a}=n,{getCounter:r,getTail:m}=e;let f;if(r!==void 0?f=r():f=o.value,!a||!f)return;f.hasAttribute(pe)&&f.removeAttribute(pe);const{children:h}=a,v=a.offsetWidth,O=[],z=t.tail?m==null?void 0:m():null;let b=z?z.offsetWidth:0,k=!1;const $=a.children.length-(t.tail?1:0);for(let T=0;T<$-1;++T){if(T<0)continue;const K=h[T];if(k){K.hasAttribute(pe)||K.setAttribute(pe,"");continue}else K.hasAttribute(pe)&&K.removeAttribute(pe);const w=K.offsetWidth;if(b+=w,O[T]=w,b>v){const{updateCounter:C}=e;for(let M=T;M>=0;--M){const W=$-1-M;C!==void 0?C(W):f.textContent=`${W}`;const G=f.offsetWidth;if(b-=O[M],b+G<=v||M===0){k=!0,T=M-1,z&&(T===-1?(z.style.maxWidth=`${v-G}px`,z.style.boxSizing="border-box"):z.style.maxWidth="");break}}}}const{onUpdateOverflow:R}=e;k?R!==void 0&&R(!0):(R!==void 0&&R(!1),f.setAttribute(pe,""))}const s=kt();return Dn.mount({id:"vueuc/overflow",head:!0,anchorMetaName:_t,ssr:s}),ze(l),{selfRef:n,counterRef:o,sync:l}},render(){const{$slots:e}=this;return ut(this.sync),u("div",{class:"v-overflow",ref:"selfRef"},[dn(e,"default"),e.counter?e.counter():u("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function At(e,t){t&&(ze(()=>{const{value:n}=e;n&&gt.registerHandler(n,t)}),Ot(()=>{const{value:n}=e;n&&gt.unregisterHandler(n)}))}const Vn=re({name:"Checkmark",render(){return u("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},u("g",{fill:"none"},u("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Wn=re({name:"Empty",render(){return u("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),u("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),jn=re({props:{onFocus:Function,onBlur:Function},setup(e){return()=>u("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function Ct(e){return Array.isArray(e)?e:[e]}const dt={STOP:"STOP"};function Bt(e,t){const n=t(e);e.children!==void 0&&n!==dt.STOP&&e.children.forEach(o=>Bt(o,t))}function Hn(e,t={}){const{preserveGroup:n=!1}=t,o=[],l=n?a=>{a.isLeaf||(o.push(a.key),s(a.children))}:a=>{a.isLeaf||(a.isGroup||o.push(a.key),s(a.children))};function s(a){a.forEach(l)}return s(e),o}function Gn(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function Un(e){return e.children}function qn(e){return e.key}function Yn(){return!1}function Zn(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function Xn(e){return e.disabled===!0}function Jn(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function nt(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function ot(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function Qn(e,t){const n=new Set(e);return t.forEach(o=>{n.has(o)||n.add(o)}),Array.from(n)}function eo(e,t){const n=new Set(e);return t.forEach(o=>{n.has(o)&&n.delete(o)}),Array.from(n)}function to(e){return(e==null?void 0:e.type)==="group"}function no(e){const t=new Map;return e.forEach((n,o)=>{t.set(n.key,o)}),n=>{var o;return(o=t.get(n))!==null&&o!==void 0?o:null}}class oo extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function io(e,t,n,o){return Ve(t.concat(e),n,o,!1)}function lo(e,t){const n=new Set;return e.forEach(o=>{const l=t.treeNodeMap.get(o);if(l!==void 0){let s=l.parent;for(;s!==null&&!(s.disabled||n.has(s.key));)n.add(s.key),s=s.parent}}),n}function ro(e,t,n,o){const l=Ve(t,n,o,!1),s=Ve(e,n,o,!0),a=lo(e,n),r=[];return l.forEach(m=>{(s.has(m)||a.has(m))&&r.push(m)}),r.forEach(m=>l.delete(m)),l}function it(e,t){const{checkedKeys:n,keysToCheck:o,keysToUncheck:l,indeterminateKeys:s,cascade:a,leafOnly:r,checkStrategy:m,allowNotLoaded:f}=e;if(!a)return o!==void 0?{checkedKeys:Qn(n,o),indeterminateKeys:Array.from(s)}:l!==void 0?{checkedKeys:eo(n,l),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:h}=t;let v;l!==void 0?v=ro(l,n,t,f):o!==void 0?v=io(o,n,t,f):v=Ve(n,t,f,!1);const O=m==="parent",z=m==="child"||r,b=v,k=new Set,$=Math.max.apply(null,Array.from(h.keys()));for(let R=$;R>=0;R-=1){const T=R===0,K=h.get(R);for(const w of K){if(w.isLeaf)continue;const{key:C,shallowLoaded:M}=w;if(z&&M&&w.children.forEach(D=>{!D.disabled&&!D.isLeaf&&D.shallowLoaded&&b.has(D.key)&&b.delete(D.key)}),w.disabled||!M)continue;let W=!0,G=!1,J=!0;for(const D of w.children){const p=D.key;if(!D.disabled){if(J&&(J=!1),b.has(p))G=!0;else if(k.has(p)){G=!0,W=!1;break}else if(W=!1,G)break}}W&&!J?(O&&w.children.forEach(D=>{!D.disabled&&b.has(D.key)&&b.delete(D.key)}),b.add(C)):G&&k.add(C),T&&z&&b.has(C)&&b.delete(C)}}return{checkedKeys:Array.from(b),indeterminateKeys:Array.from(k)}}function Ve(e,t,n,o){const{treeNodeMap:l,getChildren:s}=t,a=new Set,r=new Set(e);return e.forEach(m=>{const f=l.get(m);f!==void 0&&Bt(f,h=>{if(h.disabled)return dt.STOP;const{key:v}=h;if(!a.has(v)&&(a.add(v),r.add(v),Jn(h.rawNode,s))){if(o)return dt.STOP;if(!n)throw new oo}})}),r}function ao(e,{includeGroup:t=!1,includeSelf:n=!0},o){var l;const s=o.treeNodeMap;let a=e==null?null:(l=s.get(e))!==null&&l!==void 0?l:null;const r={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return r.treeNode=null,r;for(;a;)!a.ignored&&(t||!a.isGroup)&&r.treeNodePath.push(a),a=a.parent;return r.treeNodePath.reverse(),n||r.treeNodePath.pop(),r.keyPath=r.treeNodePath.map(m=>m.key),r}function so(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function uo(e,t){const n=e.siblings,o=n.length,{index:l}=e;return t?n[(l+1)%o]:l===n.length-1?null:n[l+1]}function St(e,t,{loop:n=!1,includeDisabled:o=!1}={}){const l=t==="prev"?co:uo,s={reverse:t==="prev"};let a=!1,r=null;function m(f){if(f!==null){if(f===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){r=e;return}}else if((!f.disabled||o)&&!f.ignored&&!f.isGroup){r=f;return}if(f.isGroup){const h=ht(f,s);h!==null?r=h:m(l(f,n))}else{const h=l(f,!1);if(h!==null)m(h);else{const v=fo(f);v!=null&&v.isGroup?m(l(v,n)):n&&m(l(f,!0))}}}}return m(e),r}function co(e,t){const n=e.siblings,o=n.length,{index:l}=e;return t?n[(l-1+o)%o]:l===0?null:n[l-1]}function fo(e){return e.parent}function ht(e,t={}){const{reverse:n=!1}=t,{children:o}=e;if(o){const{length:l}=o,s=n?l-1:0,a=n?-1:l,r=n?-1:1;for(let m=s;m!==a;m+=r){const f=o[m];if(!f.disabled&&!f.ignored)if(f.isGroup){const h=ht(f,t);if(h!==null)return h}else return f}}return null}const ho={getChild(){return this.ignored?null:ht(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return St(this,"next",e)},getPrev(e={}){return St(this,"prev",e)}};function vo(e,t){const n=t?new Set(t):void 0,o=[];function l(s){s.forEach(a=>{o.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&l(a.children)})}return l(e),o}function go(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function Nt(e,t,n,o,l,s=null,a=0){const r=[];return e.forEach((m,f)=>{var h;const v=Object.create(o);if(v.rawNode=m,v.siblings=r,v.level=a,v.index=f,v.isFirstChild=f===0,v.isLastChild=f+1===e.length,v.parent=s,!v.ignored){const O=l(m);Array.isArray(O)&&(v.children=Nt(O,t,n,o,l,v,a+1))}r.push(v),t.set(v.key,v),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(v)}),r}function bo(e,t={}){var n;const o=new Map,l=new Map,{getDisabled:s=Xn,getIgnored:a=Yn,getIsGroup:r=to,getKey:m=qn}=t,f=(n=t.getChildren)!==null&&n!==void 0?n:Un,h=t.ignoreEmptyChildren?w=>{const C=f(w);return Array.isArray(C)?C.length?C:null:C}:f,v=Object.assign({get key(){return m(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return r(this.rawNode)},get isLeaf(){return Gn(this.rawNode,h)},get shallowLoaded(){return Zn(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(w){return go(this,w)}},ho),O=Nt(e,o,l,v,h);function z(w){if(w==null)return null;const C=o.get(w);return C&&!C.isGroup&&!C.ignored?C:null}function b(w){if(w==null)return null;const C=o.get(w);return C&&!C.ignored?C:null}function k(w,C){const M=b(w);return M?M.getPrev(C):null}function $(w,C){const M=b(w);return M?M.getNext(C):null}function R(w){const C=b(w);return C?C.getParent():null}function T(w){const C=b(w);return C?C.getChild():null}const K={treeNodes:O,treeNodeMap:o,levelTreeNodeMap:l,maxLevel:Math.max(...l.keys()),getChildren:h,getFlattenedNodes(w){return vo(O,w)},getNode:z,getPrev:k,getNext:$,getParent:R,getChild:T,getFirstAvailableNode(){return so(O)},getPath(w,C={}){return ao(w,C,K)},getCheckedKeys(w,C={}){const{cascade:M=!0,leafOnly:W=!1,checkStrategy:G="all",allowNotLoaded:J=!1}=C;return it({checkedKeys:nt(w),indeterminateKeys:ot(w),cascade:M,leafOnly:W,checkStrategy:G,allowNotLoaded:J},K)},check(w,C,M={}){const{cascade:W=!0,leafOnly:G=!1,checkStrategy:J="all",allowNotLoaded:D=!1}=M;return it({checkedKeys:nt(C),indeterminateKeys:ot(C),keysToCheck:w==null?[]:Ct(w),cascade:W,leafOnly:G,checkStrategy:J,allowNotLoaded:D},K)},uncheck(w,C,M={}){const{cascade:W=!0,leafOnly:G=!1,checkStrategy:J="all",allowNotLoaded:D=!1}=M;return it({checkedKeys:nt(C),indeterminateKeys:ot(C),keysToUncheck:w==null?[]:Ct(w),cascade:W,leafOnly:G,checkStrategy:J,allowNotLoaded:D},K)},getNonLeafKeys(w={}){return Hn(O,w)}};return K}const po=L("empty",`
display: flex;
flex-direction: column;
align-items: center;
font-size: var(--n-font-size);
`,[H("icon",`
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
line-height: var(--n-icon-size);
color: var(--n-icon-color);
transition:
color .3s var(--n-bezier);
`,[le("+",[H("description",`
margin-top: 8px;
`)])]),H("description",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),H("extra",`
text-align: center;
transition: color .3s var(--n-bezier);
margin-top: 12px;
color: var(--n-extra-text-color);
`)]),mo=Object.assign(Object.assign({},ve.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),yo=re({name:"Empty",props:mo,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Ft(e),o=ve("Empty","-empty",po,un,e,t),{localeRef:l}=It("Empty"),s=ct(cn,null),a=B(()=>{var h,v,O;return(h=e.description)!==null&&h!==void 0?h:(O=(v=s==null?void 0:s.mergedComponentPropsRef.value)===null||v===void 0?void 0:v.Empty)===null||O===void 0?void 0:O.description}),r=B(()=>{var h,v;return((v=(h=s==null?void 0:s.mergedComponentPropsRef.value)===null||h===void 0?void 0:h.Empty)===null||v===void 0?void 0:v.renderIcon)||(()=>u(Wn,null))}),m=B(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:v},self:{[ce("iconSize",h)]:O,[ce("fontSize",h)]:z,textColor:b,iconColor:k,extraTextColor:$}}=o.value;return{"--n-icon-size":O,"--n-font-size":z,"--n-bezier":v,"--n-text-color":b,"--n-icon-color":k,"--n-extra-text-color":$}}),f=n?je("empty",B(()=>{let h="";const{size:v}=e;return h+=v[0],h}),m,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:r,localizedDescription:B(()=>a.value||l.value.description),cssVars:n?void 0:m,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),u("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?u("div",{class:`${t}-empty__icon`},e.icon?e.icon():u(Mt,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?u("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?u("div",{class:`${t}-empty__extra`},e.extra()):null)}});function wo(e,t){return u(Pt,{name:"fade-in-scale-up-transition"},{default:()=>e?u(Mt,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>u(Vn)}):null})}const Rt=re({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:o,valueSetRef:l,renderLabelRef:s,renderOptionRef:a,labelFieldRef:r,valueFieldRef:m,showCheckmarkRef:f,nodePropsRef:h,handleOptionClick:v,handleOptionMouseEnter:O}=ct(ft),z=$e(()=>{const{value:R}=n;return R?e.tmNode.key===R.key:!1});function b(R){const{tmNode:T}=e;T.disabled||v(R,T)}function k(R){const{tmNode:T}=e;T.disabled||O(R,T)}function $(R){const{tmNode:T}=e,{value:K}=z;T.disabled||K||O(R,T)}return{multiple:o,isGrouped:$e(()=>{const{tmNode:R}=e,{parent:T}=R;return T&&T.rawNode.type==="group"}),showCheckmark:f,nodeProps:h,isPending:z,isSelected:$e(()=>{const{value:R}=t,{value:T}=o;if(R===null)return!1;const K=e.tmNode.rawNode[m.value];if(T){const{value:w}=l;return w.has(K)}else return R===K}),labelField:r,renderLabel:s,renderOption:a,handleMouseMove:$,handleMouseEnter:k,handleClick:b}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:o,isGrouped:l,showCheckmark:s,nodeProps:a,renderOption:r,renderLabel:m,handleClick:f,handleMouseEnter:h,handleMouseMove:v}=this,O=wo(n,e),z=m?[m(t,n),s&&O]:[Se(t[this.labelField],t,n),s&&O],b=a==null?void 0:a(t),k=u("div",Object.assign({},b,{class:[`${e}-base-select-option`,t.class,b==null?void 0:b.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:l,[`${e}-base-select-option--pending`]:o,[`${e}-base-select-option--show-checkmark`]:s}],style:[(b==null?void 0:b.style)||"",t.style||""],onClick:et([f,b==null?void 0:b.onClick]),onMouseenter:et([h,b==null?void 0:b.onMouseenter]),onMousemove:et([v,b==null?void 0:b.onMousemove])}),u("div",{class:`${e}-base-select-option__content`},z));return t.render?t.render({node:k,option:t,selected:n}):r?r({node:k,option:t,selected:n}):k}}),Tt=re({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:o}=ct(ft);return{labelField:n,nodeProps:o,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:o,tmNode:{rawNode:l}}=this,s=o==null?void 0:o(l),a=t?t(l,!1):Se(l[this.labelField],l,!1),r=u("div",Object.assign({},s,{class:[`${e}-base-select-group-header`,s==null?void 0:s.class]}),a);return l.render?l.render({node:r,option:l}):n?n({node:r,option:l,selected:!1}):r}}),xo=L("base-select-menu",`
line-height: 1.5;
outline: none;
z-index: 0;
position: relative;
border-radius: var(--n-border-radius);
transition:
background-color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
background-color: var(--n-color);
`,[L("scrollbar",`
max-height: var(--n-height);
`),L("virtual-list",`
max-height: var(--n-height);
`),L("base-select-option",`
min-height: var(--n-option-height);
font-size: var(--n-option-font-size);
display: flex;
align-items: center;
`,[H("content",`
z-index: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
`)]),L("base-select-group-header",`
min-height: var(--n-option-height);
font-size: .93em;
display: flex;
align-items: center;
`),L("base-select-menu-option-wrapper",`
position: relative;
width: 100%;
`),H("loading, empty",`
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),H("loading",`
color: var(--n-loading-color);
font-size: var(--n-loading-size);
`),H("action",`
padding: 8px var(--n-option-padding-left);
font-size: var(--n-option-font-size);
transition:
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
border-top: 1px solid var(--n-action-divider-color);
color: var(--n-action-text-color);
`),L("base-select-group-header",`
position: relative;
cursor: default;
padding: var(--n-option-padding);
color: var(--n-group-header-text-color);
`),L("base-select-option",`
cursor: pointer;
position: relative;
padding: var(--n-option-padding);
transition:
color .3s var(--n-bezier),
opacity .3s var(--n-bezier);
box-sizing: border-box;
color: var(--n-option-text-color);
opacity: 1;
`,[oe("show-checkmark",`
padding-right: calc(var(--n-option-padding-right) + 20px);
`),le("&::before",`
content: "";
position: absolute;
left: 4px;
right: 4px;
top: 0;
bottom: 0;
border-radius: var(--n-border-radius);
transition: background-color .3s var(--n-bezier);
`),le("&:active",`
color: var(--n-option-text-color-pressed);
`),oe("grouped",`
padding-left: calc(var(--n-option-padding-left) * 1.5);
`),oe("pending",[le("&::before",`
background-color: var(--n-option-color-pending);
`)]),oe("selected",`
color: var(--n-option-text-color-active);
`,[le("&::before",`
background-color: var(--n-option-color-active);
`),oe("pending",[le("&::before",`
background-color: var(--n-option-color-active-pending);
`)])]),oe("disabled",`
cursor: not-allowed;
`,[at("selected",`
color: var(--n-option-text-color-disabled);
`),oe("selected",`
opacity: var(--n-option-opacity-disabled);
`)]),H("check",`
font-size: 16px;
position: absolute;
right: calc(var(--n-option-padding-right) - 4px);
top: calc(50% - 7px);
color: var(--n-option-check-color);
transition: color .3s var(--n-bezier);
`,[zt({enterScale:"0.5"})])])]),Co=re({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ve.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const t=ve("InternalSelectMenu","-internal-select-menu",xo,fn,e,te(e,"clsPrefix")),n=P(null),o=P(null),l=P(null),s=B(()=>e.treeMate.getFlattenedNodes()),a=B(()=>no(s.value)),r=P(null);function m(){const{treeMate:d}=e;let y=null;const{value:j}=e;j===null?y=d.getFirstAvailableNode():(e.multiple?y=d.getNode((j||[])[(j||[]).length-1]):y=d.getNode(j),(!y||y.disabled)&&(y=d.getFirstAvailableNode())),p(y||null)}function f(){const{value:d}=r;d&&!e.treeMate.getNode(d.key)&&(r.value=null)}let h;Re(()=>e.show,d=>{d?h=Re(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?m():f(),ut(x)):f()},{immediate:!0}):h==null||h()},{immediate:!0}),Ot(()=>{h==null||h()});const v=B(()=>rt(t.value.self[ce("optionHeight",e.size)])),O=B(()=>Je(t.value.self[ce("padding",e.size)])),z=B(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),b=B(()=>{const d=s.value;return d&&d.length===0});function k(d){const{onToggle:y}=e;y&&y(d)}function $(d){const{onScroll:y}=e;y&&y(d)}function R(d){var y;(y=l.value)===null||y===void 0||y.sync(),$(d)}function T(){var d;(d=l.value)===null||d===void 0||d.sync()}function K(){const{value:d}=r;return d||null}function w(d,y){y.disabled||p(y,!1)}function C(d,y){y.disabled||k(y)}function M(d){var y;De(d,"action")||(y=e.onKeyup)===null||y===void 0||y.call(e,d)}function W(d){var y;De(d,"action")||(y=e.onKeydown)===null||y===void 0||y.call(e,d)}function G(d){var y;(y=e.onMousedown)===null||y===void 0||y.call(e,d),!e.focusable&&d.preventDefault()}function J(){const{value:d}=r;d&&p(d.getNext({loop:!0}),!0)}function D(){const{value:d}=r;d&&p(d.getPrev({loop:!0}),!0)}function p(d,y=!1){r.value=d,y&&x()}function x(){var d,y;const j=r.value;if(!j)return;const ee=a.value(j.key);ee!==null&&(e.virtualScroll?(d=o.value)===null||d===void 0||d.scrollTo({index:ee}):(y=l.value)===null||y===void 0||y.scrollTo({index:ee,elSize:v.value}))}function N(d){var y,j;!((y=n.value)===null||y===void 0)&&y.contains(d.target)&&((j=e.onFocus)===null||j===void 0||j.call(e,d))}function q(d){var y,j;!((y=n.value)===null||y===void 0)&&y.contains(d.relatedTarget)||(j=e.onBlur)===null||j===void 0||j.call(e,d)}bt(ft,{handleOptionMouseEnter:w,handleOptionClick:C,valueSetRef:z,pendingTmNodeRef:r,nodePropsRef:te(e,"nodeProps"),showCheckmarkRef:te(e,"showCheckmark"),multipleRef:te(e,"multiple"),valueRef:te(e,"value"),renderLabelRef:te(e,"renderLabel"),renderOptionRef:te(e,"renderOption"),labelFieldRef:te(e,"labelField"),valueFieldRef:te(e,"valueField")}),bt(Fn,n),ze(()=>{const{value:d}=l;d&&d.sync()});const Y=B(()=>{const{size:d}=e,{common:{cubicBezierEaseInOut:y},self:{height:j,borderRadius:ee,color:de,groupHeaderTextColor:Te,actionDividerColor:ke,optionTextColorPressed:me,optionTextColor:ye,optionTextColorDisabled:ue,optionTextColorActive:ne,optionOpacityDisabled:we,optionCheckColor:fe,actionTextColor:Oe,optionColorPending:ge,optionColorActive:be,loadingColor:Fe,loadingSize:Me,optionColorActivePending:Pe,[ce("optionFontSize",d)]:xe,[ce("optionHeight",d)]:Ce,[ce("optionPadding",d)]:ie}}=t.value;return{"--n-height":j,"--n-action-divider-color":ke,"--n-action-text-color":Oe,"--n-bezier":y,"--n-border-radius":ee,"--n-color":de,"--n-option-font-size":xe,"--n-group-header-text-color":Te,"--n-option-check-color":fe,"--n-option-color-pending":ge,"--n-option-color-active":be,"--n-option-color-active-pending":Pe,"--n-option-height":Ce,"--n-option-opacity-disabled":we,"--n-option-text-color":ye,"--n-option-text-color-active":ne,"--n-option-text-color-disabled":ue,"--n-option-text-color-pressed":me,"--n-option-padding":ie,"--n-option-padding-left":Je(ie,"left"),"--n-option-padding-right":Je(ie,"right"),"--n-loading-color":Fe,"--n-loading-size":Me}}),{inlineThemeDisabled:U}=e,V=U?je("internal-select-menu",B(()=>e.size[0]),Y,e):void 0,Z={selfRef:n,next:J,prev:D,getPendingTmNode:K};return At(n,e.onResize),Object.assign({mergedTheme:t,virtualListRef:o,scrollbarRef:l,itemSize:v,padding:O,flattenedNodes:s,empty:b,virtualListContainer(){const{value:d}=o;return d==null?void 0:d.listElRef},virtualListContent(){const{value:d}=o;return d==null?void 0:d.itemsElRef},doScroll:$,handleFocusin:N,handleFocusout:q,handleKeyUp:M,handleKeyDown:W,handleMouseDown:G,handleVirtualListResize:T,handleVirtualListScroll:R,cssVars:U?void 0:Y,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},Z)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:o,themeClass:l,onRender:s}=this;return s==null||s(),u("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,l,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},this.loading?u("div",{class:`${n}-base-select-menu__loading`},u(vn,{clsPrefix:n,strokeWidth:20})):this.empty?u("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0,"data-action":!0},bn(e.empty,()=>[u(yo,{theme:o.peers.Empty,themeOverrides:o.peerOverrides.Empty})])):u(gn,{ref:"scrollbarRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?u(Kn,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?u(Tt,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:u(Rt,{clsPrefix:n,key:a.key,tmNode:a})}):u("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?u(Tt,{key:a.key,clsPrefix:n,tmNode:a}):u(Rt,{clsPrefix:n,key:a.key,tmNode:a})))}),hn(e.action,a=>a&&[u("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),u(jn,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),So=le([L("base-selection",`
position: relative;
z-index: auto;
box-shadow: none;
width: 100%;
max-width: 100%;
display: inline-block;
vertical-align: bottom;
border-radius: var(--n-border-radius);
min-height: var(--n-height);
line-height: 1.5;
font-size: var(--n-font-size);
`,[L("base-loading",`
color: var(--n-loading-color);
`),L("base-selection-tags","min-height: var(--n-height);"),H("border, state-border",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
border: var(--n-border);
border-radius: inherit;
transition:
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),H("state-border",`
z-index: 1;
border-color: #0000;
`),L("base-suffix",`
cursor: pointer;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10px;
`,[H("arrow",`
font-size: var(--n-arrow-size);
color: var(--n-arrow-color);
transition: color .3s var(--n-bezier);
`)]),L("base-selection-overlay",`
display: flex;
align-items: center;
white-space: nowrap;
pointer-events: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: var(--n-padding-single);
transition: color .3s var(--n-bezier);
`,[H("wrapper",`
flex-basis: 0;
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
`)]),L("base-selection-placeholder",`
color: var(--n-placeholder-color);
`,[H("inner",`
max-width: 100%;
overflow: hidden;
`)]),L("base-selection-tags",`
cursor: pointer;
outline: none;
box-sizing: border-box;
position: relative;
z-index: auto;
display: flex;
padding: var(--n-padding-multiple);
flex-wrap: wrap;
align-items: center;
width: 100%;
vertical-align: bottom;
background-color: var(--n-color);
border-radius: inherit;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),L("base-selection-label",`
height: var(--n-height);
display: inline-flex;
width: 100%;
vertical-align: bottom;
cursor: pointer;
outline: none;
z-index: auto;
box-sizing: border-box;
position: relative;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-radius: inherit;
background-color: var(--n-color);
align-items: center;
`,[L("base-selection-input",`
font-size: inherit;
line-height: inherit;
outline: none;
cursor: pointer;
box-sizing: border-box;
border:none;
width: 100%;
padding: var(--n-padding-single);
background-color: #0000;
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
caret-color: var(--n-caret-color);
`,[H("content",`
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
`)]),H("render-label",`
color: var(--n-text-color);
`)]),at("disabled",[le("&:hover",[H("state-border",`
box-shadow: var(--n-box-shadow-hover);
border: var(--n-border-hover);
`)]),oe("focus",[H("state-border",`
box-shadow: var(--n-box-shadow-focus);
border: var(--n-border-focus);
`)]),oe("active",[H("state-border",`
box-shadow: var(--n-box-shadow-active);
border: var(--n-border-active);
`),L("base-selection-label","background-color: var(--n-color-active);"),L("base-selection-tags","background-color: var(--n-color-active);")])]),oe("disabled","cursor: not-allowed;",[H("arrow",`
color: var(--n-arrow-color-disabled);
`),L("base-selection-label",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[L("base-selection-input",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
`),H("render-label",`
color: var(--n-text-color-disabled);
`)]),L("base-selection-tags",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`),L("base-selection-placeholder",`
cursor: not-allowed;
color: var(--n-placeholder-color-disabled);
`)]),L("base-selection-input-tag",`
height: calc(var(--n-height) - 6px);
line-height: calc(var(--n-height) - 6px);
outline: none;
display: none;
position: relative;
margin-bottom: 3px;
max-width: 100%;
vertical-align: bottom;
`,[H("input",`
font-size: inherit;
font-family: inherit;
min-width: 1px;
padding: 0;
background-color: #0000;
outline: none;
border: none;
max-width: 100%;
overflow: hidden;
width: 1em;
line-height: inherit;
cursor: pointer;
color: var(--n-text-color);
caret-color: var(--n-caret-color);
`),H("mirror",`
position: absolute;
left: 0;
top: 0;
white-space: pre;
visibility: hidden;
user-select: none;
-webkit-user-select: none;
opacity: 0;
`)]),["warning","error"].map(e=>oe(`${e}-status`,[H("state-border",`border: var(--n-border-${e});`),at("disabled",[le("&:hover",[H("state-border",`
box-shadow: var(--n-box-shadow-hover-${e});
border: var(--n-border-hover-${e});
`)]),oe("active",[H("state-border",`
box-shadow: var(--n-box-shadow-active-${e});
border: var(--n-border-active-${e});
`),L("base-selection-label",`background-color: var(--n-color-active-${e});`),L("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),oe("focus",[H("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),L("base-selection-popover",`
margin-bottom: -3px;
display: flex;
flex-wrap: wrap;
margin-right: -8px;
`),L("base-selection-tag-wrapper",`
max-width: 100%;
display: inline-flex;
padding: 0 7px 3px 0;
`,[le("&:last-child","padding-right: 0;"),L("tag",`
font-size: 14px;
max-width: 100%;
`,[H("content",`
line-height: 1.25;
text-overflow: ellipsis;
overflow: hidden;
`)])])]),Ro=re({name:"InternalSelection",props:Object.assign(Object.assign({},ve.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const t=P(null),n=P(null),o=P(null),l=P(null),s=P(null),a=P(null),r=P(null),m=P(null),f=P(null),h=P(null),v=P(!1),O=P(!1),z=P(!1),b=ve("InternalSelection","-internal-selection",So,pn,e,te(e,"clsPrefix")),k=B(()=>e.clearable&&!e.disabled&&(z.value||e.active)),$=B(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Se(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),R=B(()=>{const c=e.selectedOption;if(c)return c[e.labelField]}),T=B(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function K(){var c;const{value:S}=t;if(S){const{value:X}=n;X&&(X.style.width=`${S.offsetWidth}px`,e.maxTagCount!=="responsive"&&((c=f.value)===null||c===void 0||c.sync()))}}function w(){const{value:c}=h;c&&(c.style.display="none")}function C(){const{value:c}=h;c&&(c.style.display="inline-block")}Re(te(e,"active"),c=>{c||w()}),Re(te(e,"pattern"),()=>{e.multiple&&ut(K)});function M(c){const{onFocus:S}=e;S&&S(c)}function W(c){const{onBlur:S}=e;S&&S(c)}function G(c){const{onDeleteOption:S}=e;S&&S(c)}function J(c){const{onClear:S}=e;S&&S(c)}function D(c){const{onPatternInput:S}=e;S&&S(c)}function p(c){var S;(!c.relatedTarget||!(!((S=o.value)===null||S===void 0)&&S.contains(c.relatedTarget)))&&M(c)}function x(c){var S;!((S=o.value)===null||S===void 0)&&S.contains(c.relatedTarget)||W(c)}function N(c){J(c)}function q(){z.value=!0}function Y(){z.value=!1}function U(c){!e.active||!e.filterable||c.target!==n.value&&c.preventDefault()}function V(c){G(c)}function Z(c){if(c.key==="Backspace"&&!d.value&&!e.pattern.length){const{selectedOptions:S}=e;S!=null&&S.length&&V(S[S.length-1])}}const d=P(!1);let y=null;function j(c){const{value:S}=t;if(S){const X=c.target.value;S.textContent=X,K()}e.ignoreComposition&&d.value?y=c:D(c)}function ee(){d.value=!0}function de(){d.value=!1,e.ignoreComposition&&D(y),y=null}function Te(c){var S;O.value=!0,(S=e.onPatternFocus)===null||S===void 0||S.call(e,c)}function ke(c){var S;O.value=!1,(S=e.onPatternBlur)===null||S===void 0||S.call(e,c)}function me(){var c,S;if(e.filterable)O.value=!1,(c=a.value)===null||c===void 0||c.blur(),(S=n.value)===null||S===void 0||S.blur();else if(e.multiple){const{value:X}=l;X==null||X.blur()}else{const{value:X}=s;X==null||X.blur()}}function ye(){var c,S,X;e.filterable?(O.value=!1,(c=a.value)===null||c===void 0||c.focus()):e.multiple?(S=l.value)===null||S===void 0||S.focus():(X=s.value)===null||X===void 0||X.focus()}function ue(){const{value:c}=n;c&&(C(),c.focus())}function ne(){const{value:c}=n;c&&c.blur()}function we(c){const{value:S}=r;S&&S.setTextContent(`+${c}`)}function fe(){const{value:c}=m;return c}function Oe(){return n.value}let ge=null;function be(){ge!==null&&window.clearTimeout(ge)}function Fe(){e.active||(be(),ge=window.setTimeout(()=>{T.value&&(v.value=!0)},100))}function Me(){be()}function Pe(c){c||(be(),v.value=!1)}Re(T,c=>{c||(v.value=!1)}),ze(()=>{mn(()=>{const c=a.value;c&&(e.disabled?c.removeAttribute("tabindex"):c.tabIndex=O.value?-1:0)})}),At(o,e.onResize);const{inlineThemeDisabled:xe}=e,Ce=B(()=>{const{size:c}=e,{common:{cubicBezierEaseInOut:S},self:{borderRadius:X,color:Ie,placeholderColor:He,textColor:Ge,paddingSingle:Ue,paddingMultiple:qe,caretColor:_e,colorDisabled:Ae,textColorDisabled:Be,placeholderColorDisabled:Ye,colorActive:Ze,boxShadowFocus:Ne,boxShadowActive:he,boxShadowHover:i,border:g,borderFocus:F,borderHover:E,borderActive:_,arrowColor:I,arrowColorDisabled:A,loadingColor:Q,colorActiveWarning:ae,boxShadowFocusWarning:Xe,boxShadowActiveWarning:Lt,boxShadowHoverWarning:$t,borderWarning:Kt,borderFocusWarning:Dt,borderHoverWarning:Vt,borderActiveWarning:Wt,colorActiveError:jt,boxShadowFocusError:Ht,boxShadowActiveError:Gt,boxShadowHoverError:Ut,borderError:qt,borderFocusError:Yt,borderHoverError:Zt,borderActiveError:Xt,clearColor:Jt,clearColorHover:Qt,clearColorPressed:en,clearSize:tn,arrowSize:nn,[ce("height",c)]:on,[ce("fontSize",c)]:ln}}=b.value;return{"--n-bezier":S,"--n-border":g,"--n-border-active":_,"--n-border-focus":F,"--n-border-hover":E,"--n-border-radius":X,"--n-box-shadow-active":he,"--n-box-shadow-focus":Ne,"--n-box-shadow-hover":i,"--n-caret-color":_e,"--n-color":Ie,"--n-color-active":Ze,"--n-color-disabled":Ae,"--n-font-size":ln,"--n-height":on,"--n-padding-single":Ue,"--n-padding-multiple":qe,"--n-placeholder-color":He,"--n-placeholder-color-disabled":Ye,"--n-text-color":Ge,"--n-text-color-disabled":Be,"--n-arrow-color":I,"--n-arrow-color-disabled":A,"--n-loading-color":Q,"--n-color-active-warning":ae,"--n-box-shadow-focus-warning":Xe,"--n-box-shadow-active-warning":Lt,"--n-box-shadow-hover-warning":$t,"--n-border-warning":Kt,"--n-border-focus-warning":Dt,"--n-border-hover-warning":Vt,"--n-border-active-warning":Wt,"--n-color-active-error":jt,"--n-box-shadow-focus-error":Ht,"--n-box-shadow-active-error":Gt,"--n-box-shadow-hover-error":Ut,"--n-border-error":qt,"--n-border-focus-error":Yt,"--n-border-hover-error":Zt,"--n-border-active-error":Xt,"--n-clear-size":tn,"--n-clear-color":Jt,"--n-clear-color-hover":Qt,"--n-clear-color-pressed":en,"--n-arrow-size":nn}}),ie=xe?je("internal-selection",B(()=>e.size[0]),Ce,e):void 0;return{mergedTheme:b,mergedClearable:k,patternInputFocused:O,filterablePlaceholder:$,label:R,selected:T,showTagsPanel:v,isComposing:d,counterRef:r,counterWrapperRef:m,patternInputMirrorRef:t,patternInputRef:n,selfRef:o,multipleElRef:l,singleElRef:s,patternInputWrapperRef:a,overflowRef:f,inputTagElRef:h,handleMouseDown:U,handleFocusin:p,handleClear:N,handleMouseEnter:q,handleMouseLeave:Y,handleDeleteOption:V,handlePatternKeyDown:Z,handlePatternInputInput:j,handlePatternInputBlur:ke,handlePatternInputFocus:Te,handleMouseEnterCounter:Fe,handleMouseLeaveCounter:Me,handleFocusout:x,handleCompositionEnd:de,handleCompositionStart:ee,onPopoverUpdateShow:Pe,focus:ye,focusInput:ue,blur:me,blurInput:ne,updateCounter:we,getCounter:fe,getTail:Oe,renderLabel:e.renderLabel,cssVars:xe?void 0:Ce,themeClass:ie==null?void 0:ie.themeClass,onRender:ie==null?void 0:ie.onRender}},render(){const{status:e,multiple:t,size:n,disabled:o,filterable:l,maxTagCount:s,bordered:a,clsPrefix:r,onRender:m,renderTag:f,renderLabel:h}=this;m==null||m();const v=s==="responsive",O=typeof s=="number",z=v||O,b=u(yn,null,{default:()=>u(An,{clsPrefix:r,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var $,R;return(R=($=this.$slots).arrow)===null||R===void 0?void 0:R.call($)}})});let k;if(t){const{labelField:$}=this,R=x=>u("div",{class:`${r}-base-selection-tag-wrapper`,key:x.value},f?f({option:x,handleClose:()=>{this.handleDeleteOption(x)}}):u(Qe,{size:n,closable:!x.disabled,disabled:o,onClose:()=>{this.handleDeleteOption(x)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(x,!0):Se(x[$],x,!0)})),T=()=>(O?this.selectedOptions.slice(0,s):this.selectedOptions).map(R),K=l?u("div",{class:`${r}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},u("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:o,value:this.pattern,autofocus:this.autofocus,class:`${r}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),u("span",{ref:"patternInputMirrorRef",class:`${r}-base-selection-input-tag__mirror`},this.pattern)):null,w=v?()=>u("div",{class:`${r}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},u(Qe,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:o})):void 0;let C;if(O){const x=this.selectedOptions.length-s;x>0&&(C=u("div",{class:`${r}-base-selection-tag-wrapper`,key:"__counter__"},u(Qe,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:o},{default:()=>`+${x}`})))}const M=v?l?u(xt,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:T,counter:w,tail:()=>K}):u(xt,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:T,counter:w}):O?T().concat(C):T(),W=z?()=>u("div",{class:`${r}-base-selection-popover`},v?T():this.selectedOptions.map(R)):void 0,G=z?{show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover}:null,D=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?u("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`},u("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)):null,p=l?u("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-tags`},M,v?null:K,b):u("div",{ref:"multipleElRef",class:`${r}-base-selection-tags`,tabindex:o?void 0:0},M,b);k=u(wn,null,z?u(Mn,Object.assign({},G,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>p,default:W}):p,D)}else if(l){const $=this.pattern||this.isComposing,R=this.active?!$:!this.selected,T=this.active?!1:this.selected;k=u("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-label`},u("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${r}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:o,disabled:o,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),T?u("div",{class:`${r}-base-selection-label__render-label ${r}-base-selection-overlay`,key:"input"},u("div",{class:`${r}-base-selection-overlay__wrapper`},f?f({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):Se(this.label,this.selectedOption,!0))):null,R?u("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},u("div",{class:`${r}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,b)}else k=u("div",{ref:"singleElRef",class:`${r}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?u("div",{class:`${r}-base-selection-input`,title:Nn(this.label),key:"input"},u("div",{class:`${r}-base-selection-input__content`},f?f({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):Se(this.label,this.selectedOption,!0))):u("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},u("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)),b);return u("div",{ref:"selfRef",class:[`${r}-base-selection`,this.themeClass,e&&`${r}-base-selection--${e}-status`,{[`${r}-base-selection--active`]:this.active,[`${r}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${r}-base-selection--disabled`]:this.disabled,[`${r}-base-selection--multiple`]:this.multiple,[`${r}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},k,a?u("div",{class:`${r}-base-selection__border`}):null,a?u("div",{class:`${r}-base-selection__state-border`}):null)}});function We(e){return e.type==="group"}function Et(e){return e.type==="ignored"}function lt(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function To(e,t){return{getIsGroup:We,getIgnored:Et,getKey(o){return We(o)?o.name||o.key||"key-required":o[e]},getChildren(o){return o[t]}}}function ko(e,t,n,o){if(!t)return e;function l(s){if(!Array.isArray(s))return[];const a=[];for(const r of s)if(We(r)){const m=l(r[o]);m.length&&a.push(Object.assign({},r,{[o]:m}))}else{if(Et(r))continue;t(n,r)&&a.push(r)}return a}return l(e)}function Oo(e,t,n){const o=new Map;return e.forEach(l=>{We(l)?l[n].forEach(s=>{o.set(s[t],s)}):o.set(l[t],l)}),o}const Fo=le([L("select",`
z-index: auto;
outline: none;
width: 100%;
position: relative;
`),L("select-menu",`
margin: 4px 0;
box-shadow: var(--n-menu-box-shadow);
`,[zt({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Mo=Object.assign(Object.assign({},ve.props),{to:st.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),No=re({name:"Select",props:Mo,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:o,inlineThemeDisabled:l}=Ft(e),s=ve("Select","-select",Fo,xn,e,t),a=P(e.defaultValue),r=te(e,"value"),m=mt(r,a),f=P(!1),h=P(""),v=B(()=>{const{valueField:i,childrenField:g}=e,F=To(i,g);return bo(x.value,F)}),O=B(()=>Oo(D.value,e.valueField,e.childrenField)),z=P(!1),b=mt(te(e,"show"),z),k=P(null),$=P(null),R=P(null),{localeRef:T}=It("Select"),K=B(()=>{var i;return(i=e.placeholder)!==null&&i!==void 0?i:T.value.placeholder}),w=Pn(e,["items","options"]),C=[],M=P([]),W=P([]),G=P(new Map),J=B(()=>{const{fallbackOption:i}=e;if(i===void 0){const{labelField:g,valueField:F}=e;return E=>({[g]:String(E),[F]:E})}return i===!1?!1:g=>Object.assign(i(g),{value:g})}),D=B(()=>W.value.concat(M.value).concat(w.value)),p=B(()=>{const{filter:i}=e;if(i)return i;const{labelField:g,valueField:F}=e;return(E,_)=>{if(!_)return!1;const I=_[g];if(typeof I=="string")return lt(E,I);const A=_[F];return typeof A=="string"?lt(E,A):typeof A=="number"?lt(E,String(A)):!1}}),x=B(()=>{if(e.remote)return w.value;{const{value:i}=D,{value:g}=h;return!g.length||!e.filterable?i:ko(i,p.value,g,e.childrenField)}});function N(i){const g=e.remote,{value:F}=G,{value:E}=O,{value:_}=J,I=[];return i.forEach(A=>{if(E.has(A))I.push(E.get(A));else if(g&&F.has(A))I.push(F.get(A));else if(_){const Q=_(A);Q&&I.push(Q)}}),I}const q=B(()=>{if(e.multiple){const{value:i}=m;return Array.isArray(i)?N(i):[]}return null}),Y=B(()=>{const{value:i}=m;return!e.multiple&&!Array.isArray(i)?i===null?null:N([i])[0]||null:null}),U=Cn(e),{mergedSizeRef:V,mergedDisabledRef:Z,mergedStatusRef:d}=U;function y(i,g){const{onChange:F,"onUpdate:value":E,onUpdateValue:_}=e,{nTriggerFormChange:I,nTriggerFormInput:A}=U;F&&se(F,i,g),_&&se(_,i,g),E&&se(E,i,g),a.value=i,I(),A()}function j(i){const{onBlur:g}=e,{nTriggerFormBlur:F}=U;g&&se(g,i),F()}function ee(){const{onClear:i}=e;i&&se(i)}function de(i){const{onFocus:g,showOnFocus:F}=e,{nTriggerFormFocus:E}=U;g&&se(g,i),E(),F&&ue()}function Te(i){const{onSearch:g}=e;g&&se(g,i)}function ke(i){const{onScroll:g}=e;g&&se(g,i)}function me(){var i;const{remote:g,multiple:F}=e;if(g){const{value:E}=G;if(F){const{valueField:_}=e;(i=q.value)===null||i===void 0||i.forEach(I=>{E.set(I[_],I)})}else{const _=Y.value;_&&E.set(_[e.valueField],_)}}}function ye(i){const{onUpdateShow:g,"onUpdate:show":F}=e;g&&se(g,i),F&&se(F,i),z.value=i}function ue(){Z.value||(ye(!0),z.value=!0,e.filterable&&Be())}function ne(){ye(!1)}function we(){h.value="",W.value=C}const fe=P(!1);function Oe(){e.filterable&&(fe.value=!0)}function ge(){e.filterable&&(fe.value=!1,b.value||we())}function be(){Z.value||(b.value?e.filterable?Be():ne():ue())}function Fe(i){var g,F;!((F=(g=R.value)===null||g===void 0?void 0:g.selfRef)===null||F===void 0)&&F.contains(i.relatedTarget)||(f.value=!1,j(i),ne())}function Me(i){de(i),f.value=!0}function Pe(i){f.value=!0}function xe(i){var g;!((g=k.value)===null||g===void 0)&&g.$el.contains(i.relatedTarget)||(f.value=!1,j(i),ne())}function Ce(){var i;(i=k.value)===null||i===void 0||i.focus(),ne()}function ie(i){var g;b.value&&(!((g=k.value)===null||g===void 0)&&g.$el.contains(kn(i))||ne())}function c(i){if(!Array.isArray(i))return[];if(J.value)return Array.from(i);{const{remote:g}=e,{value:F}=O;if(g){const{value:E}=G;return i.filter(_=>F.has(_)||E.has(_))}else return i.filter(E=>F.has(E))}}function S(i){X(i.rawNode)}function X(i){if(Z.value)return;const{tag:g,remote:F,clearFilterAfterSelect:E,valueField:_}=e;if(g&&!F){const{value:I}=W,A=I[0]||null;if(A){const Q=M.value;Q.length?Q.push(A):M.value=[A],W.value=C}}if(F&&G.value.set(i[_],i),e.multiple){const I=c(m.value),A=I.findIndex(Q=>Q===i[_]);if(~A){if(I.splice(A,1),g&&!F){const Q=Ie(i[_]);~Q&&(M.value.splice(Q,1),E&&(h.value=""))}}else I.push(i[_]),E&&(h.value="");y(I,N(I))}else{if(g&&!F){const I=Ie(i[_]);~I?M.value=[M.value[I]]:M.value=C}Ae(),ne(),y(i[_],i)}}function Ie(i){return M.value.findIndex(F=>F[e.valueField]===i)}function He(i){b.value||ue();const{value:g}=i.target;h.value=g;const{tag:F,remote:E}=e;if(Te(g),F&&!E){if(!g){W.value=C;return}const{onCreate:_}=e,I=_?_(g):{[e.labelField]:g,[e.valueField]:g},{valueField:A,labelField:Q}=e;w.value.some(ae=>ae[A]===I[A]||ae[Q]===I[Q])||M.value.some(ae=>ae[A]===I[A]||ae[Q]===I[Q])?W.value=C:W.value=[I]}}function Ge(i){i.stopPropagation();const{multiple:g}=e;!g&&e.filterable&&ne(),ee(),g?y([],[]):y(null,null)}function Ue(i){!De(i,"action")&&!De(i,"empty")&&i.preventDefault()}function qe(i){ke(i)}function _e(i){var g,F,E,_,I;if(!e.keyboard){i.preventDefault();return}switch(i.key){case" ":if(e.filterable)break;i.preventDefault();case"Enter":if(!(!((g=k.value)===null||g===void 0)&&g.isComposing)){if(b.value){const A=(F=R.value)===null||F===void 0?void 0:F.getPendingTmNode();A?S(A):e.filterable||(ne(),Ae())}else if(ue(),e.tag&&fe.value){const A=W.value[0];if(A){const Q=A[e.valueField],{value:ae}=m;e.multiple&&Array.isArray(ae)&&ae.some(Xe=>Xe===Q)||X(A)}}}i.preventDefault();break;case"ArrowUp":if(i.preventDefault(),e.loading)return;b.value&&((E=R.value)===null||E===void 0||E.prev());break;case"ArrowDown":if(i.preventDefault(),e.loading)return;b.value?(_=R.value)===null||_===void 0||_.next():ue();break;case"Escape":b.value&&(On(i),ne()),(I=k.value)===null||I===void 0||I.focus();break}}function Ae(){var i;(i=k.value)===null||i===void 0||i.focus()}function Be(){var i;(i=k.value)===null||i===void 0||i.focusInput()}function Ye(){var i;b.value&&((i=$.value)===null||i===void 0||i.syncPosition())}me(),Re(te(e,"options"),me);const Ze={focus:()=>{var i;(i=k.value)===null||i===void 0||i.focus()},focusInput:()=>{var i;(i=k.value)===null||i===void 0||i.focusInput()},blur:()=>{var i;(i=k.value)===null||i===void 0||i.blur()},blurInput:()=>{var i;(i=k.value)===null||i===void 0||i.blurInput()}},Ne=B(()=>{const{self:{menuBoxShadow:i}}=s.value;return{"--n-menu-box-shadow":i}}),he=l?je("select",void 0,Ne,e):void 0;return Object.assign(Object.assign({},Ze),{mergedStatus:d,mergedClsPrefix:t,mergedBordered:n,namespace:o,treeMate:v,isMounted:Sn(),triggerRef:k,menuRef:R,pattern:h,uncontrolledShow:z,mergedShow:b,adjustedTo:st(e),uncontrolledValue:a,mergedValue:m,followerRef:$,localizedPlaceholder:K,selectedOption:Y,selectedOptions:q,mergedSize:V,mergedDisabled:Z,focused:f,activeWithoutMenuOpen:fe,inlineThemeDisabled:l,onTriggerInputFocus:Oe,onTriggerInputBlur:ge,handleTriggerOrMenuResize:Ye,handleMenuFocus:Pe,handleMenuBlur:xe,handleMenuTabOut:Ce,handleTriggerClick:be,handleToggle:S,handleDeleteOption:X,handlePatternInput:He,handleClear:Ge,handleTriggerBlur:Fe,handleTriggerFocus:Me,handleKeydown:_e,handleMenuAfterLeave:we,handleMenuClickOutside:ie,handleMenuScroll:qe,handleMenuKeydown:_e,handleMenuMousedown:Ue,mergedTheme:s,cssVars:l?void 0:Ne,themeClass:he==null?void 0:he.themeClass,onRender:he==null?void 0:he.onRender})},render(){return u("div",{class:`${this.mergedClsPrefix}-select`},u(zn,null,{default:()=>[u(In,null,{default:()=>u(Ro,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),u(_n,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===st.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>u(Pt,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Rn(u(Co,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var o,l;return[(l=(o=this.$slots).empty)===null||l===void 0?void 0:l.call(o)]},action:()=>{var o,l;return[(l=(o=this.$slots).action)===null||l===void 0?void 0:l.call(o)]}}),this.displayDirective==="show"?[[Tn,this.mergedShow],[pt,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[pt,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}});export{Co as N,Kn as V,No as _,yo as a,To as b,bo as c,De as h,et as m};
//# sourceMappingURL=Select-24ba44f4.js.map