/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.core.min"],function(){!function(e){function t(e,t){var n=e.x.location,i=e.y.location,o=t.x.location,r=t.y.location,a=n-o,s=i-r;return{center:{x:(n+o)/2,y:(i+r)/2},distance:Math.sqrt(a*a+s*s)}}function n(e){var t,n,i,o=[],r=e.originalEvent,s=e.currentTarget,c=0;if(e.api)o.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e});else if(e.type.match(/touch/))for(n=r?r.changedTouches:[],t=n.length;t>c;c++)i=n[c],o.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier});else a.pointers?o.push({location:r,event:e,target:e.target,currentTarget:s,id:r.pointerId}):o.push({id:1,event:e,target:e.target,currentTarget:s,location:e});return o}function i(t){var n,i,o;t.preventDefault(),n=e(t.data.root),i=n.closest(".k-widget").parent(),i[0]||(i=n.parent()),o=e.extend(!0,{},t,{target:n[0]}),i.trigger(e.Event(t.type,o))}function o(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,a=r.support,s=window.document,c=r.Class,u=r.Observable,l=e.now,h=e.extend,d=a.mobileOS,p=d&&d.android,f=a.browser.ie?5:0,v="press",g="select",_="start",m="move",y="end",T="cancel",x="tap",M="release",w="gesturestart",D="gesturechange",E="gestureend",I="gesturetap",b=c.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=l()},move:function(e){var t=this,n=e["page"+t.axis],i=l(),o=i-t.timeStamp||1;(n||!p)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/o,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),S=c.extend({init:function(e,t,n){var i=this;h(i,{x:new b("X",n.location),y:new b("Y",n.location),userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,_moved:!1,_finished:!1}),i.notifyInit=function(){i._trigger(v,n)}},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(k.current&&k.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(m,e)}},end:function(e){var t=this;t.endTime=l(),t._finished||(t._moved?t._trigger(y,e):t._trigger(x,e),t._trigger(M,e),t.dispose())},dispose:function(){var t=this,n=t.userEvents,i=n.touches;t._finished=!0,i.splice(e.inArray(t,i),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){this.startTime=l(),this._moved=!0,this._trigger(_,e)},_trigger:function(e,t){var n=this,i=t.event,o={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,o)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.userEvents.threshold}}),k=u.extend({init:function(t,n){var i,c,l,d=this,p=r.guid();n=n||{},i=d.filter=n.filter,d.threshold=n.threshold||f,d.touches=[],d._maxTouches=n.multiTouch?2:1,d.allowSelection=n.allowSelection,d.captureUpIfMoved=n.captureUpIfMoved,d.eventNS=p,t=e(t).handler(d),u.fn.init.call(d),h(d,{element:t,surface:n.global?e(s.documentElement):e(n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),d.surface.handler(d).on(r.applyEventMap("move",p),"_move").on(r.applyEventMap("up cancel",p),"_end"),t.on(r.applyEventMap("down",p),i,"_start"),a.pointers&&t.css("-ms-touch-action","pinch-zoom double-tap-zoom"),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",p),r.preventDefault),t.on(r.applyEventMap("mousedown selectstart",p),i,{root:t},"_select"),d.captureUpIfMoved&&a.eventCapture&&(c=d.surface[0],l=e.proxy(d.preventIfMoving,d),o(function(e){c.addEventListener(e,l,!0)})),d.bind([v,x,_,m,y,M,T,w,D,E,I,g],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&a.eventCapture&&(e=t.surface[0],o(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element)},capture:function(){k.current=this},cancel:function(){this._disposeAll(),this.trigger(T)},notify:function(e,n){var i=this,o=i.touches;if(this._isMultiTouch()){switch(e){case m:e=D;break;case y:e=E;break;case x:e=I}h(n,{touches:o},t(o[0],o[1]))}return this.trigger(e,n)},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){e.each(this.touches,function(){this.dispose()})},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(g,{event:e}))&&i(e)},_start:function(t){var i,o,r=this,a=0,s=r.filter,c=n(t),u=c.length;if(!r._maxTouchesReached())for(k.current=null,r.currentTarget=t.currentTarget,r.stopPropagation&&t.stopPropagation();u>a&&!r._maxTouchesReached();a++)o=c[a],i=s?e(o.currentTarget):r.element,i.length&&(o=new S(r,i,o),r.touches.push(o),o.notifyInit(),r._isMultiTouch()&&r.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_eachTouch:function(e,t){var i,o,r,a,s=this,c={},u=n(t),l=s.touches;for(i=0;i