const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../form/FormItemContext.js"),i=require("../vc-slider/src/Handle.js"),a=require("../vc-slider/src/Range.js"),o=require("../vc-slider/src/Slider.js"),s=require("./SliderTooltip.js"),c=require("./style/index.js");let l=require("vue");var u=e=>typeof e==`number`?e.toString():``,d=()=>({id:String,prefixCls:String,tooltipPrefixCls:String,range:e.someType([Boolean,Object]),reverse:e.booleanType(),min:Number,max:Number,step:e.someType([Object,Number]),marks:e.objectType(),dots:e.booleanType(),value:e.someType([Array,Number]),defaultValue:e.someType([Array,Number]),included:e.booleanType(),disabled:e.booleanType(),vertical:e.booleanType(),tipFormatter:e.someType([Function,Object],()=>u),tooltipOpen:e.booleanType(),tooltipVisible:e.booleanType(),tooltipPlacement:e.stringType(),getTooltipPopupContainer:e.functionType(),autofocus:e.booleanType(),handleStyle:e.someType([Array,Object]),trackStyle:e.someType([Array,Object]),onChange:e.functionType(),onAfterChange:e.functionType(),onFocus:e.functionType(),onBlur:e.functionType(),"onUpdate:value":e.functionType()}),f=(0,l.defineComponent)({compatConfig:{MODE:3},name:`ASlider`,inheritAttrs:!1,props:d(),slots:Object,setup(e,{attrs:u,slots:d,emit:f,expose:p}){let{prefixCls:m,rootPrefixCls:h,direction:g,getPopupContainer:_,configProvider:v}=n.default(`slider`,e),[y,b]=c.default(m),x=r.useInjectFormItemContext(),S=(0,l.ref)(),C=(0,l.ref)({}),w=(e,t)=>{C.value[e]=t},T=(0,l.computed)(()=>e.tooltipPlacement?e.tooltipPlacement:e.vertical?g.value===`rtl`?`left`:`right`:`top`),E=()=>{S.value?.focus()},D=()=>{S.value?.blur()},O=e=>{f(`update:value`,e),f(`change`,e),x.onFieldChange()},k=e=>{f(`blur`,e)};p({focus:E,blur:D});let A=({tooltipPrefixCls:t,info:{value:n,dragging:r,index:a,...o}})=>{let{tipFormatter:c,tooltipOpen:u=e.tooltipVisible,getTooltipPopupContainer:d}=e,f=c?C.value[a]||r:!1,p=u||u===void 0&&f;return(0,l.createVNode)(s.default,{prefixCls:t,title:c?c(n):``,open:p,placement:T.value,transitionName:`${h.value}-zoom-down`,key:a,overlayClassName:`${m.value}-tooltip`,getPopupContainer:d||_?.value},{default:()=>[(0,l.createVNode)(i.default,{...o,value:n,onMouseenter:()=>w(a,!0),onMouseleave:()=>w(a,!1)},null)]})};return()=>{let{tooltipPrefixCls:n,range:r,id:i=x.id.value,...s}=e,c=v.getPrefixCls(`tooltip`,n),f=t.default(u.class,{[`${m.value}-rtl`]:g.value===`rtl`},b.value);g.value===`rtl`&&!s.vertical&&(s.reverse=!s.reverse);let p;return typeof r==`object`&&(p=r.draggableTrack),y(r?(0,l.createVNode)(a.default,{...u,...s,step:s.step,draggableTrack:p,class:f,ref:S,handle:e=>A({tooltipPrefixCls:c,prefixCls:m.value,info:e}),prefixCls:m.value,onChange:O,onBlur:k},{mark:d.mark}):(0,l.createVNode)(o.default,{...u,...s,id:i,step:s.step,class:f,ref:S,handle:e=>A({tooltipPrefixCls:c,prefixCls:m.value,info:e}),prefixCls:m.value,onChange:O,onBlur:k},{mark:d.mark}))}}}),p=e.withInstall(f);exports.default=p,exports.sliderProps=d;