Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 3a3a7d07

Přidáno uživatelem Přemysl Kouba před téměř 6 roky(ů)

Filter slider repair - problem with noUiSlider and wNumb together with requirejs (refs #7602)

Zobrazit rozdíly:

sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js
157 157
	_initializeFormFields() {
158 158
		// string
159 159
		this._stringField = DOM.h('input', {
160
			type: 'text',
160
			type: FilterDataType.STRING,
161 161
			name: 'value',
162 162
			required: 'required',
163 163
		});
......
171 171

  
172 172
		// date
173 173
		this._dateField = DOM.h('input', {
174
			type: 'date',
174
			type: FilterDataType.DATE,
175 175
			name: 'value',
176 176
			required: 'required',
177 177
		});
......
214 214
				"    return new Date(str).getTime();" +
215 215
				"}" +
216 216
				"var dateSlider = document.getElementById('slider');" +
217
				"noUiSlider.create(dateSlider, {" +
217
				"window.noUiSlider.create(dateSlider, {" +
218 218
				"	 connect: true," +
219 219
				"    range: {" +
220 220
				"        min: timestamp(1970)," +
......
246 246

  
247 247
		// number
248 248
		this._numberField = DOM.h('input', {
249
			type: 'number',
249
			type: FilterDataType.NUMBER,
250 250
			name: 'value',
251 251
			required: 'required',
252 252
		});
......
567 567
					"    return new Date(str).getTime();" +
568 568
					"}" +
569 569
					"var dateSlider = document.getElementById('slider');" +
570
					"noUiSlider.create(dateSlider, {" +
570
					"window.noUiSlider.create(dateSlider, {" +
571 571
					"	 connect: true," +
572 572
					"    range: {" +
573 573
					"        min: " + minDate.getTime() + "," +
sources/imiger-core/src/main/webapp/js/components/slider/nouislider.min.js
1
/*! nouislider - 13.1.5 - 4/24/2019 */
2
!function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";var ut="13.1.5";function ct(t){t.parentElement.removeChild(t)}function s(t){return null!=t}function pt(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function ft(t,e,r){0<r&&(mt(t,e),setTimeout(function(){gt(t,e)},r))}function dt(t){return Math.max(Math.min(t,100),0)}function ht(t){return Array.isArray(t)?t:[t]}function e(t){var e=(t=String(t)).split(".");return 1<e.length?e[1].length:0}function mt(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function gt(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function vt(t){var e=void 0!==window.pageXOffset,r="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:r?t.documentElement.scrollLeft:t.body.scrollLeft,y:e?window.pageYOffset:r?t.documentElement.scrollTop:t.body.scrollTop}}function c(t,e){return 100/(e-t)}function p(t,e){return 100*e/(t[1]-t[0])}function f(t,e){for(var r=1;t>=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n,i,o=f(r,t),a=t[o-1],s=t[o],l=e[o-1],u=e[o];return l+(i=r,p(n=[a,s],n[0]<0?i+Math.abs(n[0]):i-n[0])/c(l,u))}function n(t,e,r,n){if(100===n)return n;var i,o,a=f(n,t),s=t[a-1],l=t[a];return r?(l-s)/2<n-s?l:s:e[a-1]?t[a-1]+(i=n-t[a-1],o=e[a-1],Math.round(i/o)*o):n}function o(t,e,r){var n;if("number"==typeof e&&(e=[e]),!Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'range' contains invalid value.");if(!i(n="min"===t?0:"max"===t?100:parseFloat(t))||!i(e[0]))throw new Error("noUiSlider ("+ut+"): 'range' value isn't numeric.");r.xPct.push(n),r.xVal.push(e[0]),n?r.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(r.xSteps[0]=e[1]),r.xHighestCompleteStep.push(0)}function a(t,e,r){if(e)if(r.xVal[t]!==r.xVal[t+1]){r.xSteps[t]=p([r.xVal[t],r.xVal[t+1]],e)/c(r.xPct[t],r.xPct[t+1]);var n=(r.xVal[t+1]-r.xVal[t])/r.xNumSteps[t],i=Math.ceil(Number(n.toFixed(3))-1),o=r.xVal[t]+r.xNumSteps[t]*i;r.xHighestCompleteStep[t]=o}else r.xSteps[t]=r.xHighestCompleteStep[t]=r.xVal[t]}function l(t,e,r){var n;this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i=[];for(n in t)t.hasOwnProperty(n)&&i.push([t[n],n]);for(i.length&&"object"==typeof i[0][0]?i.sort(function(t,e){return t[0][0]-e[0][0]}):i.sort(function(t,e){return t[0]-e[0]}),n=0;n<i.length;n++)o(i[n][1],i[n][0],this);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)a(n,this.xNumSteps[n],this)}l.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider ("+ut+"): 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,t)},l.prototype.toStepping=function(t){return t=r(this.xVal,this.xPct,t)},l.prototype.fromStepping=function(t){return function(t,e,r){if(100<=r)return t.slice(-1)[0];var n,i=f(r,e),o=t[i-1],a=t[i],s=e[i-1],l=e[i];return n=[o,a],(r-s)*c(s,l)*(n[1]-n[0])/100+n[0]}(this.xVal,this.xPct,t)},l.prototype.getStep=function(t){return t=n(this.xPct,this.xSteps,this.snap,t)},l.prototype.getDefaultStep=function(t,e,r){var n=f(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},l.prototype.getNearbySteps=function(t){var e=f(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},l.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(e);return Math.max.apply(null,t)},l.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var u={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function d(t){if("object"==typeof(e=t)&&"function"==typeof e.to&&"function"==typeof e.from)return!0;var e;throw new Error("noUiSlider ("+ut+"): 'format' requires 'to' and 'from' methods.")}function h(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'step' is not numeric.");t.singleStep=e}function m(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider ("+ut+"): Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider ("+ut+"): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new l(e,t.snap,t.singleStep)}function g(t,e){if(e=ht(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider ("+ut+"): 'start' option is incorrect.");t.handles=e.length,t.start=e}function v(t,e){if("boolean"!=typeof(t.snap=e))throw new Error("noUiSlider ("+ut+"): 'snap' option must be a boolean.")}function b(t,e){if("boolean"!=typeof(t.animate=e))throw new Error("noUiSlider ("+ut+"): 'animate' option must be a boolean.")}function S(t,e){if("number"!=typeof(t.animationDuration=e))throw new Error("noUiSlider ("+ut+"): 'animationDuration' option must be a number.")}function x(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 ("+ut+"): 'connect' option doesn't match handle count.");n=e}t.connect=n}function w(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider ("+ut+"): 'orientation' option is invalid.")}}function y(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider ("+ut+"): 'margin' option is only supported on linear sliders.")}function E(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider ("+ut+"): 'limit' option is only supported on linear sliders with 2 or more handles.")}function C(t,e){if(!i(e)&&!Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!i(e[0])&&!i(e[1]))throw new Error("noUiSlider ("+ut+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){if(Array.isArray(e)||(e=[e,e]),!(t.padding=[t.spectrum.getMargin(e[0]),t.spectrum.getMargin(e[1])])===t.padding[0]||!1===t.padding[1])throw new Error("noUiSlider ("+ut+"): 'padding' option is only supported on linear sliders.");if(t.padding[0]<0||t.padding[1]<0)throw new Error("noUiSlider ("+ut+"): 'padding' option must be a positive number(s).");if(100<t.padding[0]+t.padding[1])throw new Error("noUiSlider ("+ut+"): 'padding' option must not exceed 100% of the range.")}}function N(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider ("+ut+"): 'direction' option was not recognized.")}}function U(t,e){if("string"!=typeof e)throw new Error("noUiSlider ("+ut+"): 'behaviour' must be a string containing options.");var r=0<=e.indexOf("tap"),n=0<=e.indexOf("drag"),i=0<=e.indexOf("fixed"),o=0<=e.indexOf("snap"),a=0<=e.indexOf("hover"),s=0<=e.indexOf("unconstrained");if(i){if(2!==t.handles)throw new Error("noUiSlider ("+ut+"): 'fixed' behaviour must be used with 2 handles");y(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider ("+ut+"): 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:n,fixed:i,snap:o,hover:a,unconstrained:s}}function k(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var r=0;r<t.handles;r++)t.tooltips.push(!0)}else{if(t.tooltips=ht(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider ("+ut+"): must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider ("+ut+"): 'tooltips' must be passed a formatter or 'false'.")})}}function P(t,e){d(t.ariaFormat=e)}function A(t,e){d(t.format=e)}function V(t,e){if("boolean"!=typeof(t.keyboardSupport=e))throw new Error("noUiSlider ("+ut+"): 'keyboardSupport' option must be a boolean.")}function M(t,e){t.documentElement=e}function O(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider ("+ut+"): 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function L(t,e){if("object"!=typeof e)throw new Error("noUiSlider ("+ut+"): 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix)for(var r in t.cssClasses={},e)e.hasOwnProperty(r)&&(t.cssClasses[r]=t.cssPrefix+e[r]);else t.cssClasses=e}function bt(e){var r={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:u,format:u},n={step:{r:!1,t:h},start:{r:!0,t:g},connect:{r:!0,t:x},direction:{r:!0,t:N},snap:{r:!1,t:v},animate:{r:!1,t:b},animationDuration:{r:!1,t:S},range:{r:!0,t:m},orientation:{r:!1,t:w},margin:{r:!1,t:y},limit:{r:!1,t:E},padding:{r:!1,t:C},behaviour:{r:!0,t:U},ariaFormat:{r:!1,t:P},format:{r:!1,t:A},tooltips:{r:!1,t:k},keyboardSupport:{r:!0,t:V},documentElement:{r:!1,t:M},cssPrefix:{r:!0,t:O},cssClasses:{r:!0,t:L}},i={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",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",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"}};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(n).forEach(function(t){if(!s(e[t])&&void 0===i[t]){if(n[t].r)throw new Error("noUiSlider ("+ut+"): '"+t+"' is required.");return!0}n[t].t(r,s(e[t])?e[t]:i[t])}),r.pips=e.pips;var t=document.createElement("div"),o=void 0!==t.style.msTransform,a=void 0!==t.style.transform;r.transformRule=a?"transform":o?"msTransform":"webkitTransform";return r.style=[["left","top"],["right","bottom"]][r.dir][r.ort],r}function z(t,f,o){var l,u,a,c,i,s,e,p,d=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"},h=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),y=t,E=f.spectrum,m=[],g=[],v=[],b=0,S={},x=t.ownerDocument,w=f.documentElement||x.documentElement,C=x.body,N=-1,U=0,k=1,P=2,A="rtl"===x.dir||1===f.ort?0:100;function V(t,e){var r=x.createElement("div");return e&&mt(r,e),t.appendChild(r),r}function M(t,e){var r=V(t,f.cssClasses.origin),n=V(r,f.cssClasses.handle);return V(n,f.cssClasses.touchArea),n.setAttribute("data-handle",e),f.keyboardSupport&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",function(t){return function(t,e){if(L()||z(e))return!1;var r=["Left","Right"],n=["Down","Up"];f.dir&&!f.ort?r.reverse():f.ort&&!f.dir&&n.reverse();var i=t.key.replace("Arrow",""),o=i===n[0]||i===r[0],a=i===n[1]||i===r[1];if(!o&&!a)return!0;t.preventDefault();var s=o?0:1,l=lt(e)[s];if(null===l)return!1;!1===l&&(l=E.getDefaultStep(g[e],o,10));return l=Math.max(l,1e-7),l*=o?-1:1,at(e,m[e]+l,!0),!1}(t,e)})),n.setAttribute("role","slider"),n.setAttribute("aria-orientation",f.ort?"vertical":"horizontal"),0===e?mt(n,f.cssClasses.handleLower):e===f.handles-1&&mt(n,f.cssClasses.handleUpper),r}function O(t,e){return!!e&&V(t,f.cssClasses.connect)}function r(t,e){return!!f.tooltips[e]&&V(t.firstChild,f.cssClasses.tooltip)}function L(){return y.hasAttribute("disabled")}function z(t){return u[t].hasAttribute("disabled")}function j(){i&&(G("update.tooltips"),i.forEach(function(t){t&&ct(t)}),i=null)}function H(){j(),i=u.map(r),$("update.tooltips",function(t,e,r){if(i[e]){var n=t[e];!0!==f.tooltips[e]&&(n=f.tooltips[e].to(r[e])),i[e].innerHTML=n}})}function F(e,i,o){var a=x.createElement("div"),s=[];s[U]=f.cssClasses.valueNormal,s[k]=f.cssClasses.valueLarge,s[P]=f.cssClasses.valueSub;var l=[];l[U]=f.cssClasses.markerNormal,l[k]=f.cssClasses.markerLarge,l[P]=f.cssClasses.markerSub;var u=[f.cssClasses.valueHorizontal,f.cssClasses.valueVertical],c=[f.cssClasses.markerHorizontal,f.cssClasses.markerVertical];function p(t,e){var r=e===f.cssClasses.value,n=r?s:l;return e+" "+(r?u:c)[f.ort]+" "+n[t]}return mt(a,f.cssClasses.pips),mt(a,0===f.ort?f.cssClasses.pipsHorizontal:f.cssClasses.pipsVertical),Object.keys(e).forEach(function(t){!function(t,e,r){if((r=i?i(e,r):r)!==N){var n=V(a,!1);n.className=p(r,f.cssClasses.marker),n.style[f.style]=t+"%",U<r&&((n=V(a,!1)).className=p(r,f.cssClasses.value),n.setAttribute("data-value",e),n.style[f.style]=t+"%",n.innerHTML=o.to(e))}}(t,e[t][0],e[t][1])}),a}function D(){c&&(ct(c),c=null)}function T(t){D();var m,g,v,b,e,r,S,x,w,n=t.mode,i=t.density||1,o=t.filter||!1,a=function(t,e,r){if("range"===t||"steps"===t)return E.xVal;if("count"===t){if(e<2)throw new Error("noUiSlider ("+ut+"): 'values' (>= 2) required for mode 'count'.");var n=e-1,i=100/n;for(e=[];n--;)e[n]=n*i;e.push(100),t="positions"}return"positions"===t?e.map(function(t){return E.fromStepping(r?E.getStep(t):t)}):"values"===t?r?e.map(function(t){return E.fromStepping(E.getStep(E.toStepping(t)))}):e:void 0}(n,t.values||!1,t.stepped||!1),s=(m=i,g=n,v=a,b={},e=E.xVal[0],r=E.xVal[E.xVal.length-1],x=S=!1,w=0,(v=v.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==e&&(v.unshift(e),S=!0),v[v.length-1]!==r&&(v.push(r),x=!0),v.forEach(function(t,e){var r,n,i,o,a,s,l,u,c,p,f=t,d=v[e+1],h="steps"===g;if(h&&(r=E.xNumSteps[e]),r||(r=d-f),!1!==f&&void 0!==d)for(r=Math.max(r,1e-7),n=f;n<=d;n=(n+r).toFixed(7)/1){for(u=(a=(o=E.toStepping(n))-w)/m,p=a/(c=Math.round(u)),i=1;i<=c;i+=1)b[(s=w+i*p).toFixed(5)]=[E.fromStepping(s),0];l=-1<v.indexOf(n)?k:h?P:U,!e&&S&&(l=0),n===d&&x||(b[o.toFixed(5)]=[n,l]),w=o}}),b),l=t.format||{to:Math.round};return c=y.appendChild(F(s,o,l))}function R(){var t=l.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||l[e]:t.height||l[e]}function B(n,i,o,a){var e=function(t){return!!(t=function(t,e,r){var n,i,o=0===t.type.indexOf("touch"),a=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");0===t.type.indexOf("MSPointer")&&(s=!0);if(o){var l=function(t){return t.target===r||r.contains(t.target)};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(1<u.length)return!1;n=u[0].pageX,i=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;n=c.pageX,i=c.pageY}}e=e||vt(x),(a||s)&&(n=t.clientX+e.x,i=t.clientY+e.y);return t.pageOffset=e,t.points=[n,i],t.cursor=a||s,t}(t,a.pageOffset,a.target||i))&&(!(L()&&!a.doNotReject)&&(e=y,r=f.cssClasses.tap,!((e.classList?e.classList.contains(r):new RegExp("\\b"+r+"\\b").test(e.className))&&!a.doNotReject)&&(!(n===d.start&&void 0!==t.buttons&&1<t.buttons)&&((!a.hover||!t.buttons)&&(h||t.preventDefault(),t.calcPoint=t.points[f.ort],void o(t,a))))));var e,r},r=[];return n.split(" ").forEach(function(t){i.addEventListener(t,e,!!h&&{passive:!0}),r.push([t,e])}),r}function q(t){var e,r,n,i,o,a,s=100*(t-(e=l,r=f.ort,n=e.getBoundingClientRect(),i=e.ownerDocument,o=i.documentElement,a=vt(i),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(a.x=0),r?n.top+a.y-o.clientTop:n.left+a.x-o.clientLeft))/R();return s=dt(s),f.dir?100-s:s}function X(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&_(t,e)}function Y(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return _(t,e);var r=(f.dir?-1:1)*(t.calcPoint-e.startCalcPoint);Z(0<r,100*r/e.baseSize,e.locations,e.handleNumbers)}function _(t,e){e.handle&&(gt(e.handle,f.cssClasses.active),b-=1),e.listeners.forEach(function(t){w.removeEventListener(t[0],t[1])}),0===b&&(gt(y,f.cssClasses.drag),et(),t.cursor&&(C.style.cursor="",C.removeEventListener("selectstart",pt))),e.handleNumbers.forEach(function(t){J("change",t),J("set",t),J("end",t)})}function I(t,e){if(e.handleNumbers.some(z))return!1;var r;1===e.handleNumbers.length&&(r=u[e.handleNumbers[0]].children[0],b+=1,mt(r,f.cssClasses.active));t.stopPropagation();var n=[],i=B(d.move,w,Y,{target:t.target,handle:r,listeners:n,startCalcPoint:t.calcPoint,baseSize:R(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:g.slice()}),o=B(d.end,w,_,{target:t.target,handle:r,listeners:n,doNotReject:!0,handleNumbers:e.handleNumbers}),a=B("mouseout",w,X,{target:t.target,handle:r,listeners:n,doNotReject:!0,handleNumbers:e.handleNumbers});n.push.apply(n,i.concat(o,a)),t.cursor&&(C.style.cursor=getComputedStyle(t.target).cursor,1<u.length&&mt(y,f.cssClasses.drag),C.addEventListener("selectstart",pt,!1)),e.handleNumbers.forEach(function(t){J("start",t)})}function n(t){t.stopPropagation();var n,i,o,e=q(t.calcPoint),r=(n=e,o=!(i=100),u.forEach(function(t,e){if(!z(e)){var r=Math.abs(g[e]-n);(r<i||100===r&&100===i)&&(o=e,i=r)}}),o);if(!1===r)return!1;f.events.snap||ft(y,f.cssClasses.tap,f.animationDuration),rt(r,e,!0,!0),et(),J("slide",r,!0),J("update",r,!0),J("change",r,!0),J("set",r,!0),f.events.snap&&I(t,{handleNumbers:[r]})}function W(t){var e=q(t.calcPoint),r=E.getStep(e),n=E.fromStepping(r);Object.keys(S).forEach(function(t){"hover"===t.split(".")[0]&&S[t].forEach(function(t){t.call(s,n)})})}function $(t,e){S[t]=S[t]||[],S[t].push(e),"update"===t.split(".")[0]&&u.forEach(function(t,e){J("update",e)})}function G(t){var n=t&&t.split(".")[0],i=n&&t.substring(n.length);Object.keys(S).forEach(function(t){var e=t.split(".")[0],r=t.substring(e.length);n&&n!==e||i&&i!==r||delete S[t]})}function J(r,n,i){Object.keys(S).forEach(function(t){var e=t.split(".")[0];r===e&&S[t].forEach(function(t){t.call(s,m.map(f.format.to),n,m.slice(),i||!1,g.slice())})})}function K(t,e,r,n,i,o){return 1<u.length&&!f.events.unconstrained&&(n&&0<e&&(r=Math.max(r,t[e-1]+f.margin)),i&&e<u.length-1&&(r=Math.min(r,t[e+1]-f.margin))),1<u.length&&f.limit&&(n&&0<e&&(r=Math.min(r,t[e-1]+f.limit)),i&&e<u.length-1&&(r=Math.max(r,t[e+1]-f.limit))),f.padding&&(0===e&&(r=Math.max(r,f.padding[0])),e===u.length-1&&(r=Math.min(r,100-f.padding[1]))),!((r=dt(r=E.getStep(r)))===t[e]&&!o)&&r}function Q(t,e){var r=f.ort;return(r?e:t)+", "+(r?t:e)}function Z(t,n,r,e){var i=r.slice(),o=[!t,t],a=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){var r=K(i,t,i[t]+n,o[e],a[e],!1);!1===r?n=0:(n=r-i[t],i[t]=r)}):o=a=[!0];var s=!1;e.forEach(function(t,e){s=rt(t,r[t]+n,o[e],a[e])||s}),s&&e.forEach(function(t){J("update",t),J("slide",t)})}function tt(t,e){return f.dir?100-t-e:t}function et(){v.forEach(function(t){var e=50<g[t]?-1:1,r=3+(u.length+e*t);u[t].style.zIndex=r})}function rt(t,e,r,n){return!1!==(e=K(g,t,e,r,n,!1))&&(function(t,e){g[t]=e,m[t]=E.fromStepping(e);var r="translate("+Q(tt(e,0)-A+"%","0")+")";u[t].style[f.transformRule]=r,nt(t),nt(t+1)}(t,e),!0)}function nt(t){if(a[t]){var e=0,r=100;0!==t&&(e=g[t-1]),t!==a.length-1&&(r=g[t]);var n=r-e,i="translate("+Q(tt(e,n)+"%","0")+")",o="scale("+Q(n/100,"1")+")";a[t].style[f.transformRule]=i+" "+o}}function it(t,e){return null===t||!1===t||void 0===t?g[e]:("number"==typeof t&&(t=String(t)),t=f.format.from(t),!1===(t=E.toStepping(t))||isNaN(t)?g[e]:t)}function ot(t,e){var r=ht(t),n=void 0===g[0];e=void 0===e||!!e,f.animate&&!n&&ft(y,f.cssClasses.tap,f.animationDuration),v.forEach(function(t){rt(t,it(r[t],t),!0,!1)}),v.forEach(function(t){rt(t,g[t],!0,!0)}),et(),v.forEach(function(t){J("update",t),null!==r[t]&&e&&J("set",t)})}function at(t,e,r){if(!(0<=(t=Number(t))&&t<v.length))throw new Error("noUiSlider ("+ut+"): invalid handle number, got: "+t);rt(t,it(e,t),!0,!0),J("update",t),r&&J("set",t)}function st(){var t=m.map(f.format.to);return 1===t.length?t[0]:t}function lt(t){var e=g[t],r=E.getNearbySteps(e),n=m[t],i=r.thisStep.step,o=null;if(f.snap)return[n-r.stepBefore.startValue||null,r.stepAfter.startValue-n||null];!1!==i&&n+i>r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),o=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(o=null);var a=E.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,i]}return mt(e=y,f.cssClasses.target),0===f.dir?mt(e,f.cssClasses.ltr):mt(e,f.cssClasses.rtl),0===f.ort?mt(e,f.cssClasses.horizontal):mt(e,f.cssClasses.vertical),l=V(e,f.cssClasses.base),function(t,e){var r=V(e,f.cssClasses.connects);u=[],(a=[]).push(O(r,t[0]));for(var n=0;n<f.handles;n++)u.push(M(e,n)),v[n]=n,a.push(O(r,t[n+1]))}(f.connect,l),(p=f.events).fixed||u.forEach(function(t,e){B(d.start,t.children[0],I,{handleNumbers:[e]})}),p.tap&&B(d.start,l,n,{}),p.hover&&B(d.move,l,W,{hover:!0}),p.drag&&a.forEach(function(t,e){if(!1!==t&&0!==e&&e!==a.length-1){var r=u[e-1],n=u[e],i=[t];mt(t,f.cssClasses.draggable),p.fixed&&(i.push(r.children[0]),i.push(n.children[0])),i.forEach(function(t){B(d.start,t,I,{handles:[r,n],handleNumbers:[e-1,e]})})}}),ot(f.start),f.pips&&T(f.pips),f.tooltips&&H(),$("update",function(t,e,a,r,s){v.forEach(function(t){var e=u[t],r=K(g,t,0,!0,!0,!0),n=K(g,t,100,!0,!0,!0),i=s[t],o=f.ariaFormat.to(a[t]);r=E.fromStepping(r).toFixed(1),n=E.fromStepping(n).toFixed(1),i=E.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",o)})}),s={destroy:function(){for(var t in f.cssClasses)f.cssClasses.hasOwnProperty(t)&&gt(y,f.cssClasses[t]);for(;y.firstChild;)y.removeChild(y.firstChild);delete y.noUiSlider},steps:function(){return v.map(lt)},on:$,off:G,get:st,set:ot,setHandle:at,reset:function(t){ot(f.start,t)},__moveHandles:function(t,e,r){Z(t,e,g,r)},options:o,updateOptions:function(e,t){var r=st(),n=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];n.forEach(function(t){void 0!==e[t]&&(o[t]=e[t])});var i=bt(o);n.forEach(function(t){void 0!==e[t]&&(f[t]=i[t])}),E=i.spectrum,f.margin=i.margin,f.limit=i.limit,f.padding=i.padding,f.pips?T(f.pips):D(),f.tooltips?H():j(),g=[],ot(e.start||r,t)},target:y,removePips:D,removeTooltips:j,pips:T}}return{__spectrum:l,version:ut,create:function(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider ("+ut+"): create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider ("+ut+"): Slider was already initialized.");var r=z(t,bt(e),e);return t.noUiSlider=r}}});
sources/imiger-core/src/main/webapp/js/components/slider/wNumb.js
1
(function (factory) {
2

  
3
    if ( typeof define === 'function' && define.amd ) {
4

  
5
        // AMD. Register as an anonymous module.
6
        define([], factory);
7

  
8
    } else if ( typeof exports === 'object' ) {
9

  
10
        // Node/CommonJS
11
        module.exports = factory();
12

  
13
    } else {
14

  
15
        // Browser globals
16
        window.wNumb = factory();
17
    }
18

  
19
}(function(){
20

  
21
	'use strict';
22

  
23
var FormatOptions = [
24
	'decimals',
25
	'thousand',
26
	'mark',
27
	'prefix',
28
	'suffix',
29
	'encoder',
30
	'decoder',
31
	'negativeBefore',
32
	'negative',
33
	'edit',
34
	'undo'
35
];
36

  
37
// General
38

  
39
	// Reverse a string
40
	function strReverse ( a ) {
41
		return a.split('').reverse().join('');
42
	}
43

  
44
	// Check if a string starts with a specified prefix.
45
	function strStartsWith ( input, match ) {
46
		return input.substring(0, match.length) === match;
47
	}
48

  
49
	// Check is a string ends in a specified suffix.
50
	function strEndsWith ( input, match ) {
51
		return input.slice(-1 * match.length) === match;
52
	}
53

  
54
	// Throw an error if formatting options are incompatible.
55
	function throwEqualError( F, a, b ) {
56
		if ( (F[a] || F[b]) && (F[a] === F[b]) ) {
57
			throw new Error(a);
58
		}
59
	}
60

  
61
	// Check if a number is finite and not NaN
62
	function isValidNumber ( input ) {
63
		return typeof input === 'number' && isFinite( input );
64
	}
65

  
66
	// Provide rounding-accurate toFixed method.
67
	// Borrowed: http://stackoverflow.com/a/21323330/775265
68
	function toFixed ( value, exp ) {
69
		value = value.toString().split('e');
70
		value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));
71
		value = value.toString().split('e');
72
		return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);
73
	}
74

  
75

  
76
// Formatting
77

  
78
	// Accept a number as input, output formatted string.
79
	function formatTo ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
80

  
81
		var originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';
82

  
83
		// Apply user encoder to the input.
84
		// Expected outcome: number.
85
		if ( encoder ) {
86
			input = encoder(input);
87
		}
88

  
89
		// Stop if no valid number was provided, the number is infinite or NaN.
90
		if ( !isValidNumber(input) ) {
91
			return false;
92
		}
93

  
94
		// Rounding away decimals might cause a value of -0
95
		// when using very small ranges. Remove those cases.
96
		if ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {
97
			input = 0;
98
		}
99

  
100
		// Formatting is done on absolute numbers,
101
		// decorated by an optional negative symbol.
102
		if ( input < 0 ) {
103
			inputIsNegative = true;
104
			input = Math.abs(input);
105
		}
106

  
107
		// Reduce the number of decimals to the specified option.
108
		if ( decimals !== false ) {
109
			input = toFixed( input, decimals );
110
		}
111

  
112
		// Transform the number into a string, so it can be split.
113
		input = input.toString();
114

  
115
		// Break the number on the decimal separator.
116
		if ( input.indexOf('.') !== -1 ) {
117
			inputPieces = input.split('.');
118

  
119
			inputBase = inputPieces[0];
120

  
121
			if ( mark ) {
122
				inputDecimals = mark + inputPieces[1];
123
			}
124

  
125
		} else {
126

  
127
		// If it isn't split, the entire number will do.
128
			inputBase = input;
129
		}
130

  
131
		// Group numbers in sets of three.
132
		if ( thousand ) {
133
			inputBase = strReverse(inputBase).match(/.{1,3}/g);
134
			inputBase = strReverse(inputBase.join( strReverse( thousand ) ));
135
		}
136

  
137
		// If the number is negative, prefix with negation symbol.
138
		if ( inputIsNegative && negativeBefore ) {
139
			output += negativeBefore;
140
		}
141

  
142
		// Prefix the number
143
		if ( prefix ) {
144
			output += prefix;
145
		}
146

  
147
		// Normal negative option comes after the prefix. Defaults to '-'.
148
		if ( inputIsNegative && negative ) {
149
			output += negative;
150
		}
151

  
152
		// Append the actual number.
153
		output += inputBase;
154
		output += inputDecimals;
155

  
156
		// Apply the suffix.
157
		if ( suffix ) {
158
			output += suffix;
159
		}
160

  
161
		// Run the output through a user-specified post-formatter.
162
		if ( edit ) {
163
			output = edit ( output, originalInput );
164
		}
165

  
166
		// All done.
167
		return output;
168
	}
169

  
170
	// Accept a sting as input, output decoded number.
171
	function formatFrom ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
172

  
173
		var originalInput = input, inputIsNegative, output = '';
174

  
175
		// User defined pre-decoder. Result must be a non empty string.
176
		if ( undo ) {
177
			input = undo(input);
178
		}
179

  
180
		// Test the input. Can't be empty.
181
		if ( !input || typeof input !== 'string' ) {
182
			return false;
183
		}
184

  
185
		// If the string starts with the negativeBefore value: remove it.
186
		// Remember is was there, the number is negative.
187
		if ( negativeBefore && strStartsWith(input, negativeBefore) ) {
188
			input = input.replace(negativeBefore, '');
189
			inputIsNegative = true;
190
		}
191

  
192
		// Repeat the same procedure for the prefix.
193
		if ( prefix && strStartsWith(input, prefix) ) {
194
			input = input.replace(prefix, '');
195
		}
196

  
197
		// And again for negative.
198
		if ( negative && strStartsWith(input, negative) ) {
199
			input = input.replace(negative, '');
200
			inputIsNegative = true;
201
		}
202

  
203
		// Remove the suffix.
204
		// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
205
		if ( suffix && strEndsWith(input, suffix) ) {
206
			input = input.slice(0, -1 * suffix.length);
207
		}
208

  
209
		// Remove the thousand grouping.
210
		if ( thousand ) {
211
			input = input.split(thousand).join('');
212
		}
213

  
214
		// Set the decimal separator back to period.
215
		if ( mark ) {
216
			input = input.replace(mark, '.');
217
		}
218

  
219
		// Prepend the negative symbol.
220
		if ( inputIsNegative ) {
221
			output += '-';
222
		}
223

  
224
		// Add the number
225
		output += input;
226

  
227
		// Trim all non-numeric characters (allow '.' and '-');
228
		output = output.replace(/[^0-9\.\-.]/g, '');
229

  
230
		// The value contains no parse-able number.
231
		if ( output === '' ) {
232
			return false;
233
		}
234

  
235
		// Covert to number.
236
		output = Number(output);
237

  
238
		// Run the user-specified post-decoder.
239
		if ( decoder ) {
240
			output = decoder(output);
241
		}
242

  
243
		// Check is the output is valid, otherwise: return false.
244
		if ( !isValidNumber(output) ) {
245
			return false;
246
		}
247

  
248
		return output;
249
	}
