| 1 |
- !function(){function e(t,s,i){var n=e.resolve(t);if(null==n){i=i||t,s=s||"root";var o=new Error('Failed to require "'+i+'" from "'+s+'"');throw o.path=i,o.parent=s,o.require=!0,o}var r=e.modules[n];if(!r._resolving&&!r.exports){var a={};a.exports={},a.client=a.component=!0,r._resolving=!0,r.call(this,a.exports,e.relative(n),a),delete r._resolving,r.exports=a.exports}return r.exports}e.modules={},e.aliases={},e.resolve=function(t){"/"===t.charAt(0)&&(t=t.slice(1));for(var s=[t,t+".js",t+".json",t+"/index.js",t+"/index.json"],i=0;i<s.length;i++){t=s[i];if(e.modules.hasOwnProperty(t))return t;if(e.aliases.hasOwnProperty(t))return e.aliases[t]}},e.normalize=function(e,t){var s=[];if("."!=t.charAt(0))return t;e=e.split("/"),t=t.split("/");for(var i=0;i<t.length;++i)".."==t[i]?e.pop():"."!=t[i]&&""!=t[i]&&s.push(t[i]);return e.concat(s).join("/")},e.register=function(t,s){e.modules[t]=s},e.alias=function(t,s){if(!e.modules.hasOwnProperty(t))throw new Error('Failed to alias "'+t+'", it does not exist');e.aliases[s]=t},e.relative=function(t){function s(i){return e(s.resolve(i),t,i)}var i=e.normalize(t,"..");return s.resolve=function(s){var n=s.charAt(0);if("/"==n)return s.slice(1);if("."==n)return e.normalize(i,s);var o=t.split("/"),r=function(e,t){for(var s=e.length;s--;)if(e[s]===t)return s;return-1}(o,"deps")+1;return r||(r=0),s=o.slice(0,r+1).join("/")+"/deps/"+s},s.exists=function(t){return e.modules.hasOwnProperty(s.resolve(t))},s},e.register("component-event/index.js",function(e,t,s){var i=window.addEventListener?"addEventListener":"attachEvent",n=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==i?"on":"";e.bind=function(e,t,s,n){return e[i](o+t,s,n||!1),s},e.unbind=function(e,t,s,i){return e[n](o+t,s,i||!1),s}}),e.register("component-query/index.js",function(e,t,s){function i(e,t){return t.querySelector(e)}(e=s.exports=function(e,t){return t=t||document,i(e,t)}).all=function(e,t){return(t=t||document).querySelectorAll(e)},e.engine=function(t){if(!t.one)throw new Error(".one callback required");if(!t.all)throw new Error(".all callback required");return i=t.one,e.all=t.all,e}}),e.register("component-matches-selector/index.js",function(e,t,s){var i=t("query"),n=Element.prototype,o=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;s.exports=function(e,t){if(o)return o.call(e,t);for(var s=i.all(t,e.parentNode),n=0;n<s.length;++n)if(s[n]==e)return!0;return!1}}),e.register("discore-closest/index.js",function(e,t,s){var i=t("matches-selector");s.exports=function(e,t,s,n){for(e=s?{parentNode:e}:e,n=n||document;(e=e.parentNode)&&e!==document;){if(i(e,t))return e;if(e===n)return}}}),e.register("component-delegate/index.js",function(e,t,s){var i=t("closest"),n=t("event");e.bind=function(e,t,s,o,r){return n.bind(e,s,function(s){var n=s.target||s.srcElement;s.delegateTarget=i(n,t,!0,e),s.delegateTarget&&o.call(e,s)},r)},e.unbind=function(e,t,s,i){n.unbind(e,t,s,i)}}),e.register("component-events/index.js",function(e,t,s){function i(e,t){if(!(this instanceof i))return new i(e,t);if(!e)throw new Error("element required");if(!t)throw new Error("object required");this.el=e,this.obj=t,this._events={}}var n=t("event"),o=t("delegate");s.exports=i,i.prototype.sub=function(e,t,s){this._events[e]=this._events[e]||{},this._events[e][t]=s},i.prototype.bind=function(e,t){function s(){var e=[].slice.call(arguments).concat(l);a[t].apply(a,e)}var i=function(e){var t=e.split(/ +/);return{name:t.shift(),selector:t.join(" ")}}(e),r=this.el,a=this.obj,h=i.name,l=(t=t||"on"+h,[].slice.call(arguments,2));return i.selector?s=o.bind(r,i.selector,h,s):n.bind(r,h,s),this.sub(h,t,s),s},i.prototype.unbind=function(e,t){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(e);var s=this._events[e];if(s){var i=s[t];i&&n.unbind(this.el,e,i)}},i.prototype.unbindAll=function(){for(var e in this._events)this.unbindAllOf(e)},i.prototype.unbindAllOf=function(e){var t=this._events[e];if(t)for(var s in t)this.unbind(e,s)}}),e.register("component-indexof/index.js",function(e,t,s){s.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var s=0;s<e.length;++s)if(e[s]===t)return s;return-1}}),e.register("component-classes/index.js",function(e,t,s){function i(e){if(!e)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}var n=t("indexof"),o=/\s+/,r=Object.prototype.toString;s.exports=function(e){return new i(e)},i.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~n(t,e)||t.push(e),this.el.className=t.join(" "),this},i.prototype.remove=function(e){if("[object RegExp]"==r.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),s=n(t,e);return~s&&t.splice(s,1),this.el.className=t.join(" "),this},i.prototype.removeMatching=function(e){for(var t=this.array(),s=0;s<t.length;s++)e.test(t[s])&&this.remove(t[s]);return this},i.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},i.prototype.array=function(){var e=this.el.className.replace(/^\s+|\s+$/g,"").split(o);return""===e[0]&&e.shift(),e},i.prototype.has=i.prototype.contains=function(e){return this.list?this.list.contains(e):!!~n(this.array(),e)}}),e.register("component-emitter/index.js",function(e,t,s){function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}s.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function s(){i.off(e,s),t.apply(this,arguments)}var i=this;return this._callbacks=this._callbacks||{},s.fn=t,this.on(e,s),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s=this._callbacks[e];if(!s)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var i,n=0;n<s.length;n++)if((i=s[n])===t||i.fn===t){s.splice(n,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),s=this._callbacks[e];if(s)for(var i=0,n=(s=s.slice(0)).length;i<n;++i)s[i].apply(this,t);return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),e.register("ui-component-mouse/index.js",function(e,t,s){function i(e,t){this.obj=t||{},this.el=e}var n=t("emitter"),o=t("event");s.exports=function(e,t){return new i(e,t)},n(i.prototype),i.prototype.bind=function(){function e(n){s.onmouseup&&s.onmouseup(n),o.unbind(document,"mousemove",t),o.unbind(document,"mouseup",e),i.emit("up",n)}function t(e){s.onmousemove&&s.onmousemove(e),i.emit("move",e)}var s=this.obj,i=this;return i.down=function(n){s.onmousedown&&s.onmousedown(n),o.bind(document,"mouseup",e),o.bind(document,"mousemove",t),i.emit("down",n)},o.bind(this.el,"mousedown",i.down),this},i.prototype.unbind=function(){o.unbind(this.el,"mousedown",this.down),this.down=null}}),e.register("abpetkov-percentage-calc/percentage-calc.js",function(e,t,s){e.isNumber=function(e){return"number"==typeof e},e.of=function(t,s){if(e.isNumber(t)&&e.isNumber(s))return t/100*s},e.from=function(t,s){if(e.isNumber(t)&&e.isNumber(s))return t/s*100}}),e.register("abpetkov-closest-num/closest-num.js",function(e,t,s){e.find=function(e,t){var s=null,n=t[0];for(i=0;i<t.length;i++)s=Math.abs(e-n),Math.abs(e-t[i])<s&&(n=t[i]);return n}}),e.register("vesln-super/lib/super.js",function(e,t,s){var i=Array.prototype.slice;(e=s.exports=function(){var t=i.call(arguments);if(t.length)return"function"!=typeof t[0]?e.merge(t):void e.inherits.apply(null,t)}).extend=function(t,s){var i=this,n=function(){return i.apply(this,arguments)};return e.merge([n,this]),e.inherits(n,this),t&&e.merge([n.prototype,t]),s&&e.merge([n,s]),n.extend=this.extend,n},e.inherits=function(e,t){e.super_=t,Object.create?e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}):(e.prototype=new t,e.prototype.constructor=e)},e.merge=function(e){for(var t=2===e.length?e.shift():{},s=null,i=0,n=e.length;i<n;i++){s=e[i];for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}}),e.register("powerange/lib/powerange.js",function(e,t,s){t("./main");var i=t("./horizontal"),n=t("./vertical"),o={callback:function(){},decimal:!1,disable:!1,disableOpacity:.5,hideRange:!1,klass:"",min:0,max:100,handleDiameter:20,touchDiameter:42,start:null,step:null,vertical:!1};s.exports=function(e,t){t=t||{};for(var s in o)null==t[s]&&(t[s]=o[s]);return t.vertical?new n(e,t):new i(e,t)}}),e.register("powerange/lib/main.js",function(e,t,s){function n(e,t){if(!(this instanceof n))return new n(e,t);this.element=e,this.options=t||{},this.slider=this.create("div","range-container"),null!==this.element&&"text"===this.element.type&&this.init()}var o=t("mouse"),r=t("events"),a=t("classes"),h=t("percentage-calc");s.exports=n,n.prototype.bindEvents=function(){this.handle=this.slider.querySelector(".range-handle"),this.touch=r(this.slider,this),this.touch.bind("touchstart","onmousedown"),this.touch.bind("touchmove","onmousemove"),this.touch.bind("touchend","onmouseup"),this.mouse=o(this.slider,this),this.mouse.bind()},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.append=function(){var e=this.generate();this.insertAfter(this.element,e)},n.prototype.generate=function(){var e={handle:{type:"span",selector:"range-handle"},min:{type:"span",selector:"range-min"},max:{type:"span",selector:"range-max"},quantity:{type:"span",selector:"range-quantity"}},t=this.create("span","range-bar");this.slider.appendChild(t);for(var s in e)if(e.hasOwnProperty(s)){var i=this.create(e[s].type,e[s].selector);t.appendChild(i)}return this.slider},n.prototype.create=function(e,t){var s=document.createElement(e);return s.className=t,s},n.prototype.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},n.prototype.extraClass=function(e){this.options.klass&&a(this.slider).add(e)},n.prototype.setRange=function(e,t){"number"!=typeof e||"number"!=typeof t||this.options.hideRange||(this.slider.querySelector(".range-min").innerHTML=e,this.slider.querySelector(".range-max").innerHTML=t)},n.prototype.setValue=function(e,t){var s=h.from(parseFloat(e),t),i=h.of(s,this.options.max-this.options.min)+this.options.min,n=!1;i=this.options.decimal?Math.round(100*i)/100:Math.round(i),n=this.element.value!=i,this.element.value=i,this.options.callback(),n&&this.changeEvent()},n.prototype.step=function(e,t){var s=e-t,n=h.from(this.checkStep(this.options.step),this.options.max-this.options.min),o=h.of(n,s),r=[];for(0==o&&(o=1),i=0;i<=s;i+=o)r.push(i);return this.steps=r,this.steps},n.prototype.checkValues=function(e){e<this.options.min&&(this.options.start=this.options.min),e>this.options.max&&(this.options.start=this.options.max),this.options.min>=this.options.max&&(this.options.min=this.options.max)},n.prototype.checkStep=function(e){return e<0&&(e=Math.abs(e)),this.options.step=e,this.options.step},n.prototype.disable=function(){(this.options.min==this.options.max||this.options.min>this.options.max||this.options.disable)&&(this.mouse.unbind(),this.touch.unbind(),this.slider.style.opacity=this.options.disableOpacity,a(this.handle).add("range-disabled"))},n.prototype.unselectable=function(e,t){a(this.slider).has("unselectable")||!0!==t?a(this.slider).remove("unselectable"):a(this.slider).add("unselectable")},n.prototype.changeEvent=function(e){if("function"!=typeof Event&&document.fireEvent)this.element.fireEvent("onchange");else{var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.element.dispatchEvent(t)}},n.prototype.init=function(){this.hide(),this.append(),this.bindEvents(),this.extraClass(this.options.klass),this.checkValues(this.options.start),this.setRange(this.options.min,this.options.max),this.disable()}}),e.register("powerange/lib/horizontal.js",function(e,t,s){function i(){a.apply(this,arguments),this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.handle.style.top=-this.options.handleDiameter/2+2+"px",this.options.step&&this.step($(this.slider).width(),$(this.handle).width()),this.setStart(this.options.start)}var n=t("super"),o=t("closest-num"),r=t("percentage-calc"),a=t("./main");s.exports=i,n(i,a),i.prototype.setStart=function(e){var t=null===e?this.options.min:e,s=r.from(t-this.options.min,this.options.max-this.options.min)||0,i=r.of(s,$(this.slider).width()-$(this.handle).width()),n=this.options.step?o.find(i,this.steps):i;this.setPosition(n),this.setValue(this.handle.style.left,$(this.slider).width()-$(this.handle).width()),this.options.step&&this.step($(this.slider).width(),$(this.handle).width())},i.prototype.setPosition=function(e){this.handle.style.left=e+"px",this.slider.querySelector(".range-quantity").style.width=e+"px"},i.prototype.onmousedown=function(e){if(e.touches&&(e=e.touches[0]),"range-handle"!==e.target.className){if(!this.options.tap)return;for(var t=0,s=this.handle;null!==s;)t+=s.offsetLeft,s=s.offsetParent;this.startX=t-window.scrollX+this.handle.clientWidth/2}else this.startX=e.clientX,this.ht=$(this.handle).css("top"),this.handle.style.marginLeft=-(this.options.touchDiameter-this.options.handleDiameter)/4+"px",this.handle.style.width=this.options.touchDiameter+"px",this.handle.style.height=this.options.touchDiameter+"px",this.handle.style.top=parseInt(this.handle.style.top)-(this.options.touchDiameter-this.options.handleDiameter)/2+"px";this.handleOffsetX=this.handle.offsetLeft,this.restrictHandleX=$(this.slider).width()-$(this.handle).width(),this.unselectable(this.slider,!0),this.onmousemove(e)},i.prototype.onmousemove=function(e){if("range-handle"===e.target.className||this.options.tap){"function"==typeof e.preventDefault&&e.preventDefault(),e.touches&&(e=e.touches[0]);var t=this.handleOffsetX+e.clientX-this.startX,s=this.steps?o.find(t,this.steps):t;t<=0?this.setPosition(0):t>=this.restrictHandleX?this.setPosition(this.restrictHandleX):this.setPosition(s),this.setValue(this.handle.style.left,$(this.slider).width()-this.options.handleDiameter)}},i.prototype.onmouseup=function(e){this.unselectable(this.slider,!1),this.handle.style.marginLeft="0px",this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.handle.style.top=this.ht,this.setValue(this.handle.style.left,$(this.slider).width()-$(this.handle).width())}}),e.register("powerange/lib/vertical.js",function(e,t,s){function i(){h.apply(this,arguments),this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",o(this.slider).add("vertical"),this.options.step&&this.step($(this.slider).height(),$(this.handle).height()),this.setStart(this.options.start)}var n=t("super"),o=t("classes"),r=t("closest-num"),a=t("percentage-calc"),h=t("./main");s.exports=i,n(i,h),i.prototype.setStart=function(e){var t=null===e?this.options.min:e,s=a.from(t-this.options.min,this.options.max-this.options.min)||0,i=a.of(s,$(this.slider).height()-$(this.handle).height()),n=this.options.step?r.find(i,this.steps):i;this.setPosition(n),this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height()),this.options.step&&this.step($(this.slider).height(),$(this.handle).height())},i.prototype.setPosition=function(e){this.handle.style.bottom=e+"px",this.slider.querySelector(".range-quantity").style.height=e+"px"},i.prototype.onmousedown=function(e){if(e.touches&&(e=e.touches[0]),"range-handle"!==e.target.className){if(!this.options.tap)return;for(var t=0,s=this.handle;null!==s;)t+=s.offsetTop,s=s.offsetParent;this.startY=t-window.scrollY+this.handle.clientHeight/2}else this.startY=e.clientY,this.handle.style.marginLeft=-(this.options.touchDiameter-this.options.handleDiameter)/2+"px",this.handle.style.width=this.options.touchDiameter+"px",this.handle.style.height=this.options.touchDiameter+"px";this.handleOffsetY=$(this.slider).height()-$(this.handle).height()-this.handle.offsetTop,this.restrictHandleY=$(this.slider).height()-$(this.handle).height(),this.unselectable(this.slider,!0),this.onmousemove(e)},i.prototype.onmousemove=function(e){if("range-handle"===e.target.className||this.options.tap){"function"==typeof e.preventDefault&&e.preventDefault(),e.touches&&(e=e.touches[0]);var t=this.handleOffsetY+this.startY-e.clientY,s=this.steps?r.find(t,this.steps):t;t<=0?this.setPosition(0):t>=this.restrictHandleY?this.setPosition(this.restrictHandleY):this.setPosition(s),this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height())}},i.prototype.onmouseup=function(e){this.unselectable(this.slider,!1),this.handle.style.marginLeft="0px",this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height())}}),e.alias("component-events/index.js","powerange/deps/events/index.js"),e.alias("component-events/index.js","events/index.js"),e.alias("component-event/index.js","component-events/deps/event/index.js"),e.alias("component-delegate/index.js","component-events/deps/delegate/index.js"),e.alias("discore-closest/index.js","component-delegate/deps/closest/index.js"),e.alias("discore-closest/index.js","component-delegate/deps/closest/index.js"),e.alias("component-matches-selector/index.js","discore-closest/deps/matches-selector/index.js"),e.alias("component-query/index.js","component-matches-selector/deps/query/index.js"),e.alias("discore-closest/index.js","discore-closest/index.js"),e.alias("component-event/index.js","component-delegate/deps/event/index.js"),e.alias("component-classes/index.js","powerange/deps/classes/index.js"),e.alias("component-classes/index.js","classes/index.js"),e.alias("component-indexof/index.js","component-classes/deps/indexof/index.js"),e.alias("ui-component-mouse/index.js","powerange/deps/mouse/index.js"),e.alias("ui-component-mouse/index.js","mouse/index.js"),e.alias("component-emitter/index.js","ui-component-mouse/deps/emitter/index.js"),e.alias("component-event/index.js","ui-component-mouse/deps/event/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","powerange/deps/percentage-calc/percentage-calc.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","powerange/deps/percentage-calc/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","percentage-calc/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","abpetkov-percentage-calc/index.js"),e.alias("abpetkov-closest-num/closest-num.js","powerange/deps/closest-num/closest-num.js"),e.alias("abpetkov-closest-num/closest-num.js","powerange/deps/closest-num/index.js"),e.alias("abpetkov-closest-num/closest-num.js","closest-num/index.js"),e.alias("abpetkov-closest-num/closest-num.js","abpetkov-closest-num/index.js"),e.alias("vesln-super/lib/super.js","powerange/deps/super/lib/super.js"),e.alias("vesln-super/lib/super.js","powerange/deps/super/index.js"),e.alias("vesln-super/lib/super.js","super/index.js"),e.alias("vesln-super/lib/super.js","vesln-super/index.js"),e.alias("powerange/lib/powerange.js","powerange/index.js"),"object"==typeof exports?module.exports=e("powerange"):"function"==typeof define&&define.amd?define([],function(){return e("powerange")}):this.Powerange=e("powerange")}();
|