1 | "use strict";var PipsMode,PipsType;function isValidFormatter(t){return isValidPartialFormatter(t)&&"function"==typeof t.from}function isValidPartialFormatter(t){return"object"==typeof t&&"function"==typeof t.to}function removeElement(t){t.parentElement.removeChild(t)}function isSet(t){return null!=t}function preventDefault(t){t.preventDefault()}function unique(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function closest(t,e){return Math.round(t/e)*e}function offset(t,e){var r=t.getBoundingClientRect(),n=t.ownerDocument,t=n.documentElement,n=getPageOffset(n);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(n.x=0),e?r.top+n.y-t.clientTop:r.left+n.x-t.clientLeft}function isNumeric(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function addClassFor(t,e,r){0<r&&(addClass(t,e),setTimeout(function(){removeClass(t,e)},r))}function limit(t){return Math.max(Math.min(t,100),0)}function asArray(t){return Array.isArray(t)?t:[t]}function countDecimals(t){t=(t=String(t)).split(".");return 1<t.length?t[1].length:0}function addClass(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function removeClass(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function hasClass(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function getPageOffset(t){var e=void 0!==window.pageXOffset,r="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:(r?t.documentElement:t.body).scrollLeft,y:e?window.pageYOffset:(r?t.documentElement:t.body).scrollTop}}function getActions(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function getSupportsPassive(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}function getSupportsTouchActionNone(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function subRangeRatio(t,e){return 100/(e-t)}function fromPercentage(t,e,r){return 100*e/(t[r+1]-t[r])}function toPercentage(t,e){return fromPercentage(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}function isPercentage(t,e){return e*(t[1]-t[0])/100+t[0]}function getJ(t,e){for(var r=1;t>=e[r];)r+=1;return r}function toStepping(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=getJ(r,t),i=t[n-1],s=t[n],t=e[n-1],n=e[n];return t+toPercentage([i,s],r)/subRangeRatio(t,n)}function fromStepping(t,e,r){if(100<=r)return t.slice(-1)[0];var n=getJ(r,e),i=t[n-1],s=t[n],t=e[n-1];return isPercentage([i,s],(r-t)*subRangeRatio(t,e[n]))}function getStep(t,e,r,n){if(100===n)return n;var i=getJ(n,t),s=t[i-1],o=t[i];return r?(o-s)/2<n-s?o:s:e[i-1]?t[i-1]+closest(n-t[i-1],e[i-1]):n}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(PipsMode=PipsMode||{}),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(PipsType=PipsType||{});var Spectrum=function(){function t(e,t,r){var n;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t;var i=[];for(Object.keys(e).forEach(function(t){i.push([asArray(e[t]),t])}),i.sort(function(t,e){return t[0][0]-e[0][0]}),n=0;n<i.length;n++)this.handleEntryPoint(i[n][1],i[n][0]);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)this.handleStepPoint(n,this.xNumSteps[n])}return t.prototype.getDistance=function(t){for(var e=[],r=0;r<this.xNumSteps.length-1;r++)e[r]=fromPercentage(this.xVal,t,r);return e},t.prototype.getAbsoluteDistance=function(t,e,r){var n=0;if(t<this.xPct[this.xPct.length-1])for(;t>this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,s=1,o=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0<o;)i=this.xPct[n+1+u]-this.xPct[n+u],100<e[n+u]*s+100-100*c?(a=i*c,s=(o-100*c)/e[n+u],c=1):(a=e[n+u]*i/100*s,s=0),r?(l-=a,1<=this.xPct.length+u&&u--):(l+=a,1<=this.xPct.length-u&&u++),o=e[n+u]*s;return t+l},t.prototype.toStepping=function(t){return t=toStepping(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return fromStepping(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=getStep(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var n=getJ(t,this.xPct);return(100===t||e&&t===this.xPct[n-1])&&(n=Math.max(n-1,1)),(this.xVal[n]-this.xVal[n-1])/r},t.prototype.getNearbySteps=function(t){t=getJ(t,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(countDecimals);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){t="min"===t?0:"max"===t?100:parseFloat(t);if(!isNumeric(t)||!isNumeric(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(t),this.xVal.push(e[0]);e=Number(e[1]);t?this.xSteps.push(!isNaN(e)&&e):isNaN(e)||(this.xSteps[0]=e),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){e&&(this.xVal[t]!==this.xVal[t+1]?(this.xSteps[t]=fromPercentage([this.xVal[t],this.xVal[t+1]],e,0)/subRangeRatio(this.xPct[t],this.xPct[t+1]),e=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],e=Math.ceil(Number(e.toFixed(3))-1),e=this.xVal[t]+this.xNumSteps[t]*e,this.xHighestCompleteStep[t]=e):this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t])},t}(),defaultFormatter={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},cssClasses={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},INTERNAL_EVENT_NS={tooltips:".__tooltips",aria:".__aria"};function testStep(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function testKeyboardPageMultiplier(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function testKeyboardMultiplier(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function testKeyboardDefaultStep(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function testRange(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");t.spectrum=new Spectrum(e,t.snap||!1,t.singleStep)}function testStart(t,e){if(e=asArray(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function testSnap(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function testAnimate(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function testAnimationDuration(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function testConnect(t,e){var r,n=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r<t.handles;r++)n.push(e);n.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");n=e}t.connect=n}function testOrientation(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function testMargin(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'margin' option must be numeric.");0!==e&&(t.margin=t.spectrum.getDistance(e))}function testLimit(t,e){if(!isNumeric(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getDistance(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function testPadding(t,e){var r;if(!isNumeric(e)&&!Array.isArray(e))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!isNumeric(e[0])&&!isNumeric(e[1]))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){for(Array.isArray(e)||(e=[e,e]),t.padding=[t.spectrum.getDistance(e[0]),t.spectrum.getDistance(e[1])],r=0;r<t.spectrum.xNumSteps.length-1;r++)if(t.padding[0][r]<0||t.padding[1][r]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var n=e[0]+e[1],e=t.spectrum.xVal[0];if(1<n/(t.spectrum.xVal[t.spectrum.xVal.length-1]-e))throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function testDirection(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function testBehaviour(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=0<=e.indexOf("tap"),n=0<=e.indexOf("drag"),i=0<=e.indexOf("fixed"),s=0<=e.indexOf("snap"),o=0<=e.indexOf("hover"),a=0<=e.indexOf("unconstrained"),l=0<=e.indexOf("invert-connects"),u=0<=e.indexOf("drag-all"),e=0<=e.indexOf("smooth-steps");if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");testMargin(t,t.start[1]-t.start[0])}if(l&&2!==t.handles)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(a&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||s,drag:n,dragAll:u,smoothSteps:e,fixed:i,snap:s,hover:o,unconstrained:a,invertConnects:l}}function testTooltips(t,e){if(!1!==e)if(!0===e||isValidPartialFormatter(e)){t.tooltips=[];for(var r=0;r<t.handles;r++)t.tooltips.push(e)}else{if((e=asArray(e)).length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.forEach(function(t){if("boolean"!=typeof t&&!isValidPartialFormatter(t))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),t.tooltips=e}}function testHandleAttributes(t,e){if(e.length!==t.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");t.handleAttributes=e}function testAriaFormat(t,e){if(!isValidPartialFormatter(e))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");t.ariaFormat=e}function testFormat(t,e){if(!isValidFormatter(e))throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");t.format=e}function testKeyboardSupport(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");t.keyboardSupport=e}function testDocumentElement(t,e){t.documentElement=e}function testCssPrefix(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function testCssClasses(e,r){if("object"!=typeof r)throw new Error("noUiSlider: 'cssClasses' must be an object.");"string"==typeof e.cssPrefix?(e.cssClasses={},Object.keys(r).forEach(function(t){e.cssClasses[t]=e.cssPrefix+r[t]})):e.cssClasses=r}function testOptions(e){var r={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:defaultFormatter,format:defaultFormatter},n={step:{r:!1,t:testStep},keyboardPageMultiplier:{r:!1,t:testKeyboardPageMultiplier},keyboardMultiplier:{r:!1,t:testKeyboardMultiplier},keyboardDefaultStep:{r:!1,t:testKeyboardDefaultStep},start:{r:!0,t:testStart},connect:{r:!0,t:testConnect},direction:{r:!0,t:testDirection},snap:{r:!1,t:testSnap},animate:{r:!1,t:testAnimate},animationDuration:{r:!1,t:testAnimationDuration},range:{r:!0,t:testRange},orientation:{r:!1,t:testOrientation},margin:{r:!1,t:testMargin},limit:{r:!1,t:testLimit},padding:{r:!1,t:testPadding},behaviour:{r:!0,t:testBehaviour},ariaFormat:{r:!1,t:testAriaFormat},format:{r:!1,t:testFormat},tooltips:{r:!1,t:testTooltips},keyboardSupport:{r:!0,t:testKeyboardSupport},documentElement:{r:!1,t:testDocumentElement},cssPrefix:{r:!0,t:testCssPrefix},cssClasses:{r:!0,t:testCssClasses},handleAttributes:{r:!1,t:testHandleAttributes}},i={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:cssClasses,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(n).forEach(function(t){if(isSet(e[t])||void 0!==i[t])n[t].t(r,(isSet(e[t])?e:i)[t]);else if(n[t].r)throw new Error("noUiSlider: '"+t+"' is required.")}),r.pips=e.pips;var t=document.createElement("div"),s=void 0!==t.style.msTransform,t=void 0!==t.style.transform;r.transformRule=t?"transform":s?"msTransform":"webkitTransform";return r.style=[["left","top"],["right","bottom"]][r.dir][r.ort],r}function scope(t,d,s){var r,n,l,u,i,o,c=getActions(),a=getSupportsTouchActionNone()&&getSupportsPassive(),p=t,S=d.spectrum,f=[],h=[],m=[],g=0,v={},b=!1,x=t.ownerDocument,y=d.documentElement||x.documentElement,E=x.body,N="rtl"===x.dir||1===d.ort?0:100;function C(t,e){var r=x.createElement("div");return e&&addClass(r,e),t.appendChild(r),r}function w(t,e){var r,t=C(t,d.cssClasses.origin),n=C(t,d.cssClasses.handle);return C(n,d.cssClasses.touchArea),n.setAttribute("data-handle",String(e)),d.keyboardSupport&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",function(t){return function(t,e){if(A()||V(e))return!1;var r=["Left","Right"],n=["Down","Up"],i=["PageDown","PageUp"],s=["Home","End"];d.dir&&!d.ort?r.reverse():d.ort&&!d.dir&&(n.reverse(),i.reverse());var o=t.key.replace("Arrow",""),a=o===i[0],l=o===i[1],i=o===n[0]||o===r[0]||a,n=o===n[1]||o===r[1]||l,r=o===s[0],s=o===s[1];if(!(i||n||r||s))return!0;if(t.preventDefault(),n||i){var u=i?0:1,u=ot(e)[u];if(null===u)return!1;!1===u&&(u=S.getDefaultStep(h[e],i,d.keyboardDefaultStep)),u*=l||a?d.keyboardPageMultiplier:d.keyboardMultiplier,u=Math.max(u,1e-7),u*=i?-1:1,u=f[e]+u}else u=s?d.spectrum.xVal[d.spectrum.xVal.length-1]:d.spectrum.xVal[0];return et(e,S.toStepping(u),!0,!0),Y("slide",e),Y("update",e),Y("change",e),Y("set",e),!1}(t,e)})),void 0!==d.handleAttributes&&(r=d.handleAttributes[e],Object.keys(r).forEach(function(t){n.setAttribute(t,r[t])})),n.setAttribute("role","slider"),n.setAttribute("aria-orientation",d.ort?"vertical":"horizontal"),0===e?addClass(n,d.cssClasses.handleLower):e===d.handles-1&&addClass(n,d.cssClasses.handleUpper),t.handle=n,t}function P(t,e){return!!e&&C(t,d.cssClasses.connect)}function e(t,e){return!(!d.tooltips||!d.tooltips[e])&&C(t.firstChild,d.cssClasses.tooltip)}function A(){return p.hasAttribute("disabled")}function V(t){return l[t].hasAttribute("disabled")}function k(){o&&(X("update"+INTERNAL_EVENT_NS.tooltips),o.forEach(function(t){t&&removeElement(t)}),o=null)}function M(){k(),o=l.map(e),J("update"+INTERNAL_EVENT_NS.tooltips,function(t,e,r){o&&d.tooltips&&!1!==o[e]&&(t=t[e],!0!==d.tooltips[e]&&(t=d.tooltips[e].to(r[e])),o[e].innerHTML=t)})}function D(t,e){return t.map(function(t){return S.fromStepping(e?S.getStep(t):t)})}function T(f){var h=function(t){if(t.mode===PipsMode.Range||t.mode===PipsMode.Steps)return S.xVal;if(t.mode!==PipsMode.Count)return t.mode===PipsMode.Positions?D(t.values,t.stepped):t.mode===PipsMode.Values?t.stepped?t.values.map(function(t){return S.fromStepping(S.getStep(S.toStepping(t)))}):t.values:[];if(t.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),D(n,t.stepped)}(f),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=unique(h.slice().sort(function(t,e){return t-e})))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,s,o,a,l,u,t=t,c=h[e+1],p=f.mode===PipsMode.Steps,d=(d=p?S.xNumSteps[e]:d)||c-t;for(void 0===c&&(c=t),d=Math.max(d,1e-7),r=t;r<=c;r=Number((r+d).toFixed(7))){for(a=(s=(i=S.toStepping(r))-b)/(f.density||1),u=s/(l=Math.round(a)),n=1;n<=l;n+=1)m[(o=b+n*u).toFixed(5)]=[S.fromStepping(o),0];a=-1<h.indexOf(r)?PipsType.LargeValue:p?PipsType.SmallValue:PipsType.NoValue,!e&&g&&r!==c&&(a=0),r===c&&v||(m[i.toFixed(5)]=[r,a]),b=i}}),m}function U(i,s,o){var t,a=x.createElement("div"),n=((t={})[PipsType.None]="",t[PipsType.NoValue]=d.cssClasses.valueNormal,t[PipsType.LargeValue]=d.cssClasses.valueLarge,t[PipsType.SmallValue]=d.cssClasses.valueSub,t),l=((t={})[PipsType.None]="",t[PipsType.NoValue]=d.cssClasses.markerNormal,t[PipsType.LargeValue]=d.cssClasses.markerLarge,t[PipsType.SmallValue]=d.cssClasses.markerSub,t),u=[d.cssClasses.valueHorizontal,d.cssClasses.valueVertical],c=[d.cssClasses.markerHorizontal,d.cssClasses.markerVertical];function p(t,e){var r=e===d.cssClasses.value;return e+" "+(r?u:c)[d.ort]+" "+(r?n:l)[t]}return addClass(a,d.cssClasses.pips),addClass(a,0===d.ort?d.cssClasses.pipsHorizontal:d.cssClasses.pipsVertical),Object.keys(i).forEach(function(t){var e,r,n;r=i[e=t][0],n=i[t][1],(n=s?s(r,n):n)!==PipsType.None&&((t=C(a,!1)).className=p(n,d.cssClasses.marker),t.style[d.style]=e+"%",n>PipsType.NoValue&&((t=C(a,!1)).className=p(n,d.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[d.style]=e+"%",t.innerHTML=String(o.to(r))))}),a}function L(){i&&(removeElement(i),i=null)}function O(t){L();var e=T(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return i=p.appendChild(U(e,r,t))}function F(){var t=r.getBoundingClientRect(),e="offset"+["Width","Height"][d.ort];return 0===d.ort?t.width||r[e]:t.height||r[e]}function R(e,r,n,i){function s(t){return!!(t=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer"),o=0,a=0;0===e.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1<n.length)return!1;o=n[0].pageX,a=n[0].pageY}else{l=Array.prototype.find.call(e.changedTouches,l);if(!l)return!1;o=l.pageX,a=l.pageY}}t=t||getPageOffset(x),(i||s)&&(o=e.clientX+t.x,a=e.clientY+t.y);return e.pageOffset=t,e.points=[o,a],e.cursor=i||s,e}(t,i.pageOffset,i.target||r))&&(!(A()&&!i.doNotReject)&&(!(hasClass(p,d.cssClasses.tap)&&!i.doNotReject)&&(!(e===c.start&&void 0!==t.buttons&&1<t.buttons)&&((!i.hover||!t.buttons)&&(a||t.preventDefault(),t.calcPoint=t.points[d.ort],void n(t,i))))))}var o=[];return e.split(" ").forEach(function(t){r.addEventListener(t,s,!!a&&{passive:!0}),o.push([t,s])}),o}function _(t){t=limit(t=100*(t-offset(r,d.ort))/F());return d.dir?100-t:t}function z(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&j(t,e)}function H(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return j(t,e);t=(d.dir?-1:1)*(t.calcPoint-e.startCalcPoint);G(0<t,100*t/e.baseSize,e.locations,e.handleNumbers,e.connect)}function j(t,e){e.handle&&(removeClass(e.handle,d.cssClasses.active),--g),e.listeners.forEach(function(t){y.removeEventListener(t[0],t[1])}),0===g&&(removeClass(p,d.cssClasses.drag),tt(),t.cursor&&(E.style.cursor="",E.removeEventListener("selectstart",preventDefault))),d.events.smoothSteps&&(e.handleNumbers.forEach(function(t){et(t,h[t],!0,!0,!1,!1)}),e.handleNumbers.forEach(function(t){Y("update",t)})),e.handleNumbers.forEach(function(t){Y("change",t),Y("set",t),Y("end",t)})}function I(t,e){var r,n,i,s;e.handleNumbers.some(V)||(1===e.handleNumbers.length&&(s=l[e.handleNumbers[0]].children[0],g+=1,addClass(s,d.cssClasses.active)),t.stopPropagation(),n=R(c.move,y,H,{target:t.target,handle:s,connect:e.connect,listeners:r=[],startCalcPoint:t.calcPoint,baseSize:F(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:h.slice()}),i=R(c.end,y,j,{target:t.target,handle:s,listeners:r,doNotReject:!0,handleNumbers:e.handleNumbers}),s=R("mouseout",y,z,{target:t.target,handle:s,listeners:r,doNotReject:!0,handleNumbers:e.handleNumbers}),r.push.apply(r,n.concat(i,s)),t.cursor&&(E.style.cursor=getComputedStyle(t.target).cursor,1<l.length&&addClass(p,d.cssClasses.drag),E.addEventListener("selectstart",preventDefault,!1)),e.handleNumbers.forEach(function(t){Y("start",t)}))}function B(t){t.stopPropagation();var i,s,o,e=_(t.calcPoint),r=(i=e,o=!(s=100),l.forEach(function(t,e){var r,n;V(e)||(r=h[e],((n=Math.abs(r-i))<s||n<=s&&r<i||100===n&&100===s)&&(o=e,s=n))}),o);!1!==r&&(d.events.snap||addClassFor(p,d.cssClasses.tap,d.animationDuration),et(r,e,!0,!0),tt(),Y("slide",r,!0),Y("update",r,!0),d.events.snap?I(t,{handleNumbers:[r]}):(Y("change",r,!0),Y("set",r,!0)))}function K(t){var t=_(t.calcPoint),t=S.getStep(t),e=S.fromStepping(t);Object.keys(v).forEach(function(t){"hover"===t.split(".")[0]&&v[t].forEach(function(t){t.call(lt,e)})})}function q(a){a.fixed||l.forEach(function(t,e){R(c.start,t.children[0],I,{handleNumbers:[e]})}),a.tap&&R(c.start,r,B,{}),a.hover&&R(c.move,r,K,{hover:!0}),a.drag&&u.forEach(function(e,t){var r,n,i,s,o;!1!==e&&0!==t&&t!==u.length-1&&(r=l[t-1],n=l[t],i=[e],s=[r,n],o=[t-1,t],addClass(e,d.cssClasses.draggable),a.fixed&&(i.push(r.children[0]),i.push(n.children[0])),a.dragAll&&(s=l,o=m),i.forEach(function(t){R(c.start,t,I,{handles:s,handleNumbers:o,connect:e})}))})}function J(t,e){v[t]=v[t]||[],v[t].push(e),"update"===t.split(".")[0]&&l.forEach(function(t,e){Y("update",e)})}function X(t){var n=t&&t.split(".")[0],i=n?t.substring(n.length):t;Object.keys(v).forEach(function(t){var e=t.split(".")[0],r=t.substring(e.length);n&&n!==e||i&&i!==r||((e=r)!==INTERNAL_EVENT_NS.aria&&e!==INTERNAL_EVENT_NS.tooltips||i===r)&&delete v[t]})}function Y(r,n,i){Object.keys(v).forEach(function(t){var e=t.split(".")[0];r===e&&v[t].forEach(function(t){t.call(lt,f.map(d.format.to),n,f.slice(),i||!1,h.slice(),lt)})})}function W(t,e,r,n,i,s,o){var a;return 1<l.length&&!d.events.unconstrained&&(n&&0<e&&(a=S.getAbsoluteDistance(t[e-1],d.margin,!1),r=Math.max(r,a)),i&&e<l.length-1&&(a=S.getAbsoluteDistance(t[e+1],d.margin,!0),r=Math.min(r,a))),1<l.length&&d.limit&&(n&&0<e&&(a=S.getAbsoluteDistance(t[e-1],d.limit,!1),r=Math.min(r,a)),i&&e<l.length-1&&(a=S.getAbsoluteDistance(t[e+1],d.limit,!0),r=Math.max(r,a))),d.padding&&(0===e&&(a=S.getAbsoluteDistance(0,d.padding[0],!1),r=Math.max(r,a)),e===l.length-1&&(a=S.getAbsoluteDistance(100,d.padding[1],!0),r=Math.min(r,a))),!((r=limit(r=!o?S.getStep(r):r))===t[e]&&!s)&&r}function $(t,e){var r=d.ort;return(r?e:t)+", "+(r?t:e)}function G(t,r,n,e,i){var s=n.slice(),o=e[0],a=d.events.smoothSteps,l=[!t,t],u=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){e=W(s,t,s[t]+r,l[e],u[e],!1,a);!1===e?r=0:(r=e-s[t],s[t]=e)}):l=u=[!0];var c=!1;e.forEach(function(t,e){c=et(t,n[t]+r,l[e],u[e],!1,a)||c}),c&&(e.forEach(function(t){Y("update",t),Y("slide",t)}),null!=i&&Y("drag",o))}function Q(t,e){return d.dir?100-t-e:t}function Z(t,e){h[t]=e,f[t]=S.fromStepping(e);e="translate("+$(Q(e,0)-N+"%","0")+")";if(l[t].style[d.transformRule]=e,d.events.invertConnects&&1<h.length){e=h.every(function(t,e,r){return 0===e||t>=r[e-1]});if(b!==!e)return b=!b,testConnect(d,d.connect.map(function(t){return!t})),void at()}rt(t),rt(t+1),b&&(rt(t-1),rt(t+2))}function tt(){m.forEach(function(t){var e=50<h[t]?-1:1,e=3+(l.length+e*t);l[t].style.zIndex=String(e)})}function et(t,e,r,n,i,s){return!1!==(e=i?e:W(h,t,e,r,n,!1,s))&&(Z(t,e),!0)}function rt(t){var e,r,n;u[t]&&(e=h.slice(),b&&e.sort(function(t,e){return t-e}),n=100,r="translate("+$(Q(r=(r=0)!==t?e[t-1]:r,n=(n=t!==u.length-1?e[t]:n)-r)+"%","0")+")",n="scale("+$(n/100,"1")+")",u[t].style[d.transformRule]=r+" "+n)}function nt(t,e){return null===t||!1===t||void 0===t?h[e]:("number"==typeof t&&(t=String(t)),!1===(t=!1!==(t=d.format.from(t))?S.toStepping(t):t)||isNaN(t)?h[e]:t)}function it(t,e,r){var n=asArray(t),t=void 0===h[0];e=void 0===e||e,d.animate&&!t&&addClassFor(p,d.cssClasses.tap,d.animationDuration),m.forEach(function(t){et(t,nt(n[t],t),!0,!1,r)});var i,s=1===m.length?0:1;for(t&&S.hasNoSize()&&(r=!0,h[0]=0,1<m.length&&(i=100/(m.length-1),m.forEach(function(t){h[t]=t*i})));s<m.length;++s)m.forEach(function(t){et(t,h[t],!0,!0,r)});tt(),m.forEach(function(t){Y("update",t),null!==n[t]&&e&&Y("set",t)})}function st(t){if(t=void 0===t?!1:t)return 1===f.length?f[0]:f.slice(0);t=f.map(d.format.to);return 1===t.length?t[0]:t}function ot(t){var e=h[t],r=S.getNearbySteps(e),n=f[t],i=r.thisStep.step,t=null;if(d.snap)return[n-r.stepBefore.startValue||null,r.stepAfter.startValue-n||null];!1!==i&&n+i>r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}function at(){for(;n.firstChild;)n.removeChild(n.firstChild);for(var t=0;t<=d.handles;t++)u[t]=P(n,d.connect[t]),rt(t);q({drag:d.events.drag,fixed:!0})}addClass(t=p,d.cssClasses.target),0===d.dir?addClass(t,d.cssClasses.ltr):addClass(t,d.cssClasses.rtl),0===d.ort?addClass(t,d.cssClasses.horizontal):addClass(t,d.cssClasses.vertical),addClass(t,"rtl"===getComputedStyle(t).direction?d.cssClasses.textDirectionRtl:d.cssClasses.textDirectionLtr),r=C(t,d.cssClasses.base),function(t,e){n=C(e,d.cssClasses.connects),l=[],(u=[]).push(P(n,t[0]));for(var r=0;r<d.handles;r++)l.push(w(e,r)),m[r]=r,u.push(P(n,t[r+1]))}(d.connect,r),q(d.events),it(d.start),d.pips&&O(d.pips),d.tooltips&&M(),X("update"+INTERNAL_EVENT_NS.aria),J("update"+INTERNAL_EVENT_NS.aria,function(t,e,s,r,o){m.forEach(function(t){var e=l[t],r=W(h,t,0,!0,!0,!0),n=W(h,t,100,!0,!0,!0),i=o[t],t=String(d.ariaFormat.to(s[t])),r=S.fromStepping(r).toFixed(1),n=S.fromStepping(n).toFixed(1),i=S.fromStepping(i).toFixed(1);e.children[0].setAttribute("aria-valuemin",r),e.children[0].setAttribute("aria-valuemax",n),e.children[0].setAttribute("aria-valuenow",i),e.children[0].setAttribute("aria-valuetext",t)})});var lt={destroy:function(){for(X(INTERNAL_EVENT_NS.aria),X(INTERNAL_EVENT_NS.tooltips),Object.keys(d.cssClasses).forEach(function(t){removeClass(p,d.cssClasses[t])});p.firstChild;)p.removeChild(p.firstChild);delete p.noUiSlider},steps:function(){return m.map(ot)},on:J,off:X,get:st,set:it,setHandle:function(t,e,r,n){if(!(0<=(t=Number(t))&&t<m.length))throw new Error("noUiSlider: invalid handle number, got: "+t);et(t,nt(e,t),!0,!0,n),Y("update",t),r&&Y("set",t)},reset:function(t){it(d.start,t)},disable:function(t){null!=t?(l[t].setAttribute("disabled",""),l[t].handle.removeAttribute("tabindex")):(p.setAttribute("disabled",""),l.forEach(function(t){t.handle.removeAttribute("tabindex")}))},enable:function(t){null!=t?(l[t].removeAttribute("disabled"),l[t].handle.setAttribute("tabindex","0")):(p.removeAttribute("disabled"),l.forEach(function(t){t.removeAttribute("disabled"),t.handle.setAttribute("tabindex","0")}))},__moveHandles:function(t,e,r){G(t,e,h,r)},options:s,updateOptions:function(e,t){var r=st(),n=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];n.forEach(function(t){void 0!==e[t]&&(s[t]=e[t])});var i=testOptions(s);n.forEach(function(t){void 0!==e[t]&&(d[t]=i[t])}),S=i.spectrum,d.margin=i.margin,d.limit=i.limit,d.padding=i.padding,d.pips?O(d.pips):L(),(d.tooltips?M:k)(),h=[],it(isSet(e.start)?e.start:r,t),e.connect&&at()},target:p,removePips:L,removeTooltips:k,getPositions:function(){return h.slice()},getTooltips:function(){return o},getOrigins:function(){return l},pips:O};return lt}function initialize(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");e=scope(t,testOptions(e),e);return t.noUiSlider=e}export default{__spectrum:Spectrum,cssClasses:cssClasses,create:initialize};export{PipsMode,PipsType,initialize as create,cssClasses}; |