250

  
251

  
252
// Framework
253

  
254
	// Validate formatting options
255
	function validate ( inputOptions ) {
256

  
257
		var i, optionName, optionValue,
258
			filteredOptions = {};
259

  
260
		if ( inputOptions['suffix'] === undefined ) {
261
			inputOptions['suffix'] = inputOptions['postfix'];
262
		}
263

  
264
		for ( i = 0; i < FormatOptions.length; i+=1 ) {
265

  
266
			optionName = FormatOptions[i];
267
			optionValue = inputOptions[optionName];
268

  
269
			if ( optionValue === undefined ) {
270

  
271
				// Only default if negativeBefore isn't set.
272
				if ( optionName === 'negative' && !filteredOptions.negativeBefore ) {
273
					filteredOptions[optionName] = '-';
274
				// Don't set a default for mark when 'thousand' is set.
275
				} else if ( optionName === 'mark' && filteredOptions.thousand !== '.' ) {
276
					filteredOptions[optionName] = '.';
277
				} else {
278
					filteredOptions[optionName] = false;
279
				}
280

  
281
			// Floating points in JS are stable up to 7 decimals.
282
			} else if ( optionName === 'decimals' ) {
283
				if ( optionValue >= 0 && optionValue < 8 ) {
284
					filteredOptions[optionName] = optionValue;
285
				} else {
286
					throw new Error(optionName);
287
				}
288

  
289
			// These options, when provided, must be functions.
290
			} else if ( optionName === 'encoder' || optionName === 'decoder' || optionName === 'edit' || optionName === 'undo' ) {
291
				if ( typeof optionValue === 'function' ) {
292
					filteredOptions[optionName] = optionValue;
293
				} else {
294
					throw new Error(optionName);
295
				}
296

  
297
			// Other options are strings.
298
			} else {
299

  
300
				if ( typeof optionValue === 'string' ) {
301
					filteredOptions[optionName] = optionValue;
302
				} else {
303
					throw new Error(optionName);
304
				}
305
			}
306
		}
307

  
308
		// Some values can't be extracted from a
309
		// string if certain combinations are present.
310
		throwEqualError(filteredOptions, 'mark', 'thousand');
311
		throwEqualError(filteredOptions, 'prefix', 'negative');
312
		throwEqualError(filteredOptions, 'prefix', 'negativeBefore');
313

  
314
		return filteredOptions;
315
	}
