import{n as Fe,m as P,bF as fn,bG as hn,aV as vn,d as T,q as o,I as C,K as B,J as s,aj as pn,ak as gn,$ as Z,aM as Ee,A as ge,N as le,Z as bn,af as mn,U as E,W as X,b as _,w as be,bH as xn,Y as te,_ as wn,a9 as yn,V as Cn,L as Ie,M as ie,bw as zn,bI as Sn,ae as _n,ad as An,u as Se,l as Rn,bJ as Bn,ac as _e,p as $n,a0 as ke,P as ae,a3 as Pn,Q as Fn,a5 as Ae,e as Re,ag as R,j as Be,k as En,aH as In,aI as kn,bK as Mn,bL as Tn,B as $e,bM as Ln}from"./index-TSX_w_F2.js";import{r as Vn}from"./replaceable-BbwpPSxY.js";function Wn(r){const{mergedLocaleRef:i,mergedDateLocaleRef:d}=Fe(vn,null)||{},A=P(()=>{var c,u;return(u=(c=i?.value)===null||c===void 0?void 0:c[r])!==null&&u!==void 0?u:fn[r]});return{dateLocaleRef:P(()=>{var c;return(c=d?.value)!==null&&c!==void 0?c:hn}),localeRef:A}}const rt=T({name:"Add",render(){return o("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),Dn=T({name:"ChevronDown",render(){return o("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),On=Vn("clear",()=>o("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},o("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},o("g",{fill:"currentColor","fill-rule":"nonzero"},o("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),jn=T({name:"Eye",render(){return o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},o("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),o("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Nn=T({name:"EyeOff",render(){return o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},o("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),o("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),o("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),o("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),o("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),Hn=C("base-clear",`
 flex-shrink: 0;
 height: 1em;
 width: 1em;
 position: relative;
`,[B(">",[s("clear",`
 font-size: var(--n-clear-size);
 height: 1em;
 width: 1em;
 cursor: pointer;
 color: var(--n-clear-color);
 transition: color .3s var(--n-bezier);
 display: flex;
 `,[B("&:hover",`
 color: var(--n-clear-color-hover)!important;
 `),B("&:active",`
 color: var(--n-clear-color-pressed)!important;
 `)]),s("placeholder",`
 display: flex;
 `),s("clear, placeholder",`
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translateX(-50%) translateY(-50%);
 `,[pn({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),me=T({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(r){return Ee("-base-clear",Hn,ge(r,"clsPrefix")),{handleMouseDown(i){i.preventDefault()}}},render(){const{clsPrefix:r}=this;return o("div",{class:`${r}-base-clear`},o(gn,null,{default:()=>{var i,d;return this.show?o("div",{key:"dismiss",class:`${r}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Z(this.$slots.icon,()=>[o(le,{clsPrefix:r},{default:()=>o(On,null)})])):o("div",{key:"icon",class:`${r}-base-clear__placeholder`},(d=(i=this.$slots).placeholder)===null||d===void 0?void 0:d.call(i))}}))}}),Kn=T({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(r,{slots:i}){return()=>{const{clsPrefix:d}=r;return o(bn,{clsPrefix:d,class:`${d}-base-suffix`,strokeWidth:24,scale:.85,show:r.loading},{default:()=>r.showArrow?o(me,{clsPrefix:d,show:r.showClear,onClear:r.onClear},{placeholder:()=>o(le,{clsPrefix:d,class:`${d}-base-suffix__arrow`},{default:()=>Z(i.default,()=>[o(Dn,null)])})}):null})}}}),Me=mn("n-input"),Un=C("input",`
 max-width: 100%;
 cursor: text;
 line-height: 1.5;
 z-index: auto;
 outline: none;
 box-sizing: border-box;
 position: relative;
 display: inline-flex;
 border-radius: var(--n-border-radius);
 background-color: var(--n-color);
 transition: background-color .3s var(--n-bezier);
 font-size: var(--n-font-size);
 font-weight: var(--n-font-weight);
 --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
`,[s("input, textarea",`
 overflow: hidden;
 flex-grow: 1;
 position: relative;
 `),s("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",`
 box-sizing: border-box;
 font-size: inherit;
 line-height: 1.5;
 font-family: inherit;
 border: none;
 outline: none;
 background-color: #0000;
 text-align: inherit;
 transition:
 -webkit-text-fill-color .3s var(--n-bezier),
 caret-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 text-decoration-color .3s var(--n-bezier);
 `),s("input-el, textarea-el",`
 -webkit-appearance: none;
 scrollbar-width: none;
 width: 100%;
 min-width: 0;
 text-decoration-color: var(--n-text-decoration-color);
 color: var(--n-text-color);
 caret-color: var(--n-caret-color);
 background-color: transparent;
 `,[B("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
 width: 0;
 height: 0;
 display: none;
 `),B("&::placeholder",`
 color: #0000;
 -webkit-text-fill-color: transparent !important;
 `),B("&:-webkit-autofill ~",[s("placeholder","display: none;")])]),E("round",[X("textarea","border-radius: calc(var(--n-height) / 2);")]),s("placeholder",`
 pointer-events: none;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow: hidden;
 color: var(--n-placeholder-color);
 `,[B("span",`
 width: 100%;
 display: inline-block;
 `)]),E("textarea",[s("placeholder","overflow: visible;")]),X("autosize","width: 100%;"),E("autosize",[s("textarea-el, input-el",`
 position: absolute;
 top: 0;
 left: 0;
 height: 100%;
 `)]),C("input-wrapper",`
 overflow: hidden;
 display: inline-flex;
 flex-grow: 1;
 position: relative;
 padding-left: var(--n-padding-left);
 padding-right: var(--n-padding-right);
 `),s("input-mirror",`
 padding: 0;
 height: var(--n-height);
 line-height: var(--n-height);
 overflow: hidden;
 visibility: hidden;
 position: static;
 white-space: pre;
 pointer-events: none;
 `),s("input-el",`
 padding: 0;
 height: var(--n-height);
 line-height: var(--n-height);
 `,[B("&[type=password]::-ms-reveal","display: none;"),B("+",[s("placeholder",`
 display: flex;
 align-items: center; 
 `)])]),X("textarea",[s("placeholder","white-space: nowrap;")]),s("eye",`
 display: flex;
 align-items: center;
 justify-content: center;
 transition: color .3s var(--n-bezier);
 `),E("textarea","width: 100%;",[C("input-word-count",`
 position: absolute;
 right: var(--n-padding-right);
 bottom: var(--n-padding-vertical);
 `),E("resizable",[C("input-wrapper",`
 resize: vertical;
 min-height: var(--n-height);
 `)]),s("textarea-el, textarea-mirror, placeholder",`
 height: 100%;
 padding-left: 0;
 padding-right: 0;
 padding-top: var(--n-padding-vertical);
 padding-bottom: var(--n-padding-vertical);
 word-break: break-word;
 display: inline-block;
 vertical-align: bottom;
 box-sizing: border-box;
 line-height: var(--n-line-height-textarea);
 margin: 0;
 resize: none;
 white-space: pre-wrap;
 scroll-padding-block-end: var(--n-padding-vertical);
 `),s("textarea-mirror",`
 width: 100%;
 pointer-events: none;
 overflow: hidden;
 visibility: hidden;
 position: static;
 white-space: pre-wrap;
 overflow-wrap: break-word;
 `)]),E("pair",[s("input-el, placeholder","text-align: center;"),s("separator",`
 display: flex;
 align-items: center;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 white-space: nowrap;
 `,[C("icon",`
 color: var(--n-icon-color);
 `),C("base-icon",`
 color: var(--n-icon-color);
 `)])]),E("disabled",`
 cursor: not-allowed;
 background-color: var(--n-color-disabled);
 `,[s("border","border: var(--n-border-disabled);"),s("input-el, textarea-el",`
 cursor: not-allowed;
 color: var(--n-text-color-disabled);
 text-decoration-color: var(--n-text-color-disabled);
 `),s("placeholder","color: var(--n-placeholder-color-disabled);"),s("separator","color: var(--n-text-color-disabled);",[C("icon",`
 color: var(--n-icon-color-disabled);
 `),C("base-icon",`
 color: var(--n-icon-color-disabled);
 `)]),C("input-word-count",`
 color: var(--n-count-text-color-disabled);
 `),s("suffix, prefix","color: var(--n-text-color-disabled);",[C("icon",`
 color: var(--n-icon-color-disabled);
 `),C("internal-icon",`
 color: var(--n-icon-color-disabled);
 `)])]),X("disabled",[s("eye",`
 color: var(--n-icon-color);
 cursor: pointer;
 `,[B("&:hover",`
 color: var(--n-icon-color-hover);
 `),B("&:active",`
 color: var(--n-icon-color-pressed);
 `)]),B("&:hover",[s("state-border","border: var(--n-border-hover);")]),E("focus","background-color: var(--n-color-focus);",[s("state-border",`
 border: var(--n-border-focus);
 box-shadow: var(--n-box-shadow-focus);
 `)])]),s("border, state-border",`
 box-sizing: border-box;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 pointer-events: none;
 border-radius: inherit;
 border: var(--n-border);
 transition:
 box-shadow .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `),s("state-border",`
 border-color: #0000;
 z-index: 1;
 `),s("prefix","margin-right: 4px;"),s("suffix",`
 margin-left: 4px;
 `),s("suffix, prefix",`
 transition: color .3s var(--n-bezier);
 flex-wrap: nowrap;
 flex-shrink: 0;
 line-height: var(--n-height);
 white-space: nowrap;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 color: var(--n-suffix-text-color);
 `,[C("base-loading",`
 font-size: var(--n-icon-size);
 margin: 0 2px;
 color: var(--n-loading-color);
 `),C("base-clear",`
 font-size: var(--n-icon-size);
 `,[s("placeholder",[C("base-icon",`
 transition: color .3s var(--n-bezier);
 color: var(--n-icon-color);
 font-size: var(--n-icon-size);
 `)])]),B(">",[C("icon",`
 transition: color .3s var(--n-bezier);
 color: var(--n-icon-color);
 font-size: var(--n-icon-size);
 `)]),C("base-icon",`
 font-size: var(--n-icon-size);
 `)]),C("input-word-count",`
 pointer-events: none;
 line-height: 1.5;
 font-size: .85em;
 color: var(--n-count-text-color);
 transition: color .3s var(--n-bezier);
 margin-left: 4px;
 font-variant: tabular-nums;
 `),["warning","error"].map(r=>E(`${r}-status`,[X("disabled",[C("base-loading",`
 color: var(--n-loading-color-${r})
 `),s("input-el, textarea-el",`
 caret-color: var(--n-caret-color-${r});
 `),s("state-border",`
 border: var(--n-border-${r});
 `),B("&:hover",[s("state-border",`
 border: var(--n-border-hover-${r});
 `)]),B("&:focus",`
 background-color: var(--n-color-focus-${r});
 `,[s("state-border",`
 box-shadow: var(--n-box-shadow-focus-${r});
 border: var(--n-border-focus-${r});
 `)]),E("focus",`
 background-color: var(--n-color-focus-${r});
 `,[s("state-border",`
 box-shadow: var(--n-box-shadow-focus-${r});
 border: var(--n-border-focus-${r});
 `)])])]))]),Gn=C("input",[E("disabled",[s("input-el, textarea-el",`
 -webkit-text-fill-color: var(--n-text-color-disabled);
 `)])]);function Yn(r){let i=0;for(const d of r)i++;return i}function oe(r){return r===""||r==null}function Xn(r){const i=_(null);function d(){const{value:c}=r;if(!c?.focus){g();return}const{selectionStart:u,selectionEnd:t,value:b}=c;if(u==null||t==null){g();return}i.value={start:u,end:t,beforeText:b.slice(0,u),afterText:b.slice(t)}}function A(){var c;const{value:u}=i,{value:t}=r;if(!u||!t)return;const{value:b}=t,{start:I,beforeText:p,afterText:y}=u;let S=b.length;if(b.endsWith(y))S=b.length-y.length;else if(b.startsWith(p))S=p.length;else{const m=p[I-1],l=b.indexOf(m,I-1);l!==-1&&(S=l+1)}(c=t.setSelectionRange)===null||c===void 0||c.call(t,S,S)}function g(){i.value=null}return be(r,g),{recordCursor:d,restoreCursor:A}}const Pe=T({name:"InputWordCount",setup(r,{slots:i}){const{mergedValueRef:d,maxlengthRef:A,mergedClsPrefixRef:g,countGraphemesRef:c}=Fe(Me),u=P(()=>{const{value:t}=d;return t===null||Array.isArray(t)?0:(c.value||Yn)(t)});return()=>{const{value:t}=A,{value:b}=d;return o("span",{class:`${g.value}-input-word-count`},xn(i.default,{value:b===null||Array.isArray(b)?"":b},()=>[t===void 0?u.value:`${u.value} / ${t}`]))}}}),Zn=Object.assign(Object.assign({},ie.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),nt=T({name:"Input",props:Zn,slots:Object,setup(r){const{mergedClsPrefixRef:i,mergedBorderedRef:d,inlineThemeDisabled:A,mergedRtlRef:g}=Ie(r),c=ie("Input","-input",Un,zn,r,i);Sn&&Ee("-input-safari",Gn,i);const u=_(null),t=_(null),b=_(null),I=_(null),p=_(null),y=_(null),S=_(null),m=Xn(S),l=_(null),{localeRef:h}=Wn("Input"),x=_(r.defaultValue),$=ge(r,"value"),z=_n($,x),F=An(r),{mergedSizeRef:L,mergedDisabledRef:k,mergedStatusRef:M}=F,j=_(!1),H=_(!1),V=_(!1),K=_(!1);let se=null;const ce=P(()=>{const{placeholder:e,pair:n}=r;return n?Array.isArray(e)?e:e===void 0?["",""]:[e,e]:e===void 0?[h.value.placeholder]:[e]}),Te=P(()=>{const{value:e}=V,{value:n}=z,{value:a}=ce;return!e&&(oe(n)||Array.isArray(n)&&oe(n[0]))&&a[0]}),Le=P(()=>{const{value:e}=V,{value:n}=z,{value:a}=ce;return!e&&a[1]&&(oe(n)||Array.isArray(n)&&oe(n[1]))}),ue=Se(()=>r.internalForceFocus||j.value),Ve=Se(()=>{if(k.value||r.readonly||!r.clearable||!ue.value&&!H.value)return!1;const{value:e}=z,{value:n}=ue;return r.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(H.value||n):!!e&&(H.value||n)}),de=P(()=>{const{showPasswordOn:e}=r;if(e)return e;if(r.showPasswordToggle)return"click"}),U=_(!1),We=P(()=>{const{textDecoration:e}=r;return e?Array.isArray(e)?e.map(n=>({textDecoration:n})):[{textDecoration:e}]:["",""]}),xe=_(void 0),De=()=>{var e,n;if(r.type==="textarea"){const{autosize:a}=r;if(a&&(xe.value=(n=(e=l.value)===null||e===void 0?void 0:e.$el)===null||n===void 0?void 0:n.offsetWidth),!t.value||typeof a=="boolean")return;const{paddingTop:v,paddingBottom:w,lineHeight:f}=window.getComputedStyle(t.value),W=Number(v.slice(0,-2)),D=Number(w.slice(0,-2)),O=Number(f.slice(0,-2)),{value:G}=b;if(!G)return;if(a.minRows){const Y=Math.max(a.minRows,1),ve=`${W+D+O*Y}px`;G.style.minHeight=ve}if(a.maxRows){const Y=`${W+D+O*a.maxRows}px`;G.style.maxHeight=Y}}},Oe=P(()=>{const{maxlength:e}=r;return e===void 0?void 0:Number(e)});Rn(()=>{const{value:e}=z;Array.isArray(e)||he(e)});const je=Bn().proxy;function q(e,n){const{onUpdateValue:a,"onUpdate:value":v,onInput:w}=r,{nTriggerFormInput:f}=F;a&&R(a,e,n),v&&R(v,e,n),w&&R(w,e,n),x.value=e,f()}function J(e,n){const{onChange:a}=r,{nTriggerFormChange:v}=F;a&&R(a,e,n),x.value=e,v()}function Ne(e){const{onBlur:n}=r,{nTriggerFormBlur:a}=F;n&&R(n,e),a()}function He(e){const{onFocus:n}=r,{nTriggerFormFocus:a}=F;n&&R(n,e),a()}function Ke(e){const{onClear:n}=r;n&&R(n,e)}function Ue(e){const{onInputBlur:n}=r;n&&R(n,e)}function Ge(e){const{onInputFocus:n}=r;n&&R(n,e)}function Ye(){const{onDeactivate:e}=r;e&&R(e)}function Xe(){const{onActivate:e}=r;e&&R(e)}function Ze(e){const{onClick:n}=r;n&&R(n,e)}function qe(e){const{onWrapperFocus:n}=r;n&&R(n,e)}function Je(e){const{onWrapperBlur:n}=r;n&&R(n,e)}function Qe(){V.value=!0}function er(e){V.value=!1,e.target===y.value?Q(e,1):Q(e,0)}function Q(e,n=0,a="input"){const v=e.target.value;if(he(v),e instanceof InputEvent&&!e.isComposing&&(V.value=!1),r.type==="textarea"){const{value:f}=l;f&&f.syncUnifiedContainer()}if(se=v,V.value)return;m.recordCursor();const w=rr(v);if(w)if(!r.pair)a==="input"?q(v,{source:n}):J(v,{source:n});else{let{value:f}=z;Array.isArray(f)?f=[f[0],f[1]]:f=["",""],f[n]=v,a==="input"?q(f,{source:n}):J(f,{source:n})}je.$forceUpdate(),w||Ae(m.restoreCursor)}function rr(e){const{countGraphemes:n,maxlength:a,minlength:v}=r;if(n){let f;if(a!==void 0&&(f===void 0&&(f=n(e)),f>Number(a))||v!==void 0&&(f===void 0&&(f=n(e)),f<Number(a)))return!1}const{allowInput:w}=r;return typeof w=="function"?w(e):!0}function nr(e){Ue(e),e.relatedTarget===u.value&&Ye(),e.relatedTarget!==null&&(e.relatedTarget===p.value||e.relatedTarget===y.value||e.relatedTarget===t.value)||(K.value=!1),ee(e,"blur"),S.value=null}function tr(e,n){Ge(e),j.value=!0,K.value=!0,Xe(),ee(e,"focus"),n===0?S.value=p.value:n===1?S.value=y.value:n===2&&(S.value=t.value)}function or(e){r.passivelyActivated&&(Je(e),ee(e,"blur"))}function ar(e){r.passivelyActivated&&(j.value=!0,qe(e),ee(e,"focus"))}function ee(e,n){e.relatedTarget!==null&&(e.relatedTarget===p.value||e.relatedTarget===y.value||e.relatedTarget===t.value||e.relatedTarget===u.value)||(n==="focus"?(He(e),j.value=!0):n==="blur"&&(Ne(e),j.value=!1))}function lr(e,n){Q(e,n,"change")}function ir(e){Ze(e)}function sr(e){Ke(e),we()}function we(){r.pair?(q(["",""],{source:"clear"}),J(["",""],{source:"clear"})):(q("",{source:"clear"}),J("",{source:"clear"}))}function cr(e){const{onMousedown:n}=r;n&&n(e);const{tagName:a}=e.target;if(a!=="INPUT"&&a!=="TEXTAREA"){if(r.resizable){const{value:v}=u;if(v){const{left:w,top:f,width:W,height:D}=v.getBoundingClientRect(),O=14;if(w+W-O<e.clientX&&e.clientX<w+W&&f+D-O<e.clientY&&e.clientY<f+D)return}}e.preventDefault(),j.value||ye()}}function ur(){var e;H.value=!0,r.type==="textarea"&&((e=l.value)===null||e===void 0||e.handleMouseEnterWrapper())}function dr(){var e;H.value=!1,r.type==="textarea"&&((e=l.value)===null||e===void 0||e.handleMouseLeaveWrapper())}function fr(){k.value||de.value==="click"&&(U.value=!U.value)}function hr(e){if(k.value)return;e.preventDefault();const n=v=>{v.preventDefault(),Be("mouseup",document,n)};if(Re("mouseup",document,n),de.value!=="mousedown")return;U.value=!0;const a=()=>{U.value=!1,Be("mouseup",document,a)};Re("mouseup",document,a)}function vr(e){r.onKeyup&&R(r.onKeyup,e)}function pr(e){switch(r.onKeydown&&R(r.onKeydown,e),e.key){case"Escape":fe();break;case"Enter":gr(e);break}}function gr(e){var n,a;if(r.passivelyActivated){const{value:v}=K;if(v){r.internalDeactivateOnEnter&&fe();return}e.preventDefault(),r.type==="textarea"?(n=t.value)===null||n===void 0||n.focus():(a=p.value)===null||a===void 0||a.focus()}}function fe(){r.passivelyActivated&&(K.value=!1,Ae(()=>{var e;(e=u.value)===null||e===void 0||e.focus()}))}function ye(){var e,n,a;k.value||(r.passivelyActivated?(e=u.value)===null||e===void 0||e.focus():((n=t.value)===null||n===void 0||n.focus(),(a=p.value)===null||a===void 0||a.focus()))}function br(){var e;!((e=u.value)===null||e===void 0)&&e.contains(document.activeElement)&&document.activeElement.blur()}function mr(){var e,n;(e=t.value)===null||e===void 0||e.select(),(n=p.value)===null||n===void 0||n.select()}function xr(){k.value||(t.value?t.value.focus():p.value&&p.value.focus())}function wr(){const{value:e}=u;e?.contains(document.activeElement)&&e!==document.activeElement&&fe()}function yr(e){if(r.type==="textarea"){const{value:n}=t;n?.scrollTo(e)}else{const{value:n}=p;n?.scrollTo(e)}}function he(e){const{type:n,pair:a,autosize:v}=r;if(!a&&v)if(n==="textarea"){const{value:w}=b;w&&(w.textContent=`${e??""}\r
`)}else{const{value:w}=I;w&&(e?w.textContent=e:w.innerHTML="&nbsp;")}}function Cr(){De()}const Ce=_({top:"0"});function zr(e){var n;const{scrollTop:a}=e.target;Ce.value.top=`${-a}px`,(n=l.value)===null||n===void 0||n.syncUnifiedContainer()}let re=null;_e(()=>{const{autosize:e,type:n}=r;e&&n==="textarea"?re=be(z,a=>{!Array.isArray(a)&&a!==se&&he(a)}):re?.()});let ne=null;_e(()=>{r.type==="textarea"?ne=be(z,e=>{var n;!Array.isArray(e)&&e!==se&&((n=l.value)===null||n===void 0||n.syncUnifiedContainer())}):ne?.()}),$n(Me,{mergedValueRef:z,maxlengthRef:Oe,mergedClsPrefixRef:i,countGraphemesRef:ge(r,"countGraphemes")});const Sr={wrapperElRef:u,inputElRef:p,textareaElRef:t,isCompositing:V,clear:we,focus:ye,blur:br,select:mr,deactivate:wr,activate:xr,scrollTo:yr},_r=ke("Input",g,i),ze=P(()=>{const{value:e}=L,{common:{cubicBezierEaseInOut:n},self:{color:a,borderRadius:v,textColor:w,caretColor:f,caretColorError:W,caretColorWarning:D,textDecorationColor:O,border:G,borderDisabled:Y,borderHover:ve,borderFocus:Ar,placeholderColor:Rr,placeholderColorDisabled:Br,lineHeightTextarea:$r,colorDisabled:Pr,colorFocus:Fr,textColorDisabled:Er,boxShadowFocus:Ir,iconSize:kr,colorFocusWarning:Mr,boxShadowFocusWarning:Tr,borderWarning:Lr,borderFocusWarning:Vr,borderHoverWarning:Wr,colorFocusError:Dr,boxShadowFocusError:Or,borderError:jr,borderFocusError:Nr,borderHoverError:Hr,clearSize:Kr,clearColor:Ur,clearColorHover:Gr,clearColorPressed:Yr,iconColor:Xr,iconColorDisabled:Zr,suffixTextColor:qr,countTextColor:Jr,countTextColorDisabled:Qr,iconColorHover:en,iconColorPressed:rn,loadingColor:nn,loadingColorError:tn,loadingColorWarning:on,fontWeight:an,[ae("padding",e)]:ln,[ae("fontSize",e)]:sn,[ae("height",e)]:cn}}=c.value,{left:un,right:dn}=Pn(ln);return{"--n-bezier":n,"--n-count-text-color":Jr,"--n-count-text-color-disabled":Qr,"--n-color":a,"--n-font-size":sn,"--n-font-weight":an,"--n-border-radius":v,"--n-height":cn,"--n-padding-left":un,"--n-padding-right":dn,"--n-text-color":w,"--n-caret-color":f,"--n-text-decoration-color":O,"--n-border":G,"--n-border-disabled":Y,"--n-border-hover":ve,"--n-border-focus":Ar,"--n-placeholder-color":Rr,"--n-placeholder-color-disabled":Br,"--n-icon-size":kr,"--n-line-height-textarea":$r,"--n-color-disabled":Pr,"--n-color-focus":Fr,"--n-text-color-disabled":Er,"--n-box-shadow-focus":Ir,"--n-loading-color":nn,"--n-caret-color-warning":D,"--n-color-focus-warning":Mr,"--n-box-shadow-focus-warning":Tr,"--n-border-warning":Lr,"--n-border-focus-warning":Vr,"--n-border-hover-warning":Wr,"--n-loading-color-warning":on,"--n-caret-color-error":W,"--n-color-focus-error":Dr,"--n-box-shadow-focus-error":Or,"--n-border-error":jr,"--n-border-focus-error":Nr,"--n-border-hover-error":Hr,"--n-loading-color-error":tn,"--n-clear-color":Ur,"--n-clear-size":Kr,"--n-clear-color-hover":Gr,"--n-clear-color-pressed":Yr,"--n-icon-color":Xr,"--n-icon-color-hover":en,"--n-icon-color-pressed":rn,"--n-icon-color-disabled":Zr,"--n-suffix-text-color":qr}}),N=A?Fn("input",P(()=>{const{value:e}=L;return e[0]}),ze,r):void 0;return Object.assign(Object.assign({},Sr),{wrapperElRef:u,inputElRef:p,inputMirrorElRef:I,inputEl2Ref:y,textareaElRef:t,textareaMirrorElRef:b,textareaScrollbarInstRef:l,rtlEnabled:_r,uncontrolledValue:x,mergedValue:z,passwordVisible:U,mergedPlaceholder:ce,showPlaceholder1:Te,showPlaceholder2:Le,mergedFocus:ue,isComposing:V,activated:K,showClearButton:Ve,mergedSize:L,mergedDisabled:k,textDecorationStyle:We,mergedClsPrefix:i,mergedBordered:d,mergedShowPasswordOn:de,placeholderStyle:Ce,mergedStatus:M,textAreaScrollContainerWidth:xe,handleTextAreaScroll:zr,handleCompositionStart:Qe,handleCompositionEnd:er,handleInput:Q,handleInputBlur:nr,handleInputFocus:tr,handleWrapperBlur:or,handleWrapperFocus:ar,handleMouseEnter:ur,handleMouseLeave:dr,handleMouseDown:cr,handleChange:lr,handleClick:ir,handleClear:sr,handlePasswordToggleClick:fr,handlePasswordToggleMousedown:hr,handleWrapperKeydown:pr,handleWrapperKeyup:vr,handleTextAreaMirrorResize:Cr,getTextareaScrollContainer:()=>t.value,mergedTheme:c,cssVars:A?void 0:ze,themeClass:N?.themeClass,onRender:N?.onRender})},render(){var r,i,d,A,g,c,u;const{mergedClsPrefix:t,mergedStatus:b,themeClass:I,type:p,countGraphemes:y,onRender:S}=this,m=this.$slots;return S?.(),o("div",{ref:"wrapperElRef",class:[`${t}-input`,I,b&&`${t}-input--${b}-status`,{[`${t}-input--rtl`]:this.rtlEnabled,[`${t}-input--disabled`]:this.mergedDisabled,[`${t}-input--textarea`]:p==="textarea",[`${t}-input--resizable`]:this.resizable&&!this.autosize,[`${t}-input--autosize`]:this.autosize,[`${t}-input--round`]:this.round&&p!=="textarea",[`${t}-input--pair`]:this.pair,[`${t}-input--focus`]:this.mergedFocus,[`${t}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},o("div",{class:`${t}-input-wrapper`},te(m.prefix,l=>l&&o("div",{class:`${t}-input__prefix`},l)),p==="textarea"?o(wn,{ref:"textareaScrollbarInstRef",class:`${t}-input__textarea`,container:this.getTextareaScrollContainer,theme:(i=(r=this.theme)===null||r===void 0?void 0:r.peers)===null||i===void 0?void 0:i.Scrollbar,themeOverrides:(A=(d=this.themeOverrides)===null||d===void 0?void 0:d.peers)===null||A===void 0?void 0:A.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var l,h;const{textAreaScrollContainerWidth:x}=this,$={width:this.autosize&&x&&`${x}px`};return o(yn,null,o("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${t}-input__textarea-el`,(l=this.inputProps)===null||l===void 0?void 0:l.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:y?void 0:this.maxlength,minlength:y?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(h=this.inputProps)===null||h===void 0?void 0:h.style,$],onBlur:this.handleInputBlur,onFocus:z=>{this.handleInputFocus(z,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?o("div",{class:`${t}-input__placeholder`,style:[this.placeholderStyle,$],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?o(Cn,{onResize:this.handleTextAreaMirrorResize},{default:()=>o("div",{ref:"textareaMirrorElRef",class:`${t}-input__textarea-mirror`,key:"mirror"})}):null)}}):o("div",{class:`${t}-input__input`},o("input",Object.assign({type:p==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":p},this.inputProps,{ref:"inputElRef",class:[`${t}-input__input-el`,(g=this.inputProps)===null||g===void 0?void 0:g.class],style:[this.textDecorationStyle[0],(c=this.inputProps)===null||c===void 0?void 0:c.style],tabindex:this.passivelyActivated&&!this.activated?-1:(u=this.inputProps)===null||u===void 0?void 0:u.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:y?void 0:this.maxlength,minlength:y?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:l=>{this.handleInputFocus(l,0)},onInput:l=>{this.handleInput(l,0)},onChange:l=>{this.handleChange(l,0)}})),this.showPlaceholder1?o("div",{class:`${t}-input__placeholder`},o("span",null,this.mergedPlaceholder[0])):null,this.autosize?o("div",{class:`${t}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&te(m.suffix,l=>l||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?o("div",{class:`${t}-input__suffix`},[te(m["clear-icon-placeholder"],h=>(this.clearable||h)&&o(me,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>h,icon:()=>{var x,$;return($=(x=this.$slots)["clear-icon"])===null||$===void 0?void 0:$.call(x)}})),this.internalLoadingBeforeSuffix?null:l,this.loading!==void 0?o(Kn,{clsPrefix:t,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?l:null,this.showCount&&this.type!=="textarea"?o(Pe,null,{default:h=>{var x;const{renderCount:$}=this;return $?$(h):(x=m.count)===null||x===void 0?void 0:x.call(m,h)}}):null,this.mergedShowPasswordOn&&this.type==="password"?o("div",{class:`${t}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Z(m["password-visible-icon"],()=>[o(le,{clsPrefix:t},{default:()=>o(jn,null)})]):Z(m["password-invisible-icon"],()=>[o(le,{clsPrefix:t},{default:()=>o(Nn,null)})])):null]):null)),this.pair?o("span",{class:`${t}-input__separator`},Z(m.separator,()=>[this.separator])):null,this.pair?o("div",{class:`${t}-input-wrapper`},o("div",{class:`${t}-input__input`},o("input",{ref:"inputEl2Ref",type:this.type,class:`${t}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:y?void 0:this.maxlength,minlength:y?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:l=>{this.handleInputFocus(l,1)},onInput:l=>{this.handleInput(l,1)},onChange:l=>{this.handleChange(l,1)}}),this.showPlaceholder2?o("div",{class:`${t}-input__placeholder`},o("span",null,this.mergedPlaceholder[1])):null),te(m.suffix,l=>(this.clearable||l)&&o("div",{class:`${t}-input__suffix`},[this.clearable&&o(me,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var h;return(h=m["clear-icon"])===null||h===void 0?void 0:h.call(m)},placeholder:()=>{var h;return(h=m["clear-icon-placeholder"])===null||h===void 0?void 0:h.call(m)}}),l]))):null,this.mergedBordered?o("div",{class:`${t}-input__border`}):null,this.mergedBordered?o("div",{class:`${t}-input__state-border`}):null,this.showCount&&p==="textarea"?o(Pe,null,{default:l=>{var h;const{renderCount:x}=this;return x?x(l):(h=m.count)===null||h===void 0?void 0:h.call(m,l)}}):null)}});let pe;function qn(){if(!En)return!0;if(pe===void 0){const r=document.createElement("div");r.style.display="flex",r.style.flexDirection="column",r.style.rowGap="1px",r.appendChild(document.createElement("div")),r.appendChild(document.createElement("div")),document.body.appendChild(r);const i=r.scrollHeight===1;return document.body.removeChild(r),pe=i}return pe}const Jn=Object.assign(Object.assign({},ie.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),tt=T({name:"Space",props:Jn,setup(r){const{mergedClsPrefixRef:i,mergedRtlRef:d}=Ie(r),A=ie("Space","-space",void 0,Ln,r,i),g=ke("Space",d,i);return{useGap:qn(),rtlEnabled:g,mergedClsPrefix:i,margin:P(()=>{const{size:c}=r;if(Array.isArray(c))return{horizontal:c[0],vertical:c[1]};if(typeof c=="number")return{horizontal:c,vertical:c};const{self:{[ae("gap",c)]:u}}=A.value,{row:t,col:b}=Tn(u);return{horizontal:$e(b),vertical:$e(t)}})}},render(){const{vertical:r,reverse:i,align:d,inline:A,justify:g,itemClass:c,itemStyle:u,margin:t,wrap:b,mergedClsPrefix:I,rtlEnabled:p,useGap:y,wrapItem:S,internalUseGap:m}=this,l=In(kn(this),!1);if(!l.length)return null;const h=`${t.horizontal}px`,x=`${t.horizontal/2}px`,$=`${t.vertical}px`,z=`${t.vertical/2}px`,F=l.length-1,L=g.startsWith("space-");return o("div",{role:"none",class:[`${I}-space`,p&&`${I}-space--rtl`],style:{display:A?"inline-flex":"flex",flexDirection:r&&!i?"column":r&&i?"column-reverse":!r&&i?"row-reverse":"row",justifyContent:["start","end"].includes(g)?`flex-${g}`:g,flexWrap:!b||r?"nowrap":"wrap",marginTop:y||r?"":`-${z}`,marginBottom:y||r?"":`-${z}`,alignItems:d,gap:y?`${t.vertical}px ${t.horizontal}px`:""}},!S&&(y||m)?l:l.map((k,M)=>k.type===Mn?k:o("div",{role:"none",class:c,style:[u,{maxWidth:"100%"},y?"":r?{marginBottom:M!==F?$:""}:p?{marginLeft:L?g==="space-between"&&M===F?"":x:M!==F?h:"",marginRight:L?g==="space-between"&&M===0?"":x:"",paddingTop:z,paddingBottom:z}:{marginRight:L?g==="space-between"&&M===F?"":x:M!==F?h:"",marginLeft:L?g==="space-between"&&M===0?"":x:"",paddingTop:z,paddingBottom:z}]},k)))}});export{rt as A,Dn as C,Kn as N,nt as a,tt as b,Wn as u};
