-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_angular_material_slider.FmJVK-S4qg.js
More file actions
360 lines (360 loc) · 47.1 KB
/
_angular_material_slider.FmJVK-S4qg.js
File metadata and controls
360 lines (360 loc) · 47.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
import { a as V } from "@nf-internal/chunk-4UKDDKDA";
import { a as v, e as S, f as g } from "@nf-internal/chunk-U56RZWEM";
import { a as E } from "@nf-internal/chunk-4MZRILT7";
import { e as M } from "@nf-internal/chunk-5KSFOI5Q";
import { b as w } from "@nf-internal/chunk-RXMLTE5A";
import "@nf-internal/chunk-C2A5IV4Z";
import { i as y } from "@nf-internal/chunk-IR6MR6UK";
import "@nf-internal/chunk-6MDQTQU3";
import { Directionality as L } from "@angular/cdk/bidi";
import { Platform as T } from "@angular/cdk/platform";
import * as e from "@angular/core";
import { InjectionToken as p, inject as d, ChangeDetectorRef as f, NgZone as k, Renderer2 as A, ElementRef as I, booleanAttribute as c, numberAttribute as h, forwardRef as U, EventEmitter as b, signal as z } from "@angular/core";
import { _CdkPrivateStyleLoader as F } from "@angular/cdk/private";
import { NG_VALUE_ACCESSOR as D } from "@angular/forms";
import "@angular/cdk/a11y";
import "@angular/cdk/coercion";
import "@angular/cdk/layout";
var H = ["knob"], Q = ["valueIndicatorContainer"];
function $(a, _) { if (a & 1 && (e.\u0275\u0275elementStart(0, "div", 2, 1)(2, "div", 5)(3, "span", 6), e.\u0275\u0275text(4), e.\u0275\u0275elementEnd()()()), a & 2) {
let t = e.\u0275\u0275nextContext();
e.\u0275\u0275advance(4), e.\u0275\u0275textInterpolate(t.valueIndicatorText);
} }
var j = ["trackActive"], q = ["*"];
function Z(a, _) { if (a & 1 && e.\u0275\u0275element(0, "div"), a & 2) {
let t = _.$implicit, i = _.$index, s = e.\u0275\u0275nextContext(3);
e.\u0275\u0275classMap(t === 0 ? "mdc-slider__tick-mark--active" : "mdc-slider__tick-mark--inactive"), e.\u0275\u0275styleProp("transform", s._calcTickMarkTransform(i));
} }
function G(a, _) { if (a & 1 && e.\u0275\u0275repeaterCreate(0, Z, 1, 4, "div", 8, e.\u0275\u0275repeaterTrackByIndex), a & 2) {
let t = e.\u0275\u0275nextContext(2);
e.\u0275\u0275repeater(t._tickMarks);
} }
function Y(a, _) { if (a & 1 && (e.\u0275\u0275elementStart(0, "div", 6, 1), e.\u0275\u0275conditionalCreate(2, G, 2, 0), e.\u0275\u0275elementEnd()), a & 2) {
let t = e.\u0275\u0275nextContext();
e.\u0275\u0275advance(2), e.\u0275\u0275conditional(t._cachedWidth ? 2 : -1);
} }
function K(a, _) { if (a & 1 && e.\u0275\u0275element(0, "mat-slider-visual-thumb", 7), a & 2) {
let t = e.\u0275\u0275nextContext();
e.\u0275\u0275property("discrete", t.discrete)("thumbPosition", 1)("valueIndicatorText", t.startValueIndicatorText);
} }
var r = (function (a) { return a[a.START = 1] = "START", a[a.END = 2] = "END", a; })(r || {}), u = (function (a) { return a[a.ACTIVE = 0] = "ACTIVE", a[a.INACTIVE = 1] = "INACTIVE", a; })(u || {}), x = new p("_MatSlider"), N = new p("_MatSliderThumb"), P = new p("_MatSliderRangeThumb"), O = new p("_MatSliderVisualThumb"), C = class {
source;
parent;
value;
}, J = (() => {
class a {
_cdr = d(f);
_ngZone = d(k);
_slider = d(x);
_renderer = d(A);
_listenerCleanups;
discrete;
thumbPosition;
valueIndicatorText;
_ripple;
_knob;
_valueIndicatorContainer;
_sliderInput;
_sliderInputEl;
_hoverRippleRef;
_focusRippleRef;
_activeRippleRef;
_isHovered = !1;
_isActive = !1;
_isValueIndicatorVisible = !1;
_hostElement = d(I).nativeElement;
_platform = d(T);
constructor() { }
ngAfterViewInit() { let t = this._slider._getInput(this.thumbPosition); t && (this._ripple.radius = 24, this._sliderInput = t, this._sliderInputEl = this._sliderInput._hostElement, this._ngZone.runOutsideAngular(() => { let i = this._sliderInputEl, s = this._renderer; this._listenerCleanups = [s.listen(i, "pointermove", this._onPointerMove), s.listen(i, "pointerdown", this._onDragStart), s.listen(i, "pointerup", this._onDragEnd), s.listen(i, "pointerleave", this._onMouseLeave), s.listen(i, "focus", this._onFocus), s.listen(i, "blur", this._onBlur)]; })); }
ngOnDestroy() { this._listenerCleanups?.forEach(t => t()); }
_onPointerMove = t => { if (this._sliderInput._isFocused)
return; let i = this._hostElement.getBoundingClientRect(), s = this._slider._isCursorOnSliderThumb(t, i); this._isHovered = s, s ? this._showHoverRipple() : this._hideRipple(this._hoverRippleRef); };
_onMouseLeave = () => { this._isHovered = !1, this._hideRipple(this._hoverRippleRef); };
_onFocus = () => { this._hideRipple(this._hoverRippleRef), this._showFocusRipple(), this._hostElement.classList.add("mdc-slider__thumb--focused"); };
_onBlur = () => { this._isActive || this._hideRipple(this._focusRippleRef), this._isHovered && this._showHoverRipple(), this._hostElement.classList.remove("mdc-slider__thumb--focused"); };
_onDragStart = t => { t.button === 0 && (this._isActive = !0, this._showActiveRipple()); };
_onDragEnd = () => { this._isActive = !1, this._hideRipple(this._activeRippleRef), this._sliderInput._isFocused || this._hideRipple(this._focusRippleRef), this._platform.SAFARI && this._showHoverRipple(); };
_showHoverRipple() { this._isShowingRipple(this._hoverRippleRef) || (this._hoverRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 }), this._hoverRippleRef?.element.classList.add("mat-mdc-slider-hover-ripple")); }
_showFocusRipple() { this._isShowingRipple(this._focusRippleRef) || (this._focusRippleRef = this._showRipple({ enterDuration: 0, exitDuration: 0 }, !0), this._focusRippleRef?.element.classList.add("mat-mdc-slider-focus-ripple")); }
_showActiveRipple() { this._isShowingRipple(this._activeRippleRef) || (this._activeRippleRef = this._showRipple({ enterDuration: 225, exitDuration: 400 }), this._activeRippleRef?.element.classList.add("mat-mdc-slider-active-ripple")); }
_isShowingRipple(t) { return t?.state === v.FADING_IN || t?.state === v.VISIBLE; }
_showRipple(t, i) { if (!this._slider.disabled && (this._showValueIndicator(), this._slider._isRange && this._slider._getThumb(this.thumbPosition === r.START ? r.END : r.START)._showValueIndicator(), !(this._slider._globalRippleOptions?.disabled && !i)))
return this._ripple.launch({ animation: this._slider._noopAnimations ? { enterDuration: 0, exitDuration: 0 } : t, centered: !0, persistent: !0 }); }
_hideRipple(t) { if (t?.fadeOut(), this._isShowingAnyRipple())
return; this._slider._isRange || this._hideValueIndicator(); let i = this._getSibling(); i._isShowingAnyRipple() || (this._hideValueIndicator(), i._hideValueIndicator()); }
_showValueIndicator() { this._hostElement.classList.add("mdc-slider__thumb--with-indicator"); }
_hideValueIndicator() { this._hostElement.classList.remove("mdc-slider__thumb--with-indicator"); }
_getSibling() { return this._slider._getThumb(this.thumbPosition === r.START ? r.END : r.START); }
_getValueIndicatorContainer() { return this._valueIndicatorContainer?.nativeElement; }
_getKnob() { return this._knob.nativeElement; }
_isShowingAnyRipple() { return this._isShowingRipple(this._hoverRippleRef) || this._isShowingRipple(this._focusRippleRef) || this._isShowingRipple(this._activeRippleRef); }
static \u0275fac = function (i) { return new (i || a); };
static \u0275cmp = e.\u0275\u0275defineComponent({ type: a, selectors: [["mat-slider-visual-thumb"]], viewQuery: function (i, s) { if (i & 1 && (e.\u0275\u0275viewQuery(g, 5), e.\u0275\u0275viewQuery(H, 5), e.\u0275\u0275viewQuery(Q, 5)), i & 2) {
let n;
e.\u0275\u0275queryRefresh(n = e.\u0275\u0275loadQuery()) && (s._ripple = n.first), e.\u0275\u0275queryRefresh(n = e.\u0275\u0275loadQuery()) && (s._knob = n.first), e.\u0275\u0275queryRefresh(n = e.\u0275\u0275loadQuery()) && (s._valueIndicatorContainer = n.first);
} }, hostAttrs: [1, "mdc-slider__thumb", "mat-mdc-slider-visual-thumb"], inputs: { discrete: "discrete", thumbPosition: "thumbPosition", valueIndicatorText: "valueIndicatorText" }, features: [e.\u0275\u0275ProvidersFeature([{ provide: O, useExisting: a }])], decls: 4, vars: 2, consts: [["knob", ""], ["valueIndicatorContainer", ""], [1, "mdc-slider__value-indicator-container"], [1, "mdc-slider__thumb-knob"], ["matRipple", "", 1, "mat-focus-indicator", 3, "matRippleDisabled"], [1, "mdc-slider__value-indicator"], [1, "mdc-slider__value-indicator-text"]], template: function (i, s) { i & 1 && (e.\u0275\u0275conditionalCreate(0, $, 5, 1, "div", 2), e.\u0275\u0275element(1, "div", 3, 0)(3, "div", 4)), i & 2 && (e.\u0275\u0275conditional(s.discrete ? 0 : -1), e.\u0275\u0275advance(3), e.\u0275\u0275property("matRippleDisabled", !0)); }, dependencies: [g], styles: [`.mat-mdc-slider-visual-thumb .mat-ripple{height:100%;width:100%}.mat-mdc-slider .mdc-slider__tick-marks{justify-content:start}.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--active,.mat-mdc-slider .mdc-slider__tick-marks .mdc-slider__tick-mark--inactive{position:absolute;left:2px}
`], encapsulation: 2, changeDetection: 0 });
}
return a;
})(), Et = (() => {
class a {
_ngZone = d(k);
_cdr = d(f);
_elementRef = d(I);
_dir = d(L, { optional: !0 });
_globalRippleOptions = d(S, { optional: !0 });
_trackActive;
_thumbs;
_input;
_inputs;
get disabled() { return this._disabled; }
set disabled(t) { this._disabled = t; let i = this._getInput(r.END), s = this._getInput(r.START); i && (i.disabled = this._disabled), s && (s.disabled = this._disabled); }
_disabled = !1;
get discrete() { return this._discrete; }
set discrete(t) { this._discrete = t, this._updateValueIndicatorUIs(); }
_discrete = !1;
get showTickMarks() { return this._showTickMarks; }
set showTickMarks(t) { this._showTickMarks = t, this._hasViewInitialized && (this._updateTickMarkUI(), this._updateTickMarkTrackUI()); }
_showTickMarks = !1;
get min() { return this._min; }
set min(t) { let i = t == null || isNaN(t) ? this._min : t; this._min !== i && this._updateMin(i); }
_min = 0;
color;
disableRipple = !1;
_updateMin(t) { let i = this._min; this._min = t, this._isRange ? this._updateMinRange({ old: i, new: t }) : this._updateMinNonRange(t), this._onMinMaxOrStepChange(); }
_updateMinRange(t) { let i = this._getInput(r.END), s = this._getInput(r.START), n = i.value, l = s.value; s.min = t.new, i.min = Math.max(t.new, s.value), s.max = Math.min(i.max, i.value), s._updateWidthInactive(), i._updateWidthInactive(), t.new < t.old ? this._onTranslateXChangeBySideEffect(i, s) : this._onTranslateXChangeBySideEffect(s, i), n !== i.value && this._onValueChange(i), l !== s.value && this._onValueChange(s); }
_updateMinNonRange(t) { let i = this._getInput(r.END); if (i) {
let s = i.value;
i.min = t, i._updateThumbUIByValue(), this._updateTrackUI(i), s !== i.value && this._onValueChange(i);
} }
get max() { return this._max; }
set max(t) { let i = t == null || isNaN(t) ? this._max : t; this._max !== i && this._updateMax(i); }
_max = 100;
_updateMax(t) { let i = this._max; this._max = t, this._isRange ? this._updateMaxRange({ old: i, new: t }) : this._updateMaxNonRange(t), this._onMinMaxOrStepChange(); }
_updateMaxRange(t) { let i = this._getInput(r.END), s = this._getInput(r.START), n = i.value, l = s.value; i.max = t.new, s.max = Math.min(t.new, i.value), i.min = s.value, i._updateWidthInactive(), s._updateWidthInactive(), t.new > t.old ? this._onTranslateXChangeBySideEffect(s, i) : this._onTranslateXChangeBySideEffect(i, s), n !== i.value && this._onValueChange(i), l !== s.value && this._onValueChange(s); }
_updateMaxNonRange(t) { let i = this._getInput(r.END); if (i) {
let s = i.value;
i.max = t, i._updateThumbUIByValue(), this._updateTrackUI(i), s !== i.value && this._onValueChange(i);
} }
get step() { return this._step; }
set step(t) { let i = isNaN(t) ? this._step : t; this._step !== i && this._updateStep(i); }
_step = 1;
_updateStep(t) { this._step = t, this._isRange ? this._updateStepRange() : this._updateStepNonRange(), this._onMinMaxOrStepChange(); }
_updateStepRange() { let t = this._getInput(r.END), i = this._getInput(r.START), s = t.value, n = i.value, l = i.value; t.min = this._min, i.max = this._max, t.step = this._step, i.step = this._step, this._platform.SAFARI && (t.value = t.value, i.value = i.value), t.min = Math.max(this._min, i.value), i.max = Math.min(this._max, t.value), i._updateWidthInactive(), t._updateWidthInactive(), t.value < l ? this._onTranslateXChangeBySideEffect(i, t) : this._onTranslateXChangeBySideEffect(t, i), s !== t.value && this._onValueChange(t), n !== i.value && this._onValueChange(i); }
_updateStepNonRange() { let t = this._getInput(r.END); if (t) {
let i = t.value;
t.step = this._step, this._platform.SAFARI && (t.value = t.value), t._updateThumbUIByValue(), i !== t.value && this._onValueChange(t);
} }
displayWith = t => `${t}`;
_tickMarks;
_noopAnimations = M();
_dirChangeSubscription;
_resizeObserver;
_cachedWidth;
_cachedLeft;
_rippleRadius = 24;
startValueIndicatorText = "";
endValueIndicatorText = "";
_endThumbTransform;
_startThumbTransform;
_isRange = !1;
_isRtl = !1;
_hasViewInitialized = !1;
_tickMarkTrackWidth = 0;
_hasAnimation = !1;
_resizeTimer = null;
_platform = d(T);
constructor() { d(F).load(E), this._dir && (this._dirChangeSubscription = this._dir.change.subscribe(() => this._onDirChange()), this._isRtl = this._dir.value === "rtl"); }
_knobRadius = 8;
_inputPadding;
ngAfterViewInit() { this._platform.isBrowser && this._updateDimensions(); let t = this._getInput(r.END), i = this._getInput(r.START); this._isRange = !!t && !!i, this._cdr.detectChanges(); let s = this._getThumb(r.END); this._rippleRadius = s._ripple.radius, this._inputPadding = this._rippleRadius - this._knobRadius, this._isRange ? this._initUIRange(t, i) : this._initUINonRange(t), this._updateTrackUI(t), this._updateTickMarkUI(), this._updateTickMarkTrackUI(), this._observeHostResize(), this._cdr.detectChanges(); }
_initUINonRange(t) { t.initProps(), t.initUI(), this._updateValueIndicatorUI(t), this._hasViewInitialized = !0, t._updateThumbUIByValue(); }
_initUIRange(t, i) { t.initProps(), t.initUI(), i.initProps(), i.initUI(), t._updateMinMax(), i._updateMinMax(), t._updateStaticStyles(), i._updateStaticStyles(), this._updateValueIndicatorUIs(), this._hasViewInitialized = !0, t._updateThumbUIByValue(), i._updateThumbUIByValue(); }
ngOnDestroy() { this._dirChangeSubscription.unsubscribe(), this._resizeObserver?.disconnect(), this._resizeObserver = null; }
_onDirChange() { this._isRtl = this._dir?.value === "rtl", this._isRange ? this._onDirChangeRange() : this._onDirChangeNonRange(), this._updateTickMarkUI(); }
_onDirChangeRange() { let t = this._getInput(r.END), i = this._getInput(r.START); t._setIsLeftThumb(), i._setIsLeftThumb(), t.translateX = t._calcTranslateXByValue(), i.translateX = i._calcTranslateXByValue(), t._updateStaticStyles(), i._updateStaticStyles(), t._updateWidthInactive(), i._updateWidthInactive(), t._updateThumbUIByValue(), i._updateThumbUIByValue(); }
_onDirChangeNonRange() { this._getInput(r.END)._updateThumbUIByValue(); }
_observeHostResize() { typeof ResizeObserver > "u" || !ResizeObserver || this._ngZone.runOutsideAngular(() => { this._resizeObserver = new ResizeObserver(() => { this._isActive() || (this._resizeTimer && clearTimeout(this._resizeTimer), this._onResize()); }), this._resizeObserver.observe(this._elementRef.nativeElement); }); }
_isActive() { return this._getThumb(r.START)._isActive || this._getThumb(r.END)._isActive; }
_getValue(t = r.END) { let i = this._getInput(t); return i ? i.value : this.min; }
_skipUpdate() { return !!(this._getInput(r.START)?._skipUIUpdate || this._getInput(r.END)?._skipUIUpdate); }
_updateDimensions() { this._cachedWidth = this._elementRef.nativeElement.offsetWidth, this._cachedLeft = this._elementRef.nativeElement.getBoundingClientRect().left; }
_setTrackActiveStyles(t) { let i = this._trackActive.nativeElement.style; i.left = t.left, i.right = t.right, i.transformOrigin = t.transformOrigin, i.transform = t.transform; }
_calcTickMarkTransform(t) { let i = t * (this._tickMarkTrackWidth / (this._tickMarks.length - 1)); return `translateX(${this._isRtl ? this._cachedWidth - 6 - i : i}px`; }
_onTranslateXChange(t) { this._hasViewInitialized && (this._updateThumbUI(t), this._updateTrackUI(t), this._updateOverlappingThumbUI(t)); }
_onTranslateXChangeBySideEffect(t, i) { this._hasViewInitialized && (t._updateThumbUIByValue(), i._updateThumbUIByValue()); }
_onValueChange(t) { this._hasViewInitialized && (this._updateValueIndicatorUI(t), this._updateTickMarkUI(), this._cdr.detectChanges()); }
_onMinMaxOrStepChange() { this._hasViewInitialized && (this._updateTickMarkUI(), this._updateTickMarkTrackUI(), this._cdr.markForCheck()); }
_onResize() { if (this._hasViewInitialized) {
if (this._updateDimensions(), this._isRange) {
let t = this._getInput(r.END), i = this._getInput(r.START);
t._updateThumbUIByValue(), i._updateThumbUIByValue(), t._updateStaticStyles(), i._updateStaticStyles(), t._updateMinMax(), i._updateMinMax(), t._updateWidthInactive(), i._updateWidthInactive();
}
else {
let t = this._getInput(r.END);
t && t._updateThumbUIByValue();
}
this._updateTickMarkUI(), this._updateTickMarkTrackUI(), this._cdr.detectChanges();
} }
_thumbsOverlap = !1;
_areThumbsOverlapping() { let t = this._getInput(r.START), i = this._getInput(r.END); return !t || !i ? !1 : i.translateX - t.translateX < 20; }
_updateOverlappingThumbClassNames(t) { let i = t.getSibling(), s = this._getThumb(t.thumbPosition); this._getThumb(i.thumbPosition)._hostElement.classList.remove("mdc-slider__thumb--top"), s._hostElement.classList.toggle("mdc-slider__thumb--top", this._thumbsOverlap); }
_updateOverlappingThumbUI(t) { !this._isRange || this._skipUpdate() || this._thumbsOverlap !== this._areThumbsOverlapping() && (this._thumbsOverlap = !this._thumbsOverlap, this._updateOverlappingThumbClassNames(t)); }
_updateThumbUI(t) { if (this._skipUpdate())
return; let i = this._getThumb(t.thumbPosition === r.END ? r.END : r.START); i._hostElement.style.transform = `translateX(${t.translateX}px)`; }
_updateValueIndicatorUI(t) { if (this._skipUpdate())
return; let i = this.displayWith(t.value); if (this._hasViewInitialized ? t._valuetext.set(i) : t._hostElement.setAttribute("aria-valuetext", i), this.discrete) {
t.thumbPosition === r.START ? this.startValueIndicatorText = i : this.endValueIndicatorText = i;
let s = this._getThumb(t.thumbPosition);
i.length < 3 ? s._hostElement.classList.add("mdc-slider__thumb--short-value") : s._hostElement.classList.remove("mdc-slider__thumb--short-value");
} }
_updateValueIndicatorUIs() { let t = this._getInput(r.END), i = this._getInput(r.START); t && this._updateValueIndicatorUI(t), i && this._updateValueIndicatorUI(i); }
_updateTickMarkTrackUI() { if (!this.showTickMarks || this._skipUpdate())
return; let t = this._step && this._step > 0 ? this._step : 1, s = (Math.floor(this.max / t) * t - this.min) / (this.max - this.min); this._tickMarkTrackWidth = (this._cachedWidth - 6) * s; }
_updateTrackUI(t) { this._skipUpdate() || (this._isRange ? this._updateTrackUIRange(t) : this._updateTrackUINonRange(t)); }
_updateTrackUIRange(t) { let i = t.getSibling(); if (!i || !this._cachedWidth)
return; let s = Math.abs(i.translateX - t.translateX) / this._cachedWidth; t._isLeftThumb && this._cachedWidth ? this._setTrackActiveStyles({ left: "auto", right: `${this._cachedWidth - i.translateX}px`, transformOrigin: "right", transform: `scaleX(${s})` }) : this._setTrackActiveStyles({ left: `${i.translateX}px`, right: "auto", transformOrigin: "left", transform: `scaleX(${s})` }); }
_updateTrackUINonRange(t) { this._isRtl ? this._setTrackActiveStyles({ left: "auto", right: "0px", transformOrigin: "right", transform: `scaleX(${1 - t.fillPercentage})` }) : this._setTrackActiveStyles({ left: "0px", right: "auto", transformOrigin: "left", transform: `scaleX(${t.fillPercentage})` }); }
_updateTickMarkUI() { if (!this.showTickMarks || this.step === void 0 || this.min === void 0 || this.max === void 0)
return; let t = this.step > 0 ? this.step : 1; this._isRange ? this._updateTickMarkUIRange(t) : this._updateTickMarkUINonRange(t); }
_updateTickMarkUINonRange(t) { let i = this._getValue(), s = Math.max(Math.round((i - this.min) / t), 0) + 1, n = Math.max(Math.round((this.max - i) / t), 0) - 1; this._isRtl ? s++ : n++, this._tickMarks = Array(s).fill(u.ACTIVE).concat(Array(n).fill(u.INACTIVE)); }
_updateTickMarkUIRange(t) { let i = this._getValue(), s = this._getValue(r.START), n = Math.max(Math.round((s - this.min) / t), 0), l = Math.max(Math.round((i - s) / t) + 1, 0), o = Math.max(Math.round((this.max - i) / t), 0); this._tickMarks = Array(n).fill(u.INACTIVE).concat(Array(l).fill(u.ACTIVE), Array(o).fill(u.INACTIVE)); }
_getInput(t) { if (t === r.END && this._input)
return this._input; if (this._inputs?.length)
return t === r.START ? this._inputs.first : this._inputs.last; }
_getThumb(t) { return t === r.END ? this._thumbs?.last : this._thumbs?.first; }
_setTransition(t) { this._hasAnimation = !this._platform.IOS && t && !this._noopAnimations, this._elementRef.nativeElement.classList.toggle("mat-mdc-slider-with-animation", this._hasAnimation); }
_isCursorOnSliderThumb(t, i) { let s = i.width / 2, n = i.x + s, l = i.y + s, o = t.clientX - n, m = t.clientY - l; return Math.pow(o, 2) + Math.pow(m, 2) < Math.pow(s, 2); }
static \u0275fac = function (i) { return new (i || a); };
static \u0275cmp = e.\u0275\u0275defineComponent({ type: a, selectors: [["mat-slider"]], contentQueries: function (i, s, n) { if (i & 1 && (e.\u0275\u0275contentQuery(n, N, 5), e.\u0275\u0275contentQuery(n, P, 4)), i & 2) {
let l;
e.\u0275\u0275queryRefresh(l = e.\u0275\u0275loadQuery()) && (s._input = l.first), e.\u0275\u0275queryRefresh(l = e.\u0275\u0275loadQuery()) && (s._inputs = l);
} }, viewQuery: function (i, s) { if (i & 1 && (e.\u0275\u0275viewQuery(j, 5), e.\u0275\u0275viewQuery(O, 5)), i & 2) {
let n;
e.\u0275\u0275queryRefresh(n = e.\u0275\u0275loadQuery()) && (s._trackActive = n.first), e.\u0275\u0275queryRefresh(n = e.\u0275\u0275loadQuery()) && (s._thumbs = n);
} }, hostAttrs: [1, "mat-mdc-slider", "mdc-slider"], hostVars: 12, hostBindings: function (i, s) { i & 2 && (e.\u0275\u0275classMap("mat-" + (s.color || "primary")), e.\u0275\u0275classProp("mdc-slider--range", s._isRange)("mdc-slider--disabled", s.disabled)("mdc-slider--discrete", s.discrete)("mdc-slider--tick-marks", s.showTickMarks)("_mat-animation-noopable", s._noopAnimations)); }, inputs: { disabled: [2, "disabled", "disabled", c], discrete: [2, "discrete", "discrete", c], showTickMarks: [2, "showTickMarks", "showTickMarks", c], min: [2, "min", "min", h], color: "color", disableRipple: [2, "disableRipple", "disableRipple", c], max: [2, "max", "max", h], step: [2, "step", "step", h], displayWith: "displayWith" }, exportAs: ["matSlider"], features: [e.\u0275\u0275ProvidersFeature([{ provide: x, useExisting: a }])], ngContentSelectors: q, decls: 9, vars: 5, consts: [["trackActive", ""], ["tickMarkContainer", ""], [1, "mdc-slider__track"], [1, "mdc-slider__track--inactive"], [1, "mdc-slider__track--active"], [1, "mdc-slider__track--active_fill"], [1, "mdc-slider__tick-marks"], [3, "discrete", "thumbPosition", "valueIndicatorText"], [3, "class", "transform"]], template: function (i, s) { i & 1 && (e.\u0275\u0275projectionDef(), e.\u0275\u0275projection(0), e.\u0275\u0275elementStart(1, "div", 2), e.\u0275\u0275element(2, "div", 3), e.\u0275\u0275elementStart(3, "div", 4), e.\u0275\u0275element(4, "div", 5, 0), e.\u0275\u0275elementEnd(), e.\u0275\u0275conditionalCreate(6, Y, 3, 1, "div", 6), e.\u0275\u0275elementEnd(), e.\u0275\u0275conditionalCreate(7, K, 1, 3, "mat-slider-visual-thumb", 7), e.\u0275\u0275element(8, "mat-slider-visual-thumb", 7)), i & 2 && (e.\u0275\u0275advance(6), e.\u0275\u0275conditional(s.showTickMarks ? 6 : -1), e.\u0275\u0275advance(), e.\u0275\u0275conditional(s._isRange ? 7 : -1), e.\u0275\u0275advance(), e.\u0275\u0275property("discrete", s.discrete)("thumbPosition", 2)("valueIndicatorText", s.endValueIndicatorText)); }, dependencies: [J], styles: [`.mdc-slider__track{position:absolute;top:50%;transform:translateY(-50%);width:100%;pointer-events:none;height:var(--mat-slider-inactive-track-height, 4px)}.mdc-slider__track--active,.mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider__track--active{overflow:hidden;border-radius:var(--mat-slider-active-track-shape, var(--mat-sys-corner-full));height:var(--mat-slider-active-track-height, 4px);top:calc((var(--mat-slider-inactive-track-height, 4px) - var(--mat-slider-active-track-height, 4px))/2)}.mdc-slider__track--active_fill{border-top-style:solid;box-sizing:border-box;height:100%;width:100%;position:relative;transform-origin:left;transition:transform 80ms ease;border-color:var(--mat-slider-active-track-color, var(--mat-sys-primary));border-top-width:var(--mat-slider-active-track-height, 4px)}.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--mat-slider-disabled-active-track-color, var(--mat-sys-on-surface))}[dir=rtl] .mdc-slider__track--active_fill{-webkit-transform-origin:right;transform-origin:right}.mdc-slider__track--inactive{left:0;top:0;opacity:.24;background-color:var(--mat-slider-inactive-track-color, var(--mat-sys-surface-variant));height:var(--mat-slider-inactive-track-height, 4px);border-radius:var(--mat-slider-inactive-track-shape, var(--mat-sys-corner-full))}.mdc-slider--disabled .mdc-slider__track--inactive{background-color:var(--mat-slider-disabled-inactive-track-color, var(--mat-sys-on-surface));opacity:.24}.mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media(forced-colors: active){.mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider__value-indicator-container{bottom:44px;left:50%;pointer-events:none;position:absolute;transform:var(--mat-slider-value-indicator-container-transform, translateX(-50%) rotate(-45deg))}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider__value-indicator{display:flex;align-items:center;transform:scale(0);transform-origin:var(--mat-slider-value-indicator-transform-origin, 0 28px);transition:transform 100ms cubic-bezier(0.4, 0, 1, 1);word-break:normal;background-color:var(--mat-slider-label-container-color, var(--mat-sys-primary));color:var(--mat-slider-label-label-text-color, var(--mat-sys-on-primary));width:var(--mat-slider-value-indicator-width, 28px);height:var(--mat-slider-value-indicator-height, 28px);padding:var(--mat-slider-value-indicator-padding, 0);opacity:var(--mat-slider-value-indicator-opacity, 1);border-radius:var(--mat-slider-value-indicator-border-radius, 50% 50% 50% 0)}.mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}.mdc-slider__value-indicator::before{border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-top:6px solid;bottom:-5px;content:"";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;display:var(--mat-slider-value-indicator-caret-display, none);border-top-color:var(--mat-slider-label-container-color, var(--mat-sys-primary))}.mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media(forced-colors: active){.mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider__value-indicator-text{text-align:center;width:var(--mat-slider-value-indicator-width, 28px);transform:var(--mat-slider-value-indicator-text-transform, rotate(45deg));font-family:var(--mat-slider-label-label-text-font, var(--mat-sys-label-medium-font));font-size:var(--mat-slider-label-label-text-size, var(--mat-sys-label-medium-size));font-weight:var(--mat-slider-label-label-text-weight, var(--mat-sys-label-medium-weight));line-height:var(--mat-slider-label-label-text-line-height, var(--mat-sys-label-medium-line-height));letter-spacing:var(--mat-slider-label-label-text-tracking, var(--mat-sys-label-medium-tracking))}.mdc-slider__thumb{-webkit-user-select:none;user-select:none;display:flex;left:-24px;outline:none;position:absolute;height:48px;width:48px;pointer-events:none}.mdc-slider--discrete .mdc-slider__thumb{transition:transform 80ms ease}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__thumb--top{z-index:1}.mdc-slider__thumb-knob{position:absolute;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%, -50%);border-style:solid;width:var(--mat-slider-handle-width, 20px);height:var(--mat-slider-handle-height, 20px);border-width:calc(var(--mat-slider-handle-height, 20px)/2) calc(var(--mat-slider-handle-width, 20px)/2);box-shadow:var(--mat-slider-handle-elevation, var(--mat-sys-level1));background-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-handle-color, var(--mat-sys-primary));border-radius:var(--mat-slider-handle-shape, var(--mat-sys-corner-full))}.mdc-slider__thumb:hover .mdc-slider__thumb-knob{background-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-hover-handle-color, var(--mat-sys-primary))}.mdc-slider__thumb--focused .mdc-slider__thumb-knob{background-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary));border-color:var(--mat-slider-focus-handle-color, var(--mat-sys-primary))}.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface));border-color:var(--mat-slider-disabled-handle-color, var(--mat-sys-on-surface))}.mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border:solid 1px #fff;box-sizing:content-box;border-color:var(--mat-slider-with-overlap-handle-outline-color, var(--mat-sys-on-primary));border-width:var(--mat-slider-with-overlap-handle-outline-width, 1px)}.mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider__tick-mark--active,.mdc-slider__tick-mark--inactive{width:var(--mat-slider-with-tick-marks-container-size, 2px);height:var(--mat-slider-with-tick-marks-container-size, 2px);border-radius:var(--mat-slider-with-tick-marks-container-shape, var(--mat-sys-corner-full))}.mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-inactive-container-color, var(--mat-sys-on-surface-variant))}.mdc-slider--disabled .mdc-slider__tick-mark--inactive{opacity:var(--mat-slider-with-tick-marks-inactive-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-disabled-container-color, var(--mat-sys-on-surface))}.mdc-slider__tick-mark--active{opacity:var(--mat-slider-with-tick-marks-active-container-opacity, 0.38);background-color:var(--mat-slider-with-tick-marks-active-container-color, var(--mat-sys-on-primary))}.mdc-slider__input{cursor:pointer;left:2px;margin:0;height:44px;opacity:0;position:absolute;top:2px;width:44px;box-sizing:content-box}.mdc-slider__input.mat-mdc-slider-input-no-pointer-events{pointer-events:none}.mdc-slider__input.mat-slider__right-input{left:auto;right:0}.mat-mdc-slider{display:inline-block;box-sizing:border-box;outline:none;vertical-align:middle;cursor:pointer;height:48px;margin:0 8px;position:relative;touch-action:pan-y;width:auto;min-width:112px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-slider.mdc-slider--disabled{cursor:auto;opacity:.38}.mat-mdc-slider.mdc-slider--disabled .mdc-slider__input{cursor:auto}.mat-mdc-slider .mdc-slider__thumb,.mat-mdc-slider .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider.mdc-slider--discrete .mdc-slider__track--active_fill{transition-duration:0ms}.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__thumb,.mat-mdc-slider.mat-mdc-slider-with-animation .mdc-slider__track--active_fill{transition-duration:80ms}.mat-mdc-slider .mat-ripple .mat-ripple-element{background-color:var(--mat-slider-ripple-color, var(--mat-sys-primary))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-hover-ripple{background-color:var(--mat-slider-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 5%, transparent))}.mat-mdc-slider .mat-ripple .mat-mdc-slider-focus-ripple,.mat-mdc-slider .mat-ripple .mat-mdc-slider-active-ripple{background-color:var(--mat-slider-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__thumb,.mat-mdc-slider._mat-animation-noopable.mdc-slider--discrete .mdc-slider__track--active_fill,.mat-mdc-slider._mat-animation-noopable .mdc-slider__value-indicator{transition:none}.mat-mdc-slider .mat-focus-indicator::before{border-radius:50%}.mdc-slider__thumb--focused .mat-focus-indicator::before{content:""}
`], encapsulation: 2, changeDetection: 0 });
}
return a;
})();
var tt = { provide: D, useExisting: U(() => B), multi: !0 }, it = { provide: D, useExisting: U(() => et), multi: !0 }, B = (() => { class a {
_ngZone = d(k);
_elementRef = d(I);
_cdr = d(f);
_slider = d(x);
_platform = d(T);
_listenerCleanups;
get value() { return h(this._hostElement.value, 0); }
set value(t) { t === null && (t = this._getDefaultValue()), t = isNaN(t) ? 0 : t; let i = t + ""; if (!this._hasSetInitialValue) {
this._initialValue = i;
return;
} this._isActive || this._setValue(i); }
_setValue(t) { this._hostElement.value = t, this._updateThumbUIByValue(), this._slider._onValueChange(this), this._cdr.detectChanges(), this._slider._cdr.markForCheck(); }
valueChange = new b;
dragStart = new b;
dragEnd = new b;
get translateX() { return this._slider.min >= this._slider.max ? (this._translateX = this._tickMarkOffset, this._translateX) : (this._translateX === void 0 && (this._translateX = this._calcTranslateXByValue()), this._translateX); }
set translateX(t) { this._translateX = t; }
_translateX;
thumbPosition = r.END;
get min() { return h(this._hostElement.min, 0); }
set min(t) { this._hostElement.min = t + "", this._cdr.detectChanges(); }
get max() { return h(this._hostElement.max, 0); }
set max(t) { this._hostElement.max = t + "", this._cdr.detectChanges(); }
get step() { return h(this._hostElement.step, 0); }
set step(t) { this._hostElement.step = t + "", this._cdr.detectChanges(); }
get disabled() { return c(this._hostElement.disabled); }
set disabled(t) { this._hostElement.disabled = t, this._cdr.detectChanges(), this._slider.disabled !== this.disabled && (this._slider.disabled = this.disabled); }
get percentage() { return this._slider.min >= this._slider.max ? this._slider._isRtl ? 1 : 0 : (this.value - this._slider.min) / (this._slider.max - this._slider.min); }
get fillPercentage() { return this._slider._cachedWidth ? this._translateX === 0 ? 0 : this.translateX / this._slider._cachedWidth : this._slider._isRtl ? 1 : 0; }
_hostElement = this._elementRef.nativeElement;
_valuetext = z("");
_knobRadius = 8;
_tickMarkOffset = 3;
_isActive = !1;
_isFocused = !1;
_setIsFocused(t) { this._isFocused = t; }
_hasSetInitialValue = !1;
_initialValue;
_formControl;
_destroyed = new y;
_skipUIUpdate = !1;
_onChangeFn;
_onTouchedFn = () => { };
_isControlInitialized = !1;
constructor() { let t = d(A); this._ngZone.runOutsideAngular(() => { this._listenerCleanups = [t.listen(this._hostElement, "pointerdown", this._onPointerDown.bind(this)), t.listen(this._hostElement, "pointermove", this._onPointerMove.bind(this)), t.listen(this._hostElement, "pointerup", this._onPointerUp.bind(this))]; }); }
ngOnDestroy() { this._listenerCleanups.forEach(t => t()), this._destroyed.next(), this._destroyed.complete(), this.dragStart.complete(), this.dragEnd.complete(); }
initProps() { this._updateWidthInactive(), this.disabled !== this._slider.disabled && (this._slider.disabled = !0), this.step = this._slider.step, this.min = this._slider.min, this.max = this._slider.max, this._initValue(); }
initUI() { this._updateThumbUIByValue(); }
_initValue() { this._hasSetInitialValue = !0, this._initialValue === void 0 ? this.value = this._getDefaultValue() : (this._hostElement.value = this._initialValue, this._updateThumbUIByValue(), this._slider._onValueChange(this), this._cdr.detectChanges()); }
_getDefaultValue() { return this.min; }
_onBlur() { this._setIsFocused(!1), this._onTouchedFn(); }
_onFocus() { this._slider._setTransition(!1), this._slider._updateTrackUI(this), this._setIsFocused(!0); }
_onChange() { this.valueChange.emit(this.value), this._isActive && this._updateThumbUIByValue({ withAnimation: !0 }); }
_onInput() { this._onChangeFn?.(this.value), (this._slider.step || !this._isActive) && this._updateThumbUIByValue({ withAnimation: !0 }), this._slider._onValueChange(this); }
_onNgControlValueChange() { (!this._isActive || !this._isFocused) && (this._slider._onValueChange(this), this._updateThumbUIByValue()), this._slider.disabled = this._formControl.disabled; }
_onPointerDown(t) { if (!(this.disabled || t.button !== 0)) {
if (this._platform.IOS) {
let i = this._slider._isCursorOnSliderThumb(t, this._slider._getThumb(this.thumbPosition)._hostElement.getBoundingClientRect());
this._isActive = i, this._updateWidthActive(), this._slider._updateDimensions();
return;
}
this._isActive = !0, this._setIsFocused(!0), this._updateWidthActive(), this._slider._updateDimensions(), this._slider.step || this._updateThumbUIByPointerEvent(t, { withAnimation: !0 }), this.disabled || (this._handleValueCorrection(t), this.dragStart.emit({ source: this, parent: this._slider, value: this.value }));
} }
_handleValueCorrection(t) { this._skipUIUpdate = !0, setTimeout(() => { this._skipUIUpdate = !1, this._fixValue(t); }, 0); }
_fixValue(t) { let i = t.clientX - this._slider._cachedLeft, s = this._slider._cachedWidth, n = this._slider.step === 0 ? 1 : this._slider.step, l = Math.floor((this._slider.max - this._slider.min) / n), o = this._slider._isRtl ? 1 - i / s : i / s, W = Math.round(o * l) / l * (this._slider.max - this._slider.min) + this._slider.min, R = Math.round(W / n) * n, X = this.value; if (R === X) {
this._slider._onValueChange(this), this._slider.step > 0 ? this._updateThumbUIByValue() : this._updateThumbUIByPointerEvent(t, { withAnimation: this._slider._hasAnimation });
return;
} this.value = R, this.valueChange.emit(this.value), this._onChangeFn?.(this.value), this._slider._onValueChange(this), this._slider.step > 0 ? this._updateThumbUIByValue() : this._updateThumbUIByPointerEvent(t, { withAnimation: this._slider._hasAnimation }); }
_onPointerMove(t) { !this._slider.step && this._isActive && this._updateThumbUIByPointerEvent(t); }
_onPointerUp() { this._isActive && (this._isActive = !1, this._platform.SAFARI && this._setIsFocused(!1), this.dragEnd.emit({ source: this, parent: this._slider, value: this.value }), setTimeout(() => this._updateWidthInactive(), this._platform.IOS ? 10 : 0)); }
_clamp(t) { let i = this._tickMarkOffset, s = this._slider._cachedWidth - this._tickMarkOffset; return Math.max(Math.min(t, s), i); }
_calcTranslateXByValue() { return this._slider._isRtl ? (1 - this.percentage) * (this._slider._cachedWidth - this._tickMarkOffset * 2) + this._tickMarkOffset : this.percentage * (this._slider._cachedWidth - this._tickMarkOffset * 2) + this._tickMarkOffset; }
_calcTranslateXByPointerEvent(t) { return t.clientX - this._slider._cachedLeft; }
_updateWidthActive() { }
_updateWidthInactive() { this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`, this._hostElement.style.width = `calc(100% + ${this._slider._inputPadding - this._tickMarkOffset * 2}px)`, this._hostElement.style.left = `-${this._slider._rippleRadius - this._tickMarkOffset}px`; }
_updateThumbUIByValue(t) { this.translateX = this._clamp(this._calcTranslateXByValue()), this._updateThumbUI(t); }
_updateThumbUIByPointerEvent(t, i) { this.translateX = this._clamp(this._calcTranslateXByPointerEvent(t)), this._updateThumbUI(i); }
_updateThumbUI(t) { this._slider._setTransition(!!t?.withAnimation), this._slider._onTranslateXChange(this); }
writeValue(t) { (this._isControlInitialized || t !== null) && (this.value = t); }
registerOnChange(t) { this._onChangeFn = t, this._isControlInitialized = !0; }
registerOnTouched(t) { this._onTouchedFn = t; }
setDisabledState(t) { this.disabled = t; }
focus() { this._hostElement.focus(); }
blur() { this._hostElement.blur(); }
static \u0275fac = function (i) { return new (i || a); };
static \u0275dir = e.\u0275\u0275defineDirective({ type: a, selectors: [["input", "matSliderThumb", ""]], hostAttrs: ["type", "range", 1, "mdc-slider__input"], hostVars: 1, hostBindings: function (i, s) { i & 1 && e.\u0275\u0275listener("change", function () { return s._onChange(); })("input", function () { return s._onInput(); })("blur", function () { return s._onBlur(); })("focus", function () { return s._onFocus(); }), i & 2 && e.\u0275\u0275attribute("aria-valuetext", s._valuetext()); }, inputs: { value: [2, "value", "value", h] }, outputs: { valueChange: "valueChange", dragStart: "dragStart", dragEnd: "dragEnd" }, exportAs: ["matSliderThumb"], features: [e.\u0275\u0275ProvidersFeature([tt, { provide: N, useExisting: a }])] });
} return a; })(), et = (() => { class a extends B {
_cdr = d(f);
getSibling() { return this._sibling || (this._sibling = this._slider._getInput(this._isEndThumb ? r.START : r.END)), this._sibling; }
_sibling;
getMinPos() { let t = this.getSibling(); return !this._isLeftThumb && t ? t.translateX : this._tickMarkOffset; }
getMaxPos() { let t = this.getSibling(); return this._isLeftThumb && t ? t.translateX : this._slider._cachedWidth - this._tickMarkOffset; }
_setIsLeftThumb() { this._isLeftThumb = this._isEndThumb && this._slider._isRtl || !this._isEndThumb && !this._slider._isRtl; }
_isLeftThumb;
_isEndThumb;
constructor() { super(), this._isEndThumb = this._hostElement.hasAttribute("matSliderEndThumb"), this._setIsLeftThumb(), this.thumbPosition = this._isEndThumb ? r.END : r.START; }
_getDefaultValue() { return this._isEndThumb && this._slider._isRange ? this.max : this.min; }
_onInput() { super._onInput(), this._updateSibling(), this._isActive || this._updateWidthInactive(); }
_onNgControlValueChange() { super._onNgControlValueChange(), this.getSibling()?._updateMinMax(); }
_onPointerDown(t) { this.disabled || t.button !== 0 || (this._sibling && (this._sibling._updateWidthActive(), this._sibling._hostElement.classList.add("mat-mdc-slider-input-no-pointer-events")), super._onPointerDown(t)); }
_onPointerUp() { super._onPointerUp(), this._sibling && setTimeout(() => { this._sibling._updateWidthInactive(), this._sibling._hostElement.classList.remove("mat-mdc-slider-input-no-pointer-events"); }); }
_onPointerMove(t) { super._onPointerMove(t), !this._slider.step && this._isActive && this._updateSibling(); }
_fixValue(t) { super._fixValue(t), this._sibling?._updateMinMax(); }
_clamp(t) { return Math.max(Math.min(t, this.getMaxPos()), this.getMinPos()); }
_updateMinMax() { let t = this.getSibling(); t && (this._isEndThumb ? (this.min = Math.max(this._slider.min, t.value), this.max = this._slider.max) : (this.min = this._slider.min, this.max = Math.min(this._slider.max, t.value))); }
_updateWidthActive() { let t = this._slider._rippleRadius * 2 - this._slider._inputPadding * 2, i = this._slider._cachedWidth + this._slider._inputPadding - t - this._tickMarkOffset * 2, s = this._slider.min < this._slider.max ? (this.max - this.min) / (this._slider.max - this._slider.min) : 1, n = i * s + t; this._hostElement.style.width = `${n}px`, this._hostElement.style.padding = `0 ${this._slider._inputPadding}px`; }
_updateWidthInactive() { let t = this.getSibling(); if (!t)
return; let i = this._slider._cachedWidth - this._tickMarkOffset * 2, s = this._isEndThumb ? this.value - (this.value - t.value) / 2 : this.value + (t.value - this.value) / 2, n = this._isEndThumb ? (this.max - s) / (this._slider.max - this._slider.min) : (s - this.min) / (this._slider.max - this._slider.min), l = this._slider.min < this._slider.max ? n : 1, o = this._slider._rippleRadius; l === 1 ? o = 48 : l === 0 && (o = 0); let m = i * l + o; this._hostElement.style.width = `${m}px`, this._hostElement.style.padding = "0px", this._isLeftThumb ? (this._hostElement.style.left = `-${this._slider._rippleRadius - this._tickMarkOffset}px`, this._hostElement.style.right = "auto") : (this._hostElement.style.left = "auto", this._hostElement.style.right = `-${this._slider._rippleRadius - this._tickMarkOffset}px`); }
_updateStaticStyles() { this._hostElement.classList.toggle("mat-slider__right-input", !this._isLeftThumb); }
_updateSibling() { let t = this.getSibling(); t && (t._updateMinMax(), this._isActive ? t._updateWidthActive() : t._updateWidthInactive()); }
writeValue(t) { (this._isControlInitialized || t !== null) && (this.value = t, this._updateWidthInactive(), this._updateSibling()); }
_setValue(t) { super._setValue(t), this._updateWidthInactive(), this._updateSibling(); }
static \u0275fac = function (i) { return new (i || a); };
static \u0275dir = e.\u0275\u0275defineDirective({ type: a, selectors: [["input", "matSliderStartThumb", ""], ["input", "matSliderEndThumb", ""]], exportAs: ["matSliderRangeThumb"], features: [e.\u0275\u0275ProvidersFeature([it, { provide: P, useExisting: a }]), e.\u0275\u0275InheritDefinitionFeature] });
} return a; })(), wt = (() => { class a {
static \u0275fac = function (i) { return new (i || a); };
static \u0275mod = e.\u0275\u0275defineNgModule({ type: a });
static \u0275inj = e.\u0275\u0275defineInjector({ imports: [w, V] });
} return a; })();
export { Et as MatSlider, C as MatSliderChange, wt as MatSliderModule, et as MatSliderRangeThumb, B as MatSliderThumb, J as MatSliderVisualThumb };