316

  
317
	// Pass all options as function arguments
318
	function passAll ( options, method, input ) {
319
		var i, args = [];
320

  
321
		// Add all options in order of FormatOptions
322
		for ( i = 0; i < FormatOptions.length; i+=1 ) {
323
			args.push(options[FormatOptions[i]]);
324
		}
325

  
326
		// Append the input, then call the method, presenting all
327
		// options as arguments.
328
		args.push(input);
329
		return method.apply('', args);
330
	}
331

  
332
	function wNumb ( options ) {
333

  
334
		if ( !(this instanceof wNumb) ) {
335
			return new wNumb ( options );
336
		}
337

  
338
		if ( typeof options !== "object" ) {
339
			return;
340
		}
341

  
342
		options = validate(options);
343

  
344
		// Call 'formatTo' with proper arguments.
345
		this.to = function ( input ) {
346
			return passAll(options, formatTo, input);
347
		};
348

  
349
		// Call 'formatFrom' with proper arguments.
350
		this.from = function ( input ) {
351
			return passAll(options, formatFrom, input);
352
		};
353
	}
354

  
355
	return wNumb;
356

  
357
}));
sources/imiger-core/src/main/webapp/js/timeline/auxiliary/nouislider.min.js
1
/*! nouislider - 13.1.5 - 4/24/2019 */
2
!function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";var ut="13.1.5";function ct(t){t.parentElement.removeChild(t)}function s(t){return null!=t}function pt(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function ft(t,e,r){0<r&&(mt(t,e),setTimeout(function(){gt(t,e)},r))}function dt(t){return Math.max(Math.min(t,100),0)}function ht(t){return Array.isArray(t)?t:[t]}function e(t){var e=(t=String(t)).split(".");return 1<e.length?e[1].length:0}function mt(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function gt(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function vt(t){var e=void 0!==window.pageXOffset,r="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:r?t.documentElement.scrollLeft:t.body.scrollLeft,y:e?window.pageYOffset:r?t.documentElement.scrollTop:t.body.scrollTop}}function c(t,e){return 100/(e-t)}function p(t,e){return 100*e/(t[1]-t[0])}function f(t,e){for(var r=1;t>=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n,i,o=f(r,t),a=t[o-1],s=t[o],l=e[o-1],u=e[o];return l+(i=r,p(n=[a,s],n[0]<0?i+Math.abs(n[0]):i-n[0])/c(l,u))}function n(t,e,r,n){if(100===n)return n;var i,o,a=f(n,t),s=t[a-1],l=t[a];return r?(l-s)/2<n-s?l:s:e[a-1]?t[a-1]+(i=n-t[a-1],o=e[a-1],Math.round(i/o)*o):n}function o(t,e,r){var n;if("number"==typeof e&&(e=[e]),!Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'range' contains invalid value.");if(!i(n="min"===t?0:"max"===t?100:parseFloat(t))||!i(e[0]))throw new Error("noUiSlider ("+ut+"): 'range' value isn't numeric.");r.xPct.push(n),r.xVal.push(e[0]),n?r.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(r.xSteps[0]=e[1]),r.xHighestCompleteStep.push(0)}function a(t,e,r){if(e)if(r.xVal[t]!==r.xVal[t+1]){r.xSteps[t]=p([r.xVal[t],r.xVal[t+1]],e)/c(r.xPct[t],r.xPct[t+1]);var n=(r.xVal[t+1]-r.xVal[t])/r.xNumSteps[t],i=Math.ceil(Number(n.toFixed(3))-1),o=r.xVal[t]+r.xNumSteps[t]*i;r.xHighestCompleteStep[t]=o}else r.xSteps[t]=r.xHighestCompleteStep[t]=r.xVal[t]}function l(t,e,r){var n;this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i=[];for(n in t)t.hasOwnProperty(n)&&i.push([t[n],n]);for(i.length&&"object"==typeof i[0][0]?i.sort(function(t,e){return t[0][0]-e[0][0]}):i.sort(function(t,e){return t[0]-e[0]}),n=0;n<i.length;n++)o(i[n][1],i[n][0],this);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)a(n,this.xNumSteps[n],this)}l.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider ("+ut+"): 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&p(this.xVal,t)},l.prototype.toStepping=function(t){return t=r(this.xVal,this.xPct,t)},l.prototype.fromStepping=function(t){return function(t,e,r){if(100<=r)return t.slice(-1)[0];var n,i=f(r,e),o=t[i-1],a=t[i],s=e[i-1],l=e[i];return n=[o,a],(r-s)*c(s,l)*(n[1]-n[0])/100+n[0]}(this.xVal,this.xPct,t)},l.prototype.getStep=function(t){return t=n(this.xPct,this.xSteps,this.snap,t)},l.prototype.getDefaultStep=function(t,e,r){var n=f(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},l.prototype.getNearbySteps=function(t){var e=f(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},l.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(e);return Math.max.apply(null,t)},l.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var u={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function d(t){if("object"==typeof(e=t)&&"function"==typeof e.to&&"function"==typeof e.from)return!0;var e;throw new Error("noUiSlider ("+ut+"): 'format' requires 'to' and 'from' methods.")}function h(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'step' is not numeric.");t.singleStep=e}function m(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider ("+ut+"): Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider ("+ut+"): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new l(e,t.snap,t.singleStep)}function g(t,e){if(e=ht(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider ("+ut+"): 'start' option is incorrect.");t.handles=e.length,t.start=e}function v(t,e){if("boolean"!=typeof(t.snap=e))throw new Error("noUiSlider ("+ut+"): 'snap' option must be a boolean.")}function b(t,e){if("boolean"!=typeof(t.animate=e))throw new Error("noUiSlider ("+ut+"): 'animate' option must be a boolean.")}function S(t,e){if("number"!=typeof(t.animationDuration=e))throw new Error("noUiSlider ("+ut+"): 'animationDuration' option must be a number.")}function x(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 ("+ut+"): 'connect' option doesn't match handle count.");n=e}t.connect=n}function w(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider ("+ut+"): 'orientation' option is invalid.")}}function y(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider ("+ut+"): 'margin' option is only supported on linear sliders.")}function E(t,e){if(!i(e))throw new Error("noUiSlider ("+ut+"): 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider ("+ut+"): 'limit' option is only supported on linear sliders with 2 or more handles.")}function C(t,e){if(!i(e)&&!Array.isArray(e))throw new Error("noUiSlider ("+ut+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!i(e[0])&&!i(e[1]))throw new Error("noUiSlider ("+ut+"): 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){if(Array.isArray(e)||(e=[e,e]),!(t.padding=[t.spectrum.getMargin(e[0]),t.spectrum.getMargin(e[1])])===t.padding[0]||!1===t.padding[1])throw new Error("noUiSlider ("+ut+"): 'padding' option is only supported on linear sliders.");if(t.padding[0]<0||t.padding[1]<0)throw new Error("noUiSlider ("+ut+"): 'padding' option must be a positive number(s).");if(100<t.padding[0]+t.padding[1])throw new Error("noUiSlider ("+ut+"): 'padding' option must not exceed 100% of the range.")}}function N(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider ("+ut+"): 'direction' option was not recognized.")}}function U(t,e){if("string"!=typeof e)throw new Error("noUiSlider ("+ut+"): 'behaviour' must be a string containing options.");var r=0<=e.indexOf("tap"),n=0<=e.indexOf("drag"),i=0<=e.indexOf("fixed"),o=0<=e.indexOf("snap"),a=0<=e.indexOf("hover"),s=0<=e.indexOf("unconstrained");if(i){if(2!==t.handles)throw new Error("noUiSlider ("+ut+"): 'fixed' behaviour must be used with 2 handles");y(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider ("+ut+"): 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:n,fixed:i,snap:o,hover:a,unconstrained:s}}function k(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var r=0;r<t.handles;r++)t.tooltips.push(!0)}else{if(t.tooltips=ht(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider ("+ut+"): must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider ("+ut+"): 'tooltips' must be passed a formatter or 'false'.")})}}function P(t,e){d(t.ariaFormat=e)}function A(t,e){d(t.format=e)}function V(t,e){if("boolean"!=typeof(t.keyboardSupport=e))throw new Error("noUiSlider ("+ut+"): 'keyboardSupport' option must be a boolean.")}function M(t,e){t.documentElement=e}function O(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider ("+ut+"): 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function L(t,e){if("object"!=typeof e)throw new Error("noUiSlider ("+ut+"): 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix)for(var r in t.cssClasses={},e)e.hasOwnProperty(r)&&(t.cssClasses[r]=t.cssPrefix+e[r]);else t.cssClasses=e}function bt(e){var r={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:u,format:u},n={step:{r:!1,t:h},start:{r:!0,t:g},connect:{r:!0,t:x},direction:{r:!0,t:N},snap:{r:!1,t:v},animate:{r:!1,t:b},animationDuration:{r:!1,t:S},range:{r:!0,t:m},orientation:{r:!1,t:w},margin:{r:!1,t:y},limit:{r:!1,t:E},padding:{r:!1,t:C},behaviour:{r:!0,t:U},ariaFormat:{r:!1,t:P},format:{r:!1,t:A},tooltips:{r:!1,t:k},keyboardSupport:{r:!0,t:V},documentElement:{r:!1,t:M},cssPrefix:{r:!0,t:O},cssClasses:{r:!0,t:L}},i={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",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",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"}};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(n).forEach(function(t){if(!s(e[t])&&void 0===i[t]){if(n[t].r)throw new Error("noUiSlider ("+ut+"): '"+t+"' is required.");return!0}n[t].t(r,s(e[t])?e[t]:i[t])}),r.pips=e.pips;var t=document.createElement("div"),o=void 0!==t.style.msTransform,a=void 0!==t.style.transform;r.transformRule=a?"transform":o?"msTransform":"webkitTransform";return r.style=[["left","top"],["right","bottom"]][r.dir][r.ort],r}function z(t,f,o){var l,u,a,c,i,s,e,p,d=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"},h=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),y=t,E=f.spectrum,m=[],g=[],v=[],b=0,S={},x=t.ownerDocument,w=f.documentElement||x.documentElement,C=x.body,N=-1,U=0,k=1,P=2,A="rtl"===x.dir||1===f.ort?0:100;function V(t,e){var r=x.createElement("div");return e&&mt(r,e),t.appendChild(r),r}function M(t,e){var r=V(t,f.cssClasses.origin),n=V(r,f.cssClasses.handle);return V(n,f.cssClasses.touchArea),n.setAttribute("data-handle",e),f.keyboardSupport&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",function(t){return function(t,e){if(L()||z(e))return!1;var r=["Left","Right"],n=["Down","Up"];f.dir&&!f.ort?r.reverse():f.ort&&!f.dir&&n.reverse();var i=t.key.replace("Arrow",""),o=i===n[0]||i===r[0],a=i===n[1]||i===r[1];if(!o&&!a)return!0;t.preventDefault();var s=o?0:1,l=lt(e)[s];if(null===l)return!1;!1===l&&(l=E.getDefaultStep(g[e],o,10));return l=Math.max(l,1e-7),l*=o?-1:1,at(e,m[e]+l,!0),!1}(t,e)})),n.setAttribute("role","slider"),n.setAttribute("aria-orientation",f.ort?"vertical":"horizontal"),0===e?mt(n,f.cssClasses.handleLower):e===f.handles-1&&mt(n,f.cssClasses.handleUpper),r}function O(t,e){return!!e&&V(t,f.cssClasses.connect)}function r(t,e){return!!f.tooltips[e]&&V(t.firstChild,f.cssClasses.tooltip)}function L(){return y.hasAttribute("disabled")}function z(t){return u[t].hasAttribute("disabled")}function j(){i&&(G("update.tooltips"),i.forEach(function(t){t&&ct(t)}),i=null)}function H(){j(),i=u.map(r),$("update.tooltips",function(t,e,r){if(i[e]){var n=t[e];!0!==f.tooltips[e]&&(n=f.tooltips[e].to(r[e])),i[e].innerHTML=n}})}function F(e,i,o){var a=x.createElement("div"),s=[];s[U]=f.cssClasses.valueNormal,s[k]=f.cssClasses.valueLarge,s[P]=f.cssClasses.valueSub;var l=[];l[U]=f.cssClasses.markerNormal,l[k]=f.cssClasses.markerLarge,l[P]=f.cssClasses.markerSub;var u=[f.cssClasses.valueHorizontal,f.cssClasses.valueVertical],c=[f.cssClasses.markerHorizontal,f.cssClasses.markerVertical];function p(t,e){var r=e===f.cssClasses.value,n=r?s:l;return e+" "+(r?u:c)[f.ort]+" "+n[t]}return mt(a,f.cssClasses.pips),mt(a,0===f.ort?f.cssClasses.pipsHorizontal:f.cssClasses.pipsVertical),Object.keys(e).forEach(function(t){!function(t,e,r){if((r=i?i(e,r):r)!==N){var n=V(a,!1);n.className=p(r,f.cssClasses.marker),n.style[f.style]=t+"%",U<r&&((n=V(a,!1)).className=p(r,f.cssClasses.value),n.setAttribute("data-value",e),n.style[f.style]=t+"%",n.innerHTML=o.to(e))}}(t,e[t][0],e[t][1])}),a}function D(){c&&(ct(c),c=null)}function T(t){D();var m,g,v,b,e,r,S,x,w,n=t.mode,i=t.density||1,o=t.filter||!1,a=function(t,e,r){if("range"===t||"steps"===t)return E.xVal;if("count"===t){if(e<2)throw new Error("noUiSlider ("+ut+"): 'values' (>= 2) required for mode 'count'.");var n=e-1,i=100/n;for(e=[];n--;)e[n]=n*i;e.push(100),t="positions"}return"positions"===t?e.map(function(t){return E.fromStepping(r?E.getStep(t):t)}):"values"===t?r?e.map(function(t){return E.fromStepping(E.getStep(E.toStepping(t)))}):e:void 0}(n,t.values||!1,t.stepped||!1),s=(m=i,g=n,v=a,b={},e=E.xVal[0],r=E.xVal[E.xVal.length-1],x=S=!1,w=0,(v=v.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==e&&(v.unshift(e),S=!0),v[v.length-1]!==r&&(v.push(r),x=!0),v.forEach(function(t,e){var r,n,i,o,a,s,l,u,c,p,f=t,d=v[e+1],h="steps"===g;if(h&&(r=E.xNumSteps[e]),r||(r=d-f),!1!==f&&void 0!==d)for(r=Math.max(r,1e-7),n=f;n<=d;n=(n+r).toFixed(7)/1){for(u=(a=(o=E.toStepping(n))-w)/m,p=a/(c=Math.round(u)),i=1;i<=c;i+=1)b[(s=w+i*p).toFixed(5)]=[E.fromStepping(s),0];l=-1<v.indexOf(n)?k:h?P:U,!e&&S&&(l=0),n===d&&x||(b[o.toFixed(5)]=[n,l]),w=o}}),b),l=t.format||{to:Math.round};return c=y.appendChild(F(s,o,l))}function R(){var t=l.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||l[e]:t.height||l[e]}function B(n,i,o,a){var e=function(t){return!!(t=function(t,e,r){var n,i,o=0===t.type.indexOf("touch"),a=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");0===t.type.indexOf("MSPointer")&&(s=!0);if(o){var l=function(t){return t.target===r||r.contains(t.target)};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(1<u.length)return!1;n=u[0].pageX,i=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;n=c.pageX,i=c.pageY}}e=e||vt(x),(a||s)&&(n=t.clientX+e.x,i=t.clientY+e.y);return t.pageOffset=e,t.points=[n,i],t.cursor=a||s,t}(t,a.pageOffset,a.target||i))&&(!(L()&&!a.doNotReject)&&(e=y,r=f.cssClasses.tap,!((e.classList?e.classList.contains(r):new RegExp("\\b"+r+"\\b").test(e.className))&&!a.doNotReject)&&(!(n===d.start&&void 0!==t.buttons&&1<t.buttons)&&((!a.hover||!t.buttons)&&(h||t.preventDefault(),t.calcPoint=t.points[f.ort],void o(t,a))))));var e,r},r=[];return n.split(" ").forEach(function(t){i.addEventListener(t,e,!!h&&{passive:!0}),r.push([t,e])}),r}function q(t){var e,r,n,i,o,a,s=100*(t-(e=l,r=f.ort,n=e.getBoundingClientRect(),i=e.ownerDocument,o=i.documentElement,a=vt(i),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(a.x=0),r?n.top+a.y-o.clientTop:n.left+a.x-o.clientLeft))/R();return s=dt(s),f.dir?100-s:s}function X(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&_(t,e)}function Y(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return _(t,e);var r=(f.dir?-1:1)*(t.calcPoint-e.startCalcPoint);Z(0<r,100*r/e.baseSize,e.locations,e.handleNumbers)}function _(t,e){e.handle&&(gt(e.handle,f.cssClasses.active),b-=1),e.listeners.forEach(function(t){w.removeEventListener(t[0],t[1])}),0===b&&(gt(y,f.cssClasses.drag),et(),t.cursor&&(C.style.cursor="",C.removeEventListener("selectstart",pt))),e.handleNumbers.forEach(function(t){J("change",t),J("set",t),J("end",t)})}function I(t,e){if(e.handleNumbers.some(z))return!1;var r;1===e.handleNumbers.length&&(r=u[e.handleNumbers[0]].children[0],b+=1,mt(r,f.cssClasses.active));t.stopPropagation();var n=[],i=B(d.move,w,Y,{target:t.target,handle:r,listeners:n,startCalcPoint:t.calcPoint,baseSize:R(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:g.slice()}),o=B(d.end,w,_,{target:t.target,handle:r,listeners:n,doNotReject:!0,handleNumbers:e.handleNumbers}),a=B("mouseout",w,X,{target:t.target,handle:r,listeners:n,doNotReject:!0,handleNumbers:e.handleNumbers});n.push.apply(n,i.concat(o,a)),t.cursor&&(C.style.cursor=getComputedStyle(t.target).cursor,1<u.length&&mt(y,f.cssClasses.drag),C.addEventListener("selectstart",pt,!1)),e.handleNumbers.forEach(function(t){J("start",t)})}function n(t){t.stopPropagation();var n,i,o,e=q(t.calcPoint),r=(n=e,o=!(i=100),u.forEach(function(t,e){if(!z(e)){var r=Math.abs(g[e]-n);(r<i||100===r&&100===i)&&(o=e,i=r)}}),o);if(!1===r)return!1;f.events.snap||ft(y,f.cssClasses.tap,f.animationDuration),rt(r,e,!0,!0),et(),J("slide",r,!0),J("update",r,!0),J("change",r,!0),J("set",r,!0),f.events.snap&&I(t,{handleNumbers:[r]})}function W(t){var e=q(t.calcPoint),r=E.getStep(e),n=E.fromStepping(r);Object.keys(S).forEach(function(t){"hover"===t.split(".")[0]&&S[t].forEach(function(t){t.call(s,n)})})}function $(t,e){S[t]=S[t]||[],S[t].push(e),"update"===t.split(".")[0]&&u.forEach(function(t,e){J("update",e)})}function G(t){var n=t&&t.split(".")[0],i=n&&t.substring(n.length);Object.keys(S).forEach(function(t){var e=t.split(".")[0],r=t.substring(e.length);n&&n!==e||i&&i!==r||delete S[t]})}function J(r,n,i){Object.keys(S).forEach(function(t){var e=t.split(".")[0];r===e&&S[t].forEach(function(t){t.call(s,m.map(f.format.to),n,m.slice(),i||!1,g.slice())})})}function K(t,e,r,n,i,o){return 1<u.length&&!f.events.unconstrained&&(n&&0<e&&(r=Math.max(r,t[e-1]+f.margin)),i&&e<u.length-1&&(r=Math.min(r,t[e+1]-f.margin))),1<u.length&&f.limit&&(n&&0<e&&(r=Math.min(r,t[e-1]+f.limit)),i&&e<u.length-1&&(r=Math.max(r,t[e+1]-f.limit))),f.padding&&(0===e&&(r=Math.max(r,f.padding[0])),e===u.length-1&&(r=Math.min(r,100-f.padding[1]))),!((r=dt(r=E.getStep(r)))===t[e]&&!o)&&r}function Q(t,e){var r=f.ort;return(r?e:t)+", "+(r?t:e)}function Z(t,n,r,e){var i=r.slice(),o=[!t,t],a=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){var r=K(i,t,i[t]+n,o[e],a[e],!1);!1===r?n=0:(n=r-i[t],i[t]=r)}):o=a=[!0];var s=!1;e.forEach(function(t,e){s=rt(t,r[t]+n,o[e],a[e])||s}),s&&e.forEach(function(t){J("update",t),J("slide",t)})}function tt(t,e){return f.dir?100-t-e:t}function et(){v.forEach(function(t){var e=50<g[t]?-1:1,r=3+(u.length+e*t);u[t].style.zIndex=r})}function rt(t,e,r,n){return!1!==(e=K(g,t,e,r,n,!1))&&(function(t,e){g[t]=e,m[t]=E.fromStepping(e);var r="translate("+Q(tt(e,0)-A+"%","0")+")";u[t].style[f.transformRule]=r,nt(t),nt(t+1)}(t,e),!0)}function nt(t){if(a[t]){var e=0,r=100;0!==t&&(e=g[t-1]),t!==a.length-1&&(r=g[t]);var n=r-e,i="translate("+Q(tt(e,n)+"%","0")+")",o="scale("+Q(n/100,"1")+")";a[t].style[f.transformRule]=i+" "+o}}function it(t,e){return null===t||!1===t||void 0===t?g[e]:("number"==typeof t&&(t=String(t)),t=f.format.from(t),!1===(t=E.toStepping(t))||isNaN(t)?g[e]:t)}function ot(t,e){var r=ht(t),n=void 0===g[0];e=void 0===e||!!e,f.animate&&!n&&ft(y,f.cssClasses.tap,f.animationDuration),v.forEach(function(t){rt(t,it(r[t],t),!0,!1)}),v.forEach(function(t){rt(t,g[t],!0,!0)}),et(),v.forEach(function(t){J("update",t),null!==r[t]&&e&&J("set",t)})}function at(t,e,r){if(!(0<=(t=Number(t))&&t<v.length))throw new Error("noUiSlider ("+ut+"): invalid handle number, got: "+t);rt(t,it(e,t),!0,!0),J("update",t),r&&J("set",t)}function st(){var t=m.map(f.format.to);return 1===t.length?t[0]:t}function lt(t){var e=g[t],r=E.getNearbySteps(e),n=m[t],i=r.thisStep.step,o=null;if(f.snap)return[n-r.stepBefore.startValue||null,r.stepAfter.startValue-n||null];!1!==i&&n+i>r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),o=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(o=null);var a=E.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,i]}return mt(e=y,f.cssClasses.target),0===f.dir?mt(e,f.cssClasses.ltr):mt(e,f.cssClasses.rtl),0===f.ort?mt(e,f.cssClasses.horizontal):mt(e,f.cssClasses.vertical),l=V(e,f.cssClasses.base),function(t,e){var r=V(e,f.cssClasses.connects);u=[],(a=[]).push(O(r,t[0]));for(var n=0;n<f.handles;n++)u.push(M(e,n)),v[n]=n,a.push(O(r,t[n+1]))}(f.connect,l),(p=f.events).fixed||u.forEach(function(t,e){B(d.start,t.children[0],I,{handleNumbers:[e]})}),p.tap&&B(d.start,l,n,{}),p.hover&&B(d.move,l,W,{hover:!0}),p.drag&&a.forEach(function(t,e){if(!1!==t&&0!==e&&e!==a.length-1){var r=u[e-1],n=u[e],i=[t];mt(t,f.cssClasses.draggable),p.fixed&&(i.push(r.children[0]),i.push(n.children[0])),i.forEach(function(t){B(d.start,t,I,{handles:[r,n],handleNumbers:[e-1,e]})})}}),ot(f.start),f.pips&&T(f.pips),f.tooltips&&H(),$("update",function(t,e,a,r,s){v.forEach(function(t){var e=u[t],r=K(g,t,0,!0,!0,!0),n=K(g,t,100,!0,!0,!0),i=s[t],o=f.ariaFormat.to(a[t]);r=E.fromStepping(r).toFixed(1),n=E.fromStepping(n).toFixed(1),i=E.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",o)})}),s={destroy:function(){for(var t in f.cssClasses)f.cssClasses.hasOwnProperty(t)&&gt(y,f.cssClasses[t]);for(;y.firstChild;)y.removeChild(y.firstChild);delete y.noUiSlider},steps:function(){return v.map(lt)},on:$,off:G,get:st,set:ot,setHandle:at,reset:function(t){ot(f.start,t)},__moveHandles:function(t,e,r){Z(t,e,g,r)},options:o,updateOptions:function(e,t){var r=st(),n=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];n.forEach(function(t){void 0!==e[t]&&(o[t]=e[t])});var i=bt(o);n.forEach(function(t){void 0!==e[t]&&(f[t]=i[t])}),E=i.spectrum,f.margin=i.margin,f.limit=i.limit,f.padding=i.padding,f.pips?T(f.pips):D(),f.tooltips?H():j(),g=[],ot(e.start||r,t)},target:y,removePips:D,removeTooltips:j,pips:T}}return{__spectrum:l,version:ut,create:function(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider ("+ut+"): create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider ("+ut+"): Slider was already initialized.");var r=z(t,bt(e),e);return t.noUiSlider=r}}});
sources/imiger-core/src/main/webapp/js/timeline/auxiliary/wNumb.js
1
(function (factory) {
2

  
3
    if ( typeof define === 'function' && define.amd ) {
4

  
5
        // AMD. Register as an anonymous module.
6
        define([], factory);
7

  
8
    } else if ( typeof exports === 'object' ) {
9

  
10
        // Node/CommonJS
11
        module.exports = factory();
12

  
13
    } else {
14

  
15
        // Browser globals
16
        window.wNumb = factory();
17
    }
18

  
19
}(function(){
20

  
21
	'use strict';
22

  
23
var FormatOptions = [
24
	'decimals',
25
	'thousand',
26
	'mark',
27
	'prefix',
28
	'suffix',
29
	'encoder',
30
	'decoder',
31
	'negativeBefore',
32
	'negative',
33
	'edit',
34
	'undo'
35
];
36

  
37
// General
38

  
39
	// Reverse a string
40
	function strReverse ( a ) {
41
		return a.split('').reverse().join('');
42
	}
43

  
44
	// Check if a string starts with a specified prefix.
45
	function strStartsWith ( input, match ) {
46
		return input.substring(0, match.length) === match;
47
	}
48

  
49
	// Check is a string ends in a specified suffix.
50
	function strEndsWith ( input, match ) {
51
		return input.slice(-1 * match.length) === match;
52
	}
53

  
54
	// Throw an error if formatting options are incompatible.
55
	function throwEqualError( F, a, b ) {
56
		if ( (F[a] || F[b]) && (F[a] === F[b]) ) {
57
			throw new Error(a);
58
		}
59
	}
60

  
61
	// Check if a number is finite and not NaN
62
	function isValidNumber ( input ) {
63
		return typeof input === 'number' && isFinite( input );
64
	}
65

  
66
	// Provide rounding-accurate toFixed method.
67
	// Borrowed: http://stackoverflow.com/a/21323330/775265
68
	function toFixed ( value, exp ) {
69
		value = value.toString().split('e');
70
		value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));
71
		value = value.toString().split('e');
72
		return (+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))).toFixed(exp);
73
	}
74

  
75

  
76
// Formatting
77

  
78
	// Accept a number as input, output formatted string.
79
	function formatTo ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
80

  
81
		var originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';
82

  
83
		// Apply user encoder to the input.
84
		// Expected outcome: number.
85
		if ( encoder ) {
86
			input = encoder(input);
87
		}
88

  
89
		// Stop if no valid number was provided, the number is infinite or NaN.
90
		if ( !isValidNumber(input) ) {
91
			return false;
92
		}
93

  
94
		// Rounding away decimals might cause a value of -0
95
		// when using very small ranges. Remove those cases.
96
		if ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {
97
			input = 0;
98
		}
99

  
100
		// Formatting is done on absolute numbers,
101
		// decorated by an optional negative symbol.
102
		if ( input < 0 ) {
103
			inputIsNegative = true;
104
			input = Math.abs(input);
105
		}
106

  
107
		// Reduce the number of decimals to the specified option.
108
		if ( decimals !== false ) {
109
			input = toFixed( input, decimals );
110
		}
111

  
112
		// Transform the number into a string, so it can be split.
113
		input = input.toString();
114

  
115
		// Break the number on the decimal separator.
116
		if ( input.indexOf('.') !== -1 ) {
117
			inputPieces = input.split('.');
118

  
119
			inputBase = inputPieces[0];
120

  
121
			if ( mark ) {
122
				inputDecimals = mark + inputPieces[1];
123
			}
124

  
125
		} else {
126

  
127
		// If it isn't split, the entire number will do.
128
			inputBase = input;
129
		}
130

  
131
		// Group numbers in sets of three.
132
		if ( thousand ) {
133
			inputBase = strReverse(inputBase).match(/.{1,3}/g);
134
			inputBase = strReverse(inputBase.join( strReverse( thousand ) ));
135
		}
136

  
137
		// If the number is negative, prefix with negation symbol.
138
		if ( inputIsNegative && negativeBefore ) {
139
			output += negativeBefore;
140
		}
141

  
142
		// Prefix the number
143
		if ( prefix ) {
144
			output += prefix;
145
		}
146

  
147
		// Normal negative option comes after the prefix. Defaults to '-'.
148
		if ( inputIsNegative && negative ) {
149
			output += negative;
150
		}
151

  
152
		// Append the actual number.
153
		output += inputBase;
154
		output += inputDecimals;
155

  
156
		// Apply the suffix.
157
		if ( suffix ) {
158
			output += suffix;
159
		}
160

  
161
		// Run the output through a user-specified post-formatter.
162
		if ( edit ) {
163
			output = edit ( output, originalInput );
164
		}
165

  
166
		// All done.
167
		return output;
168
	}
