Files
prod/frontend/dist/assets/Input-B0pT-V_P.js
T
2026-10-27 15:18:26 +07:00

234 lines
28 KiB
JavaScript

import{At as e,Ft as t,Gt as n,Nt as r,U as i,W as a,X as o,Yt as s,_ as c,an as l,at as u,ct as ee,gt as d,h as te,in as f,jt as ne,m as p,nt as m,ot as h,rt as g,st as _,vn as v,xn as y,xt as b,zt as x}from"./client-DrrW410h.js";import{a as S,c as C,s as re,t as w}from"./Scrollbar-DGnXZ64x.js";import{s as ie}from"./ui-BXphkCO3.js";import{i as ae,r as T,t as E}from"./Suffix-1hsPP30m.js";import{t as oe}from"./use-merged-state-CIQwNmUb.js";import{i as se}from"./Button-VP0HlDWp.js";import{a as D,c as O,i as k,o as A}from"./_plugin-vue_export-helper-2ZWAS1ss.js";import{n as ce}from"./use-form-item-CNQ45NOh.js";import{N as le,Q as j,at as M}from"./index-CvfVA1ID.js";var N=e({name:`Eye`,render(){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},r(`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`}),r(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),P=e({name:`EyeOff`,render(){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},r(`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`}),r(`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`}),r(`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`}),r(`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`}),r(`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`}))}}),F=o(`n-input`),ue=g(`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);
`,[u(`input, textarea`,`
overflow: hidden;
flex-grow: 1;
position: relative;
`),u(`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);
`),u(`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;
`,[m(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
width: 0;
height: 0;
display: none;
`),m(`&::placeholder`,`
color: #0000;
-webkit-text-fill-color: transparent !important;
`),m(`&:-webkit-autofill ~`,[u(`placeholder`,`display: none;`)])]),h(`round`,[_(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),u(`placeholder`,`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
color: var(--n-placeholder-color);
`,[m(`span`,`
width: 100%;
display: inline-block;
`)]),h(`textarea`,[u(`placeholder`,`overflow: visible;`)]),_(`autosize`,`width: 100%;`),h(`autosize`,[u(`textarea-el, input-el`,`
position: absolute;
top: 0;
left: 0;
height: 100%;
`)]),g(`input-wrapper`,`
overflow: hidden;
display: inline-flex;
flex-grow: 1;
position: relative;
padding-left: var(--n-padding-left);
padding-right: var(--n-padding-right);
`),u(`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;
`),u(`input-el`,`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
`,[m(`&[type=password]::-ms-reveal`,`display: none;`),m(`+`,[u(`placeholder`,`
display: flex;
align-items: center;
`)])]),_(`textarea`,[u(`placeholder`,`white-space: nowrap;`)]),u(`eye`,`
display: flex;
align-items: center;
justify-content: center;
transition: color .3s var(--n-bezier);
`),h(`textarea`,`width: 100%;`,[g(`input-word-count`,`
position: absolute;
right: var(--n-padding-right);
bottom: var(--n-padding-vertical);
`),h(`resizable`,[g(`input-wrapper`,`
resize: vertical;
min-height: var(--n-height);
`)]),u(`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);
`),u(`textarea-mirror`,`
width: 100%;
pointer-events: none;
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre-wrap;
overflow-wrap: break-word;
`)]),h(`pair`,[u(`input-el, placeholder`,`text-align: center;`),u(`separator`,`
display: flex;
align-items: center;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
white-space: nowrap;
`,[g(`icon`,`
color: var(--n-icon-color);
`),g(`base-icon`,`
color: var(--n-icon-color);
`)])]),h(`disabled`,`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[u(`border`,`border: var(--n-border-disabled);`),u(`input-el, textarea-el`,`
cursor: not-allowed;
color: var(--n-text-color-disabled);
text-decoration-color: var(--n-text-color-disabled);
`),u(`placeholder`,`color: var(--n-placeholder-color-disabled);`),u(`separator`,`color: var(--n-text-color-disabled);`,[g(`icon`,`
color: var(--n-icon-color-disabled);
`),g(`base-icon`,`
color: var(--n-icon-color-disabled);
`)]),g(`input-word-count`,`
color: var(--n-count-text-color-disabled);
`),u(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[g(`icon`,`
color: var(--n-icon-color-disabled);
`),g(`internal-icon`,`
color: var(--n-icon-color-disabled);
`)])]),_(`disabled`,[u(`eye`,`
color: var(--n-icon-color);
cursor: pointer;
`,[m(`&:hover`,`
color: var(--n-icon-color-hover);
`),m(`&:active`,`
color: var(--n-icon-color-pressed);
`)]),m(`&:hover`,[u(`state-border`,`border: var(--n-border-hover);`)]),h(`focus`,`background-color: var(--n-color-focus);`,[u(`state-border`,`
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]),u(`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);
`),u(`state-border`,`
border-color: #0000;
z-index: 1;
`),u(`prefix`,`margin-right: 4px;`),u(`suffix`,`
margin-left: 4px;
`),u(`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);
`,[g(`base-loading`,`
font-size: var(--n-icon-size);
margin: 0 2px;
color: var(--n-loading-color);
`),g(`base-clear`,`
font-size: var(--n-icon-size);
`,[u(`placeholder`,[g(`base-icon`,`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)])]),m(`>`,[g(`icon`,`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)]),g(`base-icon`,`
font-size: var(--n-icon-size);
`)]),g(`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(e=>h(`${e}-status`,[_(`disabled`,[g(`base-loading`,`
color: var(--n-loading-color-${e})
`),u(`input-el, textarea-el`,`
caret-color: var(--n-caret-color-${e});
`),u(`state-border`,`
border: var(--n-border-${e});
`),m(`&:hover`,[u(`state-border`,`
border: var(--n-border-hover-${e});
`)]),m(`&:focus`,`
background-color: var(--n-color-focus-${e});
`,[u(`state-border`,`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)]),h(`focus`,`
background-color: var(--n-color-focus-${e});
`,[u(`state-border`,`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),de=g(`input`,[h(`disabled`,[u(`input-el, textarea-el`,`
-webkit-text-fill-color: var(--n-text-color-disabled);
`)])]);function I(e){let t=0;for(let n of e)t++;return t}function L(e){return e===``||e==null}function fe(e){let t=v(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}function r(){var n;let{value:r}=t,{value:i}=e;if(!r||!i)return;let{value:a}=i,{start:o,beforeText:s,afterText:c}=r,l=a.length;if(a.endsWith(c))l=a.length-c.length;else if(a.startsWith(s))l=s.length;else{let e=s[o-1],t=a.indexOf(e,o-1);t!==-1&&(l=t+1)}(n=i.setSelectionRange)==null||n.call(i,l,l)}function i(){t.value=null}return f(e,i),{recordCursor:n,restoreCursor:r}}var R=e({name:`InputWordCount`,setup(e,{slots:n}){let{mergedValueRef:i,maxlengthRef:a,mergedClsPrefixRef:o,countGraphemesRef:s}=t(F),c=b(()=>{let{value:e}=i;return e===null||Array.isArray(e)?0:(s.value||I)(e)});return()=>{let{value:e}=a,{value:t}=i;return r(`span`,{class:`${o.value}-input-word-count`},D(n.default,{value:t===null||Array.isArray(t)?``:t},()=>[e===void 0?c.value:`${c.value} / ${e}`]))}}}),z=e({name:`Input`,props:Object.assign(Object.assign({},p.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}),slots:Object,setup(e){let{mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:o,mergedRtlRef:u,mergedComponentPropsRef:d}=a(e),m=p(`Input`,`-input`,ue,le,e,t);se&&te(`-input-safari`,de,t);let h=v(null),g=v(null),_=v(null),S=v(null),w=v(null),T=v(null),E=v(null),D=fe(E),k=v(null),{localeRef:A}=ae(`Input`),j=v(e.defaultValue),N=oe(y(e,`value`),j),P=ce(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:d?.value?.Input?.size||`medium`}}),{mergedSizeRef:I,mergedDisabledRef:R,mergedStatusRef:z}=P,B=v(!1),V=v(!1),H=v(!1),U=v(!1),W=null,G=b(()=>{let{placeholder:t,pair:n}=e;return n?Array.isArray(t)?t:t===void 0?[``,``]:[t,t]:t===void 0?[A.value.placeholder]:[t]}),pe=b(()=>{let{value:e}=H,{value:t}=N,{value:n}=G;return!e&&(L(t)||Array.isArray(t)&&L(t[0]))&&n[0]}),me=b(()=>{let{value:e}=H,{value:t}=N,{value:n}=G;return!e&&n[1]&&(L(t)||Array.isArray(t)&&L(t[1]))}),K=M(()=>e.internalForceFocus||B.value),he=M(()=>{if(R.value||e.readonly||!e.clearable||!K.value&&!V.value)return!1;let{value:t}=N,{value:n}=K;return e.pair?!!(Array.isArray(t)&&(t[0]||t[1]))&&(V.value||n):!!t&&(V.value||n)}),q=b(()=>{let{showPasswordOn:t}=e;if(t)return t;if(e.showPasswordToggle)return`click`}),J=v(!1),ge=b(()=>{let{textDecoration:t}=e;return t?Array.isArray(t)?t.map(e=>({textDecoration:e})):[{textDecoration:t}]:[``,``]}),_e=v(void 0),ve=()=>{if(e.type===`textarea`){let{autosize:t}=e;if(t&&(_e.value=k.value?.$el?.offsetWidth),!g.value||typeof t==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(g.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=_;if(!c)return;if(t.minRows){let e=Math.max(t.minRows,1),n=`${a+o+s*e}px`;c.style.minHeight=n}if(t.maxRows){let e=`${a+o+s*t.maxRows}px`;c.style.maxHeight=e}}},ye=b(()=>{let{maxlength:t}=e;return t===void 0?void 0:Number(t)});n(()=>{let{value:e}=N;Array.isArray(e)||$(e)});let be=ne().proxy;function Y(t,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=e,{nTriggerFormInput:o}=P;r&&O(r,t,n),i&&O(i,t,n),a&&O(a,t,n),j.value=t,o()}function X(t,n){let{onChange:r}=e,{nTriggerFormChange:i}=P;r&&O(r,t,n),j.value=t,i()}function xe(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=P;n&&O(n,t),r()}function Se(t){let{onFocus:n}=e,{nTriggerFormFocus:r}=P;n&&O(n,t),r()}function Ce(t){let{onClear:n}=e;n&&O(n,t)}function we(t){let{onInputBlur:n}=e;n&&O(n,t)}function Te(t){let{onInputFocus:n}=e;n&&O(n,t)}function Ee(){let{onDeactivate:t}=e;t&&O(t)}function De(){let{onActivate:t}=e;t&&O(t)}function Oe(t){let{onClick:n}=e;n&&O(n,t)}function ke(t){let{onWrapperFocus:n}=e;n&&O(n,t)}function Ae(t){let{onWrapperBlur:n}=e;n&&O(n,t)}function je(){H.value=!0}function Me(e){H.value=!1,e.target===T.value?Z(e,1):Z(e,0)}function Z(t,n=0,r=`input`){let i=t.target.value;if($(i),t instanceof InputEvent&&!t.isComposing&&(H.value=!1),e.type===`textarea`){let{value:e}=k;e&&e.syncUnifiedContainer()}if(W=i,H.value)return;D.recordCursor();let a=Ne(i);if(a)if(!e.pair)r===`input`?Y(i,{source:n}):X(i,{source:n});else{let{value:e}=N;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?Y(e,{source:n}):X(e,{source:n})}be.$forceUpdate(),a||x(D.restoreCursor)}function Ne(t){let{countGraphemes:n,maxlength:r,minlength:i}=e;if(n){let e;if(r!==void 0&&(e===void 0&&(e=n(t)),e>Number(r))||i!==void 0&&(e===void 0&&(e=n(t)),e<Number(r)))return!1}let{allowInput:a}=e;return typeof a==`function`?a(t):!0}function Pe(e){we(e),e.relatedTarget===h.value&&Ee(),e.relatedTarget!==null&&(e.relatedTarget===w.value||e.relatedTarget===T.value||e.relatedTarget===g.value)||(U.value=!1),Q(e,`blur`),E.value=null}function Fe(e,t){Te(e),B.value=!0,U.value=!0,De(),Q(e,`focus`),t===0?E.value=w.value:t===1?E.value=T.value:t===2&&(E.value=g.value)}function Ie(t){e.passivelyActivated&&(Ae(t),Q(t,`blur`))}function Le(t){e.passivelyActivated&&(B.value=!0,ke(t),Q(t,`focus`))}function Q(e,t){e.relatedTarget!==null&&(e.relatedTarget===w.value||e.relatedTarget===T.value||e.relatedTarget===g.value||e.relatedTarget===h.value)||(t===`focus`?(Se(e),B.value=!0):t===`blur`&&(xe(e),B.value=!1))}function Re(e,t){Z(e,t,`change`)}function ze(e){Oe(e)}function Be(e){Ce(e),Ve()}function Ve(){e.pair?(Y([``,``],{source:`clear`}),X([``,``],{source:`clear`})):(Y(``,{source:`clear`}),X(``,{source:`clear`}))}function He(t){let{onMousedown:n}=e;n&&n(t);let{tagName:r}=t.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(e.resizable){let{value:e}=h;if(e){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();if(n+i-14<t.clientX&&t.clientX<n+i&&r+a-14<t.clientY&&t.clientY<r+a)return}}t.preventDefault(),B.value||Ze()}}function Ue(){var t;V.value=!0,e.type===`textarea`&&((t=k.value)==null||t.handleMouseEnterWrapper())}function We(){var t;V.value=!1,e.type===`textarea`&&((t=k.value)==null||t.handleMouseLeaveWrapper())}function Ge(){R.value||q.value===`click`&&(J.value=!J.value)}function Ke(e){if(R.value)return;e.preventDefault();let t=e=>{e.preventDefault(),re(`mouseup`,document,t)};if(C(`mouseup`,document,t),q.value!==`mousedown`)return;J.value=!0;let n=()=>{J.value=!1,re(`mouseup`,document,n)};C(`mouseup`,document,n)}function qe(t){e.onKeyup&&O(e.onKeyup,t)}function Je(t){switch(e.onKeydown&&O(e.onKeydown,t),t.key){case`Escape`:Xe();break;case`Enter`:Ye(t);break}}function Ye(t){var n,r;if(e.passivelyActivated){let{value:i}=U;if(i){e.internalDeactivateOnEnter&&Xe();return}t.preventDefault(),e.type===`textarea`?(n=g.value)==null||n.focus():(r=w.value)==null||r.focus()}}function Xe(){e.passivelyActivated&&(U.value=!1,x(()=>{var e;(e=h.value)==null||e.focus()}))}function Ze(){var t,n,r;R.value||(e.passivelyActivated?(t=h.value)==null||t.focus():((n=g.value)==null||n.focus(),(r=w.value)==null||r.focus()))}function Qe(){h.value?.contains(document.activeElement)&&document.activeElement.blur()}function $e(){var e,t;(e=g.value)==null||e.select(),(t=w.value)==null||t.select()}function et(){R.value||(g.value?g.value.focus():w.value&&w.value.focus())}function tt(){let{value:e}=h;e?.contains(document.activeElement)&&e!==document.activeElement&&Xe()}function nt(t){if(e.type===`textarea`){let{value:e}=g;e?.scrollTo(t)}else{let{value:e}=w;e?.scrollTo(t)}}function $(t){let{type:n,pair:r,autosize:i}=e;if(!r&&i)if(n===`textarea`){let{value:e}=_;e&&(e.textContent=`${t??``}\r\n`)}else{let{value:e}=S;e&&(t?e.textContent=t:e.innerHTML=`&nbsp;`)}}function rt(){ve()}let it=v({top:`0`});function at(e){var t;let{scrollTop:n}=e.target;it.value.top=`${-n}px`,(t=k.value)==null||t.syncUnifiedContainer()}let ot=null;l(()=>{let{autosize:t,type:n}=e;t&&n===`textarea`?ot=f(N,e=>{!Array.isArray(e)&&e!==W&&$(e)}):ot?.()});let st=null;l(()=>{e.type===`textarea`?st=f(N,e=>{var t;!Array.isArray(e)&&e!==W&&((t=k.value)==null||t.syncUnifiedContainer())}):st?.()}),s(F,{mergedValueRef:N,maxlengthRef:ye,mergedClsPrefixRef:t,countGraphemesRef:y(e,`countGraphemes`)});let ct={wrapperElRef:h,inputElRef:w,textareaElRef:g,isCompositing:H,clear:Ve,focus:Ze,blur:Qe,select:$e,deactivate:tt,activate:et,scrollTo:nt},lt=c(`Input`,u,t),ut=b(()=>{let{value:e}=I,{common:{cubicBezierEaseInOut:t},self:{color:n,borderRadius:r,textColor:i,caretColor:a,caretColorError:o,caretColorWarning:s,textDecorationColor:c,border:l,borderDisabled:u,borderHover:d,borderFocus:te,placeholderColor:f,placeholderColorDisabled:ne,lineHeightTextarea:p,colorDisabled:h,colorFocus:g,textColorDisabled:_,boxShadowFocus:v,iconSize:y,colorFocusWarning:b,boxShadowFocusWarning:x,borderWarning:S,borderFocusWarning:C,borderHoverWarning:re,colorFocusError:w,boxShadowFocusError:ae,borderError:T,borderFocusError:E,borderHoverError:oe,clearSize:se,clearColor:D,clearColorHover:O,clearColorPressed:k,iconColor:A,iconColorDisabled:ce,suffixTextColor:le,countTextColor:j,countTextColorDisabled:M,iconColorHover:N,iconColorPressed:P,loadingColor:F,loadingColorError:ue,loadingColorWarning:de,fontWeight:L,[ee(`padding`,e)]:fe,[ee(`fontSize`,e)]:R,[ee(`height`,e)]:z}}=m.value,{left:B,right:V}=ie(fe);return{"--n-bezier":t,"--n-count-text-color":j,"--n-count-text-color-disabled":M,"--n-color":n,"--n-font-size":R,"--n-font-weight":L,"--n-border-radius":r,"--n-height":z,"--n-padding-left":B,"--n-padding-right":V,"--n-text-color":i,"--n-caret-color":a,"--n-text-decoration-color":c,"--n-border":l,"--n-border-disabled":u,"--n-border-hover":d,"--n-border-focus":te,"--n-placeholder-color":f,"--n-placeholder-color-disabled":ne,"--n-icon-size":y,"--n-line-height-textarea":p,"--n-color-disabled":h,"--n-color-focus":g,"--n-text-color-disabled":_,"--n-box-shadow-focus":v,"--n-loading-color":F,"--n-caret-color-warning":s,"--n-color-focus-warning":b,"--n-box-shadow-focus-warning":x,"--n-border-warning":S,"--n-border-focus-warning":C,"--n-border-hover-warning":re,"--n-loading-color-warning":de,"--n-caret-color-error":o,"--n-color-focus-error":w,"--n-box-shadow-focus-error":ae,"--n-border-error":T,"--n-border-focus-error":E,"--n-border-hover-error":oe,"--n-loading-color-error":ue,"--n-clear-color":D,"--n-clear-size":se,"--n-clear-color-hover":O,"--n-clear-color-pressed":k,"--n-icon-color":A,"--n-icon-color-hover":N,"--n-icon-color-pressed":P,"--n-icon-color-disabled":ce,"--n-suffix-text-color":le}}),dt=o?i(`input`,b(()=>{let{value:e}=I;return e[0]}),ut,e):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:h,inputElRef:w,inputMirrorElRef:S,inputEl2Ref:T,textareaElRef:g,textareaMirrorElRef:_,textareaScrollbarInstRef:k,rtlEnabled:lt,uncontrolledValue:j,mergedValue:N,passwordVisible:J,mergedPlaceholder:G,showPlaceholder1:pe,showPlaceholder2:me,mergedFocus:K,isComposing:H,activated:U,showClearButton:he,mergedSize:I,mergedDisabled:R,textDecorationStyle:ge,mergedClsPrefix:t,mergedBordered:r,mergedShowPasswordOn:q,placeholderStyle:it,mergedStatus:z,textAreaScrollContainerWidth:_e,handleTextAreaScroll:at,handleCompositionStart:je,handleCompositionEnd:Me,handleInput:Z,handleInputBlur:Pe,handleInputFocus:Fe,handleWrapperBlur:Ie,handleWrapperFocus:Le,handleMouseEnter:Ue,handleMouseLeave:We,handleMouseDown:He,handleChange:Re,handleClick:ze,handleClear:Be,handlePasswordToggleClick:Ge,handlePasswordToggleMousedown:Ke,handleWrapperKeydown:Je,handleWrapperKeyup:qe,handleTextAreaMirrorResize:rt,getTextareaScrollContainer:()=>g.value,mergedTheme:m,cssVars:o?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:i,countGraphemes:a,onRender:o}=this,s=this.$slots;return o?.(),r(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:i===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&i!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-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},r(`div`,{class:`${e}-input-wrapper`},A(s.prefix,t=>t&&r(`div`,{class:`${e}-input__prefix`},t)),i===`textarea`?r(w,{ref:`textareaScrollbarInstRef`,class:`${e}-input__textarea`,container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return r(d,null,r(`textarea`,Object.assign({},this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?r(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?r(S,{onResize:this.handleTextAreaMirrorResize},{default:()=>r(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):r(`div`,{class:`${e}-input__input`},r(`input`,Object.assign({type:i===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:i},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?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:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?r(`div`,{class:`${e}-input__placeholder`},r(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?r(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&A(s.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?r(`div`,{class:`${e}-input__suffix`},[A(s[`clear-icon-placeholder`],t=>(this.clearable||t)&&r(T,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var e;return(e=this.$slots)[`clear-icon`]?.call(e)}})),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:r(E,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?r(R,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?r(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?k(s[`password-visible-icon`],()=>[r(j,{clsPrefix:e},{default:()=>r(N,null)})]):k(s[`password-invisible-icon`],()=>[r(j,{clsPrefix:e},{default:()=>r(P,null)})])):null]):null)),this.pair?r(`span`,{class:`${e}-input__separator`},k(s.separator,()=>[this.separator])):null,this.pair?r(`div`,{class:`${e}-input-wrapper`},r(`div`,{class:`${e}-input__input`},r(`input`,{ref:`inputEl2Ref`,type:this.type,class:`${e}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?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:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?r(`div`,{class:`${e}-input__placeholder`},r(`span`,null,this.mergedPlaceholder[1])):null),A(s.suffix,t=>(this.clearable||t)&&r(`div`,{class:`${e}-input__suffix`},[this.clearable&&r(T,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>s[`clear-icon`]?.call(s),placeholder:()=>s[`clear-icon-placeholder`]?.call(s)}),t]))):null,this.mergedBordered?r(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?r(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&i===`textarea`?r(R,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null)}});export{N as n,z as t};