Spin-DNOFK4cg.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. import{A as e,Bt as t,D as n,Dn as r,En as i,Et as a,Hn as o,In as s,Jt as c,Lt as l,M as u,Mt as d,O as f,On as p,Ot as m,Qt as h,S as g,Tt as _,Un as v,Vt as y,Wt as b,Zn as x,Zt as S,_t as C,b as w,en as T,er as E,g as D,gt as ee,h as te,hn as O,jn as k,k as A,kn as j,nn as M,qt as ne,rn as N,tn as P,un as F,v as I,vt as re,wt as L,x as R,y as z,yn as B,zn as ie,zt as ae}from"./vault-CdmsmWuM.js";import{i as V,m as oe,o as se,p as H,r as U}from"./_plugin-vue_export-helper-Igk7P-hr.js";var W=i({name:`Eye`,render(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},p(`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`}),p(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),ce=i({name:`EyeOff`,render(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},p(`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`}),p(`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`}),p(`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`}),p(`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`}),p(`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`}))}}),G={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function K(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:s,borderColor:c,warningColor:l,warningColorHover:u,errorColor:d,errorColorHover:f,borderRadius:p,lineHeight:m,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:_,fontSizeLarge:v,heightTiny:y,heightSmall:x,heightMedium:S,heightLarge:C,actionColor:w,clearColor:T,clearColorHover:E,clearColorPressed:D,placeholderColor:ee,placeholderColorDisabled:te,iconColor:O,iconColorDisabled:k,iconColorHover:A,iconColorPressed:j,fontWeight:M}=e;return Object.assign(Object.assign({},G),{fontWeight:M,countTextColorDisabled:r,countTextColor:n,heightTiny:y,heightSmall:x,heightMedium:S,heightLarge:C,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:_,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:`16px`,groupLabelColor:w,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:ee,placeholderColorDisabled:te,color:o,colorDisabled:s,colorFocus:o,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${b(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:l,borderWarning:`1px solid ${l}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${b(l,{alpha:.2})}`,caretColorWarning:l,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${f}`,colorFocusError:o,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${b(d,{alpha:.2})}`,caretColorError:d,clearColor:T,clearColorHover:E,clearColorPressed:D,iconColor:O,iconColorDisabled:k,iconColorHover:A,iconColorPressed:j,suffixTextColor:t})}var le=f({name:`Input`,common:z,peers:{Scrollbar:I},self:K}),ue=l(`n-input`),de=h(`input`,`
  2. max-width: 100%;
  3. cursor: text;
  4. line-height: 1.5;
  5. z-index: auto;
  6. outline: none;
  7. box-sizing: border-box;
  8. position: relative;
  9. display: inline-flex;
  10. border-radius: var(--n-border-radius);
  11. background-color: var(--n-color);
  12. transition: background-color .3s var(--n-bezier);
  13. font-size: var(--n-font-size);
  14. font-weight: var(--n-font-weight);
  15. --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
  16. `,[T(`input, textarea`,`
  17. overflow: hidden;
  18. flex-grow: 1;
  19. position: relative;
  20. `),T(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`
  21. box-sizing: border-box;
  22. font-size: inherit;
  23. line-height: 1.5;
  24. font-family: inherit;
  25. border: none;
  26. outline: none;
  27. background-color: #0000;
  28. text-align: inherit;
  29. transition:
  30. -webkit-text-fill-color .3s var(--n-bezier),
  31. caret-color .3s var(--n-bezier),
  32. color .3s var(--n-bezier),
  33. text-decoration-color .3s var(--n-bezier);
  34. `),T(`input-el, textarea-el`,`
  35. -webkit-appearance: none;
  36. scrollbar-width: none;
  37. width: 100%;
  38. min-width: 0;
  39. text-decoration-color: var(--n-text-decoration-color);
  40. color: var(--n-text-color);
  41. caret-color: var(--n-caret-color);
  42. background-color: transparent;
  43. `,[S(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
  44. width: 0;
  45. height: 0;
  46. display: none;
  47. `),S(`&::placeholder`,`
  48. color: #0000;
  49. -webkit-text-fill-color: transparent !important;
  50. `),S(`&:-webkit-autofill ~`,[T(`placeholder`,`display: none;`)])]),P(`round`,[M(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),T(`placeholder`,`
  51. pointer-events: none;
  52. position: absolute;
  53. left: 0;
  54. right: 0;
  55. top: 0;
  56. bottom: 0;
  57. overflow: hidden;
  58. color: var(--n-placeholder-color);
  59. `,[S(`span`,`
  60. width: 100%;
  61. display: inline-block;
  62. `)]),P(`textarea`,[T(`placeholder`,`overflow: visible;`)]),M(`autosize`,`width: 100%;`),P(`autosize`,[T(`textarea-el, input-el`,`
  63. position: absolute;
  64. top: 0;
  65. left: 0;
  66. height: 100%;
  67. `)]),h(`input-wrapper`,`
  68. overflow: hidden;
  69. display: inline-flex;
  70. flex-grow: 1;
  71. position: relative;
  72. padding-left: var(--n-padding-left);
  73. padding-right: var(--n-padding-right);
  74. `),T(`input-mirror`,`
  75. padding: 0;
  76. height: var(--n-height);
  77. line-height: var(--n-height);
  78. overflow: hidden;
  79. visibility: hidden;
  80. position: static;
  81. white-space: pre;
  82. pointer-events: none;
  83. `),T(`input-el`,`
  84. padding: 0;
  85. height: var(--n-height);
  86. line-height: var(--n-height);
  87. `,[S(`&[type=password]::-ms-reveal`,`display: none;`),S(`+`,[T(`placeholder`,`
  88. display: flex;
  89. align-items: center;
  90. `)])]),M(`textarea`,[T(`placeholder`,`white-space: nowrap;`)]),T(`eye`,`
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. transition: color .3s var(--n-bezier);
  95. `),P(`textarea`,`width: 100%;`,[h(`input-word-count`,`
  96. position: absolute;
  97. right: var(--n-padding-right);
  98. bottom: var(--n-padding-vertical);
  99. `),P(`resizable`,[h(`input-wrapper`,`
  100. resize: vertical;
  101. min-height: var(--n-height);
  102. `)]),T(`textarea-el, textarea-mirror, placeholder`,`
  103. height: 100%;
  104. padding-left: 0;
  105. padding-right: 0;
  106. padding-top: var(--n-padding-vertical);
  107. padding-bottom: var(--n-padding-vertical);
  108. word-break: break-word;
  109. display: inline-block;
  110. vertical-align: bottom;
  111. box-sizing: border-box;
  112. line-height: var(--n-line-height-textarea);
  113. margin: 0;
  114. resize: none;
  115. white-space: pre-wrap;
  116. scroll-padding-block-end: var(--n-padding-vertical);
  117. `),T(`textarea-mirror`,`
  118. width: 100%;
  119. pointer-events: none;
  120. overflow: hidden;
  121. visibility: hidden;
  122. position: static;
  123. white-space: pre-wrap;
  124. overflow-wrap: break-word;
  125. `)]),P(`pair`,[T(`input-el, placeholder`,`text-align: center;`),T(`separator`,`
  126. display: flex;
  127. align-items: center;
  128. transition: color .3s var(--n-bezier);
  129. color: var(--n-text-color);
  130. white-space: nowrap;
  131. `,[h(`icon`,`
  132. color: var(--n-icon-color);
  133. `),h(`base-icon`,`
  134. color: var(--n-icon-color);
  135. `)])]),P(`disabled`,`
  136. cursor: not-allowed;
  137. background-color: var(--n-color-disabled);
  138. `,[T(`border`,`border: var(--n-border-disabled);`),T(`input-el, textarea-el`,`
  139. cursor: not-allowed;
  140. color: var(--n-text-color-disabled);
  141. text-decoration-color: var(--n-text-color-disabled);
  142. `),T(`placeholder`,`color: var(--n-placeholder-color-disabled);`),T(`separator`,`color: var(--n-text-color-disabled);`,[h(`icon`,`
  143. color: var(--n-icon-color-disabled);
  144. `),h(`base-icon`,`
  145. color: var(--n-icon-color-disabled);
  146. `)]),h(`input-word-count`,`
  147. color: var(--n-count-text-color-disabled);
  148. `),T(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[h(`icon`,`
  149. color: var(--n-icon-color-disabled);
  150. `),h(`internal-icon`,`
  151. color: var(--n-icon-color-disabled);
  152. `)])]),M(`disabled`,[T(`eye`,`
  153. color: var(--n-icon-color);
  154. cursor: pointer;
  155. `,[S(`&:hover`,`
  156. color: var(--n-icon-color-hover);
  157. `),S(`&:active`,`
  158. color: var(--n-icon-color-pressed);
  159. `)]),S(`&:hover`,[T(`state-border`,`border: var(--n-border-hover);`)]),P(`focus`,`background-color: var(--n-color-focus);`,[T(`state-border`,`
  160. border: var(--n-border-focus);
  161. box-shadow: var(--n-box-shadow-focus);
  162. `)])]),T(`border, state-border`,`
  163. box-sizing: border-box;
  164. position: absolute;
  165. left: 0;
  166. right: 0;
  167. top: 0;
  168. bottom: 0;
  169. pointer-events: none;
  170. border-radius: inherit;
  171. border: var(--n-border);
  172. transition:
  173. box-shadow .3s var(--n-bezier),
  174. border-color .3s var(--n-bezier);
  175. `),T(`state-border`,`
  176. border-color: #0000;
  177. z-index: 1;
  178. `),T(`prefix`,`margin-right: 4px;`),T(`suffix`,`
  179. margin-left: 4px;
  180. `),T(`suffix, prefix`,`
  181. transition: color .3s var(--n-bezier);
  182. flex-wrap: nowrap;
  183. flex-shrink: 0;
  184. line-height: var(--n-height);
  185. white-space: nowrap;
  186. display: inline-flex;
  187. align-items: center;
  188. justify-content: center;
  189. color: var(--n-suffix-text-color);
  190. `,[h(`base-loading`,`
  191. font-size: var(--n-icon-size);
  192. margin: 0 2px;
  193. color: var(--n-loading-color);
  194. `),h(`base-clear`,`
  195. font-size: var(--n-icon-size);
  196. `,[T(`placeholder`,[h(`base-icon`,`
  197. transition: color .3s var(--n-bezier);
  198. color: var(--n-icon-color);
  199. font-size: var(--n-icon-size);
  200. `)])]),S(`>`,[h(`icon`,`
  201. transition: color .3s var(--n-bezier);
  202. color: var(--n-icon-color);
  203. font-size: var(--n-icon-size);
  204. `)]),h(`base-icon`,`
  205. font-size: var(--n-icon-size);
  206. `)]),h(`input-word-count`,`
  207. pointer-events: none;
  208. line-height: 1.5;
  209. font-size: .85em;
  210. color: var(--n-count-text-color);
  211. transition: color .3s var(--n-bezier);
  212. margin-left: 4px;
  213. font-variant: tabular-nums;
  214. `),[`warning`,`error`].map(e=>P(`${e}-status`,[M(`disabled`,[h(`base-loading`,`
  215. color: var(--n-loading-color-${e})
  216. `),T(`input-el, textarea-el`,`
  217. caret-color: var(--n-caret-color-${e});
  218. `),T(`state-border`,`
  219. border: var(--n-border-${e});
  220. `),S(`&:hover`,[T(`state-border`,`
  221. border: var(--n-border-hover-${e});
  222. `)]),S(`&:focus`,`
  223. background-color: var(--n-color-focus-${e});
  224. `,[T(`state-border`,`
  225. box-shadow: var(--n-box-shadow-focus-${e});
  226. border: var(--n-border-focus-${e});
  227. `)]),P(`focus`,`
  228. background-color: var(--n-color-focus-${e});
  229. `,[T(`state-border`,`
  230. box-shadow: var(--n-box-shadow-focus-${e});
  231. border: var(--n-border-focus-${e});
  232. `)])])]))]),fe=h(`input`,[P(`disabled`,[T(`input-el, textarea-el`,`
  233. -webkit-text-fill-color: var(--n-text-color-disabled);
  234. `)])]);function pe(e){let t=0;for(let n of e)t++;return t}function q(e){return e===``||e==null}function me(e){let t=x(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 o(e,i),{recordCursor:n,restoreCursor:r}}var J=i({name:`InputWordCount`,setup(e,{slots:t}){let{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:i,countGraphemesRef:a}=j(ue),o=B(()=>{let{value:e}=n;return e===null||Array.isArray(e)?0:(a.value||pe)(e)});return()=>{let{value:e}=r,{value:a}=n;return p(`span`,{class:`${i.value}-input-word-count`},_(t.default,{value:a===null||Array.isArray(a)?``:a},()=>[e===void 0?o.value:`${o.value} / ${e}`]))}}}),Y=i({name:`Input`,props:Object.assign(Object.assign({},A.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(n){let{mergedClsPrefixRef:i,mergedBorderedRef:a,inlineThemeDisabled:c,mergedRtlRef:l,mergedComponentPropsRef:d}=re(n),f=A(`Input`,`-input`,de,le,n,i);te&&e(`-input-safari`,fe,i);let p=x(null),h=x(null),g=x(null),_=x(null),b=x(null),S=x(null),w=x(null),T=me(w),D=x(null),{localeRef:O}=se(`Input`),j=x(n.defaultValue),M=oe(E(n,`value`),j),P=ee(n,{mergedSize:e=>{let{size:t}=n;if(t)return t;let{mergedSize:r}=e||{};return r?.value?r.value:d?.value?.Input?.size||`medium`}}),{mergedSizeRef:F,mergedDisabledRef:I,mergedStatusRef:L}=P,R=x(!1),z=x(!1),V=x(!1),H=x(!1),U=null,W=B(()=>{let{placeholder:e,pair:t}=n;return t?Array.isArray(e)?e:e===void 0?[``,``]:[e,e]:e===void 0?[O.value.placeholder]:[e]}),ce=B(()=>{let{value:e}=V,{value:t}=M,{value:n}=W;return!e&&(q(t)||Array.isArray(t)&&q(t[0]))&&n[0]}),G=B(()=>{let{value:e}=V,{value:t}=M,{value:n}=W;return!e&&n[1]&&(q(t)||Array.isArray(t)&&q(t[1]))}),K=ae(()=>n.internalForceFocus||R.value),pe=ae(()=>{if(I.value||n.readonly||!n.clearable||!K.value&&!z.value)return!1;let{value:e}=M,{value:t}=K;return n.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(z.value||t):!!e&&(z.value||t)}),J=B(()=>{let{showPasswordOn:e}=n;if(e)return e;if(n.showPasswordToggle)return`click`}),Y=x(!1),he=B(()=>{let{textDecoration:e}=n;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:[``,``]}),ge=x(void 0),_e=()=>{if(n.type===`textarea`){let{autosize:e}=n;if(e&&(ge.value=D.value?.$el?.offsetWidth),!h.value||typeof e==`boolean`)return;let{paddingTop:t,paddingBottom:r,lineHeight:i}=window.getComputedStyle(h.value),a=Number(t.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=g;if(!c)return;if(e.minRows){let t=Math.max(e.minRows,1),n=`${a+o+s*t}px`;c.style.minHeight=n}if(e.maxRows){let t=`${a+o+s*e.maxRows}px`;c.style.maxHeight=t}}},ve=B(()=>{let{maxlength:e}=n;return e===void 0?void 0:Number(e)});s(()=>{let{value:e}=M;Array.isArray(e)||nt(e)});let ye=r().proxy;function X(e,t){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=n,{nTriggerFormInput:o}=P;r&&m(r,e,t),i&&m(i,e,t),a&&m(a,e,t),j.value=e,o()}function Z(e,t){let{onChange:r}=n,{nTriggerFormChange:i}=P;r&&m(r,e,t),j.value=e,i()}function be(e){let{onBlur:t}=n,{nTriggerFormBlur:r}=P;t&&m(t,e),r()}function xe(e){let{onFocus:t}=n,{nTriggerFormFocus:r}=P;t&&m(t,e),r()}function Se(e){let{onClear:t}=n;t&&m(t,e)}function Ce(e){let{onInputBlur:t}=n;t&&m(t,e)}function we(e){let{onInputFocus:t}=n;t&&m(t,e)}function Te(){let{onDeactivate:e}=n;e&&m(e)}function Ee(){let{onActivate:e}=n;e&&m(e)}function De(e){let{onClick:t}=n;t&&m(t,e)}function Oe(e){let{onWrapperFocus:t}=n;t&&m(t,e)}function ke(e){let{onWrapperBlur:t}=n;t&&m(t,e)}function Ae(){V.value=!0}function je(e){V.value=!1,e.target===S.value?Q(e,1):Q(e,0)}function Q(e,t=0,r=`input`){let i=e.target.value;if(nt(i),e instanceof InputEvent&&!e.isComposing&&(V.value=!1),n.type===`textarea`){let{value:e}=D;e&&e.syncUnifiedContainer()}if(U=i,V.value)return;T.recordCursor();let a=Me(i);if(a)if(!n.pair)r===`input`?X(i,{source:t}):Z(i,{source:t});else{let{value:e}=M;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[t]=i,r===`input`?X(e,{source:t}):Z(e,{source:t})}ye.$forceUpdate(),a||k(T.restoreCursor)}function Me(e){let{countGraphemes:t,maxlength:r,minlength:i}=n;if(t){let n;if(r!==void 0&&(n===void 0&&(n=t(e)),n>Number(r))||i!==void 0&&(n===void 0&&(n=t(e)),n<Number(r)))return!1}let{allowInput:a}=n;return typeof a==`function`?a(e):!0}function Ne(e){Ce(e),e.relatedTarget===p.value&&Te(),e.relatedTarget!==null&&(e.relatedTarget===b.value||e.relatedTarget===S.value||e.relatedTarget===h.value)||(H.value=!1),$(e,`blur`),w.value=null}function Pe(e,t){we(e),R.value=!0,H.value=!0,Ee(),$(e,`focus`),t===0?w.value=b.value:t===1?w.value=S.value:t===2&&(w.value=h.value)}function Fe(e){n.passivelyActivated&&(ke(e),$(e,`blur`))}function Ie(e){n.passivelyActivated&&(R.value=!0,Oe(e),$(e,`focus`))}function $(e,t){e.relatedTarget!==null&&(e.relatedTarget===b.value||e.relatedTarget===S.value||e.relatedTarget===h.value||e.relatedTarget===p.value)||(t===`focus`?(xe(e),R.value=!0):t===`blur`&&(be(e),R.value=!1))}function Le(e,t){Q(e,t,`change`)}function Re(e){De(e)}function ze(e){Se(e),Be()}function Be(){n.pair?(X([``,``],{source:`clear`}),Z([``,``],{source:`clear`})):(X(``,{source:`clear`}),Z(``,{source:`clear`}))}function Ve(e){let{onMousedown:t}=n;t&&t(e);let{tagName:r}=e.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(n.resizable){let{value:t}=p;if(t){let{left:n,top:r,width:i,height:a}=t.getBoundingClientRect();if(n+i-14<e.clientX&&e.clientX<n+i&&r+a-14<e.clientY&&e.clientY<r+a)return}}e.preventDefault(),R.value||Xe()}}function He(){var e;z.value=!0,n.type===`textarea`&&((e=D.value)==null||e.handleMouseEnterWrapper())}function Ue(){var e;z.value=!1,n.type===`textarea`&&((e=D.value)==null||e.handleMouseLeaveWrapper())}function We(){I.value||J.value===`click`&&(Y.value=!Y.value)}function Ge(e){if(I.value)return;e.preventDefault();let n=e=>{e.preventDefault(),t(`mouseup`,document,n)};if(y(`mouseup`,document,n),J.value!==`mousedown`)return;Y.value=!0;let r=()=>{Y.value=!1,t(`mouseup`,document,r)};y(`mouseup`,document,r)}function Ke(e){n.onKeyup&&m(n.onKeyup,e)}function qe(e){switch(n.onKeydown&&m(n.onKeydown,e),e.key){case`Escape`:Ye();break;case`Enter`:Je(e);break}}function Je(e){var t,r;if(n.passivelyActivated){let{value:i}=H;if(i){n.internalDeactivateOnEnter&&Ye();return}e.preventDefault(),n.type===`textarea`?(t=h.value)==null||t.focus():(r=b.value)==null||r.focus()}}function Ye(){n.passivelyActivated&&(H.value=!1,k(()=>{var e;(e=p.value)==null||e.focus()}))}function Xe(){var e,t,r;I.value||(n.passivelyActivated?(e=p.value)==null||e.focus():((t=h.value)==null||t.focus(),(r=b.value)==null||r.focus()))}function Ze(){p.value?.contains(document.activeElement)&&document.activeElement.blur()}function Qe(){var e,t;(e=h.value)==null||e.select(),(t=b.value)==null||t.select()}function $e(){I.value||(h.value?h.value.focus():b.value&&b.value.focus())}function et(){let{value:e}=p;e?.contains(document.activeElement)&&e!==document.activeElement&&Ye()}function tt(e){if(n.type===`textarea`){let{value:t}=h;t?.scrollTo(e)}else{let{value:t}=b;t?.scrollTo(e)}}function nt(e){let{type:t,pair:r,autosize:i}=n;if(!r&&i)if(t===`textarea`){let{value:t}=g;t&&(t.textContent=`${e??``}\r\n`)}else{let{value:t}=_;t&&(e?t.textContent=e:t.innerHTML=`&nbsp;`)}}function rt(){_e()}let it=x({top:`0`});function at(e){var t;let{scrollTop:n}=e.target;it.value.top=`${-n}px`,(t=D.value)==null||t.syncUnifiedContainer()}let ot=null;v(()=>{let{autosize:e,type:t}=n;e&&t===`textarea`?ot=o(M,e=>{!Array.isArray(e)&&e!==U&&nt(e)}):ot?.()});let st=null;v(()=>{n.type===`textarea`?st=o(M,e=>{var t;!Array.isArray(e)&&e!==U&&((t=D.value)==null||t.syncUnifiedContainer())}):st?.()}),ie(ue,{mergedValueRef:M,maxlengthRef:ve,mergedClsPrefixRef:i,countGraphemesRef:E(n,`countGraphemes`)});let ct={wrapperElRef:p,inputElRef:b,textareaElRef:h,isCompositing:V,clear:Be,focus:Xe,blur:Ze,select:Qe,deactivate:et,activate:$e,scrollTo:tt},lt=u(`Input`,l,i),ut=B(()=>{let{value:e}=F,{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:p,placeholderColor:m,placeholderColorDisabled:h,lineHeightTextarea:g,colorDisabled:_,colorFocus:v,textColorDisabled:y,boxShadowFocus:b,iconSize:x,colorFocusWarning:S,boxShadowFocusWarning:C,borderWarning:w,borderFocusWarning:T,borderHoverWarning:E,colorFocusError:D,boxShadowFocusError:ee,borderError:te,borderFocusError:O,borderHoverError:k,clearSize:A,clearColor:j,clearColorHover:M,clearColorPressed:P,iconColor:I,iconColorDisabled:re,suffixTextColor:L,countTextColor:R,countTextColorDisabled:z,iconColorHover:B,iconColorPressed:ie,loadingColor:ae,loadingColorError:V,loadingColorWarning:oe,fontWeight:se,[N(`padding`,e)]:H,[N(`fontSize`,e)]:U,[N(`height`,e)]:W}}=f.value,{left:ce,right:G}=ne(H);return{"--n-bezier":t,"--n-count-text-color":R,"--n-count-text-color-disabled":z,"--n-color":n,"--n-font-size":U,"--n-font-weight":se,"--n-border-radius":r,"--n-height":W,"--n-padding-left":ce,"--n-padding-right":G,"--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":p,"--n-placeholder-color":m,"--n-placeholder-color-disabled":h,"--n-icon-size":x,"--n-line-height-textarea":g,"--n-color-disabled":_,"--n-color-focus":v,"--n-text-color-disabled":y,"--n-box-shadow-focus":b,"--n-loading-color":ae,"--n-caret-color-warning":s,"--n-color-focus-warning":S,"--n-box-shadow-focus-warning":C,"--n-border-warning":w,"--n-border-focus-warning":T,"--n-border-hover-warning":E,"--n-loading-color-warning":oe,"--n-caret-color-error":o,"--n-color-focus-error":D,"--n-box-shadow-focus-error":ee,"--n-border-error":te,"--n-border-focus-error":O,"--n-border-hover-error":k,"--n-loading-color-error":V,"--n-clear-color":j,"--n-clear-size":A,"--n-clear-color-hover":M,"--n-clear-color-pressed":P,"--n-icon-color":I,"--n-icon-color-hover":B,"--n-icon-color-pressed":ie,"--n-icon-color-disabled":re,"--n-suffix-text-color":L}}),dt=c?C(`input`,B(()=>{let{value:e}=F;return e[0]}),ut,n):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:p,inputElRef:b,inputMirrorElRef:_,inputEl2Ref:S,textareaElRef:h,textareaMirrorElRef:g,textareaScrollbarInstRef:D,rtlEnabled:lt,uncontrolledValue:j,mergedValue:M,passwordVisible:Y,mergedPlaceholder:W,showPlaceholder1:ce,showPlaceholder2:G,mergedFocus:K,isComposing:V,activated:H,showClearButton:pe,mergedSize:F,mergedDisabled:I,textDecorationStyle:he,mergedClsPrefix:i,mergedBordered:a,mergedShowPasswordOn:J,placeholderStyle:it,mergedStatus:L,textAreaScrollContainerWidth:ge,handleTextAreaScroll:at,handleCompositionStart:Ae,handleCompositionEnd:je,handleInput:Q,handleInputBlur:Ne,handleInputFocus:Pe,handleWrapperBlur:Fe,handleWrapperFocus:Ie,handleMouseEnter:He,handleMouseLeave:Ue,handleMouseDown:Ve,handleChange:Le,handleClick:Re,handleClear:ze,handlePasswordToggleClick:We,handlePasswordToggleMousedown:Ge,handleWrapperKeydown:qe,handleWrapperKeyup:Ke,handleTextAreaMirrorResize:rt,getTextareaScrollContainer:()=>h.value,mergedTheme:f,cssVars:c?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:r,type:i,countGraphemes:o,onRender:s}=this,c=this.$slots;return s?.(),p(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,r,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},p(`div`,{class:`${e}-input-wrapper`},a(c.prefix,t=>t&&p(`div`,{class:`${e}-input__prefix`},t)),i===`textarea`?p(D,{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 p(O,null,p(`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:o?void 0:this.maxlength,minlength:o?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?p(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?p(d,{onResize:this.handleTextAreaMirrorResize},{default:()=>p(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):p(`div`,{class:`${e}-input__input`},p(`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:o?void 0:this.maxlength,minlength:o?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?p(`div`,{class:`${e}-input__placeholder`},p(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?p(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&a(c.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?p(`div`,{class:`${e}-input__suffix`},[a(c[`clear-icon-placeholder`],t=>(this.clearable||t)&&p(V,{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:p(U,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?p(J,null,{default:e=>{let{renderCount:t}=this;return t?t(e):c.count?.call(c,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?p(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?L(c[`password-visible-icon`],()=>[p(n,{clsPrefix:e},{default:()=>p(W,null)})]):L(c[`password-invisible-icon`],()=>[p(n,{clsPrefix:e},{default:()=>p(ce,null)})])):null]):null)),this.pair?p(`span`,{class:`${e}-input__separator`},L(c.separator,()=>[this.separator])):null,this.pair?p(`div`,{class:`${e}-input-wrapper`},p(`div`,{class:`${e}-input__input`},p(`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:o?void 0:this.maxlength,minlength:o?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?p(`div`,{class:`${e}-input__placeholder`},p(`span`,null,this.mergedPlaceholder[1])):null),a(c.suffix,t=>(this.clearable||t)&&p(`div`,{class:`${e}-input__suffix`},[this.clearable&&p(V,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>c[`clear-icon`]?.call(c),placeholder:()=>c[`clear-icon-placeholder`]?.call(c)}),t]))):null,this.mergedBordered?p(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?p(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&i===`textarea`?p(J,null,{default:e=>{let{renderCount:t}=this;return t?t(e):c.count?.call(c,e)}}):null)}});function he(e){let{opacityDisabled:t,heightTiny:n,heightSmall:r,heightMedium:i,heightLarge:a,heightHuge:o,primaryColor:s,fontSize:c}=e;return{fontSize:c,textColor:s,sizeTiny:n,sizeSmall:r,sizeMedium:i,sizeLarge:a,sizeHuge:o,color:s,opacitySpinning:t}}var ge={name:`Spin`,common:z,self:he},_e=S([S(`@keyframes spin-rotate`,`
  235. from {
  236. transform: rotate(0);
  237. }
  238. to {
  239. transform: rotate(360deg);
  240. }
  241. `),h(`spin-container`,`
  242. position: relative;
  243. `,[h(`spin-body`,`
  244. position: absolute;
  245. top: 50%;
  246. left: 50%;
  247. transform: translateX(-50%) translateY(-50%);
  248. `,[w()])]),h(`spin-body`,`
  249. display: inline-flex;
  250. align-items: center;
  251. justify-content: center;
  252. flex-direction: column;
  253. `),h(`spin`,`
  254. display: inline-flex;
  255. height: var(--n-size);
  256. width: var(--n-size);
  257. font-size: var(--n-size);
  258. color: var(--n-color);
  259. `,[P(`rotate`,`
  260. animation: spin-rotate 2s linear infinite;
  261. `)]),h(`spin-description`,`
  262. display: inline-block;
  263. font-size: var(--n-font-size);
  264. color: var(--n-text-color);
  265. transition: color .3s var(--n-bezier);
  266. margin-top: 8px;
  267. `),h(`spin-content`,`
  268. opacity: 1;
  269. transition: opacity .3s var(--n-bezier);
  270. pointer-events: all;
  271. `,[P(`spinning`,`
  272. user-select: none;
  273. -webkit-user-select: none;
  274. pointer-events: none;
  275. opacity: var(--n-opacity-spinning);
  276. `)])]),ve={small:20,medium:18,large:16},ye=i({name:`Spin`,props:Object.assign(Object.assign(Object.assign({},A.props),{contentClass:String,contentStyle:[Object,String],description:String,size:{type:[String,Number],default:`medium`},show:{type:Boolean,default:!0},rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),g),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=re(e),r=A(`Spin`,`-spin`,_e,ge,e,t),i=B(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:i}=r.value,{opacitySpinning:a,color:o,textColor:s}=i,l=typeof t==`number`?c(t):i[N(`size`,t)];return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":l,"--n-color":o,"--n-text-color":s}}),a=n?C(`spin`,B(()=>{let{size:t}=e;return typeof t==`number`?String(t):t[0]}),i,e):void 0,o=H(e,[`spinning`,`show`]),s=x(!1);return v(t=>{let n;if(o.value){let{delay:r}=e;if(r){n=window.setTimeout(()=>{s.value=!0},r),t(()=>{clearTimeout(n)});return}}s.value=o.value}),{mergedClsPrefix:t,active:s,mergedStrokeWidth:B(()=>{let{strokeWidth:t}=e;if(t!==void 0)return t;let{size:n}=e;return ve[typeof n==`number`?`medium`:n]}),cssVars:n?void 0:i,themeClass:a?.themeClass,onRender:a?.onRender}},render(){var e;let{$slots:t,mergedClsPrefix:n,description:r}=this,i=t.icon&&this.rotate,a=(r||t.description)&&p(`div`,{class:`${n}-spin-description`},r||t.description?.call(t)),o=t.icon?p(`div`,{class:[`${n}-spin-body`,this.themeClass]},p(`div`,{class:[`${n}-spin`,i&&`${n}-spin--rotate`],style:t.default?``:this.cssVars},t.icon()),a):p(`div`,{class:[`${n}-spin-body`,this.themeClass]},p(R,{clsPrefix:n,style:t.default?``:this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,radius:this.radius,scale:this.scale,class:`${n}-spin`}),a);return(e=this.onRender)==null||e.call(this),t.default?p(`div`,{class:[`${n}-spin-container`,this.themeClass],style:this.cssVars},p(`div`,{class:[`${n}-spin-content`,this.active&&`${n}-spin-content--spinning`,this.contentClass],style:this.contentStyle},t),p(F,{name:`fade-in-transition`},{default:()=>this.active?o:null})):o}});export{Y as n,le as r,ye as t};