169

  
170
	// Accept a sting as input, output decoded number.
171
	function formatFrom ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
172

  
173
		var originalInput = input, inputIsNegative, output = '';
174

  
175
		// User defined pre-decoder. Result must be a non empty string.
176
		if ( undo ) {
177
			input = undo(input);
178
		}
179

  
180
		// Test the input. Can't be empty.
181
		if ( !input || typeof input !== 'string' ) {
182
			return false;
183
		}
184

  
185
		// If the string starts with the negativeBefore value: remove it.
186
		// Remember is was there, the number is negative.
187
		if ( negativeBefore && strStartsWith(input, negativeBefore) ) {
188
			input = input.replace(negativeBefore, '');
189
			inputIsNegative = true;
190
		}
191

  
192
		// Repeat the same procedure for the prefix.
193
		if ( prefix && strStartsWith(input, prefix) ) {
194
			input = input.replace(prefix, '');
195
		}
196

  
197
		// And again for negative.
198
		if ( negative && strStartsWith(input, negative) ) {
199
			input = input.replace(negative, '');
200
			inputIsNegative = true;
201
		}
202

  
203
		// Remove the suffix.
204
		// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
205
		if ( suffix && strEndsWith(input, suffix) ) {
206
			input = input.slice(0, -1 * suffix.length);
207
		}
208

  
209
		// Remove the thousand grouping.
210
		if ( thousand ) {
211
			input = input.split(thousand).join('');
212
		}
213

  
214
		// Set the decimal separator back to period.
215
		if ( mark ) {
216
			input = input.replace(mark, '.');
217
		}
218

  
219
		// Prepend the negative symbol.
220
		if ( inputIsNegative ) {
221
			output += '-';
222
		}
223

  
224
		// Add the number
225
		output += input;
226

  
227
		// Trim all non-numeric characters (allow '.' and '-');
228
		output = output.replace(/[^0-9\.\-.]/g, '');
229

  
230
		// The value contains no parse-able number.
231
		if ( output === '' ) {
232
			return false;
233
		}
234

  
235
		// Covert to number.
236
		output = Number(output);
237

  
238
		// Run the user-specified post-decoder.
239
		if ( decoder ) {
240
			output = decoder(output);
241
		}
242

  
243
		// Check is the output is valid, otherwise: return false.
244
		if ( !isValidNumber(output) ) {
245
			return false;
246
		}
247

  
248
		return output;
249
	}
250

  
251

  
252
// Framework
253

  
254
	// Validate formatting options
255
	function validate ( inputOptions ) {
256

  
257
		var i, optionName, optionValue,
258
			filteredOptions = {};
259

  
260
		if ( inputOptions['suffix'] === undefined ) {
261
			inputOptions['suffix'] = inputOptions['postfix'];
262
		}
263

  
264
		for ( i = 0; i < FormatOptions.length; i+=1 ) {
265

  
266
			optionName = FormatOptions[i];
267
			optionValue = inputOptions[optionName];
268

  
269
			if ( optionValue === undefined ) {
270

  
271
				// Only default if negativeBefore isn't set.
272
				if ( optionName === 'negative' && !filteredOptions.negativeBefore ) {
273
					filteredOptions[optionName] = '-';
274
				// Don't set a default for mark when 'thousand' is set.
275
				} else if ( optionName === 'mark' && filteredOptions.thousand !== '.' ) {
276
					filteredOptions[optionName] = '.';
277
				} else {
278
					filteredOptions[optionName] = false;
279
				}
280

  
281
			// Floating points in JS are stable up to 7 decimals.
282
			} else if ( optionName === 'decimals' ) {
283
				if ( optionValue >= 0 && optionValue < 8 ) {
284
					filteredOptions[optionName] = optionValue;
285
				} else {
286
					throw new Error(optionName);
287
				}
288

  
289
			// These options, when provided, must be functions.
290
			} else if ( optionName === 'encoder' || optionName === 'decoder' || optionName === 'edit' || optionName === 'undo' ) {
291
				if ( typeof optionValue === 'function' ) {
292
					filteredOptions[optionName] = optionValue;
293
				} else {
294
					throw new Error(optionName);
295
				}
296

  
297
			// Other options are strings.
298
			} else {
299

  
300
				if ( typeof optionValue === 'string' ) {
301
					filteredOptions[optionName] = optionValue;
302
				} else {
303
					throw new Error(optionName);
304
				}
305
			}
306
		}
307

  
308
		// Some values can't be extracted from a
309
		// string if certain combinations are present.
310
		throwEqualError(filteredOptions, 'mark', 'thousand');
311
		throwEqualError(filteredOptions, 'prefix', 'negative');
312
		throwEqualError(filteredOptions, 'prefix', 'negativeBefore');
313

  
314
		return filteredOptions;
315
	}
316

  
317
	// Pass all options as function arguments
318
	function passAll ( options, method, input ) {
319
		var i, args = [];
320

  
321
		// Add all options in order of FormatOptions
322
		for ( i = 0; i < FormatOptions.length; i+=1 ) {
323
			args.push(options[FormatOptions[i]]);
324
		}
325

  
326
		// Append the input, then call the method, presenting all
327
		// options as arguments.
328
		args.push(input);
329
		return method.apply('', args);
330
	}
331

  
332
	function wNumb ( options ) {
333

  
334
		if ( !(this instanceof wNumb) ) {
335
			return new wNumb ( options );
336
		}
337

  
338
		if ( typeof options !== "object" ) {
339
			return;
340
		}
341

  
342
		options = validate(options);
343

  
344
		// Call 'formatTo' with proper arguments.
345
		this.to = function ( input ) {
346
			return passAll(options, formatTo, input);
347
		};
348

  
349
		// Call 'formatFrom' with proper arguments.
350
		this.from = function ( input ) {
351
			return passAll(options, formatFrom, input);
352
		};
353
	}
354

  
355
	return wNumb;
356

  
357
}));
sources/imiger-core/src/main/webapp/js/timeline/main.js
7 7
        moment: 'lib/moment/moment.min',
8 8
        "bootstrap-dialog" : 'auxiliary/bootstrap-dialog/bootstrap-dialog.min',
9 9
        momentjs : 'moment.extension',
10
        bootstrap : 'auxiliary/bootstrap/bootstrap.min'
10
        bootstrap : 'auxiliary/bootstrap/bootstrap.min',
11
        slider : 'auxiliary/nouislider.min',
12
        wNumb : 'auxiliary/wNumb'
11 13
    },
12 14
    shim: {
13 15
        "jqueryui" : {
......
26 28

  
27 29
requirejs([
28 30
    'jquery',
31
    'slider',
32
    'wNumb',
29 33
    'auxiliary/App',
30 34
    'cz/kajda/timeline/Timeline',
31 35
    '../../data/BandsDistribution'
......
37 41
 * To decide which data source should be used,
38 42
 * (un)comment one of the last lines in this function.
39 43
 */
40
function($, App, Timeline, BandsDistribution) {
44
function($, noUiSlider, wNumb, App, Timeline, BandsDistribution) {
45

  
46
    window.wNumb = wNumb;
47
    window.noUiSlider = noUiSlider;
41 48
    // create new instance of app support
49
    if($('.timeline-container').length) {
42 50
    var app = new App();
43 51
    // FIALA 
44 52
    var bandsDistribution = new BandsDistribution();
......
142 150
    
143 151
    // creates source producing random data
144 152
    //app.createRandSource({ /* here comes config that changes distribution parameters (see RandSource~_DEFAULTS) */ });
153
    }
145 154
});
sources/imiger-core/src/main/webapp/showGraph.jsp
110 110

  
111 111
		<script src="js/constants.js"></script>
112 112
		<link href="css/customStyles.css" type="text/css" rel="stylesheet" />
113

  
114
		<c:if test = "${sessionScope.showTimeline eq true}">
115
			<link href="css/cz.kajda.timeline.css" type="text/css" rel="stylesheet" />
116
			<link href="css/styles.css" type="text/css" rel="stylesheet" />
117
			<script src="js/timeline/oop.js"></script>
118
			<script data-main="js/timeline/main" src="js/timeline/lib/require/require.js"></script>
119
		</c:if>
120
		<!--<script src="js/components/slider/nouislider.min.js"></script>-->
121
		<script src="js/components/slider/wNumb.js"></script>
113
        <link href="css/cz.kajda.timeline.css" type="text/css" rel="stylesheet" />
114
        <link href="css/styles.css" type="text/css" rel="stylesheet" />
115
        <script src="js/timeline/oop.js"></script>
116
        <script data-main="js/timeline/main" src="js/timeline/lib/require/require.js"></script>
122 117

  
123 118
		<title>${APP_NAME}</title>
124 119
	</head>

Také k dispozici: Unified diff