/* * 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(t,e){return e()})(["./kendo.core.min"],function(){!function(t){var e=window.kendo,n=e.support,r=window.location,o=window.history,i=50,a=/^#*/,u=window.document,s=e.Observable.extend({start:function(t){var e=this;if(t=t||{},e.bind(["change"],t),!e._started){if(e._started=!0,e._pushStateRequested=!!t.pushState,e._pushState=n.pushState&&e._pushStateRequested,e.root=t.root||"/",e._interval=0,e._normalizeUrl())return!0;e.current=e._currentLocation(),e.locations=[e.current],e._listenToLocationChange()}},stop:function(){t(window).unbind(".kendo"),this.unbind("change"),clearInterval(this._interval),this._started=!1},change:function(t){this.bind("change",t)},navigate:function(t,e){var n=this;return"#:back"===t?(o.back(),undefined):(t=t.replace(a,""),n.current!==t&&n.current!==decodeURIComponent(t)&&(e||!n.trigger("change",{url:t}))&&(n._pushState?(o.pushState({},u.title,n._makePushStateUrl(t)),n.current=t):r.hash=n.current=t,n.locations.push(n.current)),undefined)},_normalizeUrl:function(){var t,e=this,i=e.root==r.pathname,s=e._pushStateRequested&&!n.pushState&&!i,c=e._pushState&&i&&r.hash;return s?(r.replace(e.root+"#"+e._stripRoot(r.pathname)),!0):c?(t=e._makePushStateUrl(r.hash.replace(a,"")),o.replaceState({},u.title,t),!1):!1},_listenToLocationChange:function(){var e=this,r=t.proxy(e._checkUrl,e);this._pushState?t(window).bind("popstate.kendo",r):n.hashChange?t(window).bind("hashchange.kendo",r):e._interval=setInterval(r,i)},_checkUrl:function(){var t=this,e=t._currentLocation().replace(a,""),n=e===t.locations[t.locations.length-2];if(t.current!==e&&t.current!==decodeURIComponent(e)){if(t.trigger("change",{url:e}))return n?o.forward():o.back(),undefined;t.current=e,n?t.locations.pop():t.locations.push(e)}},_stripRoot:function(t){var e=this;return 0===t.indexOf(e.root)?t.substr(e.root.length).replace(/\/\//g,"/"):t},_makePushStateUrl:function(t){var e=this,n=RegExp("^"+e.root,"i");return n.test(t)||(t=(e.root+t).replace(/\/\//g,"/")),r.protocol+"//"+r.host+t},_currentLocation:function(){var t,e=this;return e._pushState?(t=r.pathname,r.search&&(t+=r.search),e._stripRoot(t)):r.hash.replace(a,"")}});e.history=new s}(window.kendo.jQuery),function(){function t(t,e){return e?t:"([^/]+)"}function e(e){return RegExp("^"+e.replace(l,"\\$&").replace(s,"(?:$1)?").replace(c,t).replace(h,"(.*?)")+"$")}var n=window.kendo,r=n.history,o=n.Observable,i="init",a="routeMissing",u="change",s=/\((.*?)\)/g,c=/(\(\?)?:\w+/g,h=/\*\w+/g,l=/[\-{}\[\]+?.,\\\^$|#\s]/g,d=n.Class.extend({init:function(t,n){t instanceof RegExp||(t=e(t)),this.route=t,this._callback=n},callback:function(t){for(var e=this.route.exec(t).slice(1),n=0,r=e.length;r>n;n++)void 0!==e[n]&&(e[n]=decodeURIComponent(e[n]));this._callback.apply(null,e)},worksWith:function(t){return this.route.test(t)?(this.callback(t),!0):!1}}),p=o.extend({init:function(t){o.fn.init.call(this),this.routes=[],this.pushState=t?t.pushState:!1,t&&t.root&&(this.root=t.root),this.bind([i,a,u],t)},destroy:function(){r.unbind("change",this._urlChangedProxy),this.unbind()},start:function(){var t,e=this,n=function(t){e._urlChanged(t)};r.start({change:n,pushState:e.pushState,root:e.root}),t={url:r.current||"/"},e.trigger(i,t)||e._urlChanged(t),this._urlChangedProxy=n},route:function(t,e){this.routes.push(new d(t,e))},navigate:function(t,e){n.history.navigate(t,e)},_urlChanged:function(t){var e,n,r,o,i=t.url;if(i||(i="/"),this.trigger(u,{url:t.url}))return t.preventDefault(),void 0;for(n=0,r=this.routes,o=r.length;o>n;n++)if(e=r[n],e.worksWith(i))return;this.trigger(a,{url:i})&&t.preventDefault()}});n.Router=p